cancel
Showing results for 
Search instead for 
Did you mean: 

Error when jumping to user app

leeana
Associate III

Hello everyone

So I've managed to adapt and build my custom user app. Flashed it into the device.

But it fails on startup somewhere between gpio and timers initializations in main().

Console shows the following text:

= [TEST] write 8 bytes @ Isolated code start add 08000200

flash error code: 0 ===> KO!!!!!    

What this may mean?

edit: in debugger is says

Break at address "0x8009b98" with no debug information available, or outside of program code.

The MCU is STM32G070

IDE is CubeIDE

8 REPLIES 8
leeana
Associate III

Another addition: SBSFU application works just fine and reports that it has switched to user application. No messages about resets are shown (except for hard reset when I press reset button).

Jocelyn RICARD
ST Employee

Hello @leeana​ 

You have apparently activated the flag SFU_TEST_PROTECTION which is very probably not what you want !

Best regards

Jocelyn

Unfortunately, it is disabled to optimize for memory, so it's not the case.

Jocelyn RICARD
ST Employee

Hello @leeana​ 

The only location where you find [TEST] in SBSFU code is SFU_TEST_Protection located in sfu_test.c

The first line of code of this file is:

#if defined(SFU_TEST_PROTECTION)

Also, this flag is not set by default so it is not involved in any optimization process.

Best regards

Jocelyn

I meant it was undefined in app_sfu.h already.

Jocelyn RICARD
ST Employee

Hello @leeana​ 

Yes I understood your message. But as this string can only be in memory if this flag is defined you need to check your porting to understand how you can reach this code.

Best regards

Jocelyn

Hello Jocelyn

So the thing was that the symbol was NOT defined but the sfu_test.c code somehow "thought" that the symbol WAS defined. I've added #undef and the message disappeared. Strange bug.

But the issue is not gone: my user app won't start properly anyway.

SOLVED: Turns out (very strange!) the problem was somewhere in LL drivers initialization! I am confused. Why the process of adapting the user application is THIS hard? I am definitely doing something wrong on the base level.

And it is still not working properly: it turns dead after hard reset. I.e. works just once after flashing.

Okay, I'll find a way to solve it.

Thank you for all your help on my (many) questions, Jocelyn.

MBuen.1
Senior

Hello @leeana​ ,

Try to add the .elf of your applicattion into your debugger. This way you will be able to check the exact part of your code that corresponds to address 0x8009b98. This post will help u to do that. https://community.st.com/s/question/0D53W00000LFDEaSAP/sbsfu-secorebin-debug

Also check if your linker file complies with SBSFU linker configs.

Regards,

Matheus