cancel
Showing results for 
Search instead for 
Did you mean: 

Burn code to external NOR flash and boot from there .

zeros_and_ones1991
Associate III
Posted on August 12, 2014 at 15:58

Hello guys , Im working with STM32F207ZG , my code is now exceeding the 1MB flash memory , i know that the processor can boot from the external flash , but my question is how to burn the code into the external flash using the J-Link programmer (Or i need to find another method) , and also how exactly would I boot from there , and will the FSMC be involved ? ...... thx in advance .

3 REPLIES 3
Posted on August 12, 2014 at 17:02

Segger has J-Flash, Keil can also do it, both need configuration/applets which will configure the external bus and pins, and perform the write algorithm as described in the NOR documentation. Both have examples of this.

The STM32 will not be able to boot directly, you'd need some loader code at the front of the internal Flash which will again configure the clocks, pin, bus, etc and then jump to the code in the external device.

With suitable use of scatter files, or linker scripts, you can partition your code between internal and external memories. You're going to want to put as much fast/critical stuff in internal memory as possible, as external memory is SLOW and UNCACHED (ART).
Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..
zeros_and_ones1991
Associate III
Posted on August 12, 2014 at 19:37

thx for ur reply clive  , I see your point about the necessity of Booting from the internal flash , then I should configure the FSMC , n move the PC to the first address of the external NOR flash . Do you have any example for the code download part ? ...... or how I should move the PC to the external flash .

Thx in advance.
Posted on August 12, 2014 at 20:49

I guess you need to start by understanding the NOR part you have chosen, and how to write to it. Create yourself a boot loader that can read/write the memory, and provide a means to download code. The transfer of control can be done in a manner identical to all the IAP examples.

Keil has it's applets in a directory, like C:\Keil\ARM\Flash\STM32F4xx\FlashDev.c you can expand the support beyond internal flash, to external serial or parallel memory devices. J-Flash also has documentation.

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