cancel
Showing results for 
Search instead for 
Did you mean: 

Custom external loader for STM32N655X0

ArunJohn
Associate II

Hi,

I’m developing a custom external loader (.stldr) for an STM32N655X0 custom board to program external XSPI NOR flash using STM32CubeProgrammer via a J-Link interface (board does not have ST-LINK).

I have the loader framework working partially:

  • Init() executes

  • Sector erase succeeds

  • Programming fails during download phase

  • CubeProgrammer logs show repeated “Init flashloader...” calls and eventually errors like:

    • “Init function fail”

    • “Could not start CPU (ErrorCode: -1)”

    • “Cannot read R0 while CPU is running”

The external flash is S25FL064L and erase operation works correctly, so communication with flash seems functional.

I wanted guidance specifically for developing external loaders intended to be used through J-Link in STM32CubeProgrammer:

  1. Are there any additional requirements or limitations when using .stldr loaders via J-Link compared to ST-LINK?

  2. Does CubeProgrammer execute the loader lifecycle differently when J-Link is selected (Init / Erase / Write / Read sequencing)?

  3. Are there RAM regions that CubeProgrammer reserves for staging write buffers which the loader must avoid?

  4. Is there a recommended linker memory layout / maximum loader RAM footprint?

  5. Does CubeProgrammer call Init() multiple times during programming, and should Init() be designed to be fully re-entrant?

  6. Are there guidelines on cache/MPU/XSPI memory-mapped mode usage inside external loaders?

  7. Any recommended debug method to trace loader execution?

If anyone has successfully developed and used a custom STM32CubeProgrammer external loader with J-Link on STM32N6, I’d appreciate any checklist or lessons learned.

Thanks.

0 REPLIES 0