Skip to main content
Explorer II
May 21, 2024
Question

[STM32L5] OpenBootloader UART errors

  • May 21, 2024
  • 1 reply
  • 1104 views

Hi, I integrated the OpenBootlader for the STM32L552 to my project and it works normally as expected. I'm only using the UART interface and reduced the boot loader project to the minimum.

The problem I'm facing is that sometimes the flashing stops, because the MCU is not acknowledging the messages from the programmer.

BViet1_0-1716287516447.png

This is because the MCU is hanging in the USART receive loop:

 

/**
 * @brief This function is used to read one byte from USART pipe.
 * @retval Returns the read byte.
 */
uint8_t OPENBL_USART_ReadByte(void)
{
 while (!LL_USART_IsActiveFlag_RXNE(USARTx))
 {
// OPENBL_IWDG_Refresh();
 }

 return LL_USART_ReceiveData8(USARTx);
}

 

I tried different UART speeds and the problem is not speed related.
Maybe there is a problem because every single byte is handled for reading? Why there is no DMA or interrupt mechanism implemented?

How can I fix this issues?

 

    This topic has been closed for replies.

    1 reply

    Super User
    May 21, 2024

    Have you checked for UART errors - Framing, etc ?

    BViet.1Author
    Explorer II
    May 21, 2024

    No errors when the issue occurs:

    BViet1_0-1716292490631.png