cancel
Showing results for 
Search instead for 
Did you mean: 

STM32CubeProgrammer J-Link External Loader download

colinmurphygc
Associate II

I'm trying to interact with the external flash on the STM32H573I-DK, and having some issues. I'm using the `MX25LM51245G_STM32H573I-DK-RevB.stldr` external loader.

Using the J-Link, I can read the flash and erase sectors, but the program immediately crashes when I try to program a file. It works fine using the ST-LINK.

ST-LINK programming: 

Screenshot 2024-11-12 at 16.09.44.png

J-Link reading and erasing:

Screenshot 2024-11-12 at 16.11.26.png

Screenshot 2024-11-12 at 16.11.39.png

Programming using the CLI:

ST-LINK

 

./STM32_Programmer_CLI -c port=SWD mode=UR reset=HWrst freq=4000 ap=1 -el ExternalLoader/MX25LM51245G_STM32H573I-DK-RevB.stldr -d demo.bin 0x90000000
      -------------------------------------------------------------------
                        STM32CubeProgrammer v2.17.0
      -------------------------------------------------------------------

ST-LINK SN  : 0051002D3532511731333430
ST-LINK FW  : V3J11M3
Board       : STM32H573I-DK
Voltage     : 3.29V
SWD freq    : 3300 KHz
Connect mode: Under Reset
Reset mode  : Hardware reset
Device ID   : 0x484
Revision ID : --
Device name : STM32H56x/573
Flash size  : 2 MBytes
Device type : MCU
Device CPU  : Cortex-M33
BL Version  : 0xE4
SFSP Version: v2.5.0
Debug in Low Power mode enabled



Memory Programming ...
Opening and parsing file: demo.bin
  File          : demo.bin
  Size          : 9.51 KB
  Address       : 0x90000000


Erasing memory corresponding to segment 0:
Erasing external memory sector 0
Download in Progress:
[==================================================] 100%

File download complete
Time elapsed during download operation: 00:00:00.430

 

J-Link

 

./STM32_Programmer_CLI -c port=JLINK mode=UR reset=HWrst freq=4000 ap=1 -el ExternalLoader/MX25LM51245G_STM32H573I-DK-RevB.stldr -d demo.bin 0x90000000
      -------------------------------------------------------------------
                        STM32CubeProgrammer v2.17.0
      -------------------------------------------------------------------

Connecting to J-Link Probe
Device=Cortex-M33
Device ID   : 0x484
Voltage     : 3.31V
Flash size  : 2 MBytes
Segmentation fault: 11

 

6 REPLIES 6
liaifat85
Senior III

A segmentation fault suggests a software bug in STM32CubeProgrammer when handling J-Link with this specific setup.  STM32CubeProgrammer CLI installation may be corrupted. Try to run STM32CubeProgrammer with --verbose to get more detailed logs. 

colinmurphygc
Associate II

This happens with both the GUI and the CLI, but there's nothing to show/report with the GUI as it just crashes.

I have ran with the highest verbosity, but the output is not nearly as verbose as it is using the ST-LINK connection. I've included snippets for the failed download and for a succesfully erase of a couple of sectors of the external flash.

./STM32_Programmer_CLI -c port=JLINK mode=UR reset=HWrst freq=4000 ap=1 -el ExternalLoader/MX25LM51245G_STM32H573I-DK-RevB.stldr -d demo.bin 0x90000000 -vb 3
      -------------------------------------------------------------------
                        STM32CubeProgrammer v2.17.0
      -------------------------------------------------------------------

Connecting to J-Link Probe
Device=Cortex-M33
Device ID   : 0x484
Voltage     : 3.30V
Reading data...
Reading data...
PC value = 0xFFFFFFFE  :

SAU Config applied :

Zone 1 defined as non secure: 	Start= 0x40000000	 End= 0x4FFFFFFF
Zone 2 defined as non secure: 	Start= 0x8FFF000	 End= 0x8FFF7FF
Zone 3 defined as non secure: 	Start= 0xBF96000	 End= 0xBFA0000
Zone 4 defined as non secure: 	Start= 0xBFA0764	 End= 0xBFA0768
Zone 5 defined as non secure: 	Start= 0x8000000	 End= 0x8200000
Database: Config 0 is active.
flash loader /Applications/STMicroelectronics/STM32CubeProgrammer/STM32CubeProgrammer.app/Contents/MacOs/bin/FlashLoader/0x484.stldr is loaded
Reading data...
Reading data...
PC value = 0xFFFFFFFE  :

SAU Config applied :

Zone 1 defined as non secure: 	Start= 0x40000000	 End= 0x4FFFFFFF
Zone 2 defined as non secure: 	Start= 0x8FFF000	 End= 0x8FFF7FF
Zone 3 defined as non secure: 	Start= 0xBF96000	 End= 0xBFA0000
Zone 4 defined as non secure: 	Start= 0xBFA0764	 End= 0xBFA0768
Zone 5 defined as non secure: 	Start= 0x8000000	 End= 0x8200000
Database: Config 0 is active.
Reading data...
PC value = 0xFFFFFFFE  :

SAU Config applied :

