Searching \ for '[EE] Combined bootloader hex file and the applicat' in subject line. ()
Make payments with PayPal - it's fast, free and secure! Help us get a faster server
FAQ page: piclist.com/techref/index.htm?key=combined+bootloader
Search entire site for: 'Combined bootloader hex file and the applicat'.

Exact match. Not showing close matches.
PICList Thread
'[EE] Combined bootloader hex file and the applicat'
2005\08\23@200832 by Chen Xiao Fan

face
flavicon
face
Hi all,

During playing with PICDEM FS USB and PICkit 2, sometimes I
will mess up the bootloader. Therefore I need to re-flash
the bootloader (using an ICD2 normally). And then I can
use the bootloader application to download the application
hex.

I want to combine the bootloader hex and the application
hex just like what Microchip does in PICDEM FS USB
(C:\MCHPFSUSB\fw\_factory_hex) and PICKit 2
(PICkit2_Ver_101_Combined.hex in the CD). It is easy for them
to produce the demo board.

Are there any utilities out there which can do this? Thanks
in advance for any suggestions.

Regards,
Xiaofan

2005\08\23@205101 by Richard Prosser

picon face
Can't you just copy & paste with Notepad etc. ?
You may hve to delete the first line of one hex file & the last of the
other. I've done it with Atmel & M16 hexfiles so don't think PICs
would be different - unless the programmer requires a contiguous
address map.

RP

On 24/08/05, Chen Xiao Fan <spam_OUTxiaofanTakeThisOuTspamsg.pepperl-fuchs.com> wrote:
{Quote hidden}

> -

2005\08\23@205619 by Mark Rages

face picon face
On 8/23/05, Chen Xiao Fan <.....xiaofanKILLspamspam@spam@sg.pepperl-fuchs.com> wrote:
> Hi all,
>
> During playing with PICDEM FS USB and PICkit 2, sometimes I
> will mess up the bootloader. Therefore I need to re-flash
> the bootloader (using an ICD2 normally). And then I can
> use the bootloader application to download the application
> hex.
>
> I want to combine the bootloader hex and the application
> hex just like what Microchip does in PICDEM FS USB
> (C:\MCHPFSUSB\fw\_factory_hex) and PICKit 2
> (PICkit2_Ver_101_Combined.hex in the CD). It is easy for them
> to produce the demo board.
>
> Are there any utilities out there which can do this? Thanks
> in advance for any suggestions.
>

If the files are similar and don't have overlapping sections, it's not
very hard.  Here's how I solved a similar problem (In my case, I had
eeprom defs in one hex file and the code in another):  (This is a
Makefile rule, puctuate accordingly)

combined.hex: eeprom.hex main.hex
       ( head -n -1 main.hex ; cat eeprom.hex ) > combined.hex

It's just giving me the main.hex with the last (terminating) line
removed and appending the eeprom.hex to it.  ( This isn't a completely
general solution, but it works fine with the hex files produced by my
toolset. )

Regards,
Mark
markrages@gmail
--
You think that it is a secret, but it never has been one.
 - fortune cookie

2005\08\23@214441 by Denny Esterline

picon face
> I want to combine the bootloader hex and the application
> hex just like what Microchip does in PICDEM FS USB
> (C:\MCHPFSUSB\fw\_factory_hex) and PICKit 2
> (PICkit2_Ver_101_Combined.hex in the CD). It is easy for them
> to produce the demo board.
>
> Are there any utilities out there which can do this? Thanks
> in advance for any suggestions.
>

The way I got around this in the past was to use the programmer. Try this:
1. program target with bootloader.
2. use bootloader to load application code.
3. use programmer to read chip.

Then you have a hex file that contains both. May not be the most elegant
solution, but you do already have all the necessary tools.

-Denny



2005\08\23@215502 by Brent Brown

picon face
> I want to combine the bootloader hex and the application
> hex just like what Microchip does in PICDEM FS USB
> (C:\MCHPFSUSB\fw\_factory_hex) and PICKit 2
> (PICkit2_Ver_101_Combined.hex in the CD). It is easy for them
> to produce the demo board.
>
> Are there any utilities out there which can do this? Thanks
> in advance for any suggestions.

