- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
For example
# pragma abs_address: 0x4000
static const uint32 MASTER = 0x22222222;
# pragma end_abs_address
I expect to read the memory with a PSoC programmer and see 22222222 in cell 4000, but the value puts into another cell.
Or so
uint8 ram_array[16]={0x11,0x11,0x11,0x11,0x11,0x11,0x11,0x11,0x11,0x11,0x11,0x11,0x11,0x11,0x11,0x11,};
static const uint8 CYCODE eepromArray[]= {0x88,0x88,0x88,0x88,0x88,0x88,0x88,0x88,0x88,0x88,0x88,0x88,0x88,0x88,0x88,0x88 };
int main()
{
CyGlobalIntEnable;
EEPROM_Init(0x4000);
CyDelay(20000);
EEPROM_Write(ram_array,eepromArray,16);
}
I expect to read 888888 ..., turn on the device for 20 seconds and then read 1111111 ...
But I read 888888 in both cases ...
I cannot confirm email and add messages due to a bug on your site, the email section is not active
Solved! Go to Solution.
- Labels:
-
PSoC Creator & Designer Software
- Tags:
- eeprom
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi,
> By the way, where can I find an explanation of this variable initialization format in ROM?
> "const uint8 store [Em_EEPROM_PHYSICAL_SIZE]__ALIGNED (CY_FLASH_SIZEOF_ROW"
Please refer to the component datasheet of Em_EEPROM,
which can be accessed by one of the following methods.
Note: The definitions are in "Quick Start" section
(1) Selecting "Datasheet" in the configuration dialog
(2) Selecting "Datasheet" in the symbol window of the Component Catalog
> I want to set the default value, for example
> const uint32 MASTER[1]__ALIGNED(1) = {0x12345678};
>
> And actually, I read the 0x616C6966
As write/read to/from Em_EEPROM is handled by the Em_EEPROM APIs,
I don't know if there is a method to statically define the initial contents of the Em_EEPROM.
I would check the content of Em_EEPROM at the beginning of the program (after Em_EEPROM_Init())
and if the content does not have expected values, use Em_EEPROM_Write() to initialize the content.
moto
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
alli,
you can try the MyEEPROM component to save/recall data from EEPROM (PSoC5).
myEEPROM: component to save/recall application settings
/odissey1
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I am using PSoC4
I cannot confirm email and add messages due to a bug on your site, the email section is not active
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
PSoC4 doesn't have EEPROM, emulated only. Please disregard.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Right, I have edited the post
I cannot confirm email and add messages due to a bug on your site, the email section is not active
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi,
Attached is my test sample for PSoC4. (CY8CKIT-044)
moto
P.S. (Editted/Added)
Since Em_EEPROM is "Emulating" EEPROM using Flash ROM, there need to be some data/work area to manage the endurance etc, so the data is not written from the beginning of the data area (store), but the data will be written after these "management data area". So the serial output of my sample looks like below.
The actual data is written from the 13 byte offset. (12 bytes are used for the emulation)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I replaced the array initialization with
uint8 zustand [Em_EEPROM_EEPROM_SIZE] = {0x11,0x11,0x11,0x11,0x11,0x11,0x11,0x11,0x11,0x11,0x11,0x11,0x11,0x11,0x11,0x11};
I turned on the device and then read the PSoC memory with the PSoC programmer ... I did not find bytes 11 11 11 11 11 ...
Am I doing something wrong?
I cannot confirm email and add messages due to a bug on your site, the email section is not active
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi,
> Am I doing something wrong?
As I wrote in my previous response, the Flash ROM area dedicated to the Em_EEPROM is under control of Em_EEPROM component. So the component will (in my guess) format/organize the area for its use.
Please try reading the Flash ROM area before and after Em_EEPROM_Init().
Anyway, IMHO, the storage area of Em_EEPROM is not intended to be written/read directly like an array,
but we need to use Em_EEPROM_Write() and Em_EEPROM_Read().
moto
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Thank you, now it works, it seems that Cypress changed the way of accessing memory in the PSoC Creator itself...
By the way, where can I find an explanation of this variable initialization format in ROM?
"const uint8 store [Em_EEPROM_PHYSICAL_SIZE]__ALIGNED (CY_FLASH_SIZEOF_ROW"
I want to set the default value, for example
const uint32 MASTER[1]__ALIGNED(1) = {0x12345678};
And actually, I read the 0x616C6966
I cannot confirm email and add messages due to a bug on your site, the email section is not active
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi,
> By the way, where can I find an explanation of this variable initialization format in ROM?
> "const uint8 store [Em_EEPROM_PHYSICAL_SIZE]__ALIGNED (CY_FLASH_SIZEOF_ROW"
Please refer to the component datasheet of Em_EEPROM,
which can be accessed by one of the following methods.
Note: The definitions are in "Quick Start" section
(1) Selecting "Datasheet" in the configuration dialog
(2) Selecting "Datasheet" in the symbol window of the Component Catalog
> I want to set the default value, for example
> const uint32 MASTER[1]__ALIGNED(1) = {0x12345678};
>
> And actually, I read the 0x616C6966
As write/read to/from Em_EEPROM is handled by the Em_EEPROM APIs,
I don't know if there is a method to statically define the initial contents of the Em_EEPROM.
I would check the content of Em_EEPROM at the beginning of the program (after Em_EEPROM_Init())
and if the content does not have expected values, use Em_EEPROM_Write() to initialize the content.
moto