Skip to main content
Topic: Bus Pirate - Community Firmware 7.0 (Read 81593 times) previous topic - next topic

Bus Pirate - Community Firmware 7.0

Good afternoon,

I've posted the first release of the Bus Pirate community firmware v7.0.
This firmware combines multiple patches from several community members to maintain and fix the codebase.

I've attached binaries for the Bus Pirate v4.  I couldn't get BPv3 compiling due to changes in recent XC16 compilers and didn't want to change too much on BPv3 to prevent breaking things (no hardware to test)

Feedback and patches welcome.

https://github.com/BusPirate/Bus_Pirate ... s/tag/v7.0


What is the "community firmware"
Dangerous Prototypes seems to have abandoned the Bus Pirate firmware development (and the Bus Pirate v4).  The community firmware includes fixes and cleanups not accepted upstream. The primary target is the Bus Pirate v4, however the Bus Pirate v3 support will be maintained at all costs.


 

Re: Bus Pirate - Community Firmware 7.0

Reply #2
Hi there.
kallisti5, that's really terrific!
This is certainly a great help for all of BP4 owners who finally can make better use of their device, taking off of here a lot of hassle.
Good the idea to support at all costs even BP3 although unfortunately at now it was not possible to compile the firmware for that hardware revision.
Maybe next time, I hope, because I have a BP3.
An awesome job!

Be seeing you.

U.Sb

Re: Bus Pirate - Community Firmware 7.0

Reply #3
1) Bootloader/firmware builds and source code
http://http://dangerousprototypes.com/docs/Bus_Pirate#Download


2) Bootloader/firmware compiling instructions
http://http://dangerousprototypes.com/docs/Compile_the_Bus_Pirate_firmware


3) Bootloader/firmware upgrading instructions
http://http://dangerousprototypes.com/docs/Bus_Pirate#Firmware_upgrades

Re: Bus Pirate - Community Firmware 7.0

Reply #4
Quote
Unfortunately it seems that Dangerous Prototypes have abandoned the Bus Pirate firmware development (and the Bus Pirate v4 also), despite that their official firmware has never reached a truly stable state: the quantity of bug report threads at forums, especially regarding flashrom, is a direct proof of that.

I'm not sure that this is completely true - this was always a DP community project. Whenever asked, the BPv3 was recommended over the BPv4 and the current notation on the Seeed  page clearly states:

"Version 4 is the next generation Bus Pirate hardware, but it's not as stable as Bus Pirate v3."

"If you're just starting out with the Bus Pirate we still recommend v3 - it's cheaper, more reliable, and has all the same major features."

Thanks for the Wiki update - there's so few willing to contribute as you have noticed.

Finally, other than being one of the DP community who has dedicated a substantial amount of time to the Wiki, I'm not otherwise associated with DP. That's just in reference to the "your firmware" remark :)

Re: Bus Pirate - Community Firmware 7.0

Reply #5
[quote author="dpropicweb"]I'm not sure that this is completely true - this was always a DP community project. Whenever asked, the BPv3 was recommended over the BPv4[/quote] I just thought that the best way to underline the difference between "old" and "new" stuff is by putting them in two distinct categories - 1st is "official" (old google code and github) and 2nd is "community" (new github)

Bootloader/Firmware quick upgrade info

Reply #6
1) Bootloader/firmware builds and source code
http://http://dangerousprototypes.com/docs/Bus_Pirate#Download


2) Bootloader/firmware compiling instructions
http://http://dangerousprototypes.com/docs/Compile_the_Bus_Pirate_firmware


3) Bootloader/firmware upgrading instructions
http://http://dangerousprototypes.com/docs/Bus_Pirate#Firmware_upgrades

Re: Bus Pirate - Community Firmware 7.0

Reply #7
Hi, I have a BP3.8 and a BP4.0, I'm very happy to see that you guys are coming up with updates.  I'd like to get my BPs up to the latest software so can someone please point me to the steps to follow, I'm trying to read the instructions but I end up going round in circles.  I downloaded the .hex files and I do own an ICD3 (and other PIC programmers), what do I do now?  Thanks.

[Edit] I followed this link to github https://github.com/BusPirate/Bus_Pirate and then I open the package folder, I see there are BP3, BP4 and bootloader folders but it all looks old, is this the right place for BP3?

