Announcements

Equip yourself to optimize PSoc4 MCUs for Evs at the EV Webinar. Click here to register.

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

PSoC™ 4 Forum Discussions

bugkiller
Level 2
Level 2
50 sign-ins First like received 10 questions asked

Hi, thanks for reading this discussion. My plan is quite simple : Write EEPROM data and Read from it.

I want to finish this project by NOT using UART communication.  So I declare variable, initialize it using read data and start debugging mod. Finially, I add watch function to val variable so that I can see how val variable change.

Like this below: 

uint8_t val;

int main(){

....

Em_EEPROM_1_Write(cnt,0x33,4);

for(;;){

     val = Em_EEPROM_1_Read(cnt,&array[4],4);   <<<----- add watch 
     sprintf(buf,"eeprom is %d \n\r", array[4]);

}

}

bugkiller_0-1670917446236.png

 

I expected the result that val is gonna be 0x33 data, but only I have is 0x00. 

 

bugkiller_1-1670917647397.png

Is there any wrong with my process?? Or PSoC does not have this function

Best regards.

0 Likes
1 Solution
Gautami_12
Moderator
Moderator
Moderator
50 solutions authored 25 likes received First comment on blog

Hi @bugkiller ,

Currently, we also don't have any other option instead of using add watch option in debug mode.

Warm Regards,
Gautami J

View solution in original post

0 Likes
3 Replies
Gautami_12
Moderator
Moderator
Moderator
50 solutions authored 25 likes received First comment on blog

Hi @bugkiller ,

 

The Emulated EEPROM can work from both CM0+ and CM4 cores. Please find the attached code example in which CM0+ is used for writing and reading from the emulated EEPROM. Please check if this example is working on your side.

From your explanation, I understood that you are trying to emulate flash as EEPROM. There is a dedicated region for emulated EEPROM in the PSoC device. You can use this region for storing your data. If the size of this region is not sufficient for your requirement, you can use the flash memory as emulated EEPROM memory also.

To use a dedicated emulated EEPROM region, you can select the option for use Emulated EEPROM as yes as shown in the image below. Please let us know if you can use this dedicated memory.

Gautami_12_0-1670925098710.png

I also saw a "sprintf(buf,"eeprom is %d \n\r", array[4]);" in your code .Is this printing correct value?
Please refer to the attached project and try make changes in your project accordingly.

Warm Regards,
Gautami J

0 Likes

Hi, @Gautami_12 thanks for the answer. But this is not what I'm looking for. example that you are gave to me is for PSoC6 MCU, and  sorry I don't metion in the topic, but I'm using CY8CKIT-042-BLE-A development tool. I just want to know is there any way that can read stored EEPROM  data without UART serial comm(like debugg console).

0 Likes
Gautami_12
Moderator
Moderator
Moderator
50 solutions authored 25 likes received First comment on blog

Hi @bugkiller ,

Currently, we also don't have any other option instead of using add watch option in debug mode.

Warm Regards,
Gautami J

0 Likes