cancel
Showing results for 
Search instead for 
Did you mean: 

Facing issue while creating external flash loader

Nagarajan
Associate III

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

 

 

51 REPLIES 51

Is the any video or procedure link to know how to debug the loader file through UART?

Reading all zero's. Perhaps the writes not working, or the addressing isn't working, and it keeps writing data to the same page, and with sufficient patterns knocks all One bits to Zero bits?

Erased bit state is One, can be cleared to Zero once.

Make sure to mask the address passed to the memory, it is Zero Based, it doesn't understand the STM32's 0x90000000 address space.

sCommand.Address = Address & 0x0FFFFFFF; // Mask Lower 28-bits (256MB)

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..

Well you can use any hardware on your board for diagnostics.

You can use the UART to output things like function entry, parameters and success/failure indication. This way you can understand the dynamic interaction between the loader and the STM32 Cube Programmer tool.

Code with the assumption you don't have printf() or interrupts

#ifdef DEBUG_UART
  OutString("Read: Enter");
  OutString(DumpHex(Address));
  OutString(DumpHex((uint32_t)Buffer));
  OutString(DumpHex(Size));
  OutChar('\n');
#endif // DEBUG_UART

Could use LEDs for a pass/fail indication

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..

Like you suggested i put LED for pass and fail condition for debugging. With this debugging i come to know that Init function is not at all called. When i press the read button first time, read function is not called as i can see LED is not glowed. When i pressed read button again, read function is called and i am able to see LED glow and read success in log. What could be the reason for Init function not called?

>>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
...
Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..

After changing the RAM address to 0x20003004, i am able to read data without any failure. it works fine. But when i try to write the binary in external memory, i am getting erase failure. How do i approach this issue? Could i get MX25LM51245G_STM32H573I-DK project linker.ld Loader_Src.c files for reference?

Nagarajan
Associate III

There are two changes needed in Loader files. One is RAM address need to be changed to 0x20003004 in linker.ld and Loader_Src.c files. Another one is We need to deinit and init QuadSPI everytime when we do erase and write In Loader_Src.c file. With those changes external loader works fine for STM32H563 controller.

pkoevesdi
Senior

Could You provide us with a working external loader for this memory chip? I have the same one and I didn't come nearly as far as you to use it for my program.

pkoevesdi
Senior

@Mykel 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.

Express parts and pin utilizations..

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..