Skip to main content
Visitor II
November 7, 2024
Question

STM32U545 External Loader "Init Function Fail"

  • November 7, 2024
  • 3 replies
  • 2909 views

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.

    3 replies

    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.

    Visitor II
    February 5, 2025

    Hi, I have same problem, did you solved?

    Graduate II
    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

    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.
    Visitor 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