Hi Soror,
The spaces where Data and Code will be placed in the MCU are in the linker paramter file or PRM file.
In the prm file of your project, just change the addresses to the wished location.
Code:
SEGMENTS /* here all RAM/ROM areas of the device are listed. Used in PLACEMENT below. */ Z_RAM = READ_WRITE 0x0040 TO 0x00EF; RAM1 = READ_WRITE 0x0100 TO 0x043F; RAM2 = READ_WRITE 0x0580 TO 0x097F; ROM1 = READ_ONLY 0x0462 TO 0x04FF; ROM2 = READ_ONLY 0x0980 TO 0x1B7F; ROM3 = READ_ONLY 0x1E20 TO 0xFDFF;//OSVECTORS = READ_ONLY 0xFFCC TO 0xFFFF; /* OSEK interrupt vectors (use your vector.o) */ ENDPLACEMENT /* here all predefined and user segments are placed into the SEGMENTS defined above. *///.ostext, /* OSEK */ DEFAULT_ROM INTO /*ROM1, ROM2,*/ ROM3; /* in case you want to use ROM1/ROM2 here as well, add option -OnB=b to the compiler. */ DEFAULT_RAM INTO RAM1, RAM2; _DATA_ZEROPAGE, MY_ZEROPAGE INTO Z_RAM;//VECTORS_DATA INTO OSVECTORS; /* OSEK */END
Declare a Zone DATA you can map to another ROM area you don't protect.
To reset the FLBPR value to 0xFF, you need to do a MASS ERASE.
Cheers,
Alban.
Message Edited by Soror on 2006-08-10 03:08 AM
Message Edited by Soror on 2006-08-10 03:09 AM
Message Edited by Soror on 2006-08-10 03:10 AM
Message Edited by Soror on 2006-08-10 03:18 AM
Yo,
You've declared your area MyROM, OK.... But you need to tell the compiler which variable/constant you want to put there !
In the C code, I want for instance to declare a global variable, I would do like this:
Code: main.c
#pragma DATA_SEG MyROMtU08 ResetCounter;#pragma DATA_SEG DEFAULT
Only ResetCounter will go to MyROM and then I switch back to default Data space.
Alban.