If you use Hi-Tech C, then you may be aware their recent customer
newsletter mentions the Hexmate command line utility:

- Calculate and store checksum values
- Fill unused memory locations with known data sequences
- Merge multiple Intel hex files with one output file
- Convert INHX32 files to other INHX formats (eg. INHX8M)
- Detect opcode sequences within a hexfile
- Find/replace opcode sequences

It's free (to existing customers at least) and they aim to include it with all their
future compilers.

--
Brent Brown, Electronic Design Solutions
16 English Street, Hamilton 2001, New Zealand
Ph: +64 7 849 0069
Fax: +64 7 849 0071
Cell/txt: 027 433 4069
eMail:  brent.brownspamKILLspamclear.net.nz


2005\08\24@002247 by Chen Xiao Fan

face
flavicon
face
Thanks a lot. I guess this is exactly what I need.

I think it is free download from the forum.
I bought Version 7.85 back in year 2000 and I used to read the
forum as well. I need to check out the forum
again. Thanks again for pointing out this.

Regards,
Xiaofan



{Original Message removed}

2005\08\24@015320 by Chen Xiao Fan

face
flavicon
face
I went to Hitech forum and downloaded version 1.76 of Hexmate.
It is exactly what I want.

By the way, the Hitech 09/2005 newsletter is just on my desk.
I find out that it did mention the Hexmate. Thanks, Brent.

The URL is here. You may need to register to get access to it.
www.htsoft.com/forum/all/showflat.php/Cat/0/Number/12986/page//fpart/
1/vc/1

Regards,
Xiaofan

>From the forum:

Typical applications for Hexmate might include:

1) merging a bootloader or debug module into a main application
at build time
2) calculating a checksum over a range of program memory and
storing its value in program memory or EEPROM
3) Filling unused memory locations with an instruction to send
the PC to a known location if it gets lost.
4) Storage of a serial number at a fixed address.
5) Storage of a string (eg. time stamp) at a fixed address.
6) Store initial values at a particular memory address
(eg. initialise EEPROM)
7) Detect usage of a buggy instruction (eg. LFSR in PIC18C452).

----Original Message-----
From: Brent Brown [.....brent.brownKILLspamspam.....clear.net.nz]
Sent: Wednesday, August 24, 2005 9:55 AM

If you use Hi-Tech C, then you may be aware their recent customer
newsletter mentions the Hexmate command line utility:

It's free (to existing customers at least) and they aim to include
it with all their future compilers.

2005\08\24@021621 by Wouter van Ooijen

face picon face
> I want to combine the bootloader hex and the application
> hex just like what Microchip does in PICDEM FS USB
> (C:\MCHPFSUSB\fw\_factory_hex) and PICKit 2
> (PICkit2_Ver_101_Combined.hex in the CD). It is easy for them
> to produce the demo board.
>
> Are there any utilities out there which can do this? Thanks
> in advance for any suggestions.

If these two hex files have no overlapping adresses you could simple
cut-and-paste the application into the bootloader, eaving out a few
records (maybe an extended segment, certainly an end-of-file). I don't
know whether hex prescribes that records are in order, most code I have
seen does not assume this.

If you are into Python code it will be very easy to add an ADD command
to XWisp, so you could do

  XWISP LOAD application ADD bootloader SAVE app_and_bootloader

Wouter van Ooijen

-- -------------------------------------------
Van Ooijen Technische Informatica: http://www.voti.nl
consultancy, development, PICmicro products
docent Hogeschool van Utrecht: http://www.voti.nl/hvu


2005\08\24@044707 by Daniel Chia

flavicon
face
Hi, actually you could flash the bootloader, then
bootload your program. Subsequently use your ICD2 to
read off the whole program memory. However the
downside is that the file will be quite large so you
could hand edit out the empty portions once production
is confirmed.
--- Richard Prosser <EraseMErhprosserspam_OUTspamTakeThisOuTgmail.com> wrote:

{Quote hidden}

2005\08\24@062742 by Jose Da Silva

