cancel
Showing results for 
Search instead for 
Did you mean: 

CubeMX Uart

spa23
Associate III
Posted on February 24, 2017 at 11:30

Hi There seems to be a bug in the uart driver for the STM32L0, STM32F7 and STM32F4 but

not

for the STM32L1

The bug is that you can't send while receiving on the uart:

The code for STM32L0, STM32F7 and STM32F4:

HAL_StatusTypeDef HAL_UART_Transmit_IT(UART_HandleTypeDef *huart, uint8_t *pData, uint16_t Size)

{

   /* Check that a Tx process is not already ongoing */

   if(huart->gState == HAL_UART_STATE_READY)

   {

The Code for the STM32L1

HAL_StatusTypeDef HAL_UART_Transmit_IT(UART_HandleTypeDef *huart, uint8_t *pData, uint16_t Size)

{

 uint32_t tmp_state = 0;

 tmp_state = huart->State;

 if((tmp_state == HAL_UART_STATE_READY) || (tmp_state == HAL_UART_STATE_BUSY_RX))

 {

or in overall, you can't use the RX if you are using TX and the other way around.

In my case I'm using (

STM32L0

) DMA RX and that is all ways in use, so it is not possible for me to TX.

 #cubemx

#uart

0 REPLIES 0