CCS C Software and Maintenance Offers
FAQFAQ   FAQForum Help   FAQOfficial CCS Support   SearchSearch  RegisterRegister 

ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

CCS does not monitor this forum on a regular basis.

Please do not post bug reports on this forum. Send them to support@ccsinfo.com

Programming verification error

 
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion
View previous topic :: View next topic  
Author Message
gjs_rsdi



Joined: 06 Feb 2006
Posts: 468
Location: Bali

View user's profile Send private message Send e-mail

Programming verification error
PostPosted: Mon Jan 20, 2020 7:36 pm     Reply with quote

Hi
I am using ICDU64 to program the PIC.
The microcontroller is PIC18F26K22.
CCS PCH C Compiler, Version 5.062.

In the past I was saving some data in the internal EEPROM while programming the chip as bellow:

Code:
#rom getenv("EEPROM_ADDRESS")={0}
#rom 0xF000F0 = { 0x02 }
#rom 0xF000F1 = { 0x02 }
#rom 0xF000F2 = { 0x02 }
#rom 0xF000F3 = { 0x02 }
#rom 0xF000F4 = { 0x02 }
#rom 0xF000F5 = { 0x02 }
#rom 0xF000F6 = { 0x02 }
#rom 0xF000F7 = { 0x02 }

I presume that I am saving the data in the locations F0 and up.

I changed the software to:
Code:
#rom getenv("EEPROM_ADDRESS")={0}
#rom 0xF00000 = { 0x02 }
#rom 0xF00001 = { 0x02 }
#rom 0xF00002 = { 0x02 }
#rom 0xF00003 = { 0x02 }
#rom 0xF00004 = { 0x02 }
#rom 0xF00005 = { 0x02 }
#rom 0xF00006 = { 0x02 }
#rom 0xF00007 = { 0x02 }
#rom 0xF00008 = { 0x02 }
#rom 0xF00009 = { 0x02 }

I was thinking that now I will save the data from 00.
When trying to program the chip I am getting:
"Programming error of the data storage:
Address 0000; Actual 02; Expected 00;

Please be kind and explain me what I am doing wrong

Best wishes
Joe
Ttelmah



Joined: 11 Mar 2010
Posts: 19215

View user's profile Send private message

PostPosted: Mon Jan 20, 2020 11:05 pm     Reply with quote

Problem is you are trying to write both 0, and 2 to the same address....

Your original format was a little dangerous. Better to load
the EEPROM_ADDRESS, and do all the writes _relative_ to this. So:

Code:

#rom getenv("EEPROM_ADDRESS")={0}
#rom int8 getenv("EEPROM_ADDRESS")+0xF0 = { 0x02, 0x02, 0x02, 0x02,  0x02, 0x02, 0x02, 0x02 }


Now you can use the same approach for your new version, just remember
the first line is writing 0 to the first byte of the EEPROM, so if you want to
store '2' here this will need to change....
gjs_rsdi



Joined: 06 Feb 2006
Posts: 468
Location: Bali

View user's profile Send private message Send e-mail

PostPosted: Tue Jan 21, 2020 12:29 am     Reply with quote

Thank you for your post Ttelmah Smile

I understand what you wrote and will do as you advised.

Best wishes
Joe
Display posts from previous:   
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group