bootloader question

Started by dan michaels January 12, 2005


Hi, I've been programming PICs for some time, and recently decided to
check out some of the bootloaders available. So far, I haven't had
much luck. One I've tried is the Rick Farmer bootloader - which seems
to be fairly popular. I'm using a 16F876 and the bootloader runs ok,
and I've been able to re-assemble it ok and re-burn the chip ok, and
it erases the eeprom ok prior to downloading hex files, but it fails
during the program download. It even fails on the test example hex
files.

I've looked at what is written into the lower addresses of the code
space using my chip programmer. What happens is that it loads
the "2nd" line of 8 words of the .hex file into code eeprom ok, but
never does load the 1st line of the hex file, nor anything after the
2nd line. The error msg says "non-Hex character at line 3", but I
checked the hex files and they are all in correct INHX8M format.

Anyone have a suggestion about this? Someone must have used this
bootloader.

thanks in advance,
- dan michaels
======================






Make sure you have a 100 mS end-of-line delay if you are using
Hyperterminal. The BotLoader program in the fiiles section of the
MiniSumo Mark III group here on Yahoo incorporates this and a few
other things.

The one issue I have with BotLoader is that it is sometimes
necessary to click in the bottom text box to see what the PIC is
sending. No big deal, use it all the time.

The other issue you are probably already aware of: the boot loader
won't handle -A chips with the revised programming algorithm but
that has nothing to do with your problem.

And, of course, your code has to have an origin of 0003h which only
means that the entry point must be in the first page.

--- In , "dan michaels" <dan@o...> wrote:
>
>
> Hi, I've been programming PICs for some time, and recently decided
to
> check out some of the bootloaders available. So far, I haven't had
> much luck. One I've tried is the Rick Farmer bootloader - which
seems
> to be fairly popular. I'm using a 16F876 and the bootloader runs
ok,
> and I've been able to re-assemble it ok and re-burn the chip ok,
and
> it erases the eeprom ok prior to downloading hex files, but it
fails
> during the program download. It even fails on the test example hex
> files.
>
> I've looked at what is written into the lower addresses of the
code
> space using my chip programmer. What happens is that it loads
> the "2nd" line of 8 words of the .hex file into code eeprom ok,
but
> never does load the 1st line of the hex file, nor anything after
the
> 2nd line. The error msg says "non-Hex character at line 3", but I
> checked the hex files and they are all in correct INHX8M format.
>
> Anyone have a suggestion about this? Someone must have used this
> bootloader.
>
> thanks in advance,
> - dan michaels
> ======================





--- In , "rtstofer" <rstofer@p...> wrote:
>
>
> Make sure you have a 100 mS end-of-line delay if you are using
> Hyperterminal. The BotLoader program in the fiiles section of the
> MiniSumo Mark III group here on Yahoo incorporates this and a few
> other things.
>
> The one issue I have with BotLoader is that it is sometimes
> necessary to click in the bottom text box to see what the PIC is
> sending. No big deal, use it all the time.
>
> The other issue you are probably already aware of: the boot loader
> won't handle -A chips with the revised programming algorithm but
> that has nothing to do with your problem.
>
> And, of course, your code has to have an origin of 0003h which only
> means that the entry point must be in the first page.
>


Thanks, the delay did it. I can see the program stored in eeprom
using my chip programmer, it runs ok, etc. I figured this was
probably going to be a timing issue, related to the fact that you
need a long enough delay for the eeprom to write. I had to set the
end-of-line delay = 500 msec. I must have missed that comment in the
documentation. Also, I figured the issue might have been dealt with
in the bootloader using xon/xoff, flow control, etc. Guess not. I
guess I'm using a different version than on the Mark3 site.

I was aware of the different programming algorithm in the -A chips,
and also the 0003h org bit, etc.

It's a little difficult to get back to the bootloader from the stored
program. One trick I've used in the past is that you can interrogate
the POR flag, and use it to tell the difference between a power-up
reset and an /Mclr activation after powerup. I might try some patches
to the bootloader. thanks for the help,
- dan michaels
======================





Dan,

Glad it worked out. I have always felt that Junun should remove any
reference to Hyperterminal and standardize on BotLoader. But then,
it isn't my site.

