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

cross mob
alli_264371
Level 4
Level 4
25 replies posted 10 replies posted 10 questions asked

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
0 Likes
1 Solution
MotooTanaka
Level 9
Level 9
Distributor - Marubun (Japan)
First comment on blog Beta tester First comment on KBA

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

012-from_the_datasheet.JPG

(1) Selecting "Datasheet" in the configuration dialog

010-Config_Em_EEPROM.JPG

(2) Selecting "Datasheet" in the symbol window of the Component Catalog

011-WorkBench-Component_Catalog.JPG

 

> 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

 

View solution in original post

10 Replies