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

 

 

52 REPLIES 52

@STOne-32 @STTwo-32 @KDJEM.1  AF mapping annoyance / inconsistency across products in H7 family 

H730/H723  PA3:AF12 OCTOSPIM_P1_CLK

H7A3/H7B3  PA3:AF3 OCTOSPIM_P1_CLK

https://www.st.com/resource/en/datasheet/stm32h730ab.pdf

https://www.st.com/resource/en/datasheet/stm32h7a3ii.pdf

https://www.st.com/resource/en/datasheet/stm32h723zg.pdf

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

Try your pin configuration here

https://github.com/cturvey/stm32extldr/blob/main/h7_is25lp128/README.md

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

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.

pkoevesdi
Senior

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?

Hmm, I don't know what happened, now one week later, without chaning anything, it stops working: I get "Error: Read filed".

 

The verbosity level 3 says:

 

17:40:06:168 : UPLOADING ...
17:40:06:168 : Size : 131072 Bytes
17:40:06:168 : Address : 0x90000000
17:40:06:168 : Read progress:
17:40:06:168 : Reading data...
17:40:06:198 : halt ap 0
17:40:06:198 : w ap 0 reg 15 PC (0x24000000)
17:40:06:198 : w ap 0 reg 17 MSP (0x24000500)
17:40:06:198 : w ap 0 reg 16 xPSR (0x01000000)
17:40:06:198 : w ap 0 @0x24001F00 : 0x00000200 bytes, Data 0x00000000...
17:40:06:198 : w ap 0 @0x24000000 : 0x00000004 bytes, Data 0x0000BE00...
17:40:06:237 : w ap 0 @0x24000004 : 0x00001AD8 bytes, Data 0x4000F080...
17:40:06:237 : Loader read...
17:40:06:237 : Init flashloader...
17:40:06:237 : halt ap 0
17:40:06:237 : w ap 0 reg 0 R0 0x00000000
17:40:06:237 : w ap 0 reg 1 R1 0x00000000
17:40:06:237 : w ap 0 reg 2 R2 0x00000000
17:40:06:237 : w ap 0 reg 3 R3 0x00000000
17:40:06:237 : w ap 0 reg 4 R4 0x00000000
17:40:06:237 : w ap 0 reg 5 R5 0x00000000
17:40:06:237 : w ap 0 reg 6 R6 0x00000000
17:40:06:237 : w ap 0 reg 7 R7 0x00000000
17:40:06:237 : w ap 0 reg 8 R8 0x00000000
17:40:06:237 : w ap 0 reg 9 R9 0x00000000
17:40:06:237 : w ap 0 reg 10 R10 0x00000000
17:40:06:237 : w ap 0 reg 11 R11 0x00000000
17:40:06:237 : w ap 0 reg 12 R12 0x00000000
17:40:06:237 : w ap 0 reg 13 SP 0x00000000
17:40:06:237 : w ap 0 reg 14 LR 0x24000001
17:40:06:237 : w ap 0 reg 15 PC 0x240007C1
17:40:06:237 : w ap 0 reg 16 xPSR 0x01000000
17:40:06:238 : w ap 0 reg 17 MSP 0x24001ED8
17:40:06:238 : w ap 0 reg 18 PSP 0x00000000
17:40:06:238 : run ap 0
17:40:06:238 : halt ap 0
17:40:06:238 : r ap 0 reg 0 R0 0x00000000
17:40:06:238 : Init function fail
17:40:06:238 : r ap 0 reg 16 xPSR 0x61000000
17:40:06:243 : halt ap 0
17:40:06:243 : w ap 0 reg 15 PC (0x24000000)
17:40:06:243 : w ap 0 reg 17 MSP (0x24000500)
17:40:06:243 : w ap 0 reg 16 xPSR (0x01000000)
17:40:06:243 : Error: Data read failed
17:40:06:427 : r ap 0 @0x1FF1E7FE 0x00000004 bytes Data 0x00240092

How can I track this down? Where can I start?

Failing in the Init() function. Does check for an ISSI device responding correctly.

Power cycle board completely and retry, chip might be in unanticipated mode

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

Power cycling I tried before, that didn't help.

But, now it works again! Only thing that changed in between: I ran my rust program, that initialises and runs some read and write tests on the memory.

So, there might be some init step missing, that my rust program does? Either on the MCU or on the memory (more likely)?

But, strangely, it keeps working after another full power cycle, without running my rust program again. Maybe I have to wait another week? 😉

I can't explain this.

 

Ok, I think i figured out: It's a different rust program I tried, which itself works, but after which the external loader doesn't work anymore. Running my above mentioned first rust program again, also makes the external loader work again.

The reason: my second rust program initializes the QPI mode (Qpien = 0x35, // Enter QPI mode), the first deinitilaizes it (Qpidi = 0xF5, // Exit QPI mode).

Seemingly, this mode survives a power cycle of the flash memory.

Maybe it would make sense to either use the QPI mode (preferrable), which would have to be set in the flash chip (command 0x35) and be configured in the MCU, or deactivate the QPI mode in the flash chip (command 0xF5), if the external loader doesn't use it. But either way: bring the flash chip into a defined mode on initialization, don't leave it in any random mode, this could lead to problems or questions for many users.

 

Or is it somwhere defined / common sense / best practice to bring the flash into normal SPI mode before using an external loader?

I might need to look at and rework the reset/restart mechanics.

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