-
Notifications
You must be signed in to change notification settings - Fork 7.3k
drivers: spi: stm32 spi driver supporting DMA in asynchronous mode #55302
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
Conversation
|
1e3db2b
to
ca86044
Compare
|
||
if ((data->dma_tx.dma_dev != NULL) | ||
&& (data->dma_rx.dma_dev != NULL)) { | ||
return transceive_dma(dev, config, tx_bufs, rx_bufs, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The transceive_dma
function calls wait_dma_rx_tx_done
, so it waits for transfer to end, so it is not an asynchronous mode. It looks like, it is a synchronous mode with calling the callback at the end of transfer.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok, I am Changing the transceive_dma when the ASYNC mode is activated: behaves like the transceive() does.
3145dfd
to
a39c45a
Compare
rebase |
@@ -747,6 +741,18 @@ static int transceive_dma(const struct device *dev, | |||
/* This is turned off in spi_stm32_complete(). */ | |||
spi_stm32_cs_control(dev, true); | |||
|
|||
#if defined(CONFIG_SPI_STM32_INTERRUPT) || defined(CONFIG_SPI_ASYNC) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we want to change behavior in config Interrup + DMA (SPI_ASYNC = n) ?
Isn't it sufficient to do defined(CONFIG_SPI_ASYNC)
here ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do you use DMA in this case? It looks like transceive
function in async mode without DMA.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do you use DMA in this case? It looks like
transceive
function in async mode without DMA.
yes, if CONFIG_SPI_STM32_DMA=y
@@ -747,6 +741,18 @@ static int transceive_dma(const struct device *dev, | |||
/* This is turned off in spi_stm32_complete(). */ | |||
spi_stm32_cs_control(dev, true); | |||
|
|||
#if defined(CONFIG_SPI_STM32_INTERRUPT) || defined(CONFIG_SPI_ASYNC) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do you use DMA in this case? It looks like transceive
function in async mode without DMA.
This pull request has been marked as stale because it has been open (more than) 60 days with no activity. Remove the stale label or add a comment saying that you would like to have the label removed otherwise this pull request will automatically be closed in 14 days. Note, that you can always re-open a closed pull request at any time. |
@FRASTM Is there any further plan to merge these changes? |
Acts the SPI asynchronous mode on the stm32 devices, when DMA is activated or not for SPI transfer. Signed-off-by: Francois Ramu <[email protected]>
Add the overlay and config to run the spi loopback test transfer with DMA and also in async mode with DMA on any stm32 platform. New target disco_l475_iot1 Signed-off-by: Francois Ramu <[email protected]>
reopen and rebase |
This pull request has been marked as stale because it has been open (more than) 60 days with no activity. Remove the stale label or add a comment saying that you would like to have the label removed otherwise this pull request will automatically be closed in 14 days. Note, that you can always re-open a closed pull request at any time. |
Any news on this? |
add the support of the SPI asynchronous mode to the sm32 spi driver with DMA enabled or not
Enable this async mode when running the tests/drivers/spi/spi_loopback
and add the dma for spi transfer with overlay-stm32-spi-dma.conf
This is now the case hen the CONFIG_SPI_STM32_DMA is selected,
The SPI transfer is possible in ASYNC mode is possible CONFIG_SPI_ASYNC=y or not (CONFIG_SPI_ASYNC=n)
--> adding one more config to the tests/drivers/spi/spi_loopback for stm32 serie.
Add the b_l4s5i_iot01a disco kit to the list of supported boards
Fixes #55205
Signed-off-by: Francois Ramu [email protected]