Hi I have the evaluation board MCBSTM32F200 and I would know how to flash the Blinky's project into the external Flash NOR and run from this.
As I know, in Options Target of uVision IDE you can define the address base and size of external ROM and then allocate objects on this code region. Is this enough or do you need something else for flashing the external flash ?
Thank you for your attention
Best regards
You'd need to select a programming algorithm in the debugger settings to support the memory. To run from the debugger you'd likely need a debugger script to enable/configure the external memory.
Your code would need to enable and configure the external memory via code added to the SystemInit() routines, so that it is usable. ie clocks, pins and peripherals, etc
The part can't immediately run from external memory, you'd need to code a minimal loader that resides in internal flash to enable the external memory and transfer control. Look at ST's IAP examples
Hi Clive One,
thank you for reply, I have some questions about your comments:
I found the Programming Algorithm for the external NOR flash M29W640FB in the Flash Download dialog. If I understand, this Programming Algorithm is loaded in RAM when you want Download your project. And if you want debug, you also need the init file to configure where to jump. I was testing a init file where SP points to the initial top stack and PC points to ResetHandler but I can't debug, I think something is wrong or missed. Is there some example for external NOR flash?
FUNC void Setup (void) { SP = _RDWORD(0x60000000); // Setup Stack Pointer PC = _RDWORD(0x60000004); // Setup Program Counter _WDWORD(0xE000ED08, 0x60000000); // Setup Vector Table Offset Register } load %L incremental Setup(); // Setup for Running g, main
If only I want debug the Blinky project, is enough configure the programming algorithm and init file without add the code which configure the external NOR flash in the project and the IAP firmware?
The part can't immediately run from external memory, you'd need to code a minimal loader that resides in internal flash to enable the external memory and transfer control. Look at ST's IAP examples Great example for understand it. In this case, my IAP must program/erase the external memory instead the internal memory and then jump to a external address. If this IAP configure the external memory, is necessary configure again the external memory after jump to the main of the external memory?
Your debugger .INI would need to configure the pins, clock, and FSMC for the memory to be viable. The Flash Algorithm is a RAM base applet to get the code into the memory, you would need a custom one for your specific part (STM32 + EXT FLASH) as the chip configuration would be board unique. The external memory at 0x60000000 doesn't magically appear in the address space, at least not on this part, whereas older ARM7 and ARM9 parts without internal FLASH typically had a physical/hardwired bus that always functioned without configuration.
The IAP would need to configure the hardware once, it would remain in effect until the part is reset or reconfigured.