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

How to force CCS not to include Config. Words in .hex file

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



Joined: 27 Jun 2009
Posts: 16
Location: Bulgaria

View user's profile Send private message

How to force CCS not to include Config. Words in .hex file
PostPosted: Fri Mar 22, 2013 2:51 am     Reply with quote

MCU - PIC18F65J10, Compiler version 4.084

From document: "PIC18FxxJxx family devices do not have per-
sistent configuration memory, the top four words of
on-chip program memory are reserved for configuration
information. On Reset, the configuration information is
copied into the Configuration registers."


Is there any way(any directive?) to force compiler not to generate Configuration Words in output HEX file. Configuration Words are programmed initially by Bootloader application, so I don't need to do it again, actually it's undesirable.

#Fuses are not used in the CCS project, but still the compiler(obviously "by default") generates Config Words on address 7FF8 - 7FFF.

Thanks!
Ttelmah



Joined: 11 Mar 2010
Posts: 19236

View user's profile Send private message

PostPosted: Fri Mar 22, 2013 3:01 am     Reply with quote

Seriously they should always be the same in the compiled code as the bootloader. Many bootloaders won't write configuration bytes (best solution), since otherwise a value could be written that stops them working....
Make you booloader ignore bytes in this range.

Best Wishes
sirius



Joined: 27 Jun 2009
Posts: 16
Location: Bulgaria

View user's profile Send private message

PostPosted: Fri Mar 22, 2013 3:28 am     Reply with quote

Actually this is an update of a project, that uses non-J-part(MCU), where Config. Words are at address 300000h. On J-parts Configuration Words are part of the on-chip flash program memory ("user flash"). That's why I prefer not to eliminate thе possibility to write the whole "user flash", including Configuration Words.
So, as I understand, there's no way to stop compiler doing this?
Now I edit manually hex-file, but it's a tedious job.

Quote:
Many bootloaders won't write configuration bytes (best solution), since otherwise a value could be written that stops them working....
- I'm aware of this risk.

Quote:
Make you booloader ignore bytes in this range.

- Yes, this is one of the variants, probably the final one, if no other solution is found

Thank You for reply
Ttelmah



Joined: 11 Mar 2010
Posts: 19236

View user's profile Send private message

PostPosted: Fri Mar 22, 2013 3:35 am     Reply with quote

Load the file into MPLAB (import). Then hit export, and un-tick the 'configuration bits' tickbox.

Best Wishes
jeremiah



Joined: 20 Jul 2010
Posts: 1319

View user's profile Send private message

PostPosted: Fri Mar 22, 2013 2:06 pm     Reply with quote

I haven't checked in a long time, but I believe
Code:

#FUSES none


Also works if using the CCS IDE (the manual also mentions it). I'm not sure how it integrates with mplab
Ttelmah



Joined: 11 Mar 2010
Posts: 19236

View user's profile Send private message

PostPosted: Fri Mar 22, 2013 3:04 pm     Reply with quote

Well spotted Jeremiah.

Best Wishes
sirius



Joined: 27 Jun 2009
Posts: 16
Location: Bulgaria

View user's profile Send private message

PostPosted: Tue Mar 26, 2013 5:41 am     Reply with quote

Quote:
#FUSES none
- Thanks, works just fine!
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