I'm using the 21489 to run some complex algorithm, it should define many big arrays.when I was running the project,it will occured the error code like this:
error: attempt to write to ROM ... with PC at 0x1271f1
address supplied is invalid with PC at 0x12cd1c
apparently there is not enough sram to run the project. unfortunately, for cost saving, I cannot use SDRAM to store the big array.
I read some datasheet and communicated to other engineers about this problem, some one tells me to analyse the Memory usage .so I read the map.xml carefully, I found Bank3 was rarely used. so I want to define some array to Bank3. but it cannot works... next, I read the <C/C++ Compiler Manual for SHARC
Processors >, on the chapter "memory banks"
,I get some usfull skills like this:
int dm a = 2;
int pm b = 1;
but when I use such method to define variable, It's cannot work.
1. section("dxe_block2_pm_data") int buff1;
2. int bank("dxe_block1_dm_data_prio3") buff2 = 1;
3. #pragma bank(dxe_sdram_sw_code)
int buff3 = 1;
all in all, I have four questions:
1. I want to define variable on the specified sections, such as "mem_block3_dm32" or "mem_sdram_swco", what should I do?
(suppose I use 21489 + CCES2.1, and the IDE using the default setting)
2. how to allocate variable on the external memory?
3. Can I modified the LDF to resize the data memory space as I want? How to do it?
4. sometimes l find variable will modified by unkown reason, what should I do to protect these global variable? using "static"?
Looking for you help.
Thanks a lot