- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi,
i'm using a PSoC4 [4100S Plus] and i'm trying to add to my project an "Emulated EEPROM" component.
As described in the "Em_EEPROM" component datasheet i've compiled the project to generate a linker script file [cm0plusgcc.ld], i've renamed it [custom_cm0plusgcc.ld] and i've modified it in the following way to allocate 1024 bytes of "emulated EEPROM" at the top of the flash [CY_METADATA_SIZE and CY_MY_EEPROM_SIZE are defined at the top of the linker script and their values are respectively 64 bytes and 1024 bytes].
.my_emulated_eeprom (LENGTH (rom) - CY_METADATA_SIZE - CY_MY_EEPROM_SIZE) : ALIGN(8)
{
KEEP(*(.my_emulated_eeprom))
} >rom
Now if i add in my project an array of 1024 bytes allocated in the "my_emulated_eeprom" section the build failes and gives me the following error : "region "rom" overflowed by 88 bytes".
Of course if i modify the linker script in the following way everithing works correctly.
.my_emulated_eeprom (LENGTH (rom) - CY_METADATA_SIZE - CY_MY_EEPROM_SIZE - 88) : ALIGN(8)
So this is my question : what's allocated at the top of the flash?
Looking at the linker script i thought that at the top of the flash there was just the metadata section [with the size pre-defined at the top of the linker script (=64 bytes)]
Thank you so much in advance
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi @Miglio1982 ,
As mentioned in the datasheet "EEPROM address is an absolute address in flash where the
EEPROM should start. You must define the address value. The address
should be aligned to the size of the device’s flash row and should not
overlap with the memory space used by the application"
You can refer to the device datasheet for more information
Regards,
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi @Miglio1982 ,
Basically the user flash will start from the address as shown below in the address map
The user flash will contain the application program as shown in the above address map.
Can you also let jus know why you are subtracting the size of the application i.e.
.my_emulated_eeprom (LENGTH (rom) - CY_METADATA_SIZE - CY_MY_EEPROM_SIZE) : ALIGN(8)
How are yoy trying to allocate your EEPROM size?
And also the metadata data and the checksum section will come after the user flash as shown below
I have attached the PSoC 4 programming specifications guide and Architecture TRM below for your reference
Regards,
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi,
first of all thank you so much for your answer.
I'm sorry but i've made a mistake in writing the post here. I've tried to allocate "My Emulated EEPROM" modifying th linker script in the following way :
EmEEPROM_StartAddress = ( LENGTH(rom) - CY_FLASH_ROW_SIZE - EM_EEPROM_SIZE )
What i've not exactly understood is why i cannot allocate my EEPROM sector at the bottom of the flash but i have to leave at least "CY_FLASH_ROW_SIZE" bytes free [otherwise the build fails].
What is allocated in the last CY_FLASH_ROW_SIZE bytes?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi @Miglio1982 ,
As mentioned in the datasheet "EEPROM address is an absolute address in flash where the
EEPROM should start. You must define the address value. The address
should be aligned to the size of the device’s flash row and should not
overlap with the memory space used by the application"
You can refer to the device datasheet for more information
Regards,