flavicon
face
On August 23, 2005 11:18 pm, Wouter van Ooijen wrote:
> > I want to combine the bootloader hex and the application
> > hex just like what Microchip does in PICDEM FS USB
> > (C:\MCHPFSUSB\fw\_factory_hex) and PICKit 2
> > (PICkit2_Ver_101_Combined.hex in the CD). It is easy for them
> > to produce the demo board.
> >
> > Are there any utilities out there which can do this? Thanks
> > in advance for any suggestions.

(Just a note: I missed the earlier conversation)
Seeing the overlap visually may help a bit, so this should help show you
a quick map of any overlapping addresses assuming it's a 2k or smaller
version chip you are using right now.
File at <http://www.joescat.com/micro/picchip.htm>
warning, use 8.3 dir\filename format for DOS... then run file as:
picdisl.exe  -m  -d1  C:\MCHPFSUSB\fw\boot.hex  yourcode.hex

(warning - advertising)  ;-)
Assuming the bootloader holds the reset vector, then the commercial
version of the above program would use a batch file sort of like this:

batch.bat  yourcode.hex

---batch.bat---
picdis  -oresult.hex  -q  -dh  bootcode.hex  %1
picdis  -oresult.hex  -dh  result.hex  bootcode.hex
xwisp  result.hex
del  result.hex
------------


> If these two hex files have no overlapping adresses you could simply
> cut-and-paste the application into the bootloader, leaving out a few
> records (maybe an extended segment, certainly an end-of-file). I
> don't know whether hex prescribes that records are in order, most
> code I have seen does not assume this.

Technically speaking, Hex files don't have to be in order to be valid.
...but not everyone expects that they might be out of order.

If it's a computer that loads the HEX file, there is a relatively good
chance that it is put in order before sending or saving since
everything gets thrown into memory before programming.
However, supposing you were to directly send an out-of-order file down
to a small-memory device, such as a serial programmer, then I wouldn't
know what happens there. I'm sure some chips require some data in a
certain order (example config data), while others may be okay with data
sent out-of-order.

If you cut-n-paste manually using notepad, it should be easy to see and
to put it in order.

> If you are into Python code it will be very easy to add an ADD
> command to XWisp, so you could do
>
>    XWISP LOAD application ADD bootloader SAVE app_and_bootloader

Otherwise, like Wouter mentioned, it shouldn't be too hard to write
something, and the bootloader should be ADDed last so that it will
overwrite your application code where they both overlap (usually reset
and config areas).

2005\08\24@085043 by John Ferrell

face picon face
I encountered a similar problem with the Peatman (18F452) board. Apparently
the ICD2 has the ability to load registers as well as program storage. This
is essential to the Peatman code. Since I don't have an ICD2, it was
necessary for me to order another preloaded chip.

This may be the problem you are experiencing.

BTW, I got into the jam by inadvertently trying to write to a string
constant with Microchip C.
The Peatman board/book/info is documented at picbook.com.

John Ferrell
http://DixieNC.US

{Original Message removed}

2005\08\25@201910 by Chen Xiao Fan

face
flavicon
face
It seems to me that my problem can not be solved by hexmate
and some other methods here. There are indeed some overlapping
of the hex file.

Looks like Daniel's method is easier now. I will try
Jose Da Silva program as well.

C:\Myprog\Hitech\hexmatev176>hexmate boot.hex demo.hex -Ofsusb.hex
(944) data conflict at address 0h between boot.hex and demo.hex

Regards,
Xiaofan

2005\08\25@213216 by Daniel Chia

flavicon
face
Hi,
 I'm not suprised that there are overlapping
sections. In a bootloader, what happens is that either
in the firmware or the software the program's RESET
vector must be moved to somewhere within the boot
location. Otherwise, once u bootload the program the
bootloader won't run anymore!

--- Chen Xiao Fan <@spam@xiaofanKILLspamspamsg.pepperl-fuchs.com>
wrote:

{Quote hidden}

> --

More... (looser matching)
- Last day of these posts
- In 2005 , 2006 only
- Today
- New search...