Bus Pirate - Community Firmware 7.0

Bus Pirate firmware and hardware development.

Bus Pirate - Community Firmware 7.0

Postby kallisti5 » Sat Aug 13, 2016 2:44 pm

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.
kallisti5
Newbie
Newbie
 
Posts: 11
Joined: Mon Sep 17, 2012 11:29 pm

Re: Bus Pirate - Community Firmware 7.0

Postby dpropicweb » Sat Aug 13, 2016 4:45 pm

Could you update the Wiki documentation too so people can find the update(s) ? See http://dangerousprototypes.com/docs/Bus ... irate_v4.x
dpropicweb
Sr. Member
Sr. Member
 
Posts: 331
Joined: Thu Apr 22, 2010 5:44 am
Location: The LAN Downunder

Re: Bus Pirate - Community Firmware 7.0

Postby USBEprom » Sun Aug 14, 2016 4:16 am

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
USBEprom
Full Member
Full Member
 
Posts: 129
Joined: Wed Mar 14, 2012 4:09 pm

Re: Bus Pirate - Community Firmware 7.0

Postby mikeb » Fri Sep 09, 2016 8:41 am

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


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


3) Bootloader/firmware upgrading instructions
http://dangerousprototypes.com/docs/Bus_Pirate#Firmware_upgrades
Last edited by mikeb on Tue Sep 20, 2016 1:34 pm, edited 7 times in total.
mikeb
Newbie
Newbie
 
Posts: 30
Joined: Fri Sep 09, 2016 2:50 am

Re: Bus Pirate - Community Firmware 7.0

Postby dpropicweb » Fri Sep 09, 2016 4:08 pm

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 :)
dpropicweb
Sr. Member
Sr. Member
 
Posts: 331
Joined: Thu Apr 22, 2010 5:44 am
Location: The LAN Downunder

Re: Bus Pirate - Community Firmware 7.0

Postby mikeb » Fri Sep 09, 2016 7:37 pm

dpropicweb wrote: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
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)
Last edited by mikeb on Mon Sep 19, 2016 10:29 am, edited 4 times in total.
mikeb
Newbie
Newbie
 
Posts: 30
Joined: Fri Sep 09, 2016 2:50 am

Bootloader/Firmware quick upgrade info

Postby mikeb » Sat Sep 10, 2016 7:26 pm

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


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


3) Bootloader/firmware upgrading instructions
http://dangerousprototypes.com/docs/Bus_Pirate#Firmware_upgrades
Last edited by mikeb on Tue Sep 20, 2016 1:34 pm, edited 15 times in total.
mikeb
Newbie
Newbie
 
Posts: 30
Joined: Fri Sep 09, 2016 2:50 am

Re: Bus Pirate - Community Firmware 7.0

Postby Gandalf » Wed Sep 14, 2016 12:13 pm

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?
Gandalf
Newbie
Newbie
 
Posts: 4
Joined: Fri Aug 22, 2014 1:01 pm

Instructions for BP4

Postby mikeb » Thu Sep 15, 2016 5:11 am

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


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


3) Bootloader/firmware upgrading instructions
http://dangerousprototypes.com/docs/Bus_Pirate#Firmware_upgrades
Last edited by mikeb on Tue Sep 20, 2016 1:33 pm, edited 4 times in total.
mikeb
Newbie
Newbie
 
Posts: 30
Joined: Fri Sep 09, 2016 2:50 am

Re: Bus Pirate - Community Firmware 7.0

Postby mikeb » Thu Sep 15, 2016 5:34 am

Gandalf wrote: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?

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:
https://github.com/BusPirate/Bus_Pirate/issues/7
mikeb
Newbie
Newbie
 
Posts: 30
Joined: Fri Sep 09, 2016 2:50 am

Re: Bus Pirate - Community Firmware 7.0

Postby Gandalf » Thu Sep 15, 2016 10:47 am

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
Gandalf
Newbie
Newbie
 
Posts: 4
Joined: Fri Aug 22, 2014 1:01 pm

Re: Bus Pirate - Community Firmware 7.0

Postby mikeb » Fri Sep 16, 2016 7:16 pm

Gandalf wrote: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

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)
Attachments
package_latest_18092016.zip
SHA1 = 8a256ee9916906ee6cff7716e3fab3b19b81f09f
(1.33 MiB) Downloaded 844 times
Last edited by mikeb on Mon Sep 19, 2016 9:04 am, edited 8 times in total.
mikeb
Newbie
Newbie
 
Posts: 30
Joined: Fri Sep 09, 2016 2:50 am

Re: Bus Pirate - Community Firmware 7.0

Postby USBEprom » Sat Sep 17, 2016 4:23 pm

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
USBEprom
Full Member
Full Member
 
Posts: 129
Joined: Wed Mar 14, 2012 4:09 pm

Re: Bus Pirate - Community Firmware 7.0

Postby mikeb » Sat Sep 17, 2016 6:53 pm

USBEprom wrote: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)

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

USBEprom wrote: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

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

USBEprom wrote:Fourth:

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 ;)
mikeb
Newbie
Newbie
 
Posts: 30
Joined: Fri Sep 09, 2016 2:50 am

Re: Bus Pirate - Community Firmware 7.0

Postby USBEprom » Sun Sep 18, 2016 8:35 am

Hi there.

mikeb wrote: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


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.

mikeb wrote: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


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.

mikeb wrote: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 ;)


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


----------------------

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


----------------------

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


----------------------

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


Hoping that are useful.
Be seeing you.

U.Sb
USBEprom
Full Member
Full Member
 
Posts: 129
Joined: Wed Mar 14, 2012 4:09 pm

Next

Return to Bus Pirate Development