cancel
Showing results for 
Search instead for 
Did you mean: 

STM32U545 External Loader "Init Function Fail"

GiBi_01
Associate

I have an External Loader Project made for STM32G0/G4/L4.

I ported it to STM32U5: all the functions work fine when debugged from STM32CubeIDE (so the connections are ok). With the STM32CubeProgrammer the .stldr file is recognized but the Read/Write/SectoreErase operations fails due to "Init Function fail". 

Any suggestion will be appreciated!

6 REPLIES 6
Imen.D
ST Employee

Hello @GiBi_01 ,

Which CubeProgrammer version used ?

Make sure to use the latest STM32CubeProgrammer release v2.17.0.

If the problem persists, please attach your option bytes configuration.

When your question is answered, please close this topic by clicking "Accept as Solution".
Thanks
Imen
MMira.4
Associate II

Hi, I have same problem, did you solved?

The Init() function returning zero is the failure condition.

Your log, and that of the OP, show it returning, not timing out.

You can confirm the PC entry point for Init using objcopy or objdump

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..
gibi
ST Employee

Hi all.

Upgrading the STM32CubeProgrammer to v2.17 we found that the issue was related to the size of the ExternalLoader.

We fixed it in this way:

  • Discard unused functions flag enabled in STM32CubeIDE linker options.
  • EXT_LOADER.ld file modified to keep only the needed functions.

Can you show a template of this modified linker?

EXT_LOADER file attached as a .txt file, rename it as a .ld one.

The key point is the KEEP command.

Here the linker configuration:

gibi_1-1738847509561.png

 

#define VECT_TAB_OFFSET 0x00000200UL