Hot!How to write a bootloader

Page: < 12 Showing page 2 of 2
Author
naeem1234
Super Member
  • Total Posts : 411
  • Reward points : 0
  • Joined: 2015/02/19 06:39:28
  • Location: 0
  • Status: offline
Re: How to write a bootloader 2018/07/11 00:53:43 (permalink)
0
BMD
Hi,
I tend to agree with Susans view.
You may want to consider what I did, I designed a small unit that performs the 'On the Go' function of PicKit3. It reads a thumbdrive for a hex file and programs it into a host device.
Simple, without the limitations of a Bootloader.




Thanks. It looks like a good option. In my case I have to do the code flashing remotely OTA. I can read write data from my PIC MCU serial port remotely onto a server.. so now I am planning to use it for remote upgrading of its firmware as well. For that I would need a Boot service in my code.
#21
qɥb
Monolothic Member
  • Total Posts : 3329
  • Reward points : 0
  • Joined: 2017/09/09 05:07:30
  • Location: Jupiter
  • Status: offline
Re: How to write a bootloader 2018/07/11 06:19:52 (permalink)
+2 (2)
naeem1234
 For that I would need a Boot service in my code.

Which is a bootloader, which has all the limitations that Susan mentioned.

This forum is mis-configured so it only works correctly if you access it via https protocol.
The Microchip website links to it using http protocol. Will they ever catch on?
PicForum "it just works"
#22
amir_sh_elec
New Member
  • Total Posts : 3
  • Reward points : 0
  • Joined: 2018/07/10 14:23:24
  • Location: 0
  • Status: offline
Re: How to write a bootloader 2018/07/11 14:57:50 (permalink)
0
Hello All,
My need is almost the same as this thread.
I need a USB boot loader for my PIC18F46j50. I spent 3 days on net to find a solution. The microchip website suggests the MCC which seems not compatible with my uP. I found somewhere (github) a package of bootloaders for microchip MCUs. I found mine but when I program it nothing happens. The serial bootloader programmer does not recognise it. The file name: USBDevice-HID-HIDBootloader-C18-PIC18F46J50PIM.hex.
 
I am wondering if someone can help me to find the USB boot loader. 
 
Thank you
#23
RISC
Super Member
  • Total Posts : 5254
  • Reward points : 0
  • Status: offline
Re: How to write a bootloader 2018/07/11 15:29:55 (permalink)
+1 (1)
Hi Amir,
Good news....
There is a USB device HID class bootloader for PIC18F46J50 in the latest MLA from march 2017.
you can download the latest MLA from here : http://www.microchip.com/mplab/microchip-libraries-for-applications
After installing MLA and XC8 v1.45 (it is also possible to use XC8 v2.00 but because of some significant changes you must read the documentation...to have compilation without errors)
The project is located here :
c:\microchip\mla\v2017_03_06\apps\usb\device\bootloaders\firmware\pic18fxxjxx\
Documentation : c:\microchip\mla\v2017_03_06\doc\help_mla_usb.pdf
Everythin is explained in the documentation...how to setup the HW, the SW and run the demo ;=)
I thikn there is also a PC utility to communicate with the PIC
The project will run out of the box on the following hardware :  MA180024  (PIM for PIC18F46J50) which I strongly recommend you to buy to have a reference platform to help you bring up your own board.
Regards
 
#24
Danno
Super Member
  • Total Posts : 206
  • Reward points : 0
  • Joined: 2005/09/07 10:12:10
  • Status: offline
Re: How to write a bootloader 2018/07/11 16:28:56 (permalink)
+3 (3)
Aussie Susan
...
- you can't debug your application (unless the bootloader has this capability and they probably shouldn't)
....

...Actually, you can debug the application with the bootloader ;-)
 
Given the three project scheme documented in the bootloader user's guide, the StandAlone configuration is great for building and debugging the application without having to worry about the bootloader.
 
However, you can also debug the application Combined with the bootloader as well!  Say your application has an "enter bootloader" function that resets the device to enter the bootloader.  MPLAB X allows and tracks files as you single step through the reset in the application code to the reset vector in the bootloader!
 
Blew my mind first time I saw this work!
 
#25
pcbbc
Super Member
  • Total Posts : 453
  • Reward points : 0
  • Joined: 2014/03/27 07:04:41
  • Location: 0
  • Status: offline
Re: How to write a bootloader 2018/07/13 06:39:54 (permalink)
+1 (1)
naeem1234Thanks. It looks like a good option. In my case I have to do the code flashing remotely OTA. I can read write data from my PIC MCU serial port remotely onto a server.. so now I am planning to use it for remote upgrading of its firmware as well. For that I would need a Boot service in my code.
OTA from where and via what?


I have an 8 bit PIC design which has a XBee WiFi module attached for logging data.  The main PIC application is coded in XC8 and has an update function which can download the latest firmware from a website via the XBee.  The PIC does not have sufficient RAM for two copies of the main program, however the XBee has 1256KB of user accessible/programmable flash.
 
So first the application downloads the firware and flashes it into the XBee flash memory.  Another big advantage of this is that all the codebase between the main firmware and the OTA downloader can be shared.  Once downloading is complete and the firmware has been validated, control then passes to a minimal assembler bootloader which is located in the upper 1K of the PIC memory space.  The bootloader retrieves the firmware from the XBee flash, programs it into the PIC program memory, and reboots the PIC when it is done.
 
I have to agree with previous posters though.  Designing and writing a reliable and fault tollerant bootloader is not an easy task!  However once developed it does make field upgrading devices very simple.
#26
Page: < 12 Showing page 2 of 2
Jump to:
© 2018 APG vNext Commercial Version 4.5