a problem with saving  data on the eeprom 4k

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

a problem with saving  data on the eeprom 4k

1,406 Views
alon
Contributor I

Hallow

I M having a problem with saving  data on the eeprom 4k

I m succeeding in the saving process but when I go beyond address 0X0800 the system crashes

I have discovered that my program is using address 0X0800 and on.

I thought it is my linker.prm.

 

----------

NAMES

END

 

SECTIONS

 

    RAM = READ_WRITE 0x1000 TO 0x3FFF;

    /* unbanked FLASH ROM */

    ROM_4000 = READ_ONLY  0x4000 TO 0x7FFF;

    ROM_C000 = READ_ONLY  0xC000 TO 0xFEFF;

    /* banked FLASH ROM */

    PAGE_20 = READ_ONLY  0x208000 TO 0x20BFFF;  

    PAGE_21 = READ_ONLY  0x218000 TO 0x21BFFF;  

    PAGE_22 = READ_ONLY  0x228000 TO 0x22BFFF;  

   .

   .

   .    

    PAGE_3C = READ_ONLY  0x3C8000 TO 0x3CBFFF;  

    PAGE_3D = READ_ONLY  0x3D8000 TO 0x3DBFFF;  

/*    PAGE_3E = READ_ONLY  0x3E8000 TO 0x3EBFFF; not used: equivalent to ROM_4000 */ 

/*    PAGE_3F = READ_ONLY  0x3F8000 TO 0x3FBFFF; not used: equivalent to ROM_C000 */ 

END

 

PLACEMENT

    _PRESTART, STARTUP,

    ROM_VAR, STRINGS,

    VIRTUAL_TABLE_SEGMENT,

    NON_BANKED, COPY            INTO  ROM_C000, ROM_4000;

    DEFAULT_ROM                     INTO  PAGE_20,PAGE_21,PAGE_22,PAGE_23,PAGE_24,PAGE_25,PAGE_26,PAGE_27,

                                                                PAGE_28,PAGE_29,PAGE_2A,PAGE_2B,PAGE_2C,PAGE_2D,PAGE_2E,PAGE_2F,

                                                                PAGE_30,PAGE_31,PAGE_32,PAGE_33,PAGE_34,PAGE_35,PAGE_36,PAGE_37,

                                                                PAGE_38,PAGE_39,PAGE_3A,PAGE_3B,PAGE_3C,PAGE_3D;

    DEFAULT_RAM                      INTO  RAM;

END

 

STACKSIZE 0x100

---------------------

 

But I have no Idea how to prevent my program from using this region.

 

I tried to define

 

EEPROM = NO_INIT 0x0400 TO 0x0FEF;

 

and  added the line

 

EEPROM_DATA                                                     INTO  EEPROM;

 

But it didn’t do any good.

 

 

 

 

Labels (1)
0 Kudos
Reply
2 Replies

413 Views
CrasyCat
Specialist III
Hello
 
According to my understanding, you want to avoid that the linker allocates anything between 0x800..0xFFF. Am I right?
 
If this is what you are looking for, make sure to remove the line
      EEPROM_DATA                                                     INTO  EEPROM;
from your .prm file.
 
In order to check whether the linker allocates anything in there, check the .map file generated by the linker.
This file describes the whole application memory map.
You should be able to see whether the linker allocates anything in there.
 
CrasyCat
0 Kudos
Reply

413 Views
alon
Contributor I

Hi again

The original file do not contain that line and still the program is using that area.

To be more clear I need an area in the memory to write data to and store it even if the power is off, and I m doing it successfully between 0X0400 0X0800

Beyond 0X0800 I M writing the data but the program runs over my data immediately after.

And that is what I want to prevent.

 

0 Kudos
Reply