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

PSoC™ 5, 3 & 1 Forum Discussions

MaKo_4670821
Level 1
Level 1

hi everyone, I have a problem, after another discussion here I tried EM_EEPROM. If I'm supposed to press A, he's supposed to give me the saved  temperature values in eeprom, but it doesn't and I don't know why. Can any of you find my problem?

sorry thats the real Discussion, cause i Forget the data.

Best

Marcel

0 Likes
1 Solution
MotooTanaka
Level 9
Level 9
First comment on KBA 1000 replies posted 750 replies posted

Hi,

I found a few problems with your program.

(1) In save_str_to_eeprom() was not checking the address range

(2) In my previous sample, I always added 0 (NULL) at the end of the string  and write data with length of str + 1

     But this time null may not have been added.

(3) In get_str_from_eeprom() the length of reading str was not checked,

     so it could be (and probably) over write out side of str[] buffer.

(4) I set STR_BUF_LEN as 64, for reading and writing by human, but with format may be 64 was not enough,

     so I changed STR_BUF_LEN to 128

Below is the TeraTerm log, and while I was typing this 5LP was reporting Extra Heating Turn off, which I don't know about 😉

000-TeraTerm-log.JPG

moto

View solution in original post

0 Likes
1 Reply
MotooTanaka
Level 9
Level 9
First comment on KBA 1000 replies posted 750 replies posted

Hi,

I found a few problems with your program.

(1) In save_str_to_eeprom() was not checking the address range

(2) In my previous sample, I always added 0 (NULL) at the end of the string  and write data with length of str + 1

     But this time null may not have been added.

(3) In get_str_from_eeprom() the length of reading str was not checked,

     so it could be (and probably) over write out side of str[] buffer.

(4) I set STR_BUF_LEN as 64, for reading and writing by human, but with format may be 64 was not enough,

     so I changed STR_BUF_LEN to 128

Below is the TeraTerm log, and while I was typing this 5LP was reporting Extra Heating Turn off, which I don't know about 😉

000-TeraTerm-log.JPG

moto

0 Likes