2020-09-16 09:20 AM
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
}
2020-09-18 06:38 AM
This question is closed.