2025-07-28 1:41 AM
Hi everyone,
I was wondering if is it valid to allocate DMA buffers for USART/SPI etc.. on the heap using aligned_alloc() function?
My board is the NUCLEO-H743ZI2
If its possible - is it good practice?
Thanks, Ariel
2025-07-28 1:58 AM
"heap" is purely a software abstraction.
The DMA itself neither knows not cares anything about "heap" - it just works with hardware addresses.
The usual issues of heap in embedded applications would still apply.
2025-07-28 5:57 AM
> If its possible - is it good practice?
Dynamically allocated memory on a microcontroller is generally frowned upon, but opinions will vary. It introduces possibilities for code bugs that do not exist with static allocation.