3 Replies Latest reply on May 5, 2019 11:10 PM by LinglingG_46

    Emulated EEPROM Not Working on ModusToolbox


      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.