tests.drivers.spi_loopback stm32wb55x transfer multiple buffers with dma #25244
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
The spi test application is transferring several buffers and check that Rx one equals Tx one.
In this configuration of the stm32wb It is using the dma communication capability of the SPI feature.
In transmission mode, when the DMA has written all the data to be transmitted (the TCIF
flag is set in the DMA_ISR register), the BSY flag can be monitored to ensure that the SPI
communication is complete.
This is done waiting for the SPI BUSY flag before considering the DMA Tx and Rx completion flags. The DMA callback function, based on the DMA channel irq, will set "a end of transfer" flag.
The main SPI client transfer loop will then switch the Tx/Rx buffers when both Rx and Tx are completed.
Refer to the Data transmission and reception procedures of the SPI feature in the Ref Manual.
Fix #25241