cancel
Showing results for 
Search instead for 
Did you mean: 

Custom External Loader can pass the test but doesn't work with STM32CubeProgrammer

kb24
Senior

Hello, I am trying to create external loader for MX25L12835F flash memory. My MCU is STM32H7B0RBTx and I followed "External QSPI loader how to" video series on Youtube. I used source files from the Github link that is shared below the videos. I had to change content of functions in quadspi.c file because STM32H7B0RBTx has OCTOSPI and contents of libraries are different. But I didn't change name of functions.

0693W00000APMtmQAH.jpgWhen I try this test code it can reach end of the code without any error so I can read memory in the debug screen.0693W00000APMuVQAX.jpg 

After finishing test I include Dev_Inf.c, Dev_Inf.h, Loader_Src.c and linker.ld files. I used linker.ld for H7 devices to be sure that RAM start address is 0x24000000. In the Loader_Src.c file I only made these changes:0693W00000APMydQAH.jpg 

I compiled code and created .stldr file and prepare it for STM32CubeProgrammer.

0693W00000APN6HQAX.jpg 

When I try to read data STM32CubeProgrammer it says Data read successfully but it isn't showing correct data.0693W00000APMyEQAX.jpg

When I try to upload test binary file with these settings0693W00000APN41QAH.jpg 

I get this error.0693W00000APN62QAH.jpg 

Also in the test code it can delete sectors 0-2047, it cant delete 2048 and stuck in while loop. Device size is 16 MB and sector size is 4 KB so there must be 4096 sectors.

What am I doing wrong and how can I solve it? Thank you.

11 REPLIES 11

I will do that, thank you.

Sisyphus
Associate

First off, I apologize in advance for reviving an old thread. I thought that I should add some important information for anyone who might end up here after a google search.

 

On newer versions of the CubeProgrammer (might apply to older versions too) it's important that the RAM address contains a 4-byte offset (for whatever reason). So for an H7 that would be 0x24000004. I found out the hard way after looking at the logs and realizing that CubeProgrammer adds an offset of 4 to the PC from the starting address. Looking at some example scripts confirmed this. See Linker Script H7.