cancel
Showing results for 
Search instead for 
Did you mean: 

How to execute code from external flash on STM32F407

Daniel Collado
Associate II
Posted on June 15, 2018 at 12:15

Hi, I have read the AN4852 application note explaining how to program an external QSPI flash using the built-in UART bootloader. However it does not tell how to execute afterwards the code saved in the external flash on the microcontroller. Does the microcontroller somehow have to read the code and copy it into internal flash or how could it be done?

#external-flash #code #stm32f407 #execute

Note: this post was migrated and contained many threaded conversations, some content may be missing.
13 REPLIES 13
Posted on June 25, 2018 at 16:05

By 'auto-booting' I mean the STM32 jumps into ROM and takes the code from an external FLASH. The thing is that its bootloader just waits for commands received from UART and another device has to send the data to the STM32.

What do you mean by a 'loader in FLASH'?

Posted on June 25, 2018 at 16:27

>>What do you mean by a 'loader in FLASH'?

A loader taking 16KB of the F407 FLASH which manages the application and external FLASH, and provides a means of downloading and recovery

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..
Posted on June 25, 2018 at 16:53

Ok, but what I'd like to do is jump into bootloader and download the code to flash from there, so I need to get somehow the code from the bootloader and not depend from an application in flash.

Posted on June 25, 2018 at 17:24

You can jump into the ROM loader, or use the BOOT pins and reset into it.

To get the ROM based loader to support random external devices on random pins, you're going to need to use the ROM loader to download a custom loader into RAM that supports your specific hardware configuration.

Pretty sure the F407 doesn't provide specific QSPI support, this was added to subsequent F4 parts (F446) and newer STM32 families (ie L4 or F7)

Expect code to run much slower from external memory.

At the end of the day you're going to have to run code in a way constrained/allowed for in the design of the micro-controller.

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