Emulated EEPROM on PSoC4

Tip / Sign in to post questions, reply, level up, and achieve exciting badges. Know more

cross mob
Miglio1982
Level 1
Level 1
5 replies posted 10 sign-ins 5 questions asked

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

0 Likes
1 Solution
Alakananda_BG
Moderator
Moderator
Moderator
50 likes received 250 sign-ins 250 replies posted

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

https://www.infineon.com/dgdl/Infineon-Component_Emulated_EEPROM_V2.0-Software%20Module%20Datasheets...

Regards,

Alakananda

View solution in original post

3 Replies
Alakananda_BG
Moderator
Moderator
Moderator
50 likes received 250 sign-ins 250 replies posted

Hi @Miglio1982 ,

Basically the user flash will start from the address as shown below in the address map 

Alakananda_BG_0-1646202931644.png

 

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

Alakananda_BG_1-1646203153593.png

I have attached the PSoC 4 programming specifications guide and Architecture TRM below for your reference

https://www.infineon.com/dgdl/Infineon-CY8C4xxx_CYBLxxxx_Programming_Specifications-Programming+Spec...

https://www.infineon.com/dgdl/Infineon-PSoC_4100_4200_Family_PSoC_4_Architecture_TRM-AdditionalTechn...

Regards,

Alakananda
0 Likes

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?

0 Likes
Alakananda_BG
Moderator
Moderator
Moderator
50 likes received 250 sign-ins 250 replies posted

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

https://www.infineon.com/dgdl/Infineon-Component_Emulated_EEPROM_V2.0-Software%20Module%20Datasheets...

Regards,

Alakananda