- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi All
I am currently working on Emulated EEPROM based project in which I am having a variable with data type "static const uint8 CYCODE" and I initialize it with value 0u. On certain event in my main code, I change the value of this variable and I want to retain this same value on power reset. But it is not happening at the moment. When I restart the device with power reset, I again end getting the value 0u. Is it mandatory to initialize this variable with some value? I think yes, because that only gives me output atleast once till power is ON though it is also a fact that after power reset I loose that value.
In short I need to have a variable in Emulated EEPROM that is independant of power cycles. Please provide a solution to this ASAP.
Regards
Shaunak
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi Shaunak,
there is an example project for emeeprom (right click on component) which does work.
The initialization of your array or struct or whatever you'd define for eeprom data is required else the variable would be put into sram.
What is the returncode you get back from the Em_EEPROM_Write() ?
Bob
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
To put it another way? Do you actually use Eeprom_Write() at all? Or do you expect that defining the variable as CYCODE will make it automatically non-volatile?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Another project that may be useful -
Regards, Dana.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
@hli : I am using Em_EEPROM_Write() function
@Bob : As per your guidance, I have created a project, that works. Please find the attached one. In this project, I have used a single variable in order to test it. This code works well. Now I want to store a two-dimensional array in Emulated EEPROM, update it on certain events in main code and sustain the updated value even on power reset. I require help in doing that.
Thanks in Advance.
Shaunak
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
As long as the array is statically initialized (with a fixed size) you can handle it just a a large memory block. See http://beginnersbook.com/2014/01/2d-arrays-in-c-example/ . So you write as any other data structure, just the size is larger.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Shaunak,
Finally, an emulated EEPROM piece of code that works! Using the emulated EEPROM in PSoC4 had me scratching my head, despite the Cypress example project. Your code is straightforward. Thanks. My code will be completed in time for the trade show.
Jon
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
You are welcome, Jon !!!
Regards
Shaunak
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi Everyone. I am replying here after almost five years as I have an issue with Emulated EEPROM Component Versioned 2.20.
I have gone through the datasheet of Emulated EEPROM Component Version 2.20 and I have followed all the steps listed to set up fixed location based EEPROM in my PSoC4. While editing the linker script file "cm0gcc.ld" copy (custom_cm0gcc.ld), the key point is finding the line
.cy_checksum_exclude : { KEEP(*(.cy_checksum_exclude)) } >rom
in the code and adding the code segment
EM_EEPROM_START_ADDRESS = <EEPROM Address>;
.my_emulated_eeprom EM_EEPROM_START_ADDRESS :
{
KEEP(*(.my_emulated_eeprom))
} >rom
below it. I can not find the line in the linker file anywhere. What can be the reason behind this? Attached herewith is my project and linker file.
Regards
Shaunak Vyas