Announcements
Community Announcement : Welcome to the NEW Cypress Developer Community.
cancel
Showing results for 
Search instead for 
Did you mean: 

PSoC 4

ViFo_3580266
New Contributor II

Hello,

I'm trying to use the emulated eeprom in a project, and I noticed that when I try to write something on the EM_EEPROM it would change the values of my global variables and break my code.

When I was debugging i noticed on the function Cy_Em_EEPROM_Write, the variables address are overlapping the other variable addresses:

pastedImage_0.png

pastedImage_1.png

wearLevelingFactor 0x00000001 0x2000024C (All) unsigned long

emEepromRowAddr 0x00000001 0x2000024C (All) unsigned long

On the pictures you can see that emEepromRowAddr is getting the same address than context->wearLevelingFactor

Does anyone know what could be the issue that is causing this?

Thank you!

0 Likes
1 Solution
ViFo_3580266
New Contributor II

Sorry guys, I found the problem, it was a buffer defined inside my main it was a int with 800 positions, 3.2 kbytes, I only have 4kb. It was overflowing my ram, since it was inside my main, it wasn't giving me any error or warning.

Thank you, for all the help!

View solution in original post

0 Likes
4 Replies
LinglingG_46
Moderator
Moderator

From you screenshot, I find the userFlashStartAddr is not the "0x14000000" default.

Maybe you change the project cy8c6XX7_cm4.ld or cy8c6XX7_cm0plus.ld file.

It is recommend that you could open the creator P6 Em_EEPROM code example, programing, then open the *ld file to check the memory allocation.

0 Likes
ViFo_3580266
New Contributor II

I only have cm0plusgcc.ld and I cant find userFlashStartAddr in it.

I'm using psoc creator 4.2 and Em_EEPROM_v2.20.

Thank you!

0 Likes
NoriakiT_91
Employee

Please confirm what is provided as the 4th argument "context" when calling the Cy_Em_EEPROM_Write() function.

I suppose that the size of the structure given to the 4th argument is too short.

Regards,

Noriaki

0 Likes
ViFo_3580266
New Contributor II

Sorry guys, I found the problem, it was a buffer defined inside my main it was a int with 800 positions, 3.2 kbytes, I only have 4kb. It was overflowing my ram, since it was inside my main, it wasn't giving me any error or warning.

Thank you, for all the help!

View solution in original post

0 Likes