2022-11-09 02:29 AM
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:
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
/* 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
I'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
I am using an ST-LINK/V2, if that makes any difference
Thank you for your help,
Vincent
2022-11-09 03:00 AM
> 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.
2022-11-09 03:04 AM
You need code running in Internal Flash to bring up the external memory, map it and transfer control.
2022-11-09 05:15 AM
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.
2022-11-11 07:00 AM
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.
2022-11-11 09:33 AM
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.