cancel
Showing results for 
Search instead for 
Did you mean: 

How do I boot from Flash in a Baremetal?

Stnoobs
Associate II

I am using the STM32MP131 in a baremetal environment. Since there is no internal flash, I am planning to use external flash and DDR.

I have confirmed that writing to and reading from the flash works, but I don't know how to start from FLASH instead of SYSRAM when powering on.

I saved the FW's bin data at address 0 of the Flash and tried changing the boot mode to QUADSPI Flash, but it did not work.

I think QUADSPI needs to be activated before reading and executing from Flash. Where should I activate this?

Do I also need to modify the linker script for the firmware that runs from Flash?

 

Please let me know if you have any solutions to this problem

Thank you very much in advance.

5 REPLIES 5
Erwan SZYMANSKI
ST Employee

Hello @Stnoobs ,
For external flash use with STM32CubeMP13, you can refer to the following articles :

Unfortunatly, currently QSPI Flash memory are not supported.

Kind regards,
Erwan.

In order to give better visibility on the answered topics, please click on 'Accept as Solution' on the reply which solved your issue or answered your question.

What does it mean that it does not support QSPI flash memory?

If so, what is the "Serial NOR Flash on QSPI" mentioned in the Boot Mode section of the STM32MP131 Datasheet?

 

Stnoobs_0-1724127096724.png

 

Hello @Stnoobs ,
Yes the MP13, from an HW point of view can support it, and in SW this is the case on Linux side. But for MP13 Bare metal, drivers are not present. 

Kind regards,
Erwan.

In order to give better visibility on the answered topics, please click on 'Accept as Solution' on the reply which solved your issue or answered your question.

 

 

 

Does this mean that if QSPI SNOR booting is hardware-compatible, a separate driver needs to be created to use it in a bare-metal environment?

Could you provide the information required to create the driver?

 

According to the readme.txt file, the source code of the bin file shown in the picture below is said to be requested to ST.

Can I get the code?

 

Stnoobs_0-1724150468533.png

 

Good morning,
 
I am experiencing the same issue as user Stnoobs. At the hardware level, and using the example program XSPI_NOR_Programmer modified for my memory device, I have been able to program my memory in engineering mode and verify its data. However, when I try to boot from it by changing the boot pins, I only see 256 clock pulses, regardless of whether it is the binary I generated with the appropriate headers or the precompiled binary you provide, FSBLA_SNOR_A7_Signed.bin, included in the STM32Cube_FW_MP13_V1.2.0 package. If I load the binary on the microSD and boot from it, I have no issues.
To clarify, for the QSPI memory and for the SD Card I am using the same pins indicated in application note AN5474.
Now my intention is to use the same memory device that ST indicates is used on their engineering board STM32MP13XX_CUSTOM_HW, which, if I am not mistaken, should be the Macronix MX25L51245GZ2I‑08G. The goal was to see whether any specific property of this memory could affect the BootROM (for example, the SFDP functionality).
Please let us know how we could proceed to boot in a way similar to ST Linux but running bare‑metal aplications instead.