Hi,
I'm looking to use DMA for SPI, the application is reading from an ADC (ADS1299).
I found the following (https://github.com/micropython/micropython/pull/5721), but rlourette says that "This would be implemented differently on the Pyboard D for instance as its DMA controller has double buffer mode".
Does anyone know if SPI+DMA has been implemented on the Pyboard D - or how much of a challenge it would be to adapt rlourette's work?
Any help would be greatly appreciated
Pyboard D SPI DMA
Re: Pyboard D SPI DMA
All STM32 boards use DMA for SPI (see ports/stm32/spi.c). The issue here (and I suspect likely why this is relevant to you) is that the high-level Python functions are blocking. i.e. even though they use DMA internally, they block waiting for the operation to complete before returning back to the user. The issue here is how to build a good Python-level API for DMA. Off the top of my head the issues are things like buffer management and re-entrancy, but I think there was much more discussion of this stuff in the PR you linked to.Sleepy_Reenigne wrote: ↑Fri Oct 23, 2020 9:15 amDoes anyone know if SPI+DMA has been implemented on the Pyboard D
So while there are some differences between different STM32 families in terms of the DMA peripheral support, the much more difficult part is how to implement DMA-from-Python more generally.
-
- Posts: 8
- Joined: Wed Mar 04, 2020 10:07 pm
Re: Pyboard D SPI DMA
Thank you for that insight Jimmo!