Skip to main content
SHudi.1
Associate II
September 16, 2020
Question

Using STM32CubeMX 6.0.1 for the controller STM32L031K6Tx and I cant get the HAL_UART_Transmit_DMA to send data.

  • September 16, 2020
  • 1 reply
  • 1245 views

Let me start off with saying I am new to STM. I am a recent convert from NXP. I used the very cool STM32CubeMX 6.0.1 through the Keil IDE to generate what was mostly needed for my STM32L031K6Tx application. I/O and timers seem to be working fine but I hit a road block when I went to send a few bytes using HAL_UART_Transmit_DMA. I attached the cube generated file STCubeGenerated and the only src file I changed main.c.

// Here is the problem bit -

HAL_UART_Init(&huart2); // added as a test

HAL_UART_Transmit_DMA(&huart2, "buffer_tx", 5); // send "READY"

while (HAL_UART_GetState(&huart2) != HAL_UART_STATE_READY)

{

// Return value is HAL_UART_STATE_BUSY_TX = 0x21 forever

state = HAL_UART_GetState(&huart2) ; // stuck in this loop forever

}

This topic has been closed for replies.

1 reply

SHudi.1
SHudi.1Author
Associate II
September 18, 2020

This question is closed.