2021-07-27 03:15 AM
Hi all,
I'm trying to setup a DMA TX UART code using STM32H743VI MCU. The problem I'm facing right now is every time I call HAL_UART_Transmit_DMA function, I get a HAL_DMA_ERROR_TE in my DMA error call-back. The actual line of code is as follows:
char temp[] = "ATI\0";
HAL_UART_Transmit_DMA(&huart2, (uint8_t *) temp, 4U);
Strange thing is when I call this function without the temp buffer it works. For e.g.
HAL_UART_Transmit_DMA(&huart2, "ATI\0", 4U);
I have worked on STM32F4 series as well and I didn't face this type of problem before. The settings for UART and DMA are as follows:
Any help would be much appreciated. Thanks
Zeeshan
2021-07-27 03:28 AM
Hello @Zahme.2,
Could you try with:
Best regards,
Christophe
2021-07-27 03:34 AM
Hi, Unfortunately that doesn't work either. I have seen some UART example for STM32H743 cube expansion package and they have CPU cache enable. I've tried that as well but no success at all.
2021-07-27 03:37 AM
It also works fine without the DMA as well
HAL_UART_Transmit_IT(&huart2, (uint8_t *) temp, 4U);
2021-07-27 03:39 AM
You have to allocate memory which is accessible by DMA.
https://community.st.com/s/article/FAQ-DMA-is-not-working-on-STM32H7-devices
JW
2021-07-27 04:30 AM
Thank you @Community member.
For sure, your buffer 'temp' must not be in TCM memory because the DMA can not access to the TCM memory, only the MDMA can.
The link above should give you the solution.
Christophe
2021-07-27 04:39 AM
I did tried few things like putting __DCB() before calling DMA transfer function, used SCB functions like clean D cache memory by address but no success. Will try setting up a memory allocation in .ld file and see how it behaves.