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 CCS Technical Support

Bootloader + fuses

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



Joined: 10 May 2005
Posts: 323
Location: Belgium

View user's profile Send private message

Bootloader + fuses
PostPosted: Mon Jan 19, 2009 3:47 am     Reply with quote

Hi,

So you have the bootloader program that has fuses in the program itself that also has fuses. What fuses will your program use?

- Bootloader: NOBROWNOUT
- Program: (BROWNOUT RESET)

What will happen with my program when voltage drops? What fuses are determining?
Ttelmah
Guest







PostPosted: Mon Jan 19, 2009 5:04 am     Reply with quote

Depends whether your bootloader loads fuse data.
Many simpler bootloaders, only program the main memory area. Also, in some (old) chips, the 'fuses' are only programmable using an actual programmer. In these cases the fuses originally set, when the bootloader was loaded, will apply. However if the chip (and bootloader) support setting the fuses, then the fuses will chage to the new versions, for the change shown. However also some fuses (like those covering code protection for example), can only ever be 'set' by a bootloader. Clearing these, requires a full device 'erase', which will also erase the bootloader. Done so that once protected, code can't be 'unprotected', and read.

Best Wishes
Christophe



Joined: 10 May 2005
Posts: 323
Location: Belgium

View user's profile Send private message

PostPosted: Mon Jan 19, 2009 5:09 am     Reply with quote

The bootloader reads the HEX files and writes the bytes to the program memory; so I don't guess it will also write the fuses.. Are the fuses written to a special location?
asmallri



Joined: 12 Aug 2004
Posts: 1634
Location: Perth, Australia

View user's profile Send private message Send e-mail Visit poster's website

PostPosted: Mon Jan 19, 2009 6:44 pm     Reply with quote

Christophe wrote:
The bootloader reads the HEX files and writes the bytes to the program memory; so I don't guess it will also write the fuses.. Are the fuses written to a special location?


Yes #fuses are written to a specific location depending on the specific PIC. Legacy PICs do not allow fuses to be set or cleared without an external programmer. New generation PIC allow an application, such as a bootloader to set but not clear a subset of fuses. Once set, it cannot be reset by the PIC - instead the PIC must be erased by an external programmer.

Most bootloaders do not allow fuses to be set by the bootloader. The theory being that if you changed a fuse and as a result you introduced a problem, there is no way for the bootloader to recover from the problem. You could have you application program set fuses but you run into the same problem.

Fuses are typically set to match a PIC to a particular hardware environment and therefore should not normally require changing. If your application requires different fuses then you will most likely need to change the bootloader to set the fuses accordingly
_________________
Regards, Andrew

http://www.brushelectronics.com/software
Home of Ethernet, SD card and Encrypted Serial Bootloaders for PICs!!
Christophe



Joined: 10 May 2005
Posts: 323
Location: Belgium

View user's profile Send private message

PostPosted: Tue Jan 20, 2009 1:59 am     Reply with quote

Quote:

Yes #fuses are written to a specific location depending on the specific PIC. Legacy PICs do not allow fuses to be set or cleared without an external programmer. New generation PIC allow an application, such as a bootloader to set but not clear a subset of fuses. Once set, it cannot be reset by the PIC - instead the PIC must be erased by an external programmer.

How can I derive that from the datasheet? I'm using a PIC16LF877A.
asmallri



Joined: 12 Aug 2004
Posts: 1634
Location: Perth, Australia

View user's profile Send private message Send e-mail Visit poster's website

PostPosted: Tue Jan 20, 2009 3:50 am     Reply with quote

Christophe wrote:
Quote:

Yes #fuses are written to a specific location depending on the specific PIC. Legacy PICs do not allow fuses to be set or cleared without an external programmer. New generation PIC allow an application, such as a bootloader to set but not clear a subset of fuses. Once set, it cannot be reset by the PIC - instead the PIC must be erased by an external programmer.

How can I derive that from the datasheet? I'm using a PIC16LF877A.


This is a legacy PIC.

In general to find out what can and cannot be done with fuses looking in the "special features" section of the data sheet.
_________________
Regards, Andrew

http://www.brushelectronics.com/software
Home of Ethernet, SD card and Encrypted Serial Bootloaders for PICs!!
Christophe



Joined: 10 May 2005
Posts: 323
Location: Belgium

View user's profile Send private message

PostPosted: Tue Jan 20, 2009 4:18 am     Reply with quote

Okay thanks; I'll keep in mind that the fuses from the bootloader program are determining for my application.
Guest








PostPosted: Tue Jan 20, 2009 3:31 pm     Reply with quote

Hi

Will that say: If the fuses is programmed in bootloader it is not possible to change them in the program loaded from the bootloader?

Or: Can the real program set new values for the fuses?

Little confused...
asmallri



Joined: 12 Aug 2004
Posts: 1634
Location: Perth, Australia

View user's profile Send private message Send e-mail Visit poster's website

PostPosted: Tue Jan 20, 2009 3:50 pm     Reply with quote

Anonymous wrote:
Hi

Will that say: If the fuses is programmed in bootloader it is not possible to change them in the program loaded from the bootloader?

Or: Can the real program set new values for the fuses?

Little confused...


As discussed already, for a legacy PIC whatever fuses were initially set when programming the bootloader into the PIC are the fuses inherited by the bootloader.

You can set you applications fuses to whatever you like, they are ignored by most (virtually all) bootloaders for the reasons already stated.
_________________
Regards, Andrew

http://www.brushelectronics.com/software
Home of Ethernet, SD card and Encrypted Serial Bootloaders for PICs!!
Guest








PostPosted: Wed Jan 21, 2009 4:14 pm     Reply with quote

Hi

I played a little with the data sheet of a 18LF2455. In section 25 all the special reg. is described. I can not find anything there can disable a loaded program loaded with a boot loader(if you not make the chip protected).
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