Skip to main content
Graduate
April 2, 2025
Solved

Nucleo-U031R8 UART examples do not work?

  • April 2, 2025
  • 2 replies
  • 623 views

Hi to all.

I'm testing the Nucleo U031R8. To avoid the Package issue i switch also to the old package firmware version (1.0.0), but same error.

The example is UART_HyperTerminal_IT  and i simple cloned (or compiled directly in the repository), then execute without cars sending on the virtual comm port.

The progran stuck in function "UART_CheckIdleState", because the timeout of function "UART_WaitOnFlagUntilTimeout" is set to 0x1FFFFFFU via macro.

Is my new board damaged or similar? 

I've tried to rebuild the project via CubeMX (even in the recent 1.2.0 libs). No way.

 

Thanks.

    This topic has been closed for replies.
    Best answer by TheRaprus

    Did it, but nothing.

    I tried playing with clock, changing the PLL and clocksourge (still in the examples).

    Suddenly, everything work fine. Really donnow what happen. Never seen before (had abot 20+ Nucleos board).

    Thanks 

    2 replies

    Super User
    April 2, 2025

    @TheRaprus wrote:

    To avoid the Package issue .


    What "Package issue" ?

     


    @TheRaprus wrote:

    The example is UART_HyperTerminal_IT  .


    Before adding the complexity of interrupts, can you get basic polled functions working?

    TheRaprusAuthor
    Graduate
    April 2, 2025

    Here the package issue:

    https://community.st.com/t5/stm32cubemx-mcus/package-error-when-importing-examples-of-nucleo-u031r8/td-p/753894
    So, i tried the previous library.

    Concerning the 2nd question, the stuck occour in the MX_USART2_UART_Init() function, a couple of codeline below the SystemClock_Config().

    The stack is this:

    MX_USART2_UART_Init() -> HAL_UART_Init -> UART_CheckIdleState(...)

    MX_USART2_UART_Init() is defined in the main.c example (attached), the other two are stm32u0xx* library.
    In this point the program stuck unsing both library: 1.0.0 and the latest 1.2.0

    Here, in UART_CheckIdleState the program wait for the timeout.

    I don't touch the example, simply connect the board, compile ad (try to) run. This is why I presume an HW error.

     

    Graduate II
    April 2, 2025

    Might be a clock issue. Upload your IOC file.

    TheRaprusAuthorAnswer
    Graduate
    April 8, 2025

    Did it, but nothing.

    I tried playing with clock, changing the PLL and clocksourge (still in the examples).

    Suddenly, everything work fine. Really donnow what happen. Never seen before (had abot 20+ Nucleos board).

    Thanks