Skip to main content
atariman
Associate
April 27, 2023
Solved

STM32CubeProgrammer 2.12 and later can't load external loader

  • April 27, 2023
  • 3 replies
  • 2045 views

From version 2.11 to 2.12 a change was introduced that results in the programmer reporting that the external loader "cannot be loaded" while loading via stlink v2 via the command line tool.

-----------------------------------------------------------
 STM32CubeProgrammer v2.12.0
-----------------------------------------------------------
 
Error: External loader <file_name>.stldr cannot be loaded.
Press any key to continue . . .

The loader has not changed through many versions of the programmer and has been functioning as expected until now. Are there known updates to the loader api or other modifications documented somewhere?

The issue came to light after updating to 2.13 from 2.9, after which I was able to narrow down at which release the issue showed up, between 2.11 and 2.12.

Device

STM32H743IIT6 with and external QSPI flash memory

This topic has been closed for replies.
Best answer by Tesla DeLorean

The StorageInfo section is supposed to be 200 bytes in size

3 replies

Tesla DeLorean
Guru
April 27, 2023

The may have changed or updated the .ELF parser/loader

Watch also for odd characters in the file names, dots, spaces, foreign, etc.

Not seen it effect my builds.

Would suggest inspecting with OBJCOPY or FROMELF and seeing if there are any obvious issues with the program, section, or symbol names, or load address.

H7 loaders should live at 0x24000004

========================================================================
 
** ELF Header Information
 
 File Name: MX25LM51245G_STM32H735G-DK.stldr
 
 Machine class: ELFCLASS32 (32-bit)
 Data encoding: ELFDATA2LSB (Little endian)
 Header version: EV_CURRENT (Current version)
 Operating System ABI: none
 ABI Version: 0
 File Type: ET_EXEC (Executable) (2)
 Machine: EM_ARM (ARM)
 
 Image Entry point: 0x2400000f
 Flags: None (0x05000000)
 
 ARM ELF revision: 5 (ABI version 2)
 
 Conforms to Base float procedure-call standard
 
 Header size: 52 bytes (0x34)
 Program header entry size: 32 bytes (0x20)
 Section header entry size: 40 bytes (0x28)
 
 Program header entries: 2
 Section header entries: 20
 
 Program header offset: 197800 (0x000304a8)
 Section header offset: 197864 (0x000304e8)
 
 Section header string table index: 1
 
========================================================================
 
** Program header #0 (PT_LOAD) [PF_R]
 Size : 200 bytes
 Virtual address: 0x00000000 (Alignment 4)
 
====================================
 
** Program header #1 (PT_LOAD) [PF_X + PF_W + PF_R]
 Size : 18853 bytes
 Virtual address: 0x24000004 (Alignment 4)
 
========================================================================
..
 
** Section #4 'P3' (***_PROGBITS) [SHF_ALLOC]
 Size : 200 bytes (alignment 4)
 Address: 0x00000000
 
 0x000000: 4d 58 32 35 4c 4d 35 31 32 34 35 47 5f 53 54 4d MX25LM51245G_STM
 0x000010: 33 32 48 37 33 35 47 2d 44 4b 00 00 00 00 00 00 32H735G-DK......
 0x000020: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
 0x000030: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
 0x000040: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
 0x000050: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
 0x000060: 00 00 00 00 03 00 00 00 00 00 00 90 00 00 00 04 ................
 0x000070: 00 10 00 00 ff 00 00 00 00 04 00 00 00 00 01 00 ................
 0x000080: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
 0x000090: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
 0x0000a0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
 0x0000b0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
 0x0000c0: 00 00 00 00 00 00 00 00 ........
 
 Info_BLOCK$$Limit
 
** Section #5 'P1-P2 ro' (***_PROGBITS) [SHF_ALLOC + SHF_WRITE + SHF_EXECINSTR]
 Size : 18853 bytes (alignment 4)
 Address: 0x24000004
 
...

Tips, Buy me a coffee, or three.. PayPal VenmoUp vote any posts that you find helpful, it shows what's working..
atariman
atarimanAuthor
Associate
April 27, 2023

The sections were at the correct locations, the entry point address was set to 0x0, however modifying that to 0x24000004 didn't help.

atariman
atarimanAuthor
Associate
April 27, 2023

Here is the output of readelf -hS, perhaps it helps.

ELF Header:
 Magic: 7f 45 4c 46 01 01 01 00 00 00 00 00 00 00 00 00
 Class: ELF32
 Data: 2's complement, little endian
 Version: 1 (current)
 OS/ABI: UNIX - System V
 ABI Version: 0
 Type: EXEC (Executable file)
 Machine: ARM
 Version: 0x1
 Entry point address: 0x0
 Start of program headers: 52 (bytes into file)
 Start of section headers: 118252 (bytes into file)
 Flags: 0x5000000, Version5 EABI
 Size of this header: 52 (bytes)
 Size of program headers: 32 (bytes)
 Number of program headers: 2
 Size of section headers: 40 (bytes)
 Number of section headers: 12
 Section header string table index: 11
 
Section Headers:
 [Nr] Name Type Addr Off Size ES Flg Lk Inf Al
 [ 0] NULL 00000000 000000 000000 00 0 0 0
 [ 1] P2 PROGBITS 00000000 000074 000080 01 A 0 0 4
 [ 2] P1 PROGBITS 24000004 0000f4 002e74 01 WAX 0 0 4
 [ 3] P1_2 NOBITS 24002e78 002f68 00005c 01 WAX 0 0 1
 [ 4] .debug_frame PROGBITS 00000000 002f68 0015cd 01 0 0 1
 [ 5] .iar.debug_frame PROGBITS 00000000 004535 0023e9 01 0 0 1
 [ 6] .comment PROGBITS 00000000 00691e 00d2d8 01 0 0 1
 [ 7] .iar.rtmodel PROGBITS 00000000 013bf6 000032 01 0 0 1
 [ 8] .ARM.attributes ARM_ATTRIBUTES 00000000 013c28 00002e 01 0 0 1
 [ 9] .symtab SYMTAB 00000000 013c58 004840 10 10 1057 4
 [10] .strtab STRTAB 00000000 018498 0048f7 00 0 0 1
 [11] .shstrtab STRTAB 00000000 01cd8f 00005d 00 0 0 1

Tesla DeLorean
Tesla DeLoreanBest answer
Guru
April 27, 2023

The StorageInfo section is supposed to be 200 bytes in size

Tips, Buy me a coffee, or three.. PayPal VenmoUp vote any posts that you find helpful, it shows what's working..
atariman
atarimanAuthor
Associate
May 1, 2023

Thanks for the help. Fixing a change to the StorageInfo struct has corrected the issue.