For BP4 I went to https://github.com/BusPirate/Bus_Pirate ... s/tag/v7.0 and see that there's a bp4.0-fw-7.0.hex file there.  Can I take this .hex file and load it using the ICSP and Microchip's Intergrated Programming Environment (IPE) tool or do I need the bootloader?

Instructions for BP4

Reply #8
1) Bootloader/firmware builds and source code
http://http://dangerousprototypes.com/docs/Bus_Pirate#Download


2) Bootloader/firmware compiling instructions
http://http://dangerousprototypes.com/docs/Compile_the_Bus_Pirate_firmware


3) Bootloader/firmware upgrading instructions
http://http://dangerousprototypes.com/docs/Bus_Pirate#Firmware_upgrades

Re: Bus Pirate - Community Firmware 7.0

Reply #9
[quote author="Gandalf"]I followed this link to github https://github.com/BusPirate/Bus_Pirate and then I open the package folder, I see there are BP3, BP4 and bootloader folders but it all looks old, is this the right place for BP3?[/quote]
Yes, a package folder contains the very old stuff. Why you need it? You could either take our new files, or (if you don't trust the random internet strangers XD or you just want to try it by yourself) clone this github repository to your local machine, open MPLAB X and look for MPLAB X project files in "BPvX-bootloader" and "Firmware" directories, after that you open a project file, press Run -> Project Configuration -> Bus Pirate v3 or v4 (depends on for what device you want to build) then you could make some more changes to code or project if you want - and then build a bootloader or firmware hex file for testing it on your Bus Pirate

Would be a good thing if you could make a valuable contribution related to Bus Pirate v3 here:
http://https://github.com/BusPirate/Bus_Pirate/issues/7

Re: Bus Pirate - Community Firmware 7.0

Reply #10
MikeB, thanks so much for the detailed response.  I'm getting ready for a trip that will take me away until late Monday night so I won't get to try this out until next week but I will report back and contribute on my progress. Cheers :D

Re: Bus Pirate - Community Firmware 7.0

Reply #11
[quote author="Gandalf"]MikeB, thanks so much for the detailed response.  I'm getting ready for a trip that will take me away until late Monday night so I won't get to try this out until next week but I will report back and contribute on my progress. Cheers :D[/quote]
Finally (many thanks to agatti! - https://github.com/BusPirate/Bus_Pirate/issues/11) we have solved the issues related to new builds. Now you could build your bootloader/firmware at the latest revision of repository and regardless of optimization settings. However, if you need a quick update or maybe would like to compare the optimization effects between the levels, I have produced many builds using the latest version of repository (as of 18092016) and put them to package_latest_18092016.zip archive attached below (SHA1 = 8a256ee9916906ee6cff7716e3fab3b19b81f09f) Contains:
1) BPv3 - different optimization firmware builds only (you could read why - at the bottom of this thread - https://github.com/BusPirate/Bus_Pirate/issues/7 )
2) BPv4 - three directories:
* bootloader - different optimization bootloader builds
* firmware - different optimization firmware builds
* combined - I install bootloader and firmware of the same optimization, and then instantly make a complete backup of PIC24FJ256GB106 internal program memory (it is 256 KB, but because of hex file structure these 256 KB turn into 963,2 KB)

CHECK THE DOWNLOADS AT THE END OF THIS MESSAGE

25.06.2018 UPDATE: Recently I have rebuilt the latest Bus Pirate firmwares and BPv4 bootloader (sorry, have not built a bootloader for v3 because I dont have v3 and it was difficult to figure out, but there are people with BPv3 who have done it, check the last pages of this thread), together with I2C fix by ChristopherSamSoon - https://github.com/BusPirate/Bus_Pirate/pull/93 . I flashed BPv4 opt0 boot + opt0 firmware to my BPv4 and it seems to work OK - and SELFTEST PASSED - but beyond that I haven't tested it much

So if you want a stable stuff - get 18092016 builds, but if you are not afraid of the new stuff - with some old bugs fixed, but also could be some new bugs introduced - you are welcome to try 12062018 builds! Actually they should also be stable, its just I haven't tested them much and could not guarantee ;) 12062018 archive contains all the .hex files in the same directory, as well as sha256sums.txt with their checksums. Could not build a firmware for BPv3 at opt0 and opt3 optimization levels because of not enough space, so for BPv3 its only opt1/op2/optS. Unless you have some special requirements, it is recommended to choose the smallest optimization level, because some not-obvious bugs could happen at the higher levels, maybe only for some particular function. Good luck friends

Full Instruction of how I am upgrading Boot+Firmware of Bus Pirate v4 without buggy pirate-loader, just by using a Pickit2 programmer together with open-source Linux flashing tool pk2cmd - http://http://dangerousprototypes.com/docs/Bus_Pirate_v4_and_Pickit2_(bootloader_and_firmware_updates)

Re: Bus Pirate - Community Firmware 7.0

Reply #12
Hi there.
Thank you very much guys, mikeb daebak!
Just tried new firmware v7.0 on my Bus Pirate revision 3 (v3.6).
Waiting for the new one I left the original bootloader (Bootloader v4.4).
Some thought.
 
First:
From cmd in Windows 10 "pirate-loader" gives me this warning
+++++++++++++++++++++++++++++++++++++++++++
  Pirate-Loader for BP with Bootloader v4+
  Loader version: 1.0.2  OS: WINDOWS
+++++++++++++++++++++++++++++++++++++++++++
 
Parsing HEX file [bpv3_fw7.0_optS_16092016.hex]
Checksum does not match, line 4
Could not load HEX file, result=-1

 
This is because the compiled HEX file is lowercase.
I fixed the issue by converting it in uppercase.
(viewtopic.php?f=28&t=6097#p56816)
 
Second:
By using the uppercase HEX file I have converted I can upgrade my Bus Pirate v3.6 but due old bootloader I get
 
...
Erasing page 42, a800...ERROR [50]
 
Error updating firmware

 
That is because bootloader protection.
(http://dangerousprototypes.eu/forum/vie ... 3877#p3873)
 
Third:
For what I think is the same reason for the second point, "ds30 Loader GUI" gives to me a warning about the possibility of overwriting the bootloader:
 
Parsing hex-file...
      Validating hex-file...ok
      The hex-file contains code that will overwrite the bootloader
      Hex-file successfully parsed
 
      18579 program words found in 294 rows
      0 eeprom words found
      0 config words found
 
Fourth:
By issuing "i" in the terminal I get
 
Bus Pirate v3.5
Community Firmware v7.0 - goo.gl/gCzQnW [HiZ UART I2C SPI] Bootloader v4.4
DEVID:0x0447 REVID:0x3046 (24FJ64GA002 B8)
http://dangerousprototypes.com
 
So by performing the self test (~) I get no errors but when terminal shows that MODE and VREG LEDs should be on, actually the first (MODE) it is and the second (VREG) does not.
 
$ (Jump to bootloader) command does work
 
s (Script engine) does not work,  it provides a "Syntax error at char 1" message
 
# (Reset the BP) does work and it shows the message "RESET"
 
Hoping this can help.
Be seeing you.
 
U.Sb

Re: Bus Pirate - Community Firmware 7.0

Reply #13
[quote author="USBEprom"]By using the uppercase HEX file I have converted I can upgrade my Bus Pirate v3.6 but due to old bootloader I get ...
Erasing page 42, a800...ERROR [50]
Error updating firmware

That is because bootloader protection
(http://dangerousprototypes.eu/forum/vie ... 3877#p3873)
[/quote]
Not sure if that is really a bootloader protection, to me it seems more to be just a buggy process of firmware updating:
1) if its a protection it should be failing on the same addresses, but for me it could fail on any address
2) if its a protection it should always "protect" (block). however, if I try about 10 times I "bypass" it XD

[quote author="USBEprom"]For what I think is the same reason for the second point, "ds30 Loader GUI" gives to me a warning about the possibility of overwriting the bootloader[/quote]
Initially I thought that some non-essential section of bootloader got overwritten (.debug/.comment),
but how it determined a location of bootloader if you haven't told it? So most likely it was just a false positive

[quote author="USBEprom"]Fourth:[/quote]
Please could you tell, what exact version of 7.0 you are using, and with what optimization?
Sadly I have no ability to test BPv3 (only have BPv4), so I produce BPv3 builds without any testing at all...
Optimization is cool, but sometimes it could cause issues like this - https://github.com/BusPirate/Bus_Pirate/issues/10 (endless loop because of incorrect compiler optimization, got fixed here thanks to agatti and LED blinking approach - https://github.com/BusPirate/Bus_Pirate/issues/11 ) After you add this information below you could point to it by adding a link to this issue - https://github.com/BusPirate/Bus_Pirate/issues/7

Thank you for detailed report, hopefully you could join us in the debugging quest ;)

Re: Bus Pirate - Community Firmware 7.0

Reply #14
Hi there.
 
[quote author="mikeb"]
Not sure if that is really a bootloader protection, to me it seems more to be just a buggy process of firmware updating:
1) if its a protection it should be failing on the same addresses, but for me it could fail on any address
2) if its a protection it should always "protect" (block). however, if I try about 10 times I "bypass" it XD
[/quote]
 
