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

Missing line in 18F HEX file

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



Joined: 04 Jan 2005
Posts: 224

View user's profile Send private message

Missing line in 18F HEX file
PostPosted: Mon May 11, 2009 4:37 am     Reply with quote

Hello,

I've noticed that the following line (which used to be the first) in the hex file is missing starting PCWH 4.091 (PIC18):

:020000040000FA

This is causing my Microchip USB HID bootloader to fail.
What does this line means??

I can insert it manually. The bootloader works!!

Thanks
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 May 11, 2009 6:07 am     Reply with quote

This is a type 4 record. A 32 bit address is built by using the top 16 bits of address from the type 4 record and the lower 16 bits from each data record. All data records belong within the 64K address space of the last type 4 record.

For PICs with less than 64K of program memory, this record is used to differentiate program memory from EEPROM and configuration information. For PICs with greater than 64K of program memory, this record identifies the current 64K page for subsequent data records.

Some programmers and bootloaders will fail without this initial type 4 record. Others assume that the initial page will be zero. Problems can occur for bootloaders that bootload external devices as well as the PIC as they can not longer safely differentiate a malformed set of data from valid data.

For example, if you wanted to be able to bootload an external EEPROM, you would use a type 4 record to precede the EEPROM's initial address. If you forgot to add this type 4 record and your bootloader assumed a default type 4 address of 0x0000 then you EEPROM data would be loaded into the program memory instead of the EEPROM.

Check to see if you have told the compiler to use Intel Hex32 format.
_________________
Regards, Andrew

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



Joined: 04 Jan 2005
Posts: 224

View user's profile Send private message

PostPosted: Mon May 11, 2009 6:17 am     Reply with quote

Thanks,

Where to check whether it's Intel Hex32 format or not?
I didn't change anything anyway...

Thanks again
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 May 11, 2009 6:36 am     Reply with quote

PICoHolic wrote:
Thanks,

Where to check whether it's Intel Hex32 format or not?
I didn't change anything anyway...

Thanks again


It depends on your development environment. I do not know if or how you can set it for CCS.
_________________
Regards, Andrew

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



Joined: 04 Jan 2005
Posts: 224

View user's profile Send private message

PostPosted: Tue May 12, 2009 1:55 am     Reply with quote

I've sent an email to CCS support. The reply was:
Quote:
This sets the upper 16 bites of the address to 0. This should be the default at the start of the file. We had the line in for a few versions but removed it because some device programmers issued a warning about the line being unnecessary.
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 May 12, 2009 5:31 am     Reply with quote

Well they blew it. Went from a warning from some programmers to breaking others.
_________________
Regards, Andrew

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



Joined: 27 Aug 2008
Posts: 2337
Location: Germany

View user's profile Send private message

PostPosted: Tue Oct 13, 2009 1:43 am     Reply with quote

For usage with the Microchip HID bootloader, the most simple solution is to initialize the extended Address part in the PC software.
Change
Code:
unsigned long extendedAddress;
to
Code:
unsigned long extendedAddress = 0;

btn_OpenHexFile_Click in Form1.h
PICoHolic



Joined: 04 Jan 2005
Posts: 224

View user's profile Send private message

PostPosted: Tue Oct 13, 2009 1:50 am     Reply with quote

Good to know...
Thanks
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