SPI slave mode with DMA throughput
- June 18, 2019
- 4 replies
- 3952 views
STM32MP157 has a M4 core, so I am asking questions here in MCU section although the chip is belong to MPU. What I am trying to do is using M4's SPI4 to receive data at throughput of 20.6Mbits/sec, basically each SPI transition has 10.5KB block data, and each second, there are 240 transactions. Currently I am using two STM32MP157-DK2 boards and running the modified M4 core example code of SPI DMA demo. The readme.txt file from the demo has attached. what I found out is, when SPI master side clock set to be 32MHz (hspi4.Init.BaudRatePrescaler = SPI_BAUDRATEPRESCALER_2), the slave side code crash, but it runs ok at 16MHz ((hspi4.Init.BaudRatePrescaler = SPI_BAUDRATEPRESCALER_4). With logic analyzer, I can see the slave side works for a while, and then MISO became all 0, and from LED flashing pattern I would see that slave side's callback of SPI transaction is not triggered anymore. Unfortunately at this moment, I haven't figure out what's proper setup for STLink to work with this board, so right now I cannot step through to see what's going on. But I attached my main.c and any suggestion is welcome. Also I would greatly appreciated that if anyone can confirm that SPI in slave mode is capable of achieving the throughput.
