Skip to main content
Topic: Bootloader v4.x to v4.3 upgrader (Read 5113 times) previous topic - next topic

Bootloader v4.x to v4.3 upgrader

****Testers only, use at your own risk*******

Here's is an upgrader that uses the v4 bootloader to install a new v4.3 bootloader. This the same ds30 Loader bootloader with a few small enhancements. It is not required to use the latest firmware. Any v4+ firmware will work with any v4+ bootloader. This should only be used with an existing v4 bootloader, if you still have v2 bootloader (with P24QP.exe) please upgrade first with these instructions:
http://dangerousprototypes.com/2010/01/ ... 4-upgrade/

The new bootloader has these improvements:
*Proper timeout, if you enter with a jumper you can remove it to go back to the firmware with re-plugging the USB cable. (does not work when you jump from the terminal with $).
*Supports multiple connects - you can now press the check bootloader button then download without having to replug the Bus Pirate.
*If the bootloader is enabled and you type into the terminal most input will echo 'BL4+' so you know the Bus Pirate is functioning and in bootloader mode, not dead.

v4.3 is the version of the bootloader installed with an upgrader. It is the same as v4.4 in the regular firmware releases, but v4.4 is programmed with a PIC programmer like a PICkit2 or ICD2.

Sorry, no bootloader upgrader utility is available for Bus Pirate v1a. We did compile an updated bootloader for the v1a, but you'll need to download it in the latest project archive and program it with a PIC programmer

What you'll need:
*ds30 Loader or pirate-loader application
*Bootloader updater (BPv3-bootloader-upgrade-v4xtov4.3.hex)
*v4+ firmware (BPv3-Firmware-v4.5.hex)

The upgrade archive contains all these files:

Overview

We're going to:
*Connect to the Bus Pirate bootloader and upload the updater .HEX
*Open a serial terminal and run the updater (type yes to confirm)
*Connect to the new bootloader and upload a Bus Pirate firmware

Step 1. Upload the updater

Follow the ds30 Loader or pirate-loader instructions to load BPv3-bootloader-upgrade-v4xtov4.3.hex. This usually involves entering the bootloader with a jumper or by typing $ into the terminal, then loading the file with your preferred application.
http://dangerousprototypes.com/2010/02/ ... 30-loader/
http://dangerousprototypes.com/2010/01/ ... s-console/


Step 2. Run the updater

The program we just put in the Bus Pirate will install the updated bootloader, but it has to be executed from a serial terminal.
Open a terminal to the Bus Pirate's serial port and press space for further instructions. The screen will display your current bootloader version and the version that will be installed. If everything looks OK then type 'yes'. The upgrade will be installed in just a fraction of a second.

At the end of the upgrade the Bus Pirate will jump straight into the new bootloader. Just close the terminal without typing anything. You should be able to move to the next step without attaching a jumper to reenter the bootloader.

Step 3. Upload a Bus Pirate firmware

Now repeat the ds30 Loader or pirate-loader instructions to load a v4+ firmware (BPv3-Firmware-v4.5.hex included in this update).

Unplug the Bus Pirate, plug it in again. Open a serial terminal to the BUs Pirate and press i, the info should display the bootloader version as v4.3.

v4.3 is the version of the bootloader installed with an upgrader. It is the same as v4.4 in the project archive, but v4.4 is programmed with a PIC programmer like a PICkit2 or ICD2.
Got a question? Please ask in the forum for the fastest answers.

Re: Bootloader v4.x to v4.3 upgrader

Reply #1
The upgrade package.
Got a question? Please ask in the forum for the fastest answers.

 

Re: Bootloader v4.x to v4.3 upgrader

Reply #2
I noticed you a jump to the bootloader after flashing. I think it is better to print that to the terminal, wait a bit (to let all text arrive) and then make the jump. I was always struggling with what to do with the leds, this is much better.

Good job!

Re: Re: Bootloader v4.x to v4.3 upgrader

Reply #3
Hi sirs.
Sorry to hijack a so old tread.
I wonder how BPv3-bootloaderv4xtov43-update.hex has been done.
Starting from here
https://github.com/BusPirate/Bus_Pirate
it is possible to build a new bootloader v4.5.
It would be nice to know how to merge the HEX file made by MPLAB-X with the needed parts in order to build something that could be named as BPv3-bootloaderv4xtov45-update.hex.
Are there somewhere sources and documentations?
Thanks!
 
Be seeing you.

U.Sb

Re: Bootloader v4.x to v4.3 upgrader

Reply #4
Merging bootloader v4.5 into BPv3-bootloader-upgrade-v4xtov4.3.hex is easy. There is no need for additional documentation.
You already successfully built the updated bootloader v4.5.
Take a look at the comments in firmware.h
Code: [Select]
// test firmware (size should be exactly 1 page!)
// replace with the right bootloader
// export the page containing the firmware from MPLAB as a HEX
// convert the HEX to a byte array with the .html javascript converter
// if the bootloader is in the last page (Bus Pirate) don;t forget the config words
Paste the updated bootloader into firmware.h and change the last two lines from
Code: [Select]
0x37, 0xB8, 0xFE, 0x00, 0x03, 0x04,   // 127
0x00, 0xDF, 0xF9, 0x00, 0x7F, 0x3F,  // 128 (config fuses, stay the same)
to
Code: [Select]
0x37, 0xB8, 0xFE, 0x00, 0x05, 0x04,   // 127
0x00, 0xDF, 0xF9, 0x00, 0x7F, 0x3F,  // 128 (config fuses, stay the same)};
Afterwards rebuild upgrader-v4tov4.

Re: Re: Bootloader v4.x to v4.3 upgrader

Reply #5
Hi megafix.
Thank you very much for the useful information!
Honestly I did not understand all that you wrote.
Sadly at this moment I have troubles with the computer where I have MPLAB, as soon as I will fix them I will try to deepen what you have written.
Thank you very much sir!

Be seeing you.

U.Sb

Re: Re: Bootloader v4.x to v4.3 upgrader

Reply #6
Hi guys.
Thanks to megafix I have succeeded!

viewtopic.php?f=28&t=8498&p=67056#p67056

Thank you very much megafix!!!

Be seeing you.

U.Sb