cancel
Showing results for 
Search instead for 
Did you mean: 

PSoC 4

N_SE_329246
New Contributor II

Hello,

i had used cy4245 and Em_eeprom component in 4.1. it was working well. after updating to 4.2 Em_EEprom component updated to 2.0.

i updated the functions according to 4.2 api

in 4.1

Em_EEPROM_Write(bytearray,(eeptr+2),2u);

in 4.2

Em_EEPROM_Write((EEaddress+2),bytearray,(2u));

later on its not working.

while debugging i see that the library returns failure in many conditions..

for example in cy_em_eeprom.c line 186 & 430

  if((0u != size) && ((addr + size) <= (context->eepromSize)) && (NULL != eepromData))

          1.How does address+ size will be less than eeprom size, in my case eeprom size is 64, & addr is 0x00007C00 ,size is 1,

looks like EM_EEPROM 2.0 has lots of bugs..or may be i am doing some mistake. Can some one help me how to make it work and provide a sample code for EM_eeprom for psoc4. Thank u

with regards

Dr.N.Chandra sekhar,M.tech,phd

0 Likes
1 Solution
Anonymous
Not applicable

It looks like you are using the address of the variable, I think the library is referring to the address where you want to store/access the EEPROM value?

0x00007C00 in decimal is 7*256*16 + 12*256 which is much larger than 64....

My guess is that the EEPROM address needs to go from 0 to EEPROM.size for it to function properly, otherwise it won't work well

View solution in original post

0 Likes
3 Replies
Anonymous
Not applicable

It looks like you are using the address of the variable, I think the library is referring to the address where you want to store/access the EEPROM value?

0x00007C00 in decimal is 7*256*16 + 12*256 which is much larger than 64....

My guess is that the EEPROM address needs to go from 0 to EEPROM.size for it to function properly, otherwise it won't work well

View solution in original post

0 Likes
N_SE_329246
New Contributor II

Hi,

Thank you. address seems to be  virtual locations from eeprom starting location. for size of 64 (address 0 to 63)..or 1 to 64. but i thought addr as direct physical eeprom location. Thanks for your input. removing EEaddress solved my problem.

Anonymous
Not applicable

Hello,

You're welcome. I'm glad that fixed it

0 Likes