Hi,
I have one question about Cortexm3 from smartfusion device from actel. Could you pls help me?
from <keil uvision and actel smartfuison>, I know how to implement Flash target and RAM target.
Flash target mode: download and run from inner flash memory and RW data are placed in inner ram space. Ram target mode: run from inner ram space and RW data are placed in inner ram space.
However the two modes will result from below two potential problems:
(1) flash target modes will bring up speed limits. You know max speed is only 80Mhz when the program runs from inner flash memory.and speed will become to be up to 100Mhz when program runs from inner ram.
(2) ram target modes can't make programs work when the board are re-power-cycled.
I'd like to implement following function to overcome the above problems:
(1) all executed codes are downloaded to flash memory space firstly (2) then these codes are copied to inner ram space automatically (3) PC are pointed to new RAM address so as to program runs from inner ram.
I don't know how to implement it. Anybody can help me to get one example? or guidelines?
Thank you very much.
BR
Fisher
As I need everything run from inner ram, I set up scatter file as following. However it doesn't work.
LR_IROM1 0x00000000 0x00040000 { ; load region size_region RW_IRAM1 0x20000000 0x00010000 { ; execute region size_region *(InRoot$$Sections) .ANY (+RO) .ANY (+RW +ZI) } }
Here is error information, .\f\Blinky.axf: Error: L6202E: __main.o(!!!main) cannot be assigned to non-root region 'RW_IRAM1'
How can I remove it?
Please use the proper tags when posting source code !
LR_IROM1 0x00000 0x40000 { ; load region size_region ER_IROM1 +0 0x1000 { ; load address = execution address *.o (RESET, +First) *(InRoot$$Sections) .ANY (+RO) } IRAM 0x40000000 0xE000 { ; RW data RT_EVENT.o (+RO) } }
Assuming you want the code in "rt_event.c" to be loaded in RAM upon startup.
LR_IROM1 0x00000 0x40000 { ; load region size_region ER_IROM1 +0 0x40000 { ; load address = execution address *.o (RESET, +First) *(InRoot$Sections) .ANY (+RO) } IRAM 0x40000000 0xE000 { ; RW data RT_EVENT.o (+RO) } }
Assuming you have an LPC2478. The addresses for your device will differ!
However your scatter file makes codes run from 0x0 address, which belongs to flash address space in my devices. it actually violate my thoughts: everything run from inner ram address space.
Post your file here, USING THE PROPER TAGS
I should have said: the addresses of internal RAM will differ!
in my device: Inner Flash address space : 0x0 to 0x00040000 Inner ram address space : 0X20000000 to 0x20010000
Below is my scatter file. It doesn't work actually.
LR_IROM1 0x00000000 0x00040000 { ; load region size_region ER_IROM1 0x20000000 0x00008000 { ; load address = execution address *.o (RESET, +First) *(InRoot$$Sections) .ANY (+RO) } RW_IRAM1 0x20008000 0x00008000 { ; RW data .ANY (+RW +ZI) } }
Thanks.
This statement ".ANY (+RW +ZI)" should be replaced by something like this:
"<module name.o> (+RO)"
where module name is the name of the C file containing your code (see above example). You can use linker sections to place certain functions in RAM, not all the code in a module (see manual).
(1)I find when load region start address is different from execute region start address (here LMA start address is 0x0 and EMA start address is 0x20000000), below error information will occur:
\f\Blinky.axf: Error: L6202E: __main.o(!!!main) cannot be assigned to non-root region 'RW_IRAM1'
(2) according to your reply, only part of codes or certain functions can be copied to ram space automatically rather than all. right?
Right.
LR_IROM1 0x00000000 0x00040000 { ; load region size_region ER_IROM1 0x00000000 0x00040000 { ; load address = execution address *.o (RESET, +First) *(InRoot$$Sections) } RW_IRAM1 0x20000000 0x00010000 { ; RW data .ANY (+RO) .ANY (+RW +ZI) } }
above scatter file will not result in compile error. however, it will make program don't work.
I got it. thanks.