Skip to main content
Associate III
March 27, 2024
Solved

Facing issue while creating external flash loader

  • March 27, 2024
  • 14 replies
  • 13812 views

I am using NUCLEO-H563ZI evaluation board and i want to create external flash loader for IS25LP128 QSPI flash memory. I used external loader files from GIT HUB and .stldr file in STCUBE programmer external loader folder location. when i try to read from 0x90000000 location, i am getting read failure error. I used the below path to create external loader for IS25LP128 QSPI flash memory,

stm32-external-loader/Loader_Files/other devices at contrib · STMicroelectronics/stm32-external-loader · GitHub

Could you please help me to solve the below issue?

 

Nagarajan_2-1711548543593.png

 

 

    Best answer by Tesla DeLorean

    >>What could be the reason for Init function not called?

    I don't know, use your imagination.

    Set the STM32 Cube Programmer side to Verbose Logging Level 3, see what it's doing.

    Make sure it pulls in the loader image to RAM, that it correctly identifies the Init() entry point, and calls it. Use objdump or fromelf to dump/disassemble the .STLDR

    Other H5 loaders use 0x20003004 as the basis, not 0x20000004 or 0x24000004

    C:\STM32Cube\STM32CubeProgrammer_v2.15.0\bin\ExternalLoader>C:\Keil537\ARM\ARMCLANG\bin\fromelf.exe -csd MX25LM51245G_STM32H573I-DK.stldr
    
    ========================================================================
    
    ** ELF Header Information
    
     File Name: MX25LM51245G_STM32H573I-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: 0x20003005
     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: 159376 (0x00026e90)
     Section header offset: 159440 (0x00026ed0)
    
     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 : 16205 bytes
     Virtual address: 0x20003004 (Alignment 4)
    
    
    ========================================================================
    ...
     267 Init 0x20003005 Gb 5 Code De 0x66
     268 MassErase 0x2000306b Gb 5 Code De 0x3e
     269 Write 0x200030a9 Gb 5 Code De 0x46
     270 SectorErase 0x200030ef Gb 5 Code De 0x60
     271 CheckSum 0x2000320d Gb 5 Code De 0xd4
     272 Verify 0x200032e1 Gb 5 Code De 0x5e
    ...

    14 replies

    Associate III
    June 2, 2024

    @unknown wrote:
      • Get the loader files from Github [...] specific to the IS25LP128

     Could You point to where these files are to be found? I couldn't find them.

    Tesla DeLorean
    Guru
    June 2, 2024
    Tips, Buy me a coffee, or three.. PayPal VenmoUp vote any posts that you find helpful, it shows what's working..
    Associate III
    June 2, 2024
    @Tesla DeLorean wrote:

    https://github.com/STMicroelectronics/stm32-s25fl128s/blob/main/s25fl128s.c

    But this is a different chip than IS25LP128, isn't it? I'll look it up.

     

    Not here

    https://github.com/STMicroelectronics/stm32-external-loader


    This is where I already searched some time ago.


    Associate III
    June 2, 2024

    @Tesla DeLorean wrote:

    Express parts and pin utilizations..


    Not, sure, what You mean, but I try my best:

    I have a custom board consting of a STM32H730 and a IS25LP128 QSPI flash memory connected to OCTOSPI (PA3, PC11, PC9, PC10, PE2, PA6). I can access, control, read and write the flash with a little rust program, but it seems above my head to write an own external loader. Aim is to XiP my user program from the external flash, so being able to flash the program and bringing it in memory mapped mode. I'm imploringly searching for a usable solution, hopefully I'm not the first trying this.

    What I didn't understand yet fully: the external loaders are specific for the flash memory, but are they also specific for the MCU, thus specific for the combination of both?

    You mentioned a database in which You would take this solution, when it's ready, did I understand this right? Where / is this database publicly available? Is this flash memory in there?

    Tesla DeLorean
    Guru
    June 2, 2024

    >>Not, sure, what You mean, but I try my best

    Yes, those were the details.

    >>What I didn't understand yet fully: the external loaders are specific for the flash memory, but are they also specific for the MCU, thus specific for the combination of both?

    Yes, ST took a very specific path on building these, a more general script based solution, or one that passed a pin table, would have been much more flexible.

    This is my exercise   https://github.com/cturvey/stm32extldr

    In another era I would have created an Auto-Gen tool you could run as an .EXE on Windows, but now Viruses and Malware..

    There are a couple where I patched the ST .STLDR to use a table driven MSP initialization of the GPIO's. These could then be hex-edited, or bound to a generation tools with pin selections in COMBO-BOXES or an .INI file / script

    https://github.com/cturvey/stm32extldr/blob/main/h5_mx25lm51245g/patch.s

    Tips, Buy me a coffee, or three.. PayPal VenmoUp vote any posts that you find helpful, it shows what's working..
    Associate III
    June 2, 2024

    YES! This works out of the box, tried reading and writing. Giant step for our project. Thank You very much. I'll ask my collegues to put some contribution to You paypal account, otherwise I'll do.

    Associate III
    June 2, 2024

    It might be Rust-/probe-rs-specific, but maybe You have a helpful hint for this:

    https://users.rust-lang.org/t/create-own-flash-algorithm-from-binary/108885/4?u=pkoevesdi

    Failed to find 'FlashDevice' symbol in ELF file.

    When I look at this:

    https://open-cmsis-pack.github.io/Open-CMSIS-Pack-Spec/main/html/flashAlgorithm.html#CreateFPA

    there's supposed to be one, independently of Rust / probe-rs?