Skip to main content
Visitor II
November 7, 2024
Question

STM32U545 External Loader "Init Function Fail"

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!

This topic has been closed for replies.

6 replies

ST Technical Moderator
November 7, 2024

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.

In order to give better visibility on the answered topics, please click on 'Best answer' on the reply which solved your issue or answered your question. Thanks
MMira.4
Associate II
February 5, 2025

Hi, I have same problem, did you solved?

Tesla DeLorean
Guru
February 6, 2025

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 (See Profile) Up vote any posts that you find helpful, it shows what's working..
ST Employee
February 6, 2025

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.
MMira.4
Associate II
February 6, 2025

Can you show a template of this modified linker?

ST Employee
February 6, 2025

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