The rules of MiniSumo require a 5 second delay on startup. So, it
is built into the boot loader. If a user program has been loaded,
as indicated by a flag somewhere, after 5 seconds it will start
(meanwhile the serial port is sending # {could be wrong with the
char, I don't have my bot connected}). If the serial port receives
a CR before the 5 second timeout, the boot loader will take over and
send out a prompt. If the flag for a user program is not set then
the boot loader starts immediately.

In most ways that works pretty well. If a user program is loaded
then if there is no serial input the user probably doesn't want to
reprogram the bot so it may as well start executing the existing
code. If the user is connected and sends a CR during the 5 second
window then they want to consider reprogramming.

Microchip also has a boot loader and I understand it is quite a bit
smaller. I don't know anything more about it.


Hi!

There is a small ca 100byte bootloader named TinyBootLoader... Works with
16F & 18F pics... ----- Original Message -----
From: "rtstofer" <>
To: <>
Sent: Wednesday, January 12, 2005 9:57 PM
Subject: [piclist] Re: bootloader question >
>
> Dan,
>
> Glad it worked out. I have always felt that Junun should remove any
> reference to Hyperterminal and standardize on BotLoader. But then,
> it isn't my site.
>
> The rules of MiniSumo require a 5 second delay on startup. So, it
> is built into the boot loader. If a user program has been loaded,
> as indicated by a flag somewhere, after 5 seconds it will start
> (meanwhile the serial port is sending # {could be wrong with the
> char, I don't have my bot connected}). If the serial port receives
> a CR before the 5 second timeout, the boot loader will take over and
> send out a prompt. If the flag for a user program is not set then
> the boot loader starts immediately.
>
> In most ways that works pretty well. If a user program is loaded
> then if there is no serial input the user probably doesn't want to
> reprogram the bot so it may as well start executing the existing
> code. If the user is connected and sends a CR during the 5 second
> window then they want to consider reprogramming.
>
> Microchip also has a boot loader and I understand it is quite a bit
> smaller. I don't know anything more about it. >
> to unsubscribe, go to http://www.yahoogroups.com and follow the
> instructions
> Yahoo! Groups Links





Do you have a URL for it ?
Jim
----- Original Message -----
From: b...@bjarenet.com
To: p...@yahoogroups.com
Sent: Wednesday, January 12, 2005 3:18 PM
Subject: Re: [piclist] Re: bootloader question

Hi!

There is a small ca 100byte bootloader named TinyBootLoader... Works with
16F & 18F pics...----- Original Message -----
From: "rtstofer" <r...@pacbell.net>
To: <p...@yahoogroups.com>
Sent: Wednesday, January 12, 2005 9:57 PM
Subject: [piclist] Re: bootloader question>
>
> Dan,
>
> Glad it worked out.  I have always felt that Junun should remove any
> reference to Hyperterminal and standardize on BotLoader.  But then,
> it isn't my site.
>
> The rules of MiniSumo require a 5 second delay on startup.  So, it
> is built into the boot loader.  If a user program has been loaded,
> as indicated by a flag somewhere, after 5 seconds it will start
> (meanwhile the serial port is sending # {could be wrong with the
> char, I don't have my bot connected}).  If the serial port receives
> a CR before the 5 second timeout, the boot loader will take over and
> send out a prompt.  If the flag for a user program is not set then
> the boot loader starts immediately.
>
> In most ways that works pretty well.  If a user program is loaded
> then if there is no serial input the user probably doesn't want to
> reprogram the bot so it may as well start executing the existing
> code.  If the user is connected and sends a CR during the 5 second
> window then they want to consider reprogramming.
>
> Microchip also has a boot loader and I understand it is quite a bit
> smaller.  I don't know anything more about it.>
> to unsubscribe, go to http://www.yahoogroups.com and follow the
> instructions
> Yahoo! Groups Links


to unsubscribe, go to http://www.yahoogroups.com and follow the instructions

--- In , <bjk003862@b...> wrote:
> Hi!
>
> There is a small ca 100byte bootloader named TinyBootLoader...
Works with
> 16F & 18F pics...
>

Thanks to both of you. Now that I have one bootloader working, I'll
look around at some of the others. I have PICLoader v.1.5, and it
still seems to have some problems. The D cmd does not work right
(sends many extra lines not in the program), and the trap to get to
the loader is cumbersome - must either insert a special trap in the
user-program along with shift-Z input, or else have pin RB6=gnd, send
shift-Z within 1-sec of power-up (shorter than 5-sec due to 20 mhz
xtal, I guess).

I also tried the bootloader that comes with PICC-Lite the other day
but had no luck there with downloads either. Maybe now it'll go with
more playing around.

thanks,
- dan
============
> ----- Original Message -----
> From: "rtstofer" <rstofer@p...>
> To: <>
> Sent: Wednesday, January 12, 2005 9:57 PM
> Subject: [piclist] Re: bootloader question > >
> >
> > Dan,
> >
> > Glad it worked out. I have always felt that Junun should remove
any
> > reference to Hyperterminal and standardize on BotLoader. But
then,
> > it isn't my site.
> >
> > The rules of MiniSumo require a 5 second delay on startup. So, it
> > is built into the boot loader. If a user program has been loaded,
> > as indicated by a flag somewhere, after 5 seconds it will start
> > (meanwhile the serial port is sending # {could be wrong with the
> > char, I don't have my bot connected}). If the serial port
receives
> > a CR before the 5 second timeout, the boot loader will take over
and
> > send out a prompt. If the flag for a user program is not set then
> > the boot loader starts immediately.
> >
> > In most ways that works pretty well. If a user program is loaded
> > then if there is no serial input the user probably doesn't want to
> > reprogram the bot so it may as well start executing the existing
> > code. If the user is connected and sends a CR during the 5 second
> > window then they want to consider reprogramming.
> >
> > Microchip also has a boot loader and I understand it is quite a
bit
> > smaller. I don't know anything more about it.
> >



http://www.ac.ugal.ro/staff/ckiku/software/picbootloader.htm (Ver. 1.63)
 
http://www.etc.ugal.ro/cchiculita/software/picbootloader.htm (Ver 1.70)
 
//Fricke
 
----- Original Message -----
From: JCullins
To: p...@yahoogroups.com
Sent: Wednesday, January 12, 2005 11:04 PM
Subject: Re: [piclist] Re: bootloader question

Do you have a URL for it ?
Jim
----- Original Message -----
From: b...@bjarenet.com
To: p...@yahoogroups.com
Sent: Wednesday, January 12, 2005 3:18 PM
Subject: Re: [piclist] Re: bootloader question

Hi!

There is a small ca 100byte bootloader named TinyBootLoader... Works with
16F & 18F pics...----- Original Message -----
From: "rtstofer" <r...@pacbell.net>
To: <p...@yahoogroups.com>
Sent: Wednesday, January 12, 2005 9:57 PM
Subject: [piclist] Re: bootloader question>
>
> Dan,
>
> Glad it worked out.  I have always felt that Junun should remove any
> reference to Hyperterminal and standardize on BotLoader.  But then,
> it isn't my site.
>
> The rules of MiniSumo require a 5 second delay on startup.  So, it
> is built into the boot loader.  If a user program has been loaded,
> as indicated by a flag somewhere, after 5 seconds it will start
> (meanwhile the serial port is sending # {could be wrong with the
> char, I don't have my bot connected}).  If the serial port receives
> a CR before the 5 second timeout, the boot loader will take over and
> send out a prompt.  If the flag for a user program is not set then
> the boot loader starts immediately.
>
> In most ways that works pretty well.  If a user program is loaded
> then if there is no serial input the user probably doesn't want to
> reprogram the bot so it may as well start executing the existing
> code.  If the user is connected and sends a CR during the 5 second
> window then they want to consider reprogramming.
>
> Microchip also has a boot loader and I understand it is quite a bit
> smaller.  I don't know anything more about it.>
> to unsubscribe, go to http://www.yahoogroups.com and follow the
> instructions
> Yahoo! Groups Links


to unsubscribe, go to http://www.yahoogroups.com and follow the instructions
to unsubscribe, go to http://www.yahoogroups.com and follow the instructions



Thanks
Jim
----- Original Message -----
From: b...@bjarenet.com
To: p...@yahoogroups.com
Sent: Wednesday, January 12, 2005 4:22 PM
Subject: Re: [piclist] Re: bootloader question

http://www.ac.ugal.ro/staff/ckiku/software/picbootloader.htm (Ver. 1.63)
 
http://www.etc.ugal.ro/cchiculita/software/picbootloader.htm (Ver 1.70)
 
//Fricke
 
----- Original Message -----
From: JCullins
To: p...@yahoogroups.com
Sent: Wednesday, January 12, 2005 11:04 PM
Subject: Re: [piclist] Re: bootloader question

Do you have a URL for it ?
Jim
----- Original Message -----
From: b...@bjarenet.com
To: p...@yahoogroups.com
Sent: Wednesday, January 12, 2005 3:18 PM
Subject: Re: [piclist] Re: bootloader question

Hi!

There is a small ca 100byte bootloader named TinyBootLoader... Works with
16F & 18F pics...----- Original Message -----
From: "rtstofer" <r...@pacbell.net>
To: <p...@yahoogroups.com>
Sent: Wednesday, January 12, 2005 9:57 PM
Subject: [piclist] Re: bootloader question>
>
> Dan,
>
> Glad it worked out.  I have always felt that Junun should remove any
> reference to Hyperterminal and standardize on BotLoader.  But then,
> it isn't my site.
>
> The rules of MiniSumo require a 5 second delay on startup.  So, it
> is built into the boot loader.  If a user program has been loaded,
> as indicated by a flag somewhere, after 5 seconds it will start
> (meanwhile the serial port is sending # {could be wrong with the
> char, I don't have my bot connected}).  If the serial port receives
> a CR before the 5 second timeout, the boot loader will take over and
> send out a prompt.  If the flag for a user program is not set then
> the boot loader starts immediately.
>
> In most ways that works pretty well.  If a user program is loaded
> then if there is no serial input the user probably doesn't want to
> reprogram the bot so it may as well start executing the existing
> code.  If the user is connected and sends a CR during the 5 second
> window then they want to consider reprogramming.
>
> Microchip also has a boot loader and I understand it is quite a bit
> smaller.  I don't know anything more about it.>
> to unsubscribe, go to http://www.yahoogroups.com and follow the
> instructions
> Yahoo! Groups Links


to unsubscribe, go to http://www.yahoogroups.com and follow the instructions
to unsubscribe, go to http://www.yahoogroups.com and follow the instructions



to unsubscribe, go to http://www.yahoogroups.com and follow the instructions
You are welcome!
 
I have som trouble using the bootloader with PIC18F4620... But only tried to use it 1 time, and havent had much time to experiment with it... Works fine with 252/452 & 8720... :)
 
//Fricke
----- Original Message -----
From: JCullins
To: p...@yahoogroups.com
Sent: Wednesday, January 12, 2005 11:32 PM
Subject: Re: [piclist] Re: bootloader question

Thanks
Jim
----- Original Message -----
From: b...@bjarenet.com
To: p...@yahoogroups.com
Sent: Wednesday, January 12, 2005 4:22 PM
Subject: Re: [piclist] Re: bootloader question

http://www.ac.ugal.ro/staff/ckiku/software/picbootloader.htm (Ver. 1.63)
 
http://www.etc.ugal.ro/cchiculita/software/picbootloader.htm (Ver 1.70)
 
//Fricke
 
----- Original Message -----
From: JCullins
To: p...@yahoogroups.com
Sent: Wednesday, January 12, 2005 11:04 PM
Subject: Re: [piclist] Re: bootloader question

Do you have a URL for it ?
Jim
----- Original Message -----
From: b...@bjarenet.com
To: p...@yahoogroups.com
Sent: Wednesday, January 12, 2005 3:18 PM
Subject: Re: [piclist] Re: bootloader question

Hi!

There is a small ca 100byte bootloader named TinyBootLoader... Works with
16F & 18F pics...----- Original Message -----
From: "rtstofer" <r...@pacbell.net>
To: <p...@yahoogroups.com>
Sent: Wednesday, January 12, 2005 9:57 PM
Subject: [piclist] Re: bootloader question>
>
> Dan,
>
> Glad it worked out.  I have always felt that Junun should remove any
> reference to Hyperterminal and standardize on BotLoader.  But then,
> it isn't my site.
>
> The rules of MiniSumo require a 5 second delay on startup.  So, it
> is built into the boot loader.  If a user program has been loaded,
> as indicated by a flag somewhere, after 5 seconds it will start
> (meanwhile the serial port is sending # {could be wrong with the
> char, I don't have my bot connected}).  If the serial port receives
> a CR before the 5 second timeout, the boot loader will take over and
> send out a prompt.  If the flag for a user program is not set then
> the boot loader starts immediately.
>
> In most ways that works pretty well.  If a user program is loaded
> then if there is no serial input the user probably doesn't want to
> reprogram the bot so it may as well start executing the existing
> code.  If the user is connected and sends a CR during the 5 second
> window then they want to consider reprogramming.
>
> Microchip also has a boot loader and I understand it is quite a bit
> smaller.  I don't know anything more about it.>
> to unsubscribe, go to http://www.yahoogroups.com and follow the
> instructions
> Yahoo! Groups Links


to unsubscribe, go to http://www.yahoogroups.com and follow the instructions
to unsubscribe, go to http://www.yahoogroups.com and follow the instructions



to unsubscribe, go to http://www.yahoogroups.com and follow the instructions
to unsubscribe, go to http://www.yahoogroups.com and follow the instructions