Combine usart with DMA in arduino

hello, every one! I want to know how to combine usart with DMA in arduino and my board is STM32F405RGT6.
Thinks!

On STM32duino the core is written on top of the STM32 HAL, so you can just write ā€œregularā€ HAL code to use DMA and it will build / work fine. I donā€™t think there is any native Arduino framework support for doing things with DMA. In other words, you can use any example code from around the internet using DMA with the regular HAL as your example/reference code.

I recently implemented a 1wire interface using DMA and UART with platformio and it works nicely. However, I needed to program it without the HAL (which was even easier), since the weak binding of the interrupt routines conflicted (the Arduino implementation and mine overloaded the same HAL function). After all I found the HAL in that particular case more confusing than helpful.

For those cases, stm32duino also offers some build flags like -D HAL_UART_MODULE_ONLY that should disable the Arduino implementation, if that is any help!

This than also disabled the regular Serial. It effects all UARTS, not just the one I wanted to handle myself.

1 Like

Thinks for you reply! I will try to port programs generated through STM32CubeMX.
Good Luckļ¼

that sound great. I will try again.