Set any initial value to Emulated EEPROM using compiler and linker

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

cross mob
YoIs_1298666
Level 5
Level 5
250 sign-ins 100 replies posted 100 sign-ins

Hello,

I have a question regarding CE195313.

Unless the Em_EEPROM_1_em_EepromStorage array in the FLASH area used by the Emulated EEPROM is set to 00 by the compiler and linker, CY_EM_EEPROM_BAD_CHECKSUM will be returned in the following line.

pastedImage_0.png

Can’t we set any initial value to Emulated EEPROM using compiler and linker?

Certainly, due to the structure of the Emulated EEPROM, it seems difficult to set arbitrary values in advance.

We have to do something like the sample code to give the initial value, right?

pastedImage_0.png

Best regards,

Yocchi

メッセージ編集者: Yoshiharu Ishii

0 Likes
1 Solution
AikoO_51
Moderator
Moderator
Moderator
100 sign-ins First question asked 50 solutions authored

>Can’t we set any initial value to Emulated EEPROM using compiler and linker?

- Answer is “Yes”.

The initial value would be meant just a data to write on the top of the area for EEPROM.

Em_EEPROM_1_Write() is just a process to write data to Em_EEPROM_1, and eepromReturnValue is just a value to make sure whether writing to EEPROM is succeeded or not.

Em_EEPROM_1_Read() is also same, so there is nothing data to read if you didn’t put any data above.

So you can put some data you want into “array” in Em_EEPROM_1_Write(), and then it would be succeeded.

Aiko Ohtaka
Infineon Technologies

View solution in original post

0 Likes
2 Replies
AikoO_51
Moderator
Moderator
Moderator
100 sign-ins First question asked 50 solutions authored

>Can’t we set any initial value to Emulated EEPROM using compiler and linker?

- Answer is “Yes”.

The initial value would be meant just a data to write on the top of the area for EEPROM.

Em_EEPROM_1_Write() is just a process to write data to Em_EEPROM_1, and eepromReturnValue is just a value to make sure whether writing to EEPROM is succeeded or not.

Em_EEPROM_1_Read() is also same, so there is nothing data to read if you didn’t put any data above.

So you can put some data you want into “array” in Em_EEPROM_1_Write(), and then it would be succeeded.

Aiko Ohtaka
Infineon Technologies
0 Likes

Hello,

Ok. Thank you very much.

Best regards,

Yocchi

0 Likes