View previous topic :: View next topic |
Author |
Message |
PICoHolic
Joined: 04 Jan 2005 Posts: 224
|
Missing line in 18F HEX file |
Posted: Mon May 11, 2009 4:37 am |
|
|
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: 1635 Location: Perth, Australia
|
|
Posted: Mon May 11, 2009 6:07 am |
|
|
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
|
|
Posted: Mon May 11, 2009 6:17 am |
|
|
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: 1635 Location: Perth, Australia
|
|
Posted: Mon May 11, 2009 6:36 am |
|
|
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
|
|
Posted: Tue May 12, 2009 1:55 am |
|
|
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: 1635 Location: Perth, Australia
|
|
Posted: Tue May 12, 2009 5:31 am |
|
|
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
|
|
Posted: Tue Oct 13, 2009 1:43 am |
|
|
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
|
|
Posted: Tue Oct 13, 2009 1:50 am |
|
|
Good to know...
Thanks |
|
|
|