Skip to main content
Farbod
Associate
February 6, 2023
Solved

Executing main() by XIP with W25Q32 QSPI Flash

Hi

I'm using STM32H750VBT6 with W25Q32 QSPI external flash memory from Winbond and I'm using Keil Microvision IDE with ARM_CC Compiler.

I'm trying to execute my whole project from the QSPI flash directly (which is called XIP). I know that I have to configure QuadSPI peripheral properly before executing code from the memory mapped QSPI flash and I'm doing it in SystemInit() function, so I have to map the SystemInit or system_stm32h7xx.c file to the default internal flash address and change the main() address to the QSPI flash (which is 0x90000000 in my case).

The problem is, how I can change the main() base address and execute it from the QSPI flash after configuring QuadSPI in SystemInit().

And what should I do with VTOR? Do I have to leave it with the default value?

Regards

Farbod

This topic has been closed for replies.
gbm
gbmBest answer
Super User
February 6, 2023

What you are trying to do doesn't seem to be a good idea - you will get slow and non-deterministic interrupt response.

I you have to do it, treat it as two distinct programs in two separate projects: the bootloader in internal Flash, initializing QSPI access and jumping to the application in QSPI. Search the forum for posts on bootloader - you will see many interesting remarks. You will need to set VTOR in the bootloader (recommended) or in the app.

My STM32 stuff on github - compact USB device stack and more: https://github.com/gbm-ii/gbmUSBdevice

2 replies

gbm
gbmBest answer
Super User
February 6, 2023

What you are trying to do doesn't seem to be a good idea - you will get slow and non-deterministic interrupt response.

I you have to do it, treat it as two distinct programs in two separate projects: the bootloader in internal Flash, initializing QSPI access and jumping to the application in QSPI. Search the forum for posts on bootloader - you will see many interesting remarks. You will need to set VTOR in the bootloader (recommended) or in the app.

My STM32 stuff on github - compact USB device stack and more: https://github.com/gbm-ii/gbmUSBdevice
Farbod
FarbodAuthor
Associate
February 6, 2023

Thanks a lot:thumbs_up: