2025-01-13 07:41 PM - last edited on 2025-01-14 12:54 AM by Andrew Neil
Hi everyone,
I'm new to STM32CubeIDE and working on integrating an ONNX model. I have generated the C code for the model using STM32CUBEMX on the STM32F746NGHx and noticed that the main function includes functions like:
MX_X_CUBE_AI_Init();
MX_X_CUBE_AI_Process();
However, this differs from the default main function mentioned in the document.
void main_loop() {
aiInit();
while (1) {
/* 1 - Acquire, pre-process and fill the input buffers */
acquire_and_process_data(in_data);
/* 2 - Call inference engine */
aiRun(in_data, out_data);
/* 3 - Post-process the predictions */
post_process(out_data);
}
aiDeinit();
}
I'm unable to find these functions in the generated code. (using the latest versions)
I want to:
When I build the code, I get an output.
STMicroelectronics ST-LINK GDB server. Version 7.9.0
Copyright (c) 2024, STMicroelectronics. All rights reserved.
Starting server with the following options:
Persistent Mode : Disabled
Logging Level : 1
Listen Port Number : 61234
Status Refresh Delay : 15s
Verbose Mode : Disabled
SWD Debug : Enabled
InitWhile : Enabled
Waiting for debugger connection...
Debugger connected
Waiting for debugger connection...
Debugger connected
Waiting for debugger connection...
-------------------------------------------------------------------
STM32CubeProgrammer v2.18.0
-------------------------------------------------------------------
Log output file: C:\Users\mkothuri\AppData\Local\Temp\STM32CubeProgrammer_a13396.log
ST-LINK SN : 066BFF505252836687124633
ST-LINK FW : V2J45M30
Board : 32F746GDISCOVERY
Voltage : 3.23V
SWD freq : 4000 KHz
Connect mode: Under Reset
Reset mode : Hardware reset
Device ID : 0x449
Revision ID : Rev Z
Device name : STM32F74x/STM32F75x
Flash size : 1 MBytes
Device type : MCU
Device CPU : Cortex-M7
BL Version : 0x90
Debug in Low Power mode enabled
Opening and parsing file: ST-LINK_GDB_server_a13396.srec
Memory Programming ...
File : ST-LINK_GDB_server_a13396.srec
Size : 43.30 KB
Address : 0x08000000
Erasing memory corresponding to segment 0:
Erasing internal memory sectors [0 1]
Download in Progress:
File download complete
Time elapsed during download operation: 00:00:01.087
Verifying ...
Download verified successfully
Shutting down...
Exit.
Can someone guide me on:
Additionally, please correct me if I'm wrong in any of these steps or processes. Your guidance would be greatly appreciated!
2025-01-13 08:05 PM
The program size 43 KB is too small. Looks like the needed libraries are not included into the project.
> Download verified successfully
> Shutting down...
Are you sure that you start *debugging*, not *run*? In the debug configuration dialog make sure that "Set breakpoint at main" is checked. It should be by default. Once you stop on main, you can debug further.
2025-01-13 08:33 PM
Thanks, Pavel, for your response!
I have a few follow-up questions and clarifications regarding my setup:
Steps I’ve followed so far:
I’ve attached the relevant screenshots for better context. Could you guide me in completing this process? If using a larger model is required, I can make the adjustments as needed.
Thanks for your help!