Emulated EEPROM Not Working on ModusToolbox

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

cross mob
lock attach
Attachments are accessible only for community members.
JoGr_3160431
Level 1
Level 1
5 replies posted 5 questions asked First question asked

Hello, I am attempting to recreate a PSoC Creator project as a ModusToolbox project and I've hit a real snag with getting the Emulated EEPROM working.

As far as I can tell, when the EEPROM middlewear is selected in the Middlewear Selector, the cy_em_eeprom.c/h files are included in the project. This can just be replicated by including them yourself. What's missing in MTB that Creator does is that, as far as I can tell, the EEPROM structures like the config structure are no longer created for the project.

For example, in PSoC Creator, when you add the Em_EEPROM block into the schematic (with, say, the name EEPROM), files called EEPROM.c/h are made that add the EEPROM_config and EEPROM_context structures and defines necessary for easy use. I tried to find any place where these sorts of things might be added to the Modus project after selecting the EEPROM middlewear and I couldn't find any reference. You'd expect them in either cycfg_peripherals.h, which is where these sorts of things get added from Device Configurator IP modules, or as a .c or .h file under /likepsoc6sw-1.1/components/psoc6pdl/utilities/, which is where the retarget_io file gets added when that is selected from the Middlewear Selector. I also tried to just scrape the entire project for references to the EEPROM in all .c and .h files and found nothing recognizable.

To add to all this, the PDL documentation for the EEPROM appears to be unchanged from the PSoC Creator implementation, so it makes references that don't seem to be helpful. For example, this sentence from the PDL Documentation:

> "If the Em_EEPROM component is used in the project, then the respective storage (Em_EEPROM_em_EepromStorage[]) is automatically declared by the component if the "Use Emulated EEPROM" option is set to "Yes"."

That option doesn't exist in ModusToolbox anywhere, and nothing by the name Em_EEPROM_em_EepromStorage is created as far as I can tell.

All of this is to say: Creator adds things that Modus doesn't and there is no clear pathway for how to create them yourself. I've attempted to recreate these defines and structures myself and they lead to EEPROM Bad Data errors, so I have no idea how to proceed.

In brief, my question is this: Has anybody gotten the Emulated EEPROM working in a ModusToolbox project for the PSoC 6? If so, what structures did you have to make yourself and what structures were provided by adding the EEPROM IP via the Middlewear Selector.

To this post I have attached the BlinkyLED project modified with UART printf output and my best attempt at implementing EEPROM access. I also pulled out the main.c by itself for ease of access.

0 Likes
1 Solution
lock attach
Attachments are accessible only for community members.
LinglingG_46
Moderator
Moderator
Moderator
500 solutions authored 1000 replies posted 10 questions asked

Hi,

I spent some time this after to create a test project about the EM_EEPROM, I use the uart to verify the project function.

pastedImage_0.png

Hope it is helpful for you.

View solution in original post

0 Likes
3 Replies
lock attach
Attachments are accessible only for community members.
LinglingG_46
Moderator
Moderator
Moderator
500 solutions authored 1000 replies posted 10 questions asked

Hi,

I spent some time this after to create a test project about the EM_EEPROM, I use the uart to verify the project function.

pastedImage_0.png

Hope it is helpful for you.

0 Likes

Thank you for your reply, this helped a ton! I was able to get my EEPROM working no problem with this.

One quick followup about this section:

     CY_SECTION(".cy_em_eeprom") CY_ALIGN(CY_FLASH_SIZEOF_ROW)

     const uint8_t Em_EEPROM_em_EepromStorage[Em_EEPROM_ACTUAL_SIZE] = {0u};

When I copy this section over from your project into mine, the IDE flags it with a syntax error and later flags Em_EEPROM_em_EepromStorage with a "could not resolve" error, which doesn't happen in the sample project you provided. I have every include from the sample in my project, and the project builds and works just fine, but is there a correct way to add this to get rid of this seemingly erroneous error?

Best,

Josh

0 Likes

Can you attached your error information, or attached a simple project here?

From your description, I can't acquire which error you get.

0 Likes