DMA buffers declaration
Posted: Mon Apr 30, 2018 12:38 pm
Hi,
I have a question regarding the best way (or should I say requirement?) to declare the buffers for DMA read/write with SPI or UART drivers.
The samples always have those declared as static byte arrays. I get that because pointers must be passed to the drivers.
The arrays can't be declared as variables inside a function (when using async calls on the drivers), correct?
Questions:
1) would it be OK to use malloc to create those buffers and release them after the driver "transaction" is completed?
2) if the platform is an STM32F7 or STM32H7 are there any further requirements because of memory caching and such?
Thanks in advance!
I have a question regarding the best way (or should I say requirement?) to declare the buffers for DMA read/write with SPI or UART drivers.
The samples always have those declared as static byte arrays. I get that because pointers must be passed to the drivers.
The arrays can't be declared as variables inside a function (when using async calls on the drivers), correct?
Questions:
1) would it be OK to use malloc to create those buffers and release them after the driver "transaction" is completed?
2) if the platform is an STM32F7 or STM32H7 are there any further requirements because of memory caching and such?
Thanks in advance!