PSoC6 Emulated EEPROM

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

cross mob
YongseokJeon
Level 4
Level 4
Distributor - Changnam (South Korea)
50 replies posted 50 questions asked 25 replies posted

Hello,

I have questions about Flash and Emulated EEPROM.

1. The flash endurance is described in the datasheet as 100k cycles.
Does each row of flash individually have 100k cycle endurance?

2. I'm using the Emulate_EEPROM example in modus toolbox. (CY8CKIT-062-WIFI-BT)
Please let me know how it works internally when using Em_EEPROM.

I want to know about the case of repeatedly writing a few bytes of data to the same address.
For example, when only a few bytes are to be written, will the entire line (512 bytes) including this address be erased and re-written?
Does the Em_EEPROM algorithm read the entire existing row of data into RAM before it is deleted, then modify only a few bytes and write it to flash?

Thanks and Regards,
YS

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

Hi @YongseokJeon ,

1)Yes,  each row of flash individually have 100k cycle endurance only if you are individually writing to the rows.

2)The implementation of the Em_EEPROM is, On startup, the example initializes the SCB and the Em_EEPROM block in flash. Then, a read operation is performed to verify whether the data stored in EEPROM is valid. If valid, the counter is incremented by one and the new value of the counter is written back to the Em_EEPROM. Otherwise, the expected valid data is written to the Em_EEPROM. The firmware then reads the value in the Em_EEPROM and prints it to a terminal window via UART. Every time the device is reset or power is cycled, the counter is incremented and printed on serial terminal.

The firmware includes the declaration of the EEPROM storage and details of the EEPROM configuration and context structures. In this example, EEPROM storage can be declared in either the application flash (user flash) or in the section of the flash dedicated for Em_EEPROM. If the data is written to the user flash, a blocking write must be used. This is because a write to and read/execute from the same flash sector at the same time while using non-blocking writes may cause a HardFault exception. Either blocking or non-blocking write will work for the Em_EEPROM flash, because it is in a different flash sector. 

3)The entire row of flash is read by the Em_EEPROM

Regards,

Alakananda

View solution in original post

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

Hi @YongseokJeon ,

1)Yes,  each row of flash individually have 100k cycle endurance only if you are individually writing to the rows.

2)The implementation of the Em_EEPROM is, On startup, the example initializes the SCB and the Em_EEPROM block in flash. Then, a read operation is performed to verify whether the data stored in EEPROM is valid. If valid, the counter is incremented by one and the new value of the counter is written back to the Em_EEPROM. Otherwise, the expected valid data is written to the Em_EEPROM. The firmware then reads the value in the Em_EEPROM and prints it to a terminal window via UART. Every time the device is reset or power is cycled, the counter is incremented and printed on serial terminal.

The firmware includes the declaration of the EEPROM storage and details of the EEPROM configuration and context structures. In this example, EEPROM storage can be declared in either the application flash (user flash) or in the section of the flash dedicated for Em_EEPROM. If the data is written to the user flash, a blocking write must be used. This is because a write to and read/execute from the same flash sector at the same time while using non-blocking writes may cause a HardFault exception. Either blocking or non-blocking write will work for the Em_EEPROM flash, because it is in a different flash sector. 

3)The entire row of flash is read by the Em_EEPROM

Regards,

Alakananda
0 Likes
YongseokJeon
Level 4
Level 4
Distributor - Changnam (South Korea)
50 replies posted 50 questions asked 25 replies posted

Hi, Alakananda.

Thanks for your reply.

I tested the Emulate_EEPROM example.
I set the options as follows, and wrote 0xAAAAAAAA... to the Auxiliary flash area.

option.JPG

The following is the contents of the hex file that read the flash using Cypress Programmer.

test1.JPG

After that, I wrote "Power Cycle# 00" through the example, but the 0xAAAAAAAA... part remains.

test2.JPG

I thought that the 0xAAAAAAAA... part would be erased because the entire row was deleted and only "Power Cycle# 00" was written.
I don't quite understand.

Thanks and Regards,
YS

0 Likes
YongseokJeon
Level 4
Level 4
Distributor - Changnam (South Korea)
50 replies posted 50 questions asked 25 replies posted

Oh, I missed the 3) "The entire row of flash is read by the Em_EEPROM".

Thanks.

0 Likes