cancel
Showing results for 
Search instead for 
Did you mean: 

Nucleo-U031R8 UART examples do not work?

TheRaprus
Associate III

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.

1 ACCEPTED SOLUTION

Accepted Solutions

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 

View solution in original post

4 REPLIES 4
Andrew Neil
Super User

@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?

A complex system that works is invariably found to have evolved from a simple system that worked.
A complex system designed from scratch never works and cannot be patched up to make it work.

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.

 

Karl Yamashita
Principal

Might be a clock issue. Upload your IOC file.

If a reply has proven helpful, click on Accept as Solution so that it'll show at top of the post.
CAN Jammer an open source CAN bus hacking tool
CANableV3 Open Source

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