Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

I2s loopback config #83718

Merged
merged 2 commits into from
Jan 28, 2025
Merged

Conversation

Raymond0225
Copy link
Collaborator

@Raymond0225 Raymond0225 commented Jan 8, 2025

Use TX and RX blocks on SAI for i2s speed test, by this way we can avoid HW reworking.
Update Readme file and DMA channel configuration in overlay file to avoid DMA channel
conflict with other peripherals like UART.


In previous implementions, when there is no buffers in TX queue in a TX
callback context, TX will be stopped immediately. It is not correct
because there may still TX blocks in DMA TX transfer queue.
TX should only be stopped when DMA queue is empty and no more in I2S TX
queue.
Another modification is to set correct TX water FIFO level.

require this HAL patch to pass the test:
zephyrproject-rtos/hal_nxp#490

@zephyrbot zephyrbot added area: I2S platform: NXP Drivers NXP Semiconductors, drivers labels Jan 8, 2025
@Raymond0225 Raymond0225 force-pushed the i2s_loopback_config branch 2 times, most recently from 9c76380 to e92a8c4 Compare January 9, 2025 16:07
@dleach02
Copy link
Member

@Raymond0225 add an update to this PR the west.yml to point to the needed HAL PR.

@Raymond0225
Copy link
Collaborator Author

@Raymond0225 add an update to this PR the west.yml to point to the needed HAL PR.

To my understanding, we need merge the HAL PR firstly then update the full SHA in west.yml, right?
Will the SHA in the PR be changed after merge?

@zephyrbot
Copy link
Collaborator

zephyrbot commented Jan 13, 2025

The following west manifest projects have changed revision in this Pull Request:

Name Old Revision New Revision Diff
hal_nxp zephyrproject-rtos/hal_nxp@b7bd6f6 zephyrproject-rtos/hal_nxp@49ff7e3 (master) zephyrproject-rtos/[email protected]

All manifest checks OK

Note: This message is automatically posted and updated by the Manifest GitHub Action.

@Raymond0225
Copy link
Collaborator Author

Resolve conflict with last main source code, rebase to latest code of upstream.

@DerekSnell DerekSnell force-pushed the i2s_loopback_config branch 2 times, most recently from baa6fb3 to 793c180 Compare January 14, 2025 13:11
@@ -308,11 +308,23 @@ static void i2s_dma_tx_callback(const struct device *dma_dev, void *arg, uint32_
/* TX queue has drained */
strm->state = I2S_STATE_READY;
LOG_DBG("TX stream has stopped");
goto disabled_exit_no_drop;
} else {
Copy link
Member

@decsny decsny Jan 14, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think the else might not be necessary, should we remove it to reduce nesting since you're adding a new conditional within this block?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes, we can remove it.

EmilioCBen
EmilioCBen previously approved these changes Jan 15, 2025
@mmahadevan108 mmahadevan108 force-pushed the i2s_loopback_config branch 2 times, most recently from 4b81cb6 to fedd352 Compare January 27, 2025 18:00
@zephyrbot zephyrbot removed the DNM This PR should not be merged (Do Not Merge) label Jan 27, 2025
Use TX and RX blocks on SAI for i2s speed test, by this way we can avoid
HW reworking.
Update Readme file and DMA channel configuration in overlay file to avoid
DMA channel conflict with other peripherals like UART.

Signed-off-by: Raymond Lei <[email protected]>
In previous implementions, when there is no buffers in TX queue in a TX
callback context, TX will be stopped immediately. It is not correct
because there may still TX blocks in DMA TX transfer queue.
TX should only be stopped when DMA queue is empty and no more in I2S TX
queue.
Another modification is to set correct TX water FIFO level.

Signed-off-by: Raymond Lei <[email protected]>
@mmahadevan108
Copy link
Collaborator

@anangl , can you help review.

@kartben kartben merged commit f96b78b into zephyrproject-rtos:main Jan 28, 2025
26 checks passed
@mmahadevan108 mmahadevan108 deleted the i2s_loopback_config branch January 28, 2025 16:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

8 participants