cancel
Showing results for 
Search instead for 
Did you mean: 

Problem booting from external flash memory (STM32H750, IS25LP128F)

VNguy.8
Associate II

Hello,

I am currently trying to execute and debug a program from the external flash memory (IS25LP128F) on a custom PCB I've designed based on the STM32H750VBT6 MCU. I have followed this tutorial and files from this GitHub repository to create my own external loader.

My clock configuration is as follows:

0693W00000WHrrjQAD.png 

The external loader was successfully generated and I was able to write to the flash and verify that it was correctly written to using the generated external loader and STM32CUBEProgrammer. It has passed all of the tests from this file so memory-mapped mode should also be enabled.

Now, to execute the program from the external flash memory, I have been following this tutorial but I have been facing some issues:

When I change the linker settings and don't select an external loader, I get the following message

0693W00000WHrvWQAT.png 

/* Specify the memory areas */
MEMORY
{
  FLASH (rx)     : ORIGIN = 0x90000000, LENGTH = 16M
  DTCMRAM (xrw)  : ORIGIN = 0x20000000, LENGTH = 128K
  RAM_D1 (xrw)   : ORIGIN = 0x24000000, LENGTH = 512K
  RAM_D2 (xrw)   : ORIGIN = 0x30000000, LENGTH = 288K
  RAM_D3 (xrw)   : ORIGIN = 0x38000000, LENGTH = 64K
  ITCMRAM (xrw)  : ORIGIN = 0x00000000, LENGTH = 64K
}

When I select an external loader, it manages to flash the board, but it cannot get into the main loop

0693W00000WHrw5QAD.pngI've also tried the "restart the chip and restart the debug session" as was done in the tutorial, but it still doesn't get into the main loop

0693W00000WHrwFQAT.pngI am using an ST-LINK/V2, if that makes any difference

Thank you for your help,

Vincent

5 REPLIES 5
Pavel A.
Evangelist III

> I am currently trying to execute and debug a program from the external flash 

So what is this question about? Execute and debug from external flash should work.

Booting 'H750 from external flash is not possible.

You need to boot from the internal flash (make some sort of "bootloader") which will configure the external flash and jump to it. The start address in the option bytes, obviously, should point to the internal flash.

You need code running in Internal Flash to bring up the external memory, map it and transfer control.​

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

Hi, thank you for the answer. I am a bit confused about the process, as it feels like there are two ways to do it: in the video after 6:08, it seems like he manages to boot from the external flash only by choosing the external loader, changing the SCB->VTOR register and using the generated external loader.

Looking at the current answers to this question, it seems like I have to do it another way, which would be to initialize the QSPI interface, enable the Memory-Mapped mode and then jump to the external flash address.

Why is the first method not working and do I have to use the second one? I have also found a repository which uses both methods so I was wondering if there was any difference between the two.

VNguy.8
Associate II

I've managed to make it work. As the other answers suggested, it was needed to first have a project flashed at address 0x08000000 which configured the QSPI interface and jump to user application at address 0x90000000. Then, another project is used for the main firmware, which is configured to have the flash starting at 0x90000000.

Depending on what's going on the use of an External Loader, Flash Algorithm, or debugger script can bring the hardware, pins and interfaces, to a point the MCU can see them in it's current state. At that point the debugger can see and jump to the code, everything will function until disturbed. If the MCU is reset it will lose access to external memories, etc.

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