cancel
Showing results for 
Search instead for 
Did you mean: 

Hard fault during debugging of AI application in STM32N6570-DK

chanchal94
Senior

I am trying to debug AI application via FSBL (generated itself in STM32cube AI studio) , I have attached the debugger settings and Problem hereby. I had added some printf statements also in between , whose Teraterm output I have attached.
Kindly help.

 

Regards

Chanchal

chanchal94_0-1778068439097.png

chanchal94_1-1778068457700.png

 

1 ACCEPTED SOLUTION

Accepted Solutions
Andrew Neil
Super User

debugging Cortex-M Hard Faults

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.

View solution in original post

3 REPLIES 3
Andrew Neil
Super User

debugging Cortex-M Hard Faults

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.
JMar
Associate II

I have a very similar problem. My hypothesis is that the code expects to find the model's weight in the external Flash memory, but in debug mode, the binary is directly downloaded in the RAM, skipping the Flash. when executing the first operation, it reaches uninitialized memory and thus goes in HardFault mode.

I did not succeeded in fixing this. I tried to add a flashing step in my debug configuration, but it did not help. Maybe the weights are not expected to be downloaded in the FSBL section (@0x70000000).

The only way I successfully ran an inference was by flashing a "complex" project (FSBL + APPLI), but it looses the debugging capabilities, so I would like to find how to properly Debug STM32Cube AI studio projects.

 

Regards,

Julien

 

You can check the memory addresses in external memory manager and FSBL load & run file. After that go to cube programmer and try full chip erase and reflash the binaries of application and FSBL again at respective addresses according to the address in memory manager, and then again try to debug . Sometimes it clears the fault. Also you have to flash network weights at 0x71000000 not at 0x70000000. Application at 0x70100000 if you are using STM32N6570-DK. Also check the external memory loader is correct with respect to the board.

I hope any of this input can help you 

 

Regards

Chanchal