2022-06-28 01:27 AM
Hello,
I'm a newcomer in the STM32 machine learning world and I tried to make a AI model work on my STM32F429I-DISCO. Unfortunately the "Validate on target" option does not work... Errors are E200 and E801. Here is my thought process :
Iinstall a ftdi to my board to send data trough serial port : Then I launch stm32cube mx, select the board STM32F429I-DISC1 and start project without initialize all peripheral with their default mode. Then :
And finally :
I also tried validate on target on my other COM (COM4) and with communication port on the target : USART 1.
Each time I get the same result :
I don't know what to do, can someone know the solution of my problem ?
Thank in advance !
Best regards,
Martin
2022-06-28 06:48 AM
If you see the message at reset then the validation on target should work.
Tell the validation on target the COM port you where using with MobaXterm and make sure you close MobaXterm before to launch the validation on target (on windows you can have only one process accessing a COM port)
Regards
Daniel
2022-06-28 07:10 AM
Even by using the same COM port "validate on target" doesn't work (same errors as before) but MobaXtermn telling me that there is no problem :Do you know the origin of the problem ? IS this the X-Cube-AI version that is too recent ?
Do you think that coding a python script with the python module 'ai_runner' will be able to replace "validate on target"
Best regards,
Martin
2022-06-28 07:27 AM
You can first try to launch validation on target without the build as the board is already flashed with the correct code.
One possibility is that you have a hard fault when running the inference. It may be due to the stack or heap size being to small, it must be at least 0x800 but you can increase it to 0x1000 or even 0x2000. You can do that in the project tab or in the generated project if you change it in the ld script
Regards
Daniel
2022-06-28 07:59 AM
I changed the stack and heap, generated code with stmcubeMX, flash the board on CubeIDE but the validate on target without the build still doesn't work. I used a keras model, a tflite model...
Regards,
Martin
2022-06-28 08:22 AM
Do you have a hard fault in the debugger ?
Are you using external RAM or Flash ?
Regards
Daniel
2022-06-28 10:59 AM
Sorry but how do you detect a hard fault ? And I'lm not using any external flash and RAM.
Thank you for your time.
Regards,
Martin
2022-06-29 12:20 AM
To detect a hard fault you need to flash and debug the validation application using your favorite IDE (for example STM32CubeIDE). The hard fault handler is located in stm32f4xx_it.c file (void HardFault_Handler(void)), just put a breakpoint in this function.
You may also want to verify that the CRC IP is enabled. Normally it is done automatically by X-Cube-AI.
Regards
Daniel
2022-06-29 01:13 AM
Hello,
I add breakpoint and nothing happen, I assume this is because there is no hard fault. ANd the CRP is enabled in main.c, I don't see any issues here (Even so I may be wrong).
Regards,
Martin
2022-06-29 01:33 AM
I'm running out of ideas :) but still 2 more, maybe linked to your ftdi
this is to make sure you are receiving the commands from the PC
Regards
Daniel
2022-06-29 01:35 AM
If you can, it will be helpful to write a simple echo program that will loop receiving on the USART from the host and sending it back to the host.
At least we'll know that the communication is working both ways