mikeb, I know nothing but what is here:
http://dangerousprototypes.eu/forum/vie ... =3877#p387
Sorry.
You wrote that by trying about 10 times you "bypass" it, how?
I'm babo, you know.
However the message does not seem to hinder the proper functioning.
 
[quote author="mikeb"]
Initially I thought that some non-essential section of bootloader got overwritten (.debug/.comment),
but how it determined a location of bootloader if you haven't told it? So most likely it was just a false positive
[/quote]
 
Normally I do not use "ds30 Loader GUI", I used it only for test.
Know nothing but into the program is possible to flag "write program" and "write eeprom" hence I expect inside the code a some sort of watchdog.
 
[quote author="mikeb"]
Please could you tell, what exact version of 7.0 you are using, and with what optimization?
Sadly I have no ability to test BPv3 (only have BPv4), so I produce BPv3 builds without any testing at all...
Optimization is cool, but sometimes it could cause issues like this - https://github.com/BusPirate/Bus_Pirate/issues/10 (endless loop because of incorrect compiler optimization, got fixed here thanks to agatti and LED blinking approach - https://github.com/BusPirate/Bus_Pirate/issues/11 ) After you add this information below you could point to it by adding a link to this issue - https://github.com/BusPirate/Bus_Pirate/issues/7
 
