cancel
Showing results for 
Search instead for 
Did you mean: 

DMA UART transfer error "HAL_DMA_ERROR_TE"

Zahme.2
Associate II

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:

 0693W00000D0jQQQAZ.png

  • DMA mode normal
  • DMA direction Mem-Peripheral
  • DMA priority low
  • DMA data width byte

Any help would be much appreciated. Thanks

Zeeshan

6 REPLIES 6
Christophe VRIGNAUD
ST Employee

Hello @Zahme.2​,

Could you try with:

  1. HAL_UART_Transmit_DMA(&huart2, &temp, 4U);

Best regards,

Christophe

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.

It also works fine without the DMA as well

HAL_UART_Transmit_IT(&huart2, (uint8_t *) temp, 4U);

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

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

Zahme.2
Associate II

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.