ds30 Loader is the new bootloader we’ve chosen to replace the broken AN1157 bootloader currently in the Bus Pirate. It has a bunch of benefits:

  • Takes less than 10 seconds to update the firmware
  • Fixes the ‘slow’ bootloader problem effecting some PICs
  • Opens 6KB of program space for more features
  • Applications for Windows, Linux, and MAC are available
  • Single bootloader for v2go/v3
  • Released under the GPL
  • Safer than the AN1157 bootloader
  • Can be installed with the existing bootloader

Before the new bootloader can be deployed, we need to fix an error in the loader applications and do a lot of testing. We’re offering our next monthly project as a bounty on the software modifications. If you’re interested in testing the new bootloader, or can help patch the loader apps, we’ve got a lot of details for you below.

Testers

PLEASE, DO NOT UPGRADE TO THE TEST BOOTLOADER UNLESS YOU HAVE A PIC PROGRAMMER!!! YOU WILL HAVE TO RESTORE OR UPGRADE THE BOOTLOADER TO UNDO THESE CHANGES. THERE ARE KNOWN BUGS IN THE SYSTEM, THIS ISN’T READY YET!!!

Grab the ds30 loader and compatible Bus Pirate firmware for V2go/v3. Also get a ds30 Loader app for your platform.

Don’t use it unless you have a programmer to undo it, this is not final at all!!!!!!

To upgrade bootloaders:

  1. Upload ds30Loader-v01.hex with the existing bootloader. Follow the normal upgrade procedure.
  2. Remove the jumper and reset the PIC (unplug/plug in).
  3. After resetting, place the programing jumper on the PIC pin. The MODE LED should light.
  4. Flash buspirate.hex with the ds 30 Loader app. The old bootloader is now erased.
  5. The Bus Pirate should now work as normal with firmware version 3.4.

You can probably still abort the upgrade after step 2 by loading a normal PIC firmware by the usual method. There’s no going back after step 4.

Bootloader app bugs, improvements

The bootloader is (erroneously?) located in the fourth-to-last page of program memory. The bootloader is located in the next-to-last page of PIC memory. We’d like it to be in the last page. (Each address counter unit takes two words, which explains the discrepancy, we were wrong about the incorrect placement, apologies to Mikael Gustafsson).

Changing the location of the firmware in the PIC is no problem, unfortunately the fourth-to-last next-to-last page location is also hard-coded into the PC upgrade applications. This creates two problems. First, the upgrade app protects what it thinks is the bootloader page, but allows erase/writes to new bootloader location. Second, the post-bootloader jump instruction is written to the wrong location. The upgrade app writes a goto instruction so the bootloader knows where to find the actual firmware, it currently writes to the final instruction of the fifth third-to-last page, but we’d need to move it to the next-to-last page.

The ideal solution would extend the configuration file of ds30 Loader to accept a few optional parameters. First, the starting page (or starting instruction) and length of the  bootloader. This way we can locate it where ever we want. Second, a setting to configure where it relocates the goto jump instruction.

We’ll send a free IR Toy to the author who implements these changes first.

The source is C# written in MS Visual studio with Linux and Mac support via Mono. The relevant code is located here. ds30Loader-v01-0xaa00.hex ds30Loader-v01-0xa800.hex is a test firmware located in the last page of memory. Read the evolution of this project in this forum thread.

Advertisements