Zone 1 defined as non secure: 	Start= 0x40000000	 End= 0x4FFFFFFF
Zone 2 defined as non secure: 	Start= 0x8FFF000	 End= 0x8FFF7FF
Zone 3 defined as non secure: 	Start= 0xBF96000	 End= 0xBFA0000
Zone 4 defined as non secure: 	Start= 0xBFA0764	 End= 0xBFA0768
Zone 5 defined as non secure: 	Start= 0x8000000	 End= 0x8200000
Flash size  : 2 MBytes
Segmentation fault: 11
./STM32_Programmer_CLI -c port=JLINK mode=UR reset=HWrst freq=4000 ap=1 -el ExternalLoader/MX25LM51245G_STM32H573I-DK-RevB.stldr -e [0 2] -vb 3
      -------------------------------------------------------------------
                        STM32CubeProgrammer v2.17.0
      -------------------------------------------------------------------

Connecting to J-Link Probe
Device=Cortex-M33
Device ID   : 0x484
Voltage     : 3.30V
Reading data...
Reading data...
PC value = 0xFFFFFFFE  :

SAU Config applied :

Zone 1 defined as non secure: 	Start= 0x40000000	 End= 0x4FFFFFFF
Zone 2 defined as non secure: 	Start= 0x8FFF000	 End= 0x8FFF7FF
Zone 3 defined as non secure: 	Start= 0xBF96000	 End= 0xBFA0000
Zone 4 defined as non secure: 	Start= 0xBFA0764	 End= 0xBFA0768
Zone 5 defined as non secure: 	Start= 0x8000000	 End= 0x8200000
Database: Config 0 is active.
flash loader /Applications/STMicroelectronics/STM32CubeProgrammer/STM32CubeProgrammer.app/Contents/MacOs/bin/FlashLoader/0x484.stldr is loaded
Reading data...
Reading data...
PC value = 0xFFFFFFFE  :

SAU Config applied :

Zone 1 defined as non secure: 	Start= 0x40000000	 End= 0x4FFFFFFF
Zone 2 defined as non secure: 	Start= 0x8FFF000	 End= 0x8FFF7FF
Zone 3 defined as non secure: 	Start= 0xBF96000	 End= 0xBFA0000
Zone 4 defined as non secure: 	Start= 0xBFA0764	 End= 0xBFA0768
Zone 5 defined as non secure: 	Start= 0x8000000	 End= 0x8200000
Database: Config 0 is active.
Reading data...
PC value = 0xFFFFFFFE  :

SAU Config applied :

Zone 1 defined as non secure: 	Start= 0x40000000	 End= 0x4FFFFFFF
Zone 2 defined as non secure: 	Start= 0x8FFF000	 End= 0x8FFF7FF
Zone 3 defined as non secure: 	Start= 0xBF96000	 End= 0xBFA0000
Zone 4 defined as non secure: 	Start= 0xBFA0764	 End= 0xBFA0768
Zone 5 defined as non secure: 	Start= 0x8000000	 End= 0x8200000
Flash size  : 2 MBytes

Erase sector(s) ...

Flash erase...
Init flashloader...
Loader sector erase...
Init flashloader...
Loader sector erase...
Init flashloader...
Loader sector erase...
Existing specified sectors are erased successfully
Protected sectors are not erased

  The verbosity is really lacking in comparison

Pavel A.
Evangelist III

@colinmurphygc If you have a genuine J-link - while ST is working on a fix, you can program the flash with Segger J-Flash software. Segger developed "universal" loader for QSPI memories. User only has to select the pinout of the QSPI memory, then the loader automatically detects the model and size of the flash chip and does its magic.

 

> If you have a genuine J-link - while ST is working on a fix, you can program the flash with Segger J-Flash software. 

If I might ask :
Does "genuine" in this context mean that ST-Links converted to JLinks with Segger's firmware are not supported ?

colinmurphygc
Associate II

Thanks for the tip about the Segger J-Flash. I will look into this as a solution if ST confirm this CubeProgrammer issue is not caused by a user error on my side.

The GUI does produce a log error file; if it is of use I can send the full copy. I've included what looks relevant:

 

# C  [libCubeProgrammer_API.dylib+0x13780e]  ST_LINKInterface::DisableWDGRST(TargetInterface*, ST_LINKInterface*, bool)+0x2e

...

Stack: [0x0000000308577000,0x0000000308677000],  sp=0x0000000308675790,  free space=1017k
 Native frames: (J=compiled Java code, j=interpreted, Vv=VM code, C=native code)
 C  [libCubeProgrammer_API.dylib+0x13780e]  ST_LINKInterface::DisableWDGRST(TargetInterface*, ST_LINKInterface*, bool)+0x2e
 C  [libCubeProgrammer_API.dylib+0xe041]  downloadFile+0x191
 C  [jna9175919993682943405.tmp+0xdef4]  ffi_call_unix64+0x4c
 C  0x00000003086763f8

Does "genuine" in this context mean that ST-Links converted to JLinks

If this is your case, please try to run J-Flash on it and see if it complains. I haven't tried. Segger's "universal loader" works well with a real J-Link.