2016-05-25 09:09 PM
Hello,I'm just starting with cortex-m3 and with gnu arm toolchain
Myquestion may be stupid.
What I wanted to ask:
1.I know that during the development it is posible to keep everythingcode and data in SRAM and not to program FLASH.Because the internal SRAM in the Cortex-m3 is 64KB max it may not bebig enough.Is it posible to program External SRAM ?
2. Is it posible to program internal Flash ? Andhow to do that if yes? What is the sequence of commands in GDB?
3.Is it posible to program external FLASH ?Many thanks
2016-05-26 04:03 AM
Hi nguyen.binh,
Yes you can execute code from external memory. You can do that by programming Flash memory interface (FMC). . Check FSMC examples in at this path: STM32Cube_FW_F4_V1.12.0\Projects\STM324xG_EVAL\Examples\FSMC In device that embed QSPI, you can do that using QSPI. I recommend you to check the ''QSPI_ExecuteInPlace'' example at packagre at this path: STM32Cube_FW_F4_V1.12.0\Projects\STM32469I_EVAL\Examples\QSPI\QSPI_ExecuteInPlace -Hannibal-2016-05-26 08:13 AM
Saving Flash for debugging purposses make no sense. Even often and hard debiging will never broke flash. 10000. (this value is only guaranted can bo more).
1. Yes it is posible, but any power off will caouse losing. Vector table must be relocated etc. 2. Aby debugger must and can program internal flash. IDE usualy can do this autimatically. (gbd instruction load) - but IDE usualu can do this automaticcaly. 3. Programing external flash by GDB (in true OpenOCD) is posible, but hard for begginers. For this use STLink Utility.2016-05-26 08:15 AM
The Cortex-M3 is not limited to 64KB of Internal SRAM, the part you have chosen might, if you need more consider picking a part that delivers more.
You can run/debug code in External RAM, it will execute significantly slower, and depends if the region is decoded to allow execution. What the debugger will need to do is run a script to enable the external memory, ie the pins, the controller, and the memory itself, so that code can be downloaded there.Most debug tools have loaders that can write to Internal Flash, review the documentation, or pick one that does it for you. Look at tools like the ST LINK Utilities.You can read/write to any memory you attach to the system. External memory requires you define the board's/part's specific connectivity to the system, this tend to be unique rather than identical in the Internal Flash case. You must either script the debugger to access the external device, or provide a flash loader for tools like ST-LINK Utilities to program your chosen memory.You can write you own code to write to the external memory, and deliver data via the USART, etc.