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

Codeloader bootloader front end

 
Post new topic   Reply to topic    CCS Forum Index -> Code Library
View previous topic :: View next topic  
Author Message
bfmitch



Joined: 21 Aug 2004
Posts: 8

View user's profile Send private message Send e-mail

Codeloader bootloader front end
PostPosted: Fri Dec 31, 2004 10:40 am     Reply with quote

Back in May, Kasper published a VB program in the Code Library called Flasher. It was made to work with Loader.c that CCS supplies.

I wasn't real happy with Loader.c since you have to link it to your target program. That means that if the bootload process crashes, you have no way to fix it without breaking out a programmer and putting your PIC in it.

What I wanted was a bootloader that would stay resident in the PIC, that I could modify as needed.

At http://www.thebytefactory.com/dl_codeloader.asp , Gary Smithson has published a bootloader program that he calls Codeloader. (For those who don't know, the Byte Factory is a CCS dealer.) He has versions for the PIC18F and the mid range PICs. The source code is there and free to use as long as you keep his copyright intact. You can go to the web page and get the specifics of how it works, but some of the highlights are:
- It stays resident on the PIC
- You can modify the source code to suit your application
- It can work with Hyperterminal
- You don't have to relocate your code during the build

In other words, it does what I wanted. All I needed now was a front end program so I didn't have to run Hyperterminal during development. (I really dislike using Hyperterminal. Probably irrational.)

This is where Kasper's Flasher program comes in. I've taken the original program, renamed it Pic Flash Loader and made it play nice with the Codeloader bootloader. I did make a couple minor changes to my copy of the Codeloader source, removing some carriage returns and linefeeds. Pic Flash Loader shouldn't care about that. If it does, you can modify it easily. I have only used it for a PIC18F452.

Pic Flash Loader can work with a USB interface or converter that creates vitual comm ports.

One of the neat things about PFL is that, since it can take the name of a hex file as a command line parameter, you can put it right in the menus of the CCS IDE. Just go into the Tools | Debugger Programmer menu and add Pic Flash Loader under the Device Programmer section. The command line will look something like this: d:\projects\picflash\software\picflashloader.exe %H
It doesn't like quotes around the command line. I think it's a VB thing.

I've included more documentation in the VB source file.

You can download Pic Flash Loader from:
http://www.swproducts.biz/Downloads/PFL.zip

You'll have to go to the Byte Factory web site to download the Codeloader source and read his copyright info and instructions.

Both Kasper and I are claiming copyright for the new program. Use it as you like, at your own risk. Please give us credit if you use it.

Burt Mitchell (bfmitch)


Last edited by bfmitch on Mon Jul 11, 2005 3:00 pm; edited 1 time in total
chingB



Joined: 29 Dec 2003
Posts: 81

View user's profile Send private message

PostPosted: Sun Jan 02, 2005 12:11 am     Reply with quote

Hi,

I downloaded the codeloader program it to my PIC18F chip without modification and I have a hello world sample program which is to be bootloaded later.

I use your VB PIC Flasher with no modification and open the hello world program then press the flash button... with it will send a "=" character until it receives the "wait" and "load".

My problem I encountered is I received a timeout error as reported by the VB program.

to make sure I have my serial com working I decided to make a simple program by using the hyper terminal and send a series of character then after 10seconds it sends the character back to the hyper terminal... it works fine...

with the codeloader... i don't know wat seems to be the cause....

BTW, I am using a PICDEM 2 Plus Board from Microchip.

Anyone encounter this problem?

thnx
bfmitch



Joined: 21 Aug 2004
Posts: 8

View user's profile Send private message Send e-mail

PostPosted: Sun Jan 02, 2005 1:03 am     Reply with quote

Since the timeout doesn't start until the "Wait" and "Load" are received, it sounds like your baud rate is OK and you have a good connection.

With Codeloader programmed into the PIC, start Hyperterminal. Hold the '=' key while you turn on the board. If you get the "Wait" and "Load" prompts, use Hyperterminal to send your Hello World program to the PIC. See how that works. Make sure that Hyperterminal is set for Xon-Xoff


Some things to check:
- Go into your com port settings in the Device Manager and set Flow Control to Xon - Xoff. FYI: The MSComm control can't be set to Xon Xoff handshaking or it intercepts the characters and the program won't get them.

- Make sure the FUSE settings make sense for your board.

- I added "Parity=N" to my "#use rs232 settings in the Codeloader source.
future



Joined: 14 May 2004
Posts: 330

View user's profile Send private message

PostPosted: Sun Jan 02, 2005 4:28 am     Reply with quote

Quote:
' You should note that Codeloader only changes memory locations that are different when
' reloading your program. Even at 38400 BPS, bootloading a PIC18F452 that is 75% full takes
' about 4 minutes. Subsequent bootloads with changes go much faster.


Is that correct? 4 minutes is a looooong time Shocked

Tiny Bootloader takes 4s for a 10kb firmware.
jtw131



Joined: 16 Feb 2007
Posts: 1

View user's profile Send private message

Broken Link
PostPosted: Fri Feb 16, 2007 4:36 pm     Reply with quote

Anyone know where I can find the app this thread is talking about? The link in the main post is now dead....
Fabri



Joined: 22 Aug 2005
Posts: 275

View user's profile Send private message

PostPosted: Sat Mar 10, 2007 3:38 am     Reply with quote

Hi,

I decided to try this bootloader after standard loader.

I downloaded my demo firmware with terminal without problem but PicFlashLoader give me every time a timeout error writing PIC.

I tryed with PIC18 and with PIC16, set to Xon-Xoff, without port buffer, introduced also Parity=N to my "#use rs232" but I have always timeout error.

The only difference is clock of my board , 16Mhz, but I think it'snt a problem for software.

Were's the problem ?

Thanks for help
Fabri



Joined: 22 Aug 2005
Posts: 275

View user's profile Send private message

PostPosted: Mon Mar 19, 2007 10:02 am     Reply with quote

Hi,

No body can help me on ?

Regards,
Fabri
Display posts from previous:   
Post new topic   Reply to topic    CCS Forum Index -> Code Library 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