2013-08-23 03:48 AM
Hello again,
I have connected two STM32F2 via SPI1. The data will be transfered via a variable sized datablock. The first two bytes are a command (5 bit) and a length (11bit) information of the following block. Is it possible to read the first two bytes via polling and transfer the remaining - variable sized block - block via dma? Thanks Martin #spi-slave-polling-dma2013-08-23 06:51 AM
I would imagine so, and probably read the first two byte via DMA as well. Basically setting up a 2 byte transfer, and DMA TC to catch the arrival and light off a longer transfer.
2013-08-23 07:14 AM
Hello Clive,
Do you have any experience how fast the DMA can be reconfigured and restarted? It should be fast enough to run in the DMA interrupt Handler, so i don't miss any data of the running SPI Stream. I will try it, thank you for the hint.Martin2013-08-23 11:02 AM
In magnitude it's about the same whether you polled or used DMA interrupts.
How fast are you proposing to send the data? You'd have an 8 or 16 bit clock window depending on how you set up the SPI. There might be more efficient ways to change address/length in the DMA controller than reconfiguring it completely with the FW library. If it's super critical I'd probably look at a large circular DMA buffer, that wouldn't need reconfiguring and processing at HT / TC intervals.