Skip to main content
Visitor
July 20, 2026
Solved

Troubleshooting run on STM32U545

Hello ST team,

 

I am trying to run an ONNX model on a NUCLEO-U545RE-Q board using STM32Cube AI Studio

 

I first tried with a model of about 281.75 KiB weights, and the generated project failed at build/link stage with an undefined UART symbol.

 

To check whether the issue was related to memory size, I also tried a smaller model:

 

- Model: model_seqlen20.onnx

- Input: f32(1x20x25)

- Output: f32(1x1)

- Parameters: 32,129

- Weights: 128,516 B / 125.50 KiB

- Activations: 2,256 B / 2.20 KiB

- Total AI flash reported: 130,190 B

- Target: stm32u5

- Board: NUCLEO-U545RE-Q

- Firmware package: STM32Cube_FW_U5_V1.9.0

- ST Edge AI Core: v4.0.1-20581

- Toolchain: STM32CubeIDE

 

The model generation step completes successfully. The reported memory footprint is small enough for the board.

 

However, during the Run flow, STM32Cube AI Studio the build fails with:

 

undefined reference to `UartHandle`

 

The errors are:

 

Middlewares/ST/AI/Misc/Src/aiTestUtility.c:

- _put_c_driver: undefined reference to `UartHandle`

- ioRawWriteBuffer: undefined reference to `UartHandle`

- ioRawReadBuffer: undefined reference to `UartHandle`

 

The final error is:

 

collect2.exe: error: ld returned 1 exit status

make: *** [makefile:69: run-1.elf] Error 1

 

This seems unrelated to model size, because the smaller model also fails in the same UART-related step.

 

It looks like the generated validation project expects a UART handle named `UartHandle`, but the generated CubeMX/CubeIDE project does not define it or does not initialize the board communication interface needed by the validation middleware.

 

Could you please confirm whether automatic Run/validation on NUCLEO-U545RE-Q is supported with STM32CubeAI Studio and ST Edge AI Core v4.0.1?

 

Is there a specific communication setting I need to select in the tool, or is this a known issue in the generated project template for NUCLEO-U545RE-Q?

 

I am attaching:

- the full generation/build log

- the ONNX model used for this smaller test

 

Thank you.

Julian E.
Julian E.Best answer
ST Technical Moderator
October 2, 2026

Hi ​@frig,

 

Sorry for my very late answer.

We solved this issue, but this will only be available on the next release of STM32cubeAI Studio (around november).

This is caused by wrong configs sent by CubeMX.

 

Have a good day,

Julian

​In order to give better visibility on the answered topics, please click on 'Accept as Solution' on the reply which solved your issue or answered your question.

2 replies

frigAuthor
Visitor
July 21, 2026

Hello ST team,

 

I have isolated the issue.


What works:

Using STM32CubeMX with X-CUBE-AI, I generated the project, imported it into STM32CubeIDE, built it, flashed it, and then ran Validate on Target from STM32CubeMX. After selecting USART1, validation works correctly over ST-LINK VCP COM4:115200.

 

The validation succeeds with:

- rmse = 0.000000046

- mae = 0.000000024

- nse = 1.000000

- cos = 1.000000

 

What does not work:

Using STM32CubeAI Studio, Run on Target still fails for the same board/model.

 

Depending on the attempt, the AI Studio generated project either fails to build with missing UART symbols such as:

 

undefined reference to `UartHandle`

 

or, after it tries to configure USART1, with:

 

undefined reference to `huart1`

undefined reference to `MX_USART1_UART_Init`

 

According to UM3062, NUCLEO-U545RE-Q has STLINK-V3EC VCP connected by default to USART1 PA9/PA10. This is also confirmed by the working CubeMX/X-CUBE-AI validation flow when USART1 is selected.

 

Could you please check whether STM32CubeAI Studio uses the wrong UART/VCP configuration for NUCLEO-U545RE-Q during Run on Target?

 

Is there a way in STM32CubeAI Studio to force USART1 for the target communication, as in STM32CubeMX/X-CUBE-AI?

 

Thank you.

Julian E.
Julian E.Best answer
ST Technical Moderator
October 2, 2026

Hi ​@frig,

 

Sorry for my very late answer.

We solved this issue, but this will only be available on the next release of STM32cubeAI Studio (around november).

This is caused by wrong configs sent by CubeMX.

 

Have a good day,

Julian

​In order to give better visibility on the answered topics, please click on 'Accept as Solution' on the reply which solved your issue or answered your question.