cancel
Showing results for 
Search instead for 
Did you mean: 

How to boot from and execute code from external Quad SPI flash memory on STM32H742 (STM32H7) using XiP model?

mwb
Associate III

Hi all,

we're planing to use an STM32H742 with external SDRAM (for data) and external Quad SPI flash.

The Quad SPI flash shall hold the application binary - i.e. instructions, constants, etc. to be loaded at boot and all code to be executed.

We'd like to use the "XiP model [which is] based on code execution directly from the external non-volatile memory that is used for code storage" - as described in AN5188. However, the AN5188 does not mention STM32H742 but only STM32H743.

Does the STM32H742 support this feature?

It seems to be likely to us as we've seen

  • sentences like "(..) the STM32H7 devices deliver the maximum theoretical performance of the Cortex-M7 core no matter whether the code is executed from the embedded Flash or from the external memory" - mentioning the whole series; and
  • the section "23.3.7 QUADSPI memory-mapped mode" of RM0433 for STM32H742 stating "Support for execute in place (XIP) operation is implemented, where the QUADSPI (...)"

What steps need to be done to boot from the external Quad SPI flash and also execute application's code?

If so, is there a separate application note for it?

Are there any special steps to take in order to load/initialize data into both internal SRAM and external SDRAM?

How to configure the FMC and QUADSPI peripherals using the STM32CubeMX utility?

What settings need to made in STM32CubeIDE in order to make this work?

Thanks and best regards,

Matthias

3 REPLIES 3
ChahinezC
Lead

Hello @mwb​,

  • Yes, same as the STM32H743, the STM32H742 support the XiP.

  • But it is important to highlight that you can not boot from the external memory, however once setting its configuration to “memory mapped mode�?, you will be able to execute the application from the external memory.

  • Regarding the QuadSPI interface configuration on the STM32CubeMX, you can refer to the 4th section of the AN4760.

  • You can as well refer to the 6.2 section of the same application note in order to execute from external Quad-SPI memory.

  • For the FMC, unfortunately we do not have a document to refer to. But, you can refer to the configuration of the examples provided by the cube firmware found under the "..\STM32Cube_FW_H7_V.XX.X\Projects\STM32H743I-EVAL\Examples\FMC"

Chahinez.

mwb
Associate III

Hi Chahinez,

thank you for your answer. We have an (almost) working example on the STM32H745-DISCO.

We have a bootloader (BL) programmed in internal flash and an application ("Blinky") programmed into the external QSPI. We've started with fresh STM32CubeIDE projects for BL and Blinky.

Is there a guideline to how to (re-)configure the controller in the SystemInit code of the application?

As it seems the generated code contains several accesses to RCC->CR. This also seems to re-configure PLLs which will also affect the QSPI interface and then the application won't run anymore.

Furthermore, the debugging session won't be able to communicate with our target anymore ("Target is not responding, retrying...").

What is the best practice regarding SystemInit code of the application? Skip it? Manually modify the generated code? Configure the CubeMX (.ioc) file and regenerate code?

Best regards,

Matthias

Hi Chahinez,

please find my answer in the post below.

I was not aware that answers are structured in a tree topology.

Kind regards,

Matthias