2012-07-20 10:58 PM
Hi,i start a new one with STM32 Discovery.I need to know ''external flash is used for programing purpose?''
I try like:1.STM32 Discovery connect with external flash memory like S25FL128P by SPI.2.My application program is programmed to external flash memory and run on.Is it possible?Any suggestion or any comments useful for me. #stm32discov-with-external-flash #bootloader #iap2012-07-21 02:54 AM
''STM32 Discovery''
You realise that there are (at least) four different ''STM32 Discovery'' boards - yes?''external flash is used for programing purpose?'' Yes - it could be. What you need is a Bootloader to get the data from the external source, put it into the STM32 memory, and run it. ST has several application notes on this; they describe it as IAP forI
n-A
pplicationP
rogramming2012-07-21 04:03 AM
You're not going to be able to execute directly from SPI FLASH, you could copy to RAM and run code from there.
Ideally to run code directly you'd want to look at 16-bit wide NOR FLASH, but I'd imagine it would be quite slow. For large applications people sometimes use 16-bit wide SRAM, and 8/16 bit NAND FLASH, or SD Card, to store the application code, copying/decompressing to external SRAM, and perhaps time critical portions to internal SRAM. Boards running ucLinux tend to use this type of model. Now, generally there are better CPU/Memory choices to be had here, unless the STM32 is critical to the design.2012-07-23 12:05 AM
S25FL128P by SPI
)for programming purpose.You are telling that copy to ram and run it.i do not know how to do it.give any suggestion and any basic code like my concept?2012-07-23 08:00 AM
For the flash you could review STM32F4xx_DSP_StdPeriph_Lib_V1.0.1\Project\STM32F4xx_StdPeriph_Examples\SPI\SPI_FLASH
Executing arbitrary code in RAM is a matter of setting the PC appropriately, either in C or Assembler. The IAP example might provide some specific example of how to use the CPU, as would some of the manuals and books related to the M3/M4 cores.typedef void (*pFunction)(void);
{
pFunction Jump_To_ExtRAM;
Jump_To_ExtRAM = (pFunction) 0x60000001; // ODD Address for Thumb2 @ 0x60000000
Jump_To_ExtRAM();
}
ldr r0,=0x60000001
blx r0
OR
ldr r0,=0x60000000
;..
orr r0,r0,#1 ; Thumb
blx r0