Important changes to forums and questions
All forums and questions are now archived. To start a new conversation or read the latest updates go to forums.mbed.com.
1 year ago.
DMA driver for mbed-os 5
Is there any chance for DMA periphery to get an official support by mbed in the form of a driver, like every standard MCU periphery (UART, SPI, I2C ... etc) ?
Let's asume UART periphery is used somewhere and DMA acceleration is needed:
For now using of the method
set_dma_usage_xx() is pretty useless. It just sets the value of a variable
_xx_usage, which is internal for the
SerialBase driver, and this has no impact on the low level implementation of the
I get it that
serial_api is platform implementer's responsibility, but there is no way
serial_api to understand, that DMA has to be used. I mean no parameter is passed to the
serial_api, and the control remains in upper level driver.
SerialBase is mbed's responsibility, I presume.
Is there any working example with DMA enhanced periphery at all?
10 months, 1 week ago.
The HAL allows use of DMA; if you search for calls to
dma_channel_allocate() you will see that it is used on some targets for serial and SPI, as well as other uses of DMA for USB host and crypto acceleration on some targets.
I also wish there were a more general way to use DMA for other purposes, but there doesn't seem to be one right now.
I've used the DMA peripheral in the KL25Z directly for driving RGB LEDs:
Test program for my Multi_WS2811 library that started out as a fork of heroic/WS2811. My library uses hardware DMA on the FRDM-KL25Z to drive up to 16 strings of WS2811 or WS2812 LEDs in parallel.
Here are the files that use