Jump to content
Sign in to follow this  
JB99

Usb Bootloader And C

Recommended Posts

I'm considering using this usb bootloader on my 18F2550 for my next project http://www.diolan.com/pic/bootloader.html

But before I start my question is will my sourceboost c work with it? It looks like I just have to add an -rb xxxx option to the linker to make it locate the compiled code after the bootloader and all will be happy, but is that correct and is there anything else I need to be aware of?

 

Also, does anyone have any experience of that bootloader, or of any others? I'd like to be able to update my code frequently during development over USB as my design of board makes using my pickit2 awkward (but possible) so a bootloader to allow updates over USB seems ideal

Share this post


Link to post
Share on other sites
...does anyone have any experience of that bootloader...

 

You are correct - if you have a 2 Kbyte bootloader then you simply add the option -rb 0x800 to the linker command line and that offsets everything by 2 Kb. We do this all the time for our 18F4550-based products.

 

I can't remember where we got the bootloader... it was a while ago and I just followed links from the MicroChip site. I remember I had to change how to power-up into the bootloader vs into the app. On all our boards we have a boot button that is read by the bootloader on reset. If the button is pressed it continues running the bootloader, otherwise it jumps to the code entry point 2 Kb upwards. Of course, first you have to get the bootloader into the chip, and we just use ICSP for that in the latter stages of board production.

 

There are also PIC USB drivers out there that you will need to install on your develoment PC. Also, there are components (DLLS etc) that enable you to write Windows apps in VB, and maybe C# now, for downloading hex files to the bootloader. It's a bit of a pain to set up initially, but we have to support application upgrades in the field, and the USB bootloader is the only way to go for that. However, one issue I have is that the existing 32-bit USB drivers do not work on 64-bit OSes, but that will have to wait until I have more time for a resolution.

 

The bootloader we found needed the HiTech compiler but we just used a 30-day eval for that and then went with Sourceboost C for our app development, largely because of cost considerations. I never tried compiling it with SourceBoost C.

 

Keep in mind that the -rb option also offsets the reset and interrupt vectors, so that your bootloader has to take this into account.

 

Anyway, hope this helps.

Share this post


Link to post
Share on other sites
I'm considering using this usb bootloader on my 18F2550 for my next project http://www.diolan.com/pic/bootloader.html

But before I start my question is will my sourceboost c work with it? It looks like I just have to add an -rb xxxx option to the linker to make it locate the compiled code after the bootloader and all will be happy, but is that correct and is there anything else I need to be aware of?

 

Also, does anyone have any experience of that bootloader, or of any others? I'd like to be able to update my code frequently during development over USB as my design of board makes using my pickit2 awkward (but possible) so a bootloader to allow updates over USB seems ideal

 

Hi,

 

You can also have a look at Microchip device HID bootloader somewhere in the usb framework (part of the big Microchip application library).

Very useful because no driver installation on pc side (hid = native support).

Use it with -rb 0x1000. Source of pic and pc side software are in the archive.

This bootloader replace the old one made by microchip and it works with 2550, 4550, 24FJ and pic32.

 

Regards,

Charles

Share this post


Link to post
Share on other sites

Thank you, I've looked at several bootloaders since I posted this and got my sourceboost code to work perfectly with them

Share this post


Link to post
Share on other sites
Thank you, I've looked at several bootloaders since I posted this and got my sourceboost code to work perfectly with them

 

I tryed diolan bootloader but it did not work good because it use extended instruction and boostc does not support that. I now using microchip usb bootloader with out any problems.

Share this post


Link to post
Share on other sites

Yes, that's what I'm using now and it seems to work fine.

 

Pity it's not sourceboost compilable though, I need to build a slightly different version at some point and have no way to compile it at the moment.

I'm guessing that porting it would be a seriously large amount of effort...

Share this post


Link to post
Share on other sites

Join the conversation

You are posting as a guest. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
Sign in to follow this  

×
×
  • Create New...