Thank you for detailed report, hopefully you could join us in the debugging quest ;)[/quote]
 
Okay, so I have tested them all.
Here you go:
 
bpv3_fw7.0_opt0_16092016.hex
 
Writing page 41 row 334, a700...OK
Writing page 41 row 335, a780...OK
Erasing page 42, a800...ERROR [50]
 
Error updating firmware :(
 
HiZ>i
Bus Pirate v3.5
Community Firmware v7.0 - goo.gl/gCzQnW [HiZ UART I2C SPI] Bootloader v4.4
DEVID:0x0447 REVID:0x3046 (24FJ64GA002 B8)
http://dangerousprototypes.com
HiZ>~
Disconnect any devices
Connect (Vpu to +5V) and (ADC to +3.3V)
Space to continue
Ctrl
AUX OK
MODE LED OK
PULLUP H OK
PULLUP L OK
VREG OK
ADC and supply
5V(4.94) OK
VPU(5.03) OK
3.3V(3.31) OK
ADC(3.34) OK
Bus high
MOSI OK
CLK OK
MISO OK
CS OK
Bus Hi-Z 0
MOSI OK
CLK OK
MISO OK
CS OK
Bus Hi-Z 1
MOSI OK
CLK OK
MISO OK
CS OK
MODE and VREG LEDs should be on! [FAIL: VREG DOES NOT LIGHT]
Any key to exit
Found 0 errors.
HiZ>#
RESET
 
Bus Pirate v3.5
Community Firmware v7.0 - goo.gl/gCzQnW [HiZ UART I2C SPI] Bootloader v4.4
DEVID:0x0447 REVID:0x3046 (24FJ64GA002 B8)
http://dangerousprototypes.com
HiZ>s
Syntax error at char 1

HiZ>$
Are you sure? y
BOOTLOADER
[/b]
 
----------------------
 
bpv3_fw7.0_opt1_16092016.hex
 
Writing page 41 row 334, a700...OK
Writing page 41 row 335, a780...OK
Erasing page 42, a800...ERROR [50]
 
Error updating firmware :(
 
HiZ>i
Bus Pirate v3.5
Community Firmware v7.0 - goo.gl/gCzQnW [HiZ UART I2C SPI] Bootloader v4.4
DEVID:0x0447 REVID:0x3046 (24FJ64GA002 B8)
http://dangerousprototypes.com
HiZ>~
Disconnect any devices
Connect (Vpu to +5V) and (ADC to +3.3V)
Space to continue
Ctrl
AUX OK
MODE LED OK
PULLUP H OK
PULLUP L OK
VREG OK
ADC and supply
5V(4.94) OK
VPU(5.03) OK
3.3V(3.31) OK
ADC(3.34) OK
Bus high
MOSI OK
CLK OK
MISO OK
CS OK
Bus Hi-Z 0
MOSI OK
CLK OK
MISO OK
CS OK
Bus Hi-Z 1
MOSI OK
CLK OK
MISO OK
CS OK
MODE and VREG LEDs should be on! [FAIL: VREG DOES NOT LIGHT]
Any key to exit
Found 0 errors.
HiZ>#
RESET
 
Bus Pirate v3.5
Community Firmware v7.0 - goo.gl/gCzQnW [HiZ UART I2C SPI] Bootloader v4.4
DEVID:0x0447 REVID:0x3046 (24FJ64GA002 B8)
http://dangerousprototypes.com
HiZ>s
Syntax error at char 1

HiZ>$
Are you sure? y
BOOTLOADER
[/b]
 
----------------------
 
bpv3_fw7.0_opt2_16092016.hex
 
Writing page 41 row 334, a700...OK
Writing page 41 row 335, a780...OK
Erasing page 42, a800...ERROR [50]
 
Error updating firmware :(
 
HiZ>i
Bus Pirate v3.5
Community Firmware v7.0 - goo.gl/gCzQnW [HiZ UART I2C SPI] Bootloader v4.4
DEVID:0x0447 REVID:0x3046 (24FJ64GA002 B8)
http://dangerousprototypes.com
HiZ>~
Disconnect any devices
Connect (Vpu to +5V) and (ADC to +3.3V)
Space to continue
Ctrl
AUX OK
MODE LED OK
PULLUP H OK
PULLUP L OK
VREG OK
ADC and supply
5V(4.94) OK
VPU(5.03) OK
3.3V(3.31) OK
ADC(3.34) OK
Bus high
MOSI OK
CLK OK
MISO OK
CS OK
Bus Hi-Z 0
MOSI OK
CLK OK
MISO OK
CS OK
Bus Hi-Z 1
MOSI OK
CLK OK
MISO OK
CS OK
MODE and VREG LEDs should be on! [FAIL: VREG DOES NOT LIGHT]
Any key to exit
Found 0 errors.
HiZ>#
RESET
 
Bus Pirate v3.5
Community Firmware v7.0 - goo.gl/gCzQnW [HiZ UART I2C SPI] Bootloader v4.4
DEVID:0x0447 REVID:0x3046 (24FJ64GA002 B8)
http://dangerousprototypes.com
HiZ>s
Syntax error at char 1

HiZ>$
Are you sure? y
BOOTLOADER
[/b]
 
----------------------
 
bpv3_fw7.0_optS_16092016.hex
 
Writing page 41 row 334, a700...OK
Writing page 41 row 335, a780...OK
Erasing page 42, a800...ERROR [50]
 
Error updating firmware :(
 
HiZ>i
Bus Pirate v3.5
Community Firmware v7.0 - goo.gl/gCzQnW [HiZ UART I2C SPI] Bootloader v4.4
DEVID:0x0447 REVID:0x3046 (24FJ64GA002 B8)
http://dangerousprototypes.com
HiZ>~
Disconnect any devices
Connect (Vpu to +5V) and (ADC to +3.3V)
Space to continue
Ctrl
AUX OK
MODE LED OK
PULLUP H OK
PULLUP L OK
VREG OK
ADC and supply
5V(4.94) OK
VPU(5.03) OK
3.3V(3.31) OK
ADC(3.34) OK
Bus high
MOSI OK
CLK OK
MISO OK
CS OK
Bus Hi-Z 0
MOSI OK
CLK OK
MISO OK
CS OK
Bus Hi-Z 1
MOSI OK
CLK OK
MISO OK
CS OK
MODE and VREG LEDs should be on! [FAIL: VREG DOES NOT LIGHT]
Any key to exit
Found 0 errors.
HiZ>#
RESET
 
Bus Pirate v3.5
Community Firmware v7.0 - goo.gl/gCzQnW [HiZ UART I2C SPI] Bootloader v4.4
DEVID:0x0447 REVID:0x3046 (24FJ64GA002 B8)
http://dangerousprototypes.com
HiZ>s
Syntax error at char 1

HiZ>$
Are you sure? y
BOOTLOADER
[/b]
 
Hoping that are useful.
Be seeing you.
 
U.Sb