UART_DMA(LPUART) working oddly on STM32WB55
- March 24, 2022
- 4 replies
- 6123 views
Hello, I have been trying to send and receive data through UART using DMA on STM3WB55. Everything was working properly but suddenly HAL_UART_Transmit_DMA started to work unproperly: the program gets stuck in the Hard Fault function. I am calling HAL_UART_Transmit_DMA inside the function HAL_UART_RxCpltCallback. When I call it in the while loop in the main.c file, the program works good. My buffers are 71 and 273 long. Later I tried HAL_UART_Transmit and HAL_UART_Transmit_IT inside HAL_UART_RxCpltCallback but none of them works anymore. When I comment this line, the program works good.
I attached the main.c , stm32wbxx_it.c and usart.c files.
Here is the call stack untill it falls into the hard fault function:
What I want to do is to send data after the reception is complete. The reception through HAL_UART_Receive_DMA seems to be correct. Just the transmit. Any clue? Thank you.