Dangerous Prototypes

Dangerous Prototypes => Bus Pirate Development => Topic started by: kallisti5 on August 13, 2016, 09:44:10 pm

Title: Bus Pirate - Community Firmware 7.0
Post by: kallisti5 on August 13, 2016, 09:44:10 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 (https://github.com/BusPirate/Bus_Pirate/releases/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.
Title: Re: Bus Pirate - Community Firmware 7.0
Post by: dpropicweb on August 13, 2016, 11:45:01 pm
Could you update the Wiki documentation too so people can find the update(s) ? See http://dangerousprototypes.com/docs/Bus ... irate_v4.x (http://dangerousprototypes.com/docs/Bus_Pirate#Bus_Pirate_v4.x)
Title: Re: Bus Pirate - Community Firmware 7.0
Post by: USBEprom on August 14, 2016, 11:16:57 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
Title: Re: Bus Pirate - Community Firmware 7.0
Post by: mikeb on September 09, 2016, 03:41:58 pm
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
Title: Re: Bus Pirate - Community Firmware 7.0
Post by: dpropicweb on September 09, 2016, 11:08:43 pm
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 :)
Title: Re: Bus Pirate - Community Firmware 7.0
Post by: mikeb on September 10, 2016, 02:37:35 am
[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)
Title: Bootloader/Firmware quick upgrade info
Post by: mikeb on September 11, 2016, 02:26:20 am
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
Title: Re: Bus Pirate - Community Firmware 7.0
Post by: Gandalf on September 14, 2016, 07:13:41 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 (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 (https://github.com/BusPirate/Bus_Pirate/releases/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?
Title: Instructions for BP4
Post by: mikeb on September 15, 2016, 12:11:16 pm
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
Title: Re: Bus Pirate - Community Firmware 7.0
Post by: mikeb on September 15, 2016, 12:34:49 pm
[quote author="Gandalf"]I followed this link to github https://github.com/BusPirate/Bus_Pirate (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
Title: Re: Bus Pirate - Community Firmware 7.0
Post by: Gandalf on September 15, 2016, 05:47:36 pm
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
Title: Re: Bus Pirate - Community Firmware 7.0
Post by: mikeb on September 17, 2016, 02:16:26 am
[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 (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 (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 (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)
Title: Re: Bus Pirate - Community Firmware 7.0
Post by: USBEprom on September 17, 2016, 11:23:15 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 (http://dangerousprototypes.com/forum/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 (http://dangerousprototypes.eu/forum/viewtopic.php?f=28&t=447&p=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 (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
Title: Re: Bus Pirate - Community Firmware 7.0
Post by: mikeb on September 18, 2016, 01:53:50 am
[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 (http://dangerousprototypes.eu/forum/viewtopic.php?f=28&t=447&p=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 (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 (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 (https://github.com/BusPirate/Bus_Pirate/issues/7)

Thank you for detailed report, hopefully you could join us in the debugging quest ;)
Title: Re: Bus Pirate - Community Firmware 7.0
Post by: USBEprom on September 18, 2016, 03:35:14 pm
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 (http://dangerousprototypes.eu/forum/viewtopic.php?f=28&t=447&p=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 (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 (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 (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 (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 (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 (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 (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 (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 (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 (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 (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
Title: Re: Bus Pirate - Community Firmware 7.0
Post by: mikeb on September 18, 2016, 06:47:44 pm
[quote author="USBEprom"]You wrote that by trying about 10 times you "bypass" it, how?[/quote]
I am doing it the same way as this person - viewtopic.php?f=40&t=7527#p62521 (http://dangerousprototypes.com/forum/viewtopic.php?f=40&t=7527#p62521)
Use pirate-loader command, if it doesn't work then click "Normal" and "Reset" buttons a few times randomly,
then try again and repeat trying until it works. Usually it takes many tries but eventually does work
So if it is indeed a protection, it is not 100% secure ;-)
However BPv3 does not have these hardware buttons, so this way could be tried only for BPv4.
Still it is much faster to just use a chinese Pickit2 clone since it cost just a fraction of Bus Pirate cost
https://www.aliexpress.com/wholesale?mi ... atId=0&g=y (https://www.aliexpress.com/wholesale?minPrice=7&maxPrice=&isBigSale=n&isFreeShip=y&isFavorite=n&isRtl=n&isLocalReturn=n&isMobileExclusive=n&shipFromCountry=&shipCompanies=&SearchText=pickit+2&CatId=0&g=y)

[quote author="USBEprom"]Normally I do not use "ds30 Loader GUI", I used it only for test[/quote]
I never used it at all :) So you know more than me about it

[quote author="USBEprom"]Okay, so I have tested them all. Here you go:[/quote]
Thank you. So it seems that all the builds are producing the same results:
1) 0 errors during the selftest and jumps to bootloaders successfully
2) s command gives "Syntax error at char 1"
3) VREG led does not light at the end of the test

Please tell, have you tried repeating "s" command after reset?
Does this "syntax error" problem happens every time you press "s", or only at the first try?

About VREG: have you seen this LED working at least sometimes?
Just want to exclude a possibility that VREG led is faulty on your board
Title: Re: Bus Pirate - Community Firmware 7.0
Post by: USBEprom on September 18, 2016, 09:15:42 pm
Hi mikeb.
 
[quote author="mikeb"]I am doing it the same way as this person - viewtopic.php?f=40&t=7527#p62521 (http://dangerousprototypes.com/forum/viewtopic.php?f=40&t=7527#p62521)
Use pirate-loader command, if it doesn't work then click "Normal" and "Reset" buttons a few times randomly,
then try again and repeat trying until it works. Usually it takes many tries but eventually does work
So if it is indeed a protection, it is not 100% secure ;-)
However BPv3 does not have these hardware buttons, so this way could be tried only for BPv4.
Still it is much faster to just use a chinese Pickit2 clone since it cost just a fraction of Bus Pirate cost
https://www.aliexpress.com/wholesale?mi ... atId=0&g=y (https://www.aliexpress.com/wholesale?minPrice=7&maxPrice=&isBigSale=n&isFreeShip=y&isFavorite=n&isRtl=n&isLocalReturn=n&isMobileExclusive=n&shipFromCountry=&shipCompanies=&SearchText=pickit+2&CatId=0&g=y)[/quote]
 
Okay, thanks.
I get it now.
Even if I purchase a Pickit2 then I would not know how to use it, sorry.
 
[quote author="mikeb"]I never used it at all :) So you know more than me about it[/quote]
 
Actually I know nothing more, I used it only for testing.
 
[quote author="mikeb"]Thank you. So it seems that all the builds are producing the same results:
1) 0 errors during the selftest and jumps to bootloaders successfully
2) s command gives "Syntax error at char 1"
3) VREG led does not light at the end of the test[/quote]
 
Yes, it is so.
 
[quote author="mikeb"]Please tell, have you tried repeating "s" command after reset?[/quote]
 
Yes, I did it.
 
[quote author="mikeb"]Does this "syntax error" problem happens every time you press "s", or only at the first try?[/quote]
 
For what I saw always, not only at the first time.
 
[quote author="mikeb"]About VREG: have you seen this LED working at least sometimes?[/quote]
 
By using v7.0 firmware I have not ever seen it to glow.
 
[quote author="mikeb"]Just want to exclude a possibility that VREG led is faulty on your board[/quote]
 
Totally, VREG led on my Bus Pirate is not faulty.
It works fine with the spi_fix.hex firmware released by tayken in the forum.
 
Thank you friend.
Be seeing you.
 
U.Sb
Title: Re: Bus Pirate - Community Firmware 7.0
Post by: mikeb on September 18, 2016, 09:29:17 pm
[quote author="USBEprom"]Totally, VREG led on my Bus Pirate is not faulty[/quote]

Hi USBEprom, sorry for not writing it earlier (a lot of distractions).
agatti solved a problem with VREG light and also explained why 's' doesn't work for you currently
Please see - https://github.com/BusPirate/Bus_Pirate/issues/7 (https://github.com/BusPirate/Bus_Pirate/issues/7)

I am rebuilding these builds now, would upload, see you soon friend ;)
Title: Re: Bus Pirate - Community Firmware 7.0
Post by: mikeb on September 19, 2016, 01:39:48 am
[quote author="USBEprom"]Be seeing you[/quote]
Hi again! Archive with new builds is now attached to this post:
viewtopic.php?f=28&t=8498#p65290 (http://dangerousprototypes.com/forum/viewtopic.php?f=28&t=8498#p65290)
Below is another archive with the builds special for you - maximum number of features (including BASIC) :
./Bus_Pirate/Firmware/configuration.h, lines 304-319
Code: [Select]
#ifdef BUSPIRATEV3
#define BP_ENABLE_1WIRE_SUPPORT // <--- + enabled
#define BP_ENABLE_BASIC_SUPPORT // <--- + enabled
#define BP_ENABLE_DIO_SUPPORT // <--- + enabled
#undef BP_ENABLE_HD44780_SUPPORT
#define BP_ENABLE_I2C_SUPPORT
#define BP_ENABLE_JTAG_SUPPORT
#undef BP_ENABLE_PIC_SUPPORT
#undef BP_ENABLE_PC_AT_KEYBOARD_SUPPORT
#define BP_ENABLE_RAW_2WIRE_SUPPORT // <--- + enabled
#define BP_ENABLE_RAW_3WIRE_SUPPORT // <--- + enabled
#define BP_ENABLE_SMPS_SUPPORT // <--- + enabled
#define BP_ENABLE_SPI_SUPPORT
#define BP_ENABLE_SUMP_SUPPORT
#define BP_ENABLE_UART_SUPPORT
#endif /* BUSPIRATEV3 */
Could build only 3 builds:
opt1 (84% occupied),
opt2 (94% occupied, faster speed),
optS (77% occupied, slower speed)
Title: Re: Bus Pirate - Community Firmware 7.0
Post by: Sjaak on September 19, 2016, 11:22:46 am
Regarding the bootloader. It is designed to protect itself from being overwritten. The bootloader resides in the last flashblock of the pic. This is intended behaviour and not a bug :)

To get rid of this error export the whole flash minus the last flashblock (IIRC the modified linkerscript took care of that). The bootloader makes sure the jump in the beginning get overwritten with a jump to the bootloader and the original start adres gets written to the last word in the available space.
Title: Re: Bus Pirate - Community Firmware 7.0
Post by: USBEprom on September 19, 2016, 09:21:51 pm
Hi mikeb.
Thank you very much for the updates that you are releasing!
Many thanks to agatti too and kallisti5 and all the guys in the project.
I had a look to v7.0 forum but honestly I understood very few things.
I am just a hobbyist, not a software engineer.
The only thing I can do is perhaps help with debug, perhaps...
I am sorry,  no more.
I tested both the new releases.
Here you go.
 
bpv3_fw7.0_opt0_18092016.hex
bpv3_fw7.0_opt1_18092016.hex
bpv3_fw7.0_opt2_18092016.hex
bpv3_fw7.0_optS_18092016.hex
 
First I have converted them into uppercase in order to use pirate-loader for the upgrade, then I upgrade my Bus Pirate 3.6 with them all.
For each of them I got the error message that I have already written:
 
Writing page 41 row 334, a700...OK
Writing page 41 row 335, a780...OK
Erasing page 42, a800...ERROR [50]
 
Error updating firmware :(
 
Based on your explanation and the one of agatti and of others, seems to not be a problem.
So okay.
 
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 (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! [OKAY: VREG DOES 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 (http://dangerousprototypes.com)
HiZ>s
Syntax error at char 1

HiZ>$
Are you sure? y
BOOTLOADER
[/b]
 
This time for them all the self test works fine and the VREG led glow.
Basic still doesn't works but I have understood it is because purposely deactivated in the firmware.
 
Based on some bugs listed here viewtopic.php?f=28&t=6097 (http://dangerousprototypes.com/forum/viewtopic.php?f=28&t=6097), I have digged more deeply.
So,
 
HiZ>b
Set serial port speed: (bps)
 1. 300
 2. 1200
 3. 2400
 4. 4800
 5. 9600
 6. 19200
 7. 38400
 8. 57600
 9. 115200
10. BRG raw value
 
(9)>10
Enter raw value for BRG
 
(34)>8
Adjust your terminal
Space to continue
 
It works!
 
For what I know up to 255 characters of syntax may be entered into the Bus Pirate terminal at once.
I have tried but with them all the firmwares only 127 characters seems to be accepted, the extra ones are rejected (in the terminal the rejected characters are shown like not ascii).[/color]
 
I have not an oscilloscope so I can not say if SPI protocol is okay or still has the MOSI problems (viewtopic.php?f=4&t=6667#p58785 (http://dangerousprototypes.com/forum/viewtopic.php?f=4&t=6667#p58785)) fixed by tayken doing correction of typo found by luftek (viewtopic.php?f=4&t=6667&start=15#p59041 (http://dangerousprototypes.com/forum/viewtopic.php?f=4&t=6667&start=15#p59041))
 
I can not test if the i2c timeout problem has been fixed or not (viewtopic.php?f=4&t=8546 (http://dangerousprototypes.com/forum/viewtopic.php?f=4&t=8546)).
 
Last but not least, the software flashrom_v0.9.9_Win does work!
 
----------------------
 
bpv3_fw7.0_opt1_features.hex
bpv3_fw7.0_opt2_features.hex
bpv3_fw7.0_optS_features.hex
 
First I have converted them into uppercase in order to use pirate-loader for the upgrade, then I upgrade my Bus Pirate 3.6 with them all.
For each of them I got the error message that I have already written:
 
Writing page 41 row 334, a700...OK
Writing page 41 row 335, a780...OK
Erasing page 42, a800...ERROR [50]
 
Error updating firmware :(
 
Based on yours explanation and the one of agatti and of others, seems to not be a problem.
So okay.
 
HiZ>i
Bus Pirate v3.5
Community Firmware v7.0 - goo.gl/gCzQnW [HiZ 1-WIRE UART I2C SPI 2WIRE 3WIRE DIO] Bootloader v4.4
DEVID:0x0447 REVID:0x3046 (24FJ64GA002 B8)
http://dangerousprototypes.com (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! [OKAY: VREG DOES LIGHT]
Any key to exit[/b]
Found 0 errors.[/b]
HiZ>#
RESET
 
Bus Pirate v3.5
Community Firmware v7.0 - goo.gl/gCzQnW [HiZ 1-WIRE UART I2C SPI 2WIRE 3WIRE DIO] Bootloader v4.4
DEVID:0x0447 REVID:0x3046 (24FJ64GA002 B8)
http://dangerousprototypes.com (http://dangerousprototypes.com)
HiZ>s[/b]
HiZ(BASIC)>exit    (now it is active and working)[/b]
Ready[/b]
HiZ>$
Are you sure? y
BOOTLOADER
[/b]
 
This time for them all the self test works fine and the VREG led glow.
Basic too now works, I have understood it is because purposely activated in the firmware.
 
Seems that DIO does not work.
Bus Pirate v3.5
Community Firmware v7.0 - goo.gl/gCzQnW [HiZ 1-WIRE UART I2C SPI 2WIRE 3WIRE DIO] Bootloader v4.4
DEVID:0x0447 REVID:0x3046 (24FJ64GA002 B8)
http://dangerousprototypes.com (http://dangerousprototypes.com)
HiZ>m
1. HiZ
2. 1-WIRE
3. UART
4. I2C
5. SPI
6. 2WIRE
7. 3WIRE
8. DIO
x. exit(without change)
 
(1)>8
ERROR: command has no effect here
Clutch disengaged!!!
To finish setup, start up the power supplies with command 'W'
 
Ready
Syntax error at char 2
DIO>
 
But honestly I do not even understand how test it, sorry.
 
Based on some bugs listed here viewtopic.php?f=28&t=6097 (http://dangerousprototypes.com/forum/viewtopic.php?f=28&t=6097), I have digged more deeply.
So,
 
HiZ>b
Set serial port speed: (bps)
 1. 300
 2. 1200
 3. 2400
 4. 4800
 5. 9600
 6. 19200
 7. 38400
 8. 57600
 9. 115200
10. BRG raw value
 
(9)>10
Enter raw value for BRG
 
(34)>8
Adjust your terminal
Space to continue
 
It works!
 
MACRO(1) and MACRO(2) in 2WIRE protocol they do not work.
For what I can understand MACRO(1) fails due a wrong order in the lsb/MSB of the emitted bytes.
Also MACRO(2) fails but I do not know why, perhaps for the same reason of MACRO(1).
 
For what I know up to 255 characters of syntax may be entered into the Bus Pirate terminal at once.
I have tried but with them all the firmwares only 127 characters seems to be accepted, the extra ones are rejected (in the terminal that rejected characters are shown like not ascii)[/color]
 
I have not an oscilloscope so I can not say if SPI protocol is okay or still has the MOSI problems (viewtopic.php?f=4&t=6667#p58785 (http://dangerousprototypes.com/forum/viewtopic.php?f=4&t=6667#p58785)) fixed by tayken doing correction of typo found by luftek (viewtopic.php?f=4&t=6667&start=15#p59041 (http://dangerousprototypes.com/forum/viewtopic.php?f=4&t=6667&start=15#p59041))
 
I can not test if the i2c timeout problem has been fixed or not (viewtopic.php?f=4&t=8546 (http://dangerousprototypes.com/forum/viewtopic.php?f=4&t=8546))
 
Last but not least, the software flashrom_v0.9.9_Win does work!
 
I have to admit that this "features" release of the revision 7.0 of the firmware for the Bus Pirate is a dream having the full features, in my opinion the best one!
My most sincere congratulations for it, I was waiting it for years!

Due your indication as for knowledge I will enter all this informations in the development forum of the v7.0 firmware for the Bus Pirate.
Maybe that can help.
Hoping those are useful.
Thank you friend!
 
Be seeing you.
 
U.Sb
Title: Re: Bus Pirate - Community Firmware 7.0
Post by: mikeb on September 20, 2016, 01:52:37 am
Hi friends! I have spent the whole day updating the Dangerous Prototypes wiki,
moving info from this thread --> converting to wiki format --> adding some new things.
All the links could be found at the 1st page of this thread

[quote author="USBEprom"]BASIC... it is because purposely deactivated in the firmware...[/quote]
Yes its true. in this context, "#undef" means disabled and "#define" means enabled

[quote author="USBEprom"]
For what I know up to 255 characters of syntax may be entered into the Bus Pirate terminal at once.
I have tried but with them all the firmwares only 127 characters seems to be accepted, the extra ones are rejected (in the terminal the rejected characters are shown like not ascii).[/color]
[/quote]

If you look at the same file:
./Bus_Pirate/Firmware/configuration.h, lines 496-505
Code: [Select]
/**
 * How big the serial command buffer can be, in bytes.
 *
 * @warning This must be set to a power of two, ie. 256, 128, 64, 32, etc.
 */
#ifdef BUSPIRATEV3
#define BP_COMMAND_BUFFER_SIZE 128
#else
#define BP_COMMAND_BUFFER_SIZE 256
#endif /* BUSPIRATEV3 */
so BPv4 gets 256 by default, while BPv3 - only 128.
I don't know what is a reason behind this difference... but if you need 256 or bigger - just tell me,
or you could download the whole source code, make this modification and compile it by yourself
(also don't forget to enable these features like I did - see message above - or you wouldn't have them)

[quote author="USBEprom"]I have not an oscilloscope so I can not say if SPI protocol is okay or still has the MOSI problems[/quote]
I can't test it too, but if we look through this thread it seems that this problem was fixed after v6.3-beta1 r2151, so it should not happen with our newer v7.0 firmware

[quote author="USBEprom"]I can not test if the i2c timeout problem has been fixed or not (viewtopic.php?f=4&t=8546 (http://dangerousprototypes.com/forum/viewtopic.php?f=4&t=8546))[/quote]

There were no coding action regarding this thread, partially because we are still unsure if this timeout was a Bus Pirate fault or other problem. If we are unsure about problem, we cannot fix it

[quote author="USBEprom"]Last but not least, the software flashrom_v0.9.9_Win does work![/quote]

Very good :)

[quote author="USBEprom"]DIO... 2WIRE...[/quote]

Sorry but I never used these functions on practice so can't understand what's up about them ;)

See you soon
Title: Re: Bus Pirate - Community Firmware 7.0
Post by: dpropicweb on September 20, 2016, 03:26:09 am
> so BPv4 gets 256 by default, while BPv3 - only 128.
> I don't know what is a reason behind this difference... but if you need 256 or bigger - just tell me,
> or you could download the whole source code, make this modification and compile it by yourself

The BPv4 has 16Kb of memory, but the BPv3 has 8Kb. This probably explains the difference. Whether or not there is sufficient memory in the BPv3 to increase the buffer size and not affect other functions is unknown (by me anyway).
Title: Re: Bus Pirate - Community Firmware 7.0
Post by: USBEprom on September 20, 2016, 09:39:38 pm
@mikeb
Hi mikeb.
I would like compile a new firmware by myself but honestly It is beyond my abilities.
I am not a software engineers or something like that, I have no skills in that field.
Sorry.
Thanks you for the time you spent updating the Dangerous Prototypes wiki and all the useful things you are doing!

@dpropicweb
Hi dpropicweb.
I guess you are right.
Thanks.

@all

Be seeing you.

U.Sb
Title: Re: Bus Pirate - Community Firmware 7.0
Post by: mikeb on September 20, 2016, 10:16:11 pm
[quote author="USBEprom"]I would like compile a new firmware by myself but honestly It is beyond my abilities[/quote]
Dear U.Sb, its actually very simple to compile a firmware, 3 steps:
1) Download a source code from Github
2) Install MPLAB X with XC16 (my instruction describes this only for Linux because its easy on Windows)
3) Just open a project file, go to properties and choose optimization if you wish, then click "Build"
As you see, no programming knowledge is necessary!

After that you could make a few simple modifications: like opening ./Firmware/configuration.h file , changing #undef to #define to enable new features  and clicking "Clean and build". Just need a small understanding and some English language knowledge, that's all you need to compile a firmware of your dreams ;)

http://http://dangerousprototypes.com/docs/Compile_the_Bus_Pirate_firmware

Please don't make artificial limitations for yourself :) It would be great if you try and if something doesn't work - please leave the feedback so that I could improve this instruction
Title: Re: Bus Pirate - Community Firmware 7.0
Post by: USBEprom on September 22, 2016, 10:30:41 pm
[quote author="mikeb"]Please don't make artificial limitations for yourself :) It would be great if you try and if something doesn't work - please leave the feedback so that I could improve this instruction[/quote]
 
Hi mikeb.
Actually I do not fear the installation of the compiler or other thing into the computer.
I am not  making artificial limitations for myself but I have cringe at the idea to where find out what I need to modify and how do the changes.
You and others have shown me where were some of the problems that I have given, alone I would never be able to spot them.
Compile a ready-made source code it is not so hard following your instructions in the wiki, my problem is how edit the source code in the right way.
Thanks.
 
Be seeing you.
 
U.Sb
Title: Re: Bus Pirate - Community Firmware 7.0
Post by: USBEprom on October 01, 2016, 02:16:49 pm
Hi guys.
Following instructions in the wiki I have MPLAB X and MPLAB XC16 correctly installed.
I have tried to compile by myself a firmware like those named "bpv3_fw7.0_features" that are here: dangerousprototypes.com/forum/download/file.php?id=12142
I took the whole repository here:
https://github.com/BusPirate/Bus_Pirate ... master.zip (https://github.com/BusPirate/Bus_Pirate/archive/master.zip)
(I used a Windows XP computer)
I want 256 characters for the command line, so even if I am pretty babo, I understand I have to edit configuration.h, lines 496-505, in this way:
 
    /**
    * How big the serial command buffer can be, in bytes.
    *
    * @warning This must be set to a power of two, ie. 256, 128, 64, 32, etc.
    */
    #ifdef BUSPIRATEV3
    #define BP_COMMAND_BUFFER_SIZE 256
    #else
    #define BP_COMMAND_BUFFER_SIZE 256
    #endif /* BUSPIRATEV3 */
 
I have to set too lines 304-319 in this way:
 
#ifdef BUSPIRATEV3
#define BP_ENABLE_1WIRE_SUPPORT
#define BP_ENABLE_BASIC_SUPPORT
#define BP_ENABLE_DIO_SUPPORT
#undef BP_ENABLE_HD44780_SUPPORT
#define BP_ENABLE_I2C_SUPPORT
#define BP_ENABLE_JTAG_SUPPORT
#undef BP_ENABLE_PIC_SUPPORT
#undef BP_ENABLE_PC_AT_KEYBOARD_SUPPORT
#define BP_ENABLE_RAW_2WIRE_SUPPORT
#define BP_ENABLE_RAW_3WIRE_SUPPORT
#define BP_ENABLE_SMPS_SUPPORT
#define BP_ENABLE_SPI_SUPPORT
#define BP_ENABLE_SUMP_SUPPORT
#define BP_ENABLE_UART_SUPPORT
#endif /* BUSPIRATEV3 */
 
By editing I can not compile the source due out of memory error even using option S for compression.
So I remove BASIC_SUPPORT by changing configuration.h, lines 304-319, in this way:
 
#ifdef BUSPIRATEV3
#define BP_ENABLE_1WIRE_SUPPORT
#undef BP_ENABLE_BASIC_SUPPORT
#define BP_ENABLE_DIO_SUPPORT
#undef BP_ENABLE_HD44780_SUPPORT
#define BP_ENABLE_I2C_SUPPORT
#define BP_ENABLE_JTAG_SUPPORT
#undef BP_ENABLE_PIC_SUPPORT
#undef BP_ENABLE_PC_AT_KEYBOARD_SUPPORT
#define BP_ENABLE_RAW_2WIRE_SUPPORT
#define BP_ENABLE_RAW_3WIRE_SUPPORT
#define BP_ENABLE_SMPS_SUPPORT
#define BP_ENABLE_SPI_SUPPORT
#define BP_ENABLE_SUMP_SUPPORT
#define BP_ENABLE_UART_SUPPORT
#endif /* BUSPIRATEV3 */
 
This time I can compile the source with options 0,1,2 and S.
Firmwares I have got from myself pass self test but some option does not work.
My goal is to put 256 characters for the command line in "bpv3_fw7.0_features.zip".
How can I do?
Is it possible that by providing 256 characters for the command line instead of 128 then the generated code is too big for Bus Pirate revision 3 so that I have to give up BASIC?
Maybe I am doing something wrong.
I would recompile that same firmware version for obtain 256 characters for the command line.
Elsewhere (here: https://github.com/BusPirate/Bus_Pirate ... -248265311 (https://github.com/BusPirate/Bus_Pirate/issues/7#issuecomment-248265311)) it is argued that the thing should be possible:
 
it is possible to fit many features for BPv3 (including BASIC) but only for three opt levels:
opt0 - not enough program memory
opt1 - 84% occupied,
opt2 - 94% occupied, faster speed,
optS - 77% occupied, slower speed,
opt3 - not enough program memory

./Bus_Pirate/Firmware/configuration.h, lines 304-319

#ifdef BUSPIRATEV3
#define BP_ENABLE_1WIRE_SUPPORT // <--- + enabled
#define BP_ENABLE_BASIC_SUPPORT // <--- + enabled
#define BP_ENABLE_DIO_SUPPORT // <--- + enabled
#undef BP_ENABLE_HD44780_SUPPORT
#define BP_ENABLE_I2C_SUPPORT
#define BP_ENABLE_JTAG_SUPPORT
#undef BP_ENABLE_PIC_SUPPORT
#undef BP_ENABLE_PC_AT_KEYBOARD_SUPPORT
#define BP_ENABLE_RAW_2WIRE_SUPPORT // <--- + enabled
#define BP_ENABLE_RAW_3WIRE_SUPPORT // <--- + enabled
#define BP_ENABLE_SMPS_SUPPORT // <--- + enabled
#define BP_ENABLE_SPI_SUPPORT
#define BP_ENABLE_SUMP_SUPPORT
#define BP_ENABLE_UART_SUPPORT
#endif /* BUSPIRATEV3 */

BP_ENABLE_HD44780_SUPPORT could also be enabled (takes just about 1% extra)

However, there are problems with BP_ENABLE_PIC_SUPPORT and BP_ENABLE_PC_AT_KEYBOARD_SUPPORT.


Thanks.

Be seeing you.

U.Sb
Title: Re: Bus Pirate - Community Firmware 7.0
Post by: mikeb on October 05, 2016, 11:40:11 pm
[quote author="USBEprom"]Hi guys[/quote]

Hi U.Sb, sorry for a late reply, only now I have noticed your message. I tested and have observed the same problem: on BPv3 you can't have both
Code: [Select]
#define BP_ENABLE_BASIC_SUPPORT
and
Code: [Select]
#define BP_COMMAND_BUFFER_SIZE 256
at the same time. You did everything correctly, good, but please note that this error message is different - compared to when there is simply not enough place for a feature.

Not enough place for a feature:

Code: [Select]
build/BusPirate_v3/production/_ext/1472/selftest.o: Link Error: Could not allocate section .text, size = 774 PC units, attributes = code 
build/BusPirate_v3/production/_ext/1472/raw3wire.o: Link Error: Could not allocate section .text, size = 728 PC units, attributes = code
build/BusPirate_v3/production/_ext/1472/sump.o: Link Error: Could not allocate section .text, size = 662 PC units, attributes = code
build/BusPirate_v3/production/_ext/1472/base.o: Link Error: Could not allocate section .text, size = 590 PC units, attributes = code
data_init: Link Error: Could not allocate section .dinit, size = 576 PC units, attributes = code keep
build/BusPirate_v3/production/_ext/1472/uart2io.o: Link Error: Could not allocate section .text, size = 242 PC units, attributes = code
build/BusPirate_v3/production/_ext/1472/main.o: Link Error: Could not allocate section .text, size = 168 PC units, attributes = code
build/BusPirate_v3/production/_ext/1472/bus_pirate_core.o: Link Error: Could not allocate section .text, size = 156 PC units, attributes = code
build/BusPirate_v3/production/_ext/1472/openocd_asm.o: Link Error: Could not allocate section .text, size = 128 PC units, attributes = code
build/BusPirate_v3/production/_ext/1472/binIOhelpers.o: Link Error: Could not allocate section .text, size = 126 PC units, attributes = code
 Link Error: Could not allocate program memory

BPv3 specific new error message (when you try "256") :

Code: [Select]
build/BusPirate_v3/production/_ext/1472/openocd_asm.o(.text+0x1e): In function `.L0':
: Link Error: Cannot access symbol (_UART1RXRecvd) with file register addressing. Value must be less than 8192. Suggest large-data model.
build/BusPirate_v3/production/_ext/1472/openocd_asm.o(.text+0x60): In function `.L0':
: Link Error: Cannot access symbol (_UART1TXAvailable) with file register addressing. Value must be less than 8192. Suggest large-data model.
build/BusPirate_v3/production/_ext/1472/openocd_asm.o(.text+0x68): In function `.L0':
: Link Error: Cannot access symbol (_UART1TXAvailable) with file register addressing. Value must be less than 8192. Suggest large-data model.
build/BusPirate_v3/production/_ext/1472/openocd_asm.o(.text+0x6c): In function `.L0':
: Link Error: Cannot access symbol (_UART1TXBuf) with file register addressing. Value must be less than 8192. Suggest large-data model.

If we look through the source code, BP_COMMAND_BUFFER_SIZE affects the following code directly:

Code: [Select]
./Firmware/procMenu.h:19: #define CMDLENMSK (BP_COMMAND_BUFFER_SIZE-1)
./Firmware/procMenu.h:21: extern char cmdbuf[BP_COMMAND_BUFFER_SIZE];
./Firmware/procMenu.c:60: char cmdbuf[BP_COMMAND_BUFFER_SIZE];
./Firmware/procMenu.c:1003: bpWdec((BP_COMMAND_BUFFER_SIZE + cmdstart) - oldstart);

Please note that CMDLENMSK is (BP_COMMAND_BUFFER_SIZE-1). It affects the following code:

Code: [Select]
./Firmware/hd44780.c:212:        cmdstart=(cmdstart+1)&CMDLENMSK;
./Firmware/hd44780.c:213:        //cmdstart&=CMDLENMSK;
./Firmware/AUXpin.c:162:                if(cmdbuf[((cmdstart+1)&CMDLENMSK)]==0x00)  return; // return if no arguments to function
./Firmware/AUXpin.c:167:        cmdstart=(cmdstart+1)&CMDLENMSK;
./Firmware/AUXpin.c:168:        //cmdstart&=CMDLENMSK;
./Firmware/AUXpin.c:704:                if(cmdbuf[((cmdstart + 1)& CMDLENMSK)] == 0x00){//no extra data, stop servo
./Firmware/AUXpin.c:712:        cmdstart=(cmdstart+1)&CMDLENMSK;
./Firmware/procMenu.h:19:#define CMDLENMSK      (BP_COMMAND_BUFFER_SIZE-1)
./Firmware/procMenu.c:132:                    cmdend &= CMDLENMSK;
./Firmware/procMenu.c:147:                                temp &= CMDLENMSK;
./Firmware/procMenu.c:173:                            cmdend = (cmdend - 1) & CMDLENMSK;
./Firmware/procMenu.c:180:                            tmpcmdend = (tmpcmdend - 1) & CMDLENMSK;
./Firmware/procMenu.c:182:                            for (temp = tmpcmdend; temp != cmdend; temp = (temp + 1) & CMDLENMSK) {
./Firmware/procMenu.c:190:                            cmdend = (cmdend - 1) & CMDLENMSK; // end pointer moves left one
./Firmware/procMenu.c:204:                        for (temp = tmpcmdend; temp != cmdend; temp = (temp + 1) & CMDLENMSK) {
./Firmware/procMenu.c:212:                        cmdend = (cmdend - 1) & CMDLENMSK; // end pointer moves left one
./Firmware/procMenu.c:260:                            tmpcmdend = (tmpcmdend - 1) & CMDLENMSK;
./Firmware/procMenu.c:271:                        tmpcmdend = (tmpcmdend + 1) & CMDLENMSK;
./Firmware/procMenu.c:280:                    for (temp = (cmdstart - 1) & CMDLENMSK; temp != cmdend; temp = (temp - 1) & CMDLENMSK) {
./Firmware/procMenu.c:281:                        if (!cmdbuf[temp] && cmdbuf[(temp - 1) & CMDLENMSK]) { // found previous entry, temp is old cmdend
./Firmware/procMenu.c:288:                                        cmdend = (cmdend - 1) & CMDLENMSK;
./Firmware/procMenu.c:292:                                repeat = (temp - 1) & CMDLENMSK;
./Firmware/procMenu.c:295:                                        temp2 = (repeat + 1) & CMDLENMSK;
./Firmware/procMenu.c:299:                                    repeat = (repeat - 1) & CMDLENMSK;
./Firmware/procMenu.c:309:                                for (repeat = temp2; repeat != temp; repeat = (repeat + 1) & CMDLENMSK) {
./Firmware/procMenu.c:312:                                    cmdend = (cmdend + 1) & CMDLENMSK;
./Firmware/procMenu.c:325:                    for (temp = (cmdstart - 1) & CMDLENMSK; temp != cmdend; temp = (temp - 1) & CMDLENMSK) {
./Firmware/procMenu.c:326:                        if (!cmdbuf[temp] && cmdbuf[(temp - 1) & CMDLENMSK]) { // found previous entry, temp is old cmdend
./Firmware/procMenu.c:333:                                        cmdend = (cmdend - 1) & CMDLENMSK;
./Firmware/procMenu.c:337:                                repeat = (temp - 1) & CMDLENMSK;
./Firmware/procMenu.c:340:                                        temp2 = (repeat + 1) & CMDLENMSK;
./Firmware/procMenu.c:344:                                    repeat = (repeat - 1) & CMDLENMSK;
./Firmware/procMenu.c:354:                                for (repeat = temp2; repeat != temp; repeat = (repeat + 1) & CMDLENMSK) {
./Firmware/procMenu.c:357:                                    cmdend = (cmdend + 1) & CMDLENMSK;
./Firmware/procMenu.c:377:                                cmdend = (cmdend - 1) & CMDLENMSK;
./Firmware/procMenu.c:388:                        repeat = (tmpcmdend - cmdstart) & CMDLENMSK;
./Firmware/procMenu.c:400:                        repeat = (cmdend - tmpcmdend) & CMDLENMSK;
./Firmware/procMenu.c:414:                    cmdend = (cmdend + 1) & CMDLENMSK;
./Firmware/procMenu.c:429:                    if ((((cmdend + 1) & CMDLENMSK) != cmdstart) && (c >= 0x20) && (c < 0x7F)) { // no overflow and printable
./Firmware/procMenu.c:434:                            cmdend = (cmdend + 1) & CMDLENMSK;
./Firmware/procMenu.c:439:                            repeat = (cmdend - tmpcmdend) & CMDLENMSK;
./Firmware/procMenu.c:444:                            while (temp != ((tmpcmdend - 1) & CMDLENMSK)) {
./Firmware/procMenu.c:451:                                temp = (temp - 1) & CMDLENMSK;
./Firmware/procMenu.c:455:                            tmpcmdend = (tmpcmdend + 1) & CMDLENMSK;
./Firmware/procMenu.c:456:                            cmdend = (cmdend + 1) & CMDLENMSK;
./Firmware/procMenu.c:597:                    cmdstart = (cmdstart + 1) & CMDLENMSK;
./Firmware/procMenu.c:608:                    cmdstart = (cmdstart + 1) & CMDLENMSK;
./Firmware/procMenu.c:748:                    while (cmdbuf[((cmdstart + temp) & CMDLENMSK)] != 0x00) {
./Firmware/procMenu.c:749:                        if (cmdbuf[((cmdstart + temp) & CMDLENMSK)] == '>') command_error = false; // clear error if we found a > before the command ends
./Firmware/procMenu.c:754:                        cmdstart = (cmdstart + 1) & CMDLENMSK;
./Firmware/procMenu.c:756:                        if (cmdbuf[((cmdstart) & CMDLENMSK)] == '=') // assignment
./Firmware/procMenu.c:759:                                cmdstart = (cmdstart + 1) & CMDLENMSK;
./Firmware/procMenu.c:768:                                    cmdstart = (cmdstart + 1) & CMDLENMSK;
./Firmware/procMenu.c:794:                    cmdstart = (cmdstart + 1) & CMDLENMSK;
./Firmware/procMenu.c:797:                    if (cmdbuf[((cmdstart) & CMDLENMSK)] == ')') { //cmdstart++;    // skip )
./Firmware/procMenu.c:798:                        //cmdstart&=CMDLENMSK;
./Firmware/procMenu.c:810:                    while (cmdbuf[((cmdstart + temp) & CMDLENMSK)] != 0x00) {
./Firmware/procMenu.c:811:                        if (cmdbuf[((cmdstart + temp) & CMDLENMSK)] == 0x22) command_error = false; // clear error if we found a " before the command ends
./Firmware/procMenu.c:818:                        while (cmdbuf[((++cmdstart) & CMDLENMSK)] != 0x22) {
./Firmware/procMenu.c:819:                            cmdstart &= CMDLENMSK;
./Firmware/procMenu.c:828:                        cmdstart &= CMDLENMSK;
./Firmware/procMenu.c:859:                    cmdstart &= CMDLENMSK;
./Firmware/procMenu.c:995:            cmdstart = (cmdstart + 1) & CMDLENMSK;
./Firmware/procMenu.c:1028:    if ((cmdbuf[((cmdstart + i) & CMDLENMSK)] >= 0x31) && (cmdbuf[((cmdstart + i) & CMDLENMSK)] <= 0x39)) // 1-9 is for sure decimal
./Firmware/procMenu.c:1030:        number = cmdbuf[(cmdstart + i) & CMDLENMSK] - 0x30;
./Firmware/procMenu.c:1032:        while ((cmdbuf[((cmdstart + i) & CMDLENMSK)] >= 0x30) && (cmdbuf[((cmdstart + i) & CMDLENMSK)] <= 0x39)) // consume all digits
./Firmware/procMenu.c:1035:            number += cmdbuf[((cmdstart + i) & CMDLENMSK)] - 0x30;
./Firmware/procMenu.c:1038:    } else if (cmdbuf[((cmdstart + i) & CMDLENMSK)] == 0x30) // 0 could be anything
./Firmware/procMenu.c:1041:        if ((cmdbuf[((cmdstart + i) & CMDLENMSK)] == 'b') || (cmdbuf[((cmdstart + i) & CMDLENMSK)] == 'B')) {
./Firmware/procMenu.c:1043:            while ((cmdbuf[((cmdstart + i) & CMDLENMSK)] == '1') || (cmdbuf[((cmdstart + i) & CMDLENMSK)] == '0')) {
./Firmware/procMenu.c:1045:                number += cmdbuf[((cmdstart + i) & CMDLENMSK)] - 0x30;
./Firmware/procMenu.c:1048:        } else if ((cmdbuf[((cmdstart + i) & CMDLENMSK)] == 'x') || (cmdbuf[((cmdstart + i) & CMDLENMSK)] == 'X')) {
./Firmware/procMenu.c:1050:            while (((cmdbuf[((cmdstart + i) & CMDLENMSK)] >= 0x30) && (cmdbuf[((cmdstart + i) & CMDLENMSK)] <= 0x39)) ||   
./Firmware/procMenu.c:1051:                            ((cmdbuf[((cmdstart + i) & CMDLENMSK)] >= 'A') && (cmdbuf[((cmdstart + i) & CMDLENMSK)] <= 'F')) ||   
./Firmware/procMenu.c:1052:                            ((cmdbuf[((cmdstart + i) & CMDLENMSK)] >= 'a') && (cmdbuf[((cmdstart + i) & CMDLENMSK)] <= 'f'))) {
./Firmware/procMenu.c:1054:                if ((cmdbuf[(cmdstart + i) & CMDLENMSK] >= 0x30) && (cmdbuf[((cmdstart + i) & CMDLENMSK)] <= 0x39)) {
./Firmware/procMenu.c:1055:                    number += cmdbuf[((cmdstart + i) & CMDLENMSK)] - 0x30;
./Firmware/procMenu.c:1057:                    cmdbuf[((cmdstart + i) & CMDLENMSK)] |= 0x20; // make it lowercase
./Firmware/procMenu.c:1058:                    number += cmdbuf[((cmdstart + i) & CMDLENMSK)] - 0x57; // 'a'-0x61+0x0a
./Firmware/procMenu.c:1062:        } else if ((cmdbuf[((cmdstart + i) & CMDLENMSK)] >= 0x30) && (cmdbuf[((cmdstart + i) & CMDLENMSK)] <= 0x39)) {
./Firmware/procMenu.c:1063:            number = cmdbuf[((cmdstart + i) & CMDLENMSK)] - 0x30;
./Firmware/procMenu.c:1064:            while ((cmdbuf[((cmdstart + i) & CMDLENMSK)] >= 0x30) && (cmdbuf[((cmdstart + i) & CMDLENMSK)] <= 0x39)) // consume all digits
./Firmware/procMenu.c:1067:                number += cmdbuf[((cmdstart + i) & CMDLENMSK)] - 0x30;
./Firmware/procMenu.c:1078:    cmdstart &= CMDLENMSK;
./Firmware/procMenu.c:1085:    if (cmdbuf[(cmdstart + 1) & CMDLENMSK] == ':') {
./Firmware/procMenu.c:1087:        cmdstart &= CMDLENMSK;
./Firmware/procMenu.c:1090:        cmdstart &= CMDLENMSK;
./Firmware/procMenu.c:1099:    if (cmdbuf[(cmdstart + 1) & CMDLENMSK] == ';') {
./Firmware/procMenu.c:1100:        cmdstart = (cmdstart + 2) & CMDLENMSK;
./Firmware/procMenu.c:1102:        cmdstart = (cmdstart - 1) & CMDLENMSK; // to allow [6:10] (start send 6 10 times stop)
./Firmware/procMenu.c:1110:    if(cmdbuf[(cmdstart + 1) & CMDLENMSK] == 'x')
./Firmware/procMenu.c:1112:            cmdstart = (cmdstart + 1) & CMDLENMSK;
./Firmware/procMenu.c:1115:    if(cmdbuf[(cmdstart + 1) & CMDLENMSK] == 'd')
./Firmware/procMenu.c:1117:            cmdstart = (cmdstart + 1) & CMDLENMSK;
./Firmware/procMenu.c:1120:    if(cmdbuf[(cmdstart + 1) & CMDLENMSK] == 'b')
./Firmware/procMenu.c:1122:            cmdstart = (cmdstart + 1) & CMDLENMSK;
./Firmware/procMenu.c:1125:    if(cmdbuf[(cmdstart + 1) & CMDLENMSK] == 'w')
./Firmware/procMenu.c:1127:            cmdstart = (cmdstart + 1) & CMDLENMSK;
./Firmware/procMenu.c:1135:        cmdstart = (cmdstart + 1) & CMDLENMSK; // remove spaces
./Firmware/procMenu.c:1143:    cmdstart = (cmdstart + 1) & CMDLENMSK;
./Firmware/procMenu.c:1189:    cmdstart = (cmdend - 1) & CMDLENMSK;
./Firmware/procMenu.c:1200:    j = (cmdstart - 1) & CMDLENMSK;
./Firmware/procMenu.c:1204:        if ((cmdbuf[j] == 0x00) && (cmdbuf[(j + 1) & CMDLENMSK] != 0x00)) // did we find an end? is it not empty?
./Firmware/procMenu.c:1209:            while (cmdbuf[((j + k) & CMDLENMSK)]) {
./Firmware/procMenu.c:1210:                UART1TX(cmdbuf[((j + k) & CMDLENMSK)]); // print it
./Firmware/procMenu.c:1213:            historypos[i] = (j + 1) & CMDLENMSK;
./Firmware/procMenu.c:1218:        j = (j - 1) & CMDLENMSK;
./Firmware/procMenu.c:1232:        while (cmdbuf[(historypos[j] + i) & CMDLENMSK]) // copy it to the end of the ringbuffer
./Firmware/procMenu.c:1234:            cmdbuf[(cmdend + i) & CMDLENMSK] = cmdbuf[(historypos[j] + i) & CMDLENMSK];
./Firmware/procMenu.c:1237:        cmdstart = (cmdend - 1) & CMDLENMSK; // start will be increased before parsing in main loop
./Firmware/procMenu.c:1238:        cmdend = (cmdstart + i + 2) & CMDLENMSK;
./Firmware/procMenu.c:1239:        cmdbuf[(cmdend - 1) & CMDLENMSK] = 0x00;
./Firmware/procMenu.c:1725:    cmdstart = (cmdstart + 1) & CMDLENMSK;
./Firmware/procMenu.c:1749:    cmdstart = (cmdstart + 1) & CMDLENMSK;
./Firmware/procMenu.c:1818:    cmdstart = (cmdstart + 1) & CMDLENMSK;
Code: [Select]
./Firmware/basic.c:1189:                cmdstart=(cmdstart+1)&CMDLENMSK;
./Firmware/basic.c:1219:                i&=CMDLENMSK;
./Firmware/basic.c:1280:                                cmdstart=(cmdstart+1)&CMDLENMSK;

So far I don't know yet, why basic code does not like a bigger CMDLENMSK value, sadly don't have the free time to figure out yet...
Title: Re: Bus Pirate - Community Firmware 7.0
Post by: USBEprom on October 09, 2016, 04:28:34 pm
mikeb jjang! 
Good explanation!
Daebak!, i get it.
Meanwhile I compiled a new firmware by myself.
Since BP_ENABLE_PIC_SUPPORT and BP_ENABLE_PC_AT_KEYBOARD_SUPPORT now have been fixed by agatti (https://github.com/BusPirate/Bus_Pirate/issues/7 (https://github.com/BusPirate/Bus_Pirate/issues/7)) I have included them.
Whising me 256 characters for the command line I changed line 502 in configuration.h, lines 496-505, in this way:
 
/**
* How big the serial command buffer can be, in bytes.
*
* @warning This must be set to a power of two, ie. 256, 128, 64, 32, etc.
*/
#ifdef BUSPIRATEV3
#define BP_COMMAND_BUFFER_SIZE 256
#else
#define BP_COMMAND_BUFFER_SIZE 256
#endif /* BUSPIRATEV3 */
 
Then in the same file I changed lines 304-319 in this way:
 
#ifdef BUSPIRATEV3
#define BP_ENABLE_1WIRE_SUPPORT
#undef BP_ENABLE_BASIC_SUPPORT
#define BP_ENABLE_DIO_SUPPORT
#define BP_ENABLE_HD44780_SUPPORT
#define BP_ENABLE_I2C_SUPPORT
#define BP_ENABLE_JTAG_SUPPORT
#define BP_ENABLE_PIC_SUPPORT
#define BP_ENABLE_PC_AT_KEYBOARD_SUPPORT
#define BP_ENABLE_RAW_2WIRE_SUPPORT
#define BP_ENABLE_RAW_3WIRE_SUPPORT
#define BP_ENABLE_SMPS_SUPPORT
#define BP_ENABLE_SPI_SUPPORT
#define BP_ENABLE_SUMP_SUPPORT
#define BP_ENABLE_UART_SUPPORT
#endif /* BUSPIRATEV3 */
 
Practically I have activated all the disponible options discarding BASIC because there is not enough space available in the memory of the PIC into the Bus Pirate v3.
I compiled with those settings and I got a firmware that seems to work.
It has 11 options in its menu:
 
Bus Pirate v3.5
Community Firmware v7.0 - goo.gl/gCzQnW [HiZ 1-WIRE UART I2C SPI 2WIRE 3WIRE KEYB LCD PIC DIO] Bootloader v4.4
DEVID:0x0447 REVID:0x3046 (24FJ64GA002 B8)
http://dangerousprototypes.com (http://dangerousprototypes.com)
HiZ>m
1. HiZ
2. 1-WIRE
3. UART
4. I2C
5. SPI
6. 2WIRE
7. 3WIRE
8. KEYB
9. LCD
10. PIC
11. DIO
x. exit(without change)
 
It passes the selftest, it has 256 characters for the command line, flashrom is working and all is fine for what I can understand.
Well!
Now, since in the SPI option (5) there are only the standard speeds as follow:
 
(1)>5
Set speed:
 1. 30KHz
 2. 125KHz
 3. 250KHz
 4. 1MHz
 
I'd like to add others new because I need more high speeds.
If I am not wrong the speed limits for SPI with Bus Pirate v3 are 8MHz for MASTER mode and 10MHz for the SLAVE.
So, if still I am not wrong, new speeds could be added as follows:
 
    0b00000000, /*  31 kHz - Primary prescaler 64:1 / Secondary prescaler 8:1 */
    0b00001100, /*  50 kHz - Primary prescaler 64:1 / Secondary prescaler 5:1 */
    0b00011000, /* 125 kHz - Primary prescaler 64:1 / Secondary prescaler 2:1 */
    0b00011100, /* 250 kHz - Primary prescaler 64:1 / Secondary prescaler 1:1 */
    0b00011101, /*  1 MHz - Primary prescaler 16:1 / Secondary prescaler 1:1 */
    0b00010110, /* 1.3 MHz - Primary prescaler  4:1 / Secondary prescaler 3:1 */
    0b00011010, /*  2 MHz - Primary prescaler  4:1 / Secondary prescaler 2:1 */
    0b00001011, /* 2.6 MHz - Primary prescaler  1:1 / Secondary prescaler 6:1 */
    0b00001111, /* 3.2 MHz - Primary prescaler  1:1 / Secondary prescaler 5:1 */
    0b00011110, /*  4 MHz - Primary prescaler  4:1 / Secondary prescaler 1:1 */
    0b00010111, /* 5.3 MHz - Primary prescaler  1:1 / Secondary prescaler 3:1 */
    0b00011011, /*  8 MHz - Primary prescaler  1:1 / Secondary prescaler 2:1 */
 
I need to change lines 67-71 of spi.c in order to accommodate the new ones.
That is ok, but what about to change entries in order to activate them?
Seems to me the modify affects too many files, how can I do?
I do not even know if the modify I have in mind is possible with the Bus Pirate v3.
Maybe there is not enought space to accommodate the new entries.
 
Thanks.
 
Be seeing you.
 
U.Sb
Title: Re: Bus Pirate - Community Firmware 7.0
Post by: joeblack on October 16, 2016, 12:31:46 am
Hi USBEprom, would you share your latest compilation for BP V3.
(everything enabled, without basic)
would like to test your settings without to download the whole compile stuff for now.

greetings
joe
Title: Re: Bus Pirate - Community Firmware 7.0
Post by: USBEprom on October 16, 2016, 04:35:42 pm
Hi joe.
Here you go.

Be seeing you.

U.Sb
Title: Re: Bus Pirate - Community Firmware 7.0
Post by: joeblack on October 16, 2016, 05:11:14 pm
Thanks mate, i´ll try it out
joe
Title: Re: Bus Pirate - Community Firmware 7.0
Post by: USBEprom on October 16, 2016, 05:48:19 pm
Hi guys.
Here you go the new version that I built starting from the latest Bus_Pirate-master (https://github.com/BusPirate/Bus_Pirate ... master.zip (https://github.com/BusPirate/Bus_Pirate/archive/master.zip))
In this one all the features are enabled, BASIC too, but the command line is limited to 32 characters.
Due to the limited space in memory I had to set only 32 characters for the command line by change the line 502 into configuration.h, lines 496-505, in this way:
 
/**
* How big the serial command buffer can be, in bytes.
*
* @warning This must be set to a power of two, ie. 256, 128, 64, 32, etc.
*/
#ifdef BUSPIRATEV3
#define BP_COMMAND_BUFFER_SIZE 32
#else
#define BP_COMMAND_BUFFER_SIZE 256
#endif /* BUSPIRATEV3 */
 
In order to enable all the features into configuration.h I had to change lines 304-319 too in this way:
 
#ifdef BUSPIRATEV3
#define BP_ENABLE_1WIRE_SUPPORT
#define BP_ENABLE_BASIC_SUPPORT
#define BP_ENABLE_DIO_SUPPORT
#define BP_ENABLE_HD44780_SUPPORT
#define BP_ENABLE_I2C_SUPPORT
#define BP_ENABLE_JTAG_SUPPORT
#define BP_ENABLE_PIC_SUPPORT
#define BP_ENABLE_PC_AT_KEYBOARD_SUPPORT
#define BP_ENABLE_RAW_2WIRE_SUPPORT
#define BP_ENABLE_RAW_3WIRE_SUPPORT
#define BP_ENABLE_SMPS_SUPPORT
#define BP_ENABLE_SPI_SUPPORT
#define BP_ENABLE_SUMP_SUPPORT
#define BP_ENABLE_UART_SUPPORT
#endif /* BUSPIRATEV3 */
 
For me it works.
 
Thanks.
 
Be seeing you.
 
U.Sb
Title: Re: Bus Pirate - Community Firmware 7.0
Post by: USBEprom on October 18, 2016, 10:00:14 pm
Hi guys.
Here you go the newest version that I just built starting from the latest Bus_Pirate-master (https://github.com/BusPirate/Bus_Pirate ... master.zip (https://github.com/BusPirate/Bus_Pirate/archive/master.zip)).
In this one all the features are enabled except BASIC, but the command line limit is now up 1024 characters.
I had to set 1024 characters for the command line by change the line 502 into configuration.h, lines 496-505, in this way:
 
/**
* How big the serial command buffer can be, in bytes.
*
* @warning This must be set to a power of two, ie. 256, 128, 64, 32, etc.
*/
#ifdef BUSPIRATEV3
#define BP_COMMAND_BUFFER_SIZE 1024
#else
#define BP_COMMAND_BUFFER_SIZE 256
#endif /* BUSPIRATEV3 */
 
In order to enable all the features into configuration.h I had to change lines 304-319 too in this way:
 
#ifdef BUSPIRATEV3
#define BP_ENABLE_1WIRE_SUPPORT
#undef BP_ENABLE_BASIC_SUPPORT
#define BP_ENABLE_DIO_SUPPORT
#define BP_ENABLE_HD44780_SUPPORT
#define BP_ENABLE_I2C_SUPPORT
#define BP_ENABLE_JTAG_SUPPORT
#define BP_ENABLE_PIC_SUPPORT
#define BP_ENABLE_PC_AT_KEYBOARD_SUPPORT
#define BP_ENABLE_RAW_2WIRE_SUPPORT
#define BP_ENABLE_RAW_3WIRE_SUPPORT
#define BP_ENABLE_SMPS_SUPPORT
#define BP_ENABLE_SPI_SUPPORT
#define BP_ENABLE_SUMP_SUPPORT
#define BP_ENABLE_UART_SUPPORT
#endif /* BUSPIRATEV3 */
 
Even this for me it works.
 
Thanks.
 
Be seeing you.
 
U.Sb
Title: Re: Bus Pirate - Community Firmware 7.0
Post by: mikeb on October 20, 2016, 12:45:07 am
Hi U.Sb, sorry for the lack of replies from my side, spent all my free time writing these wiki pages:
1) http://dangerousprototypes.com/docs/Fla ... Bus_Pirate (http://dangerousprototypes.com/docs/Flashing_a_BIOS_chip_with_Bus_Pirate) - Flashing a BIOS chip with Bus Pirate
2) http://dangerousprototypes.com/docs/Fla ... Bus_Pirate (http://dangerousprototypes.com/docs/Flashing_KB9012_with_Bus_Pirate) - Flashing KB9012 with Bus Pirate
(any feedback comments about them are welcome)
By your recent messages it seems that you have figured it out. Congratulations!

Just a small note: while I have not understood this problem completely, I think that it is _not_ the lack of _total_ memory space of PIC that sometimes prevents the firmware to be compiled even at S level. - I think that because there was a completely different error, if you look at my last message before (viewtopic.php?f=28&t=8498&start=15#p65383 (http://dangerousprototypes.com/forum/viewtopic.php?f=28&t=8498&start=15#p65383)). Probably some sections of firmware's memory map are not large enough, and when some code couldn't be fit to this section this causes an error (despite that PIC itself could have some free memory available). If I remember correctly this memory map is being created dynamically - during the compilation of project. So maybe something about that process could be improved to get rid of these errors completely
Title: Re: Bus Pirate - Community Firmware 7.0
Post by: USBEprom on October 20, 2016, 09:08:39 pm
Hi mikeb.
[quote author="mikeb"]Hi U.Sb, sorry for the lack of replies from my side, spent all my free time writing these wiki pages:
1) http://dangerousprototypes.com/docs/Fla ... Bus_Pirate (http://dangerousprototypes.com/docs/Flashing_a_BIOS_chip_with_Bus_Pirate) - Flashing a BIOS chip with Bus Pirate
2) http://dangerousprototypes.com/docs/Fla ... Bus_Pirate (http://dangerousprototypes.com/docs/Flashing_KB9012_with_Bus_Pirate) - Flashing KB9012 with Bus Pirate
(any feedback comments about them are welcome)[/quote]
 
That is an awesome work, daebak!
My feedback can only be jjang!
 
[quote author="mikeb"]By your recent messages it seems that you have figured it out. Congratulations![/quote]
 
I do not think so.
I compile myself only what others prepare me, I can not do the job by me alone.
I can not add new speed for SPI mode (agatti did it for me and even now I can not figure how put his modifications in my code so I compile myself a custom firmware).
Just yesterday I tried to fix MACRO (1) and MACRO (2) in the 2WIRE protocol but I understood nothing, I had to give up.
And so on.
 
[quote author="mikeb"]Just a small note: while I have not understood this problem completely, I think that it is _not_ the lack of _total_ memory space of PIC that sometimes prevents the firmware to be compiled even at S level. - I think that because there was a completely different error, if you look at my last message before (viewtopic.php?f=28&t=8498&start=15#p65383 (http://dangerousprototypes.com/forum/viewtopic.php?f=28&t=8498&start=15#p65383)). Probably some sections of firmware's memory map are not large enough, and when some code couldn't be fit to this section this causes an error (despite that PIC itself could have some free memory available). If I remember correctly this memory map is being created dynamically - during the compilation of project. So maybe something about that process could be improved to get rid of these errors completely[/quote]
 
I saw it, but I know nothing.
Sorry I am pretty babo there.
My only hope is that by optimize will be at least possible to compile a version with BASIC enabled and something like 256 characters for the command line.
I was able to get to a maximum of 32 characters for the command line when BASIC is also enabled, no more.
But I do not think it will be possible.
For me one possible workaround could be a terminal program that it is able to send the command string for fractional shares.
I mean, for instance the command line of the Bus Pirate is up 32 characters but it is needed perform a sequence of instructions that is composed of more characters.
Simply the terminal send a first slice of 32 characters followed by another slice and so on until all the characters that are inside the whole sequence do not end.
Mainly I use "Buccaneer's Den" as terminal for the Bus Pirate.
It has macros but it can not automatically perform them so that are executed as one single command.
It has BASIC scripting also but it is not possible to write an executable that behaves as a single instruction (I can not do it).
"Buccaneer's Den" is why I would like BASIC enabled and at least 256 characters for the command line in the firmware of the Bus Pirate.
Thanks for all.
 
Be seeing you.
 
U.Sb
Title: Re: Bus Pirate - Community Firmware 7.0
Post by: USBEprom on October 29, 2016, 12:22:38 am
Hi guys.
Here you go the very newest version that I just built starting from the latest Bus_Pirate-master (https://github.com/BusPirate/Bus_Pirate ... master.zip (https://github.com/BusPirate/Bus_Pirate/archive/master.zip)) and some improvements made by agatti (https://github.com/BusPirate/Bus_Pirate ... source.zip (https://github.com/BusPirate/Bus_Pirate/files/521122/extra-spi-source.zip)).
In this release all the features are enabled except BASIC, the command line limit is up 256 characters.
I had to set 256 characters for the command line by change the line 502 into configuration.h, lines 496-505, in this way:
 
/**
* How big the serial command buffer can be, in bytes.
*
* @warning This must be set to a power of two, ie. 256, 128, 64, 32, etc.
*/
#ifdef BUSPIRATEV3
#define BP_COMMAND_BUFFER_SIZE 256
#else
#define BP_COMMAND_BUFFER_SIZE 256
#endif /* BUSPIRATEV3 */
 
In order to enable the selected features into configuration.h I had to change lines 304-319 too in this way:
 
#ifdef BUSPIRATEV3
#define BP_ENABLE_1WIRE_SUPPORT
#undef BP_ENABLE_BASIC_SUPPORT
#define BP_ENABLE_DIO_SUPPORT
#define BP_ENABLE_HD44780_SUPPORT
#define BP_ENABLE_I2C_SUPPORT
#define BP_ENABLE_JTAG_SUPPORT
#define BP_ENABLE_PIC_SUPPORT
#define BP_ENABLE_PC_AT_KEYBOARD_SUPPORT
#define BP_ENABLE_RAW_2WIRE_SUPPORT
#define BP_ENABLE_RAW_3WIRE_SUPPORT
#define BP_ENABLE_SMPS_SUPPORT
#define BP_ENABLE_SPI_SUPPORT
#define BP_ENABLE_SUMP_SUPPORT
#define BP_ENABLE_UART_SUPPORT
#endif /* BUSPIRATEV3 */
 
Now there are 12 item for speed into SPI menu
 
m
1. HiZ
2. 1-WIRE
3. UART
4. I2C
5. SPI
6. 2WIRE
7. 3WIRE
8. KEYB
9. LCD
10. PIC
11. DIO
x. exit(without change)
 
(1)>5
Set speed:
 1.  30KHz
 2. 125KHz
 3. 250KHz
 4.  1MHz
 5.  50KHz
 6. 1.3MHz
 7.  2MHz
 8. 2.6MHz
 9. 3.2MHz
10.  4MHz
11. 5.3MHz
12.  8MHz
 
For me it works (many thanks agatti).
 
Thanks.
 
Be seeing you.
 
U.Sb
Title: Re: Bus Pirate - Community Firmware 7.0
Post by: USBEprom on October 29, 2016, 12:32:15 am
Hi guys.
Here you go a further very newest version that I just built starting from the latest Bus_Pirate-master (https://github.com/BusPirate/Bus_Pirate ... master.zip (https://github.com/BusPirate/Bus_Pirate/archive/master.zip)) and some improvements made by agatti (https://github.com/BusPirate/Bus_Pirate ... source.zip (https://github.com/BusPirate/Bus_Pirate/files/521122/extra-spi-source.zip)).
In this release all the features are enabled, BASIC too, the command line limit is up 32 characters.
I had to set 32 characters for the command line by change the line 502 into configuration.h, lines 496-505, in this way:
 
/**
* How big the serial command buffer can be, in bytes.
*
* @warning This must be set to a power of two, ie. 256, 128, 64, 32, etc.
*/
#ifdef BUSPIRATEV3
#define BP_COMMAND_BUFFER_SIZE 32
#else
#define BP_COMMAND_BUFFER_SIZE 256
#endif /* BUSPIRATEV3 */
 
In order to enable all the features into configuration.h I had to change lines 304-319 too in this way:
 
#ifdef BUSPIRATEV3
#define BP_ENABLE_1WIRE_SUPPORT
#define BP_ENABLE_BASIC_SUPPORT
#define BP_ENABLE_DIO_SUPPORT
#define BP_ENABLE_HD44780_SUPPORT
#define BP_ENABLE_I2C_SUPPORT
#define BP_ENABLE_JTAG_SUPPORT
#define BP_ENABLE_PIC_SUPPORT
#define BP_ENABLE_PC_AT_KEYBOARD_SUPPORT
#define BP_ENABLE_RAW_2WIRE_SUPPORT
#define BP_ENABLE_RAW_3WIRE_SUPPORT
#define BP_ENABLE_SMPS_SUPPORT
#define BP_ENABLE_SPI_SUPPORT
#define BP_ENABLE_SUMP_SUPPORT
#define BP_ENABLE_UART_SUPPORT
#endif /* BUSPIRATEV3 */
 
Now all the features are enabled and there are 12 item for speed into SPI menu:
 
m
1. HiZ
2. 1-WIRE
3. UART
4. I2C
5. SPI
6. 2WIRE
7. 3WIRE
8. KEYB
9. LCD
10. PIC
11. DIO
x. exit(without change)
 
(1)>5
Set speed:
 1.  30KHz
 2. 125KHz
 3. 250KHz
 4.  1MHz
 5.  50KHz
 6. 1.3MHz
 7.  2MHz
 8. 2.6MHz
 9. 3.2MHz
10.  4MHz
11. 5.3MHz
12.  8MHz
 
For me it works (many thanks agatti).
 
Thanks.
 
Be seeing you.
 
U.Sb
Title: Re: Bus Pirate - Community Firmware 7.0
Post by: joeblack on October 29, 2016, 09:58:13 am
@ agatti, USBEprom
Thank you both for developing further and sharing the files.
Joe
Title: Re: Bus Pirate - Community Firmware 7.0
Post by: USBEprom on October 29, 2016, 07:04:22 pm
Hi guys.
I am figuring how fix the problem of macro (1) and macro(2) in raw2wire mode.
I found some clues here
 
viewtopic.php?f=28&t=6097#p56809 (http://dangerousprototypes.com/forum/viewtopic.php?f=28&t=6097#p56809)
 
where is stated that the issue could be in raw2wire.c and bitbang.c
 
 
raw2wire.c (lines 183-188)
 
// R2W macros
 
//ISO 7813-3 Answer to reset macro for smartcards
// syntax: a0%255@^a
// **depricated, some cards are MSB first** forces LSB format for easy use
// now uses CS pin instead of AUX pin because 1,2,3 have build in pullups on CS but not AUX
 
 
bitbang.c (lines 191-206)
 
    unsigned int bbReadByte(void){
      unsigned int i,di,dat=0;
 
      //bbi();//prepare for input
      bbR(MOSI); //setup for input
 
      for(i=0;i<modeConfig.numbits;i++){
          bbH(CLK,bitbang.delayClock);//set clock high
          di=bbR(MOSI); //same as MISO on 2-wire
          bbL(CLK,bitbang.delayClock);;//set clock low
 
          //get MSB first
          dat=dat<<1;//shift the data input byte bits
          if(di)dat++;//if datapin in is high, set LBS

      }
      return dat;
    }

 
In the same link it is even stated that firmware v4.2 have not any problem there, so first I started looking for its source code but no joy.
I found the source code of the version 4.3 though.
By looking inside it I saw a lot of differences compared on the latest releases, mostly obout the scheme of the messages.
That said, I took some lines of the od code and I put them into the recent one, also uncommenting some remark.
I added lines 192-194 from the old release
 
   //force LSB fist setting for ISO compliance
   //c=modeConfig.lsbEN;//store origional setting
   //modeConfig.lsbEN=1;

 
between line 216 and 217 of the new one so that I got this:
 
// R2W macros
 
//ISO 7813-3 Answer to reset macro for smartcards
// syntax: a0%255@^a
// **depricated, some cards are MSB first** forces LSB format for easy use
// now uses CS pin instead of AUX pin because 1,2,3 have build in pullups on CS but not AUX
void r2wMacro_78133Write(void){
 
   //bpWline("ISO 7816-3 ATR (RESET on CS)");
   //bpWline("RESET HIGH, CLOCK TICK, RESET LOW");
   BPMSG1145;
   
   //Reset needs to start low
   bbCS(0); //bpAuxLow();
   bp_delay_us(0xff);
   
   //RESET HIGH
   bbCS(1);
 
   //clock tick
   bbClockTicks(1);
 
   //reset low again
   bbCS(0); //bpAuxLow();
}
    
void r2wMacro_78133Read(void){   
   unsigned char m[4];//macro buffer...
   unsigned char c;
   unsigned int i;
 
   //bpWstring("ISO 7816-3 reply (uses current LSB setting): ");
   BPMSG1146;
   
   //force LSB fist setting for ISO compliance
   c=modeConfig.lsbEN;//store origional setting
   modeConfig.lsbEN=1;

 
I made changes only on raw2wire.c, do not for bitbang.c, which I do not even know how to do there.
In the end it is appeared that raw2wire.c is like the old one from the release 4.3, but unfortunately it does not work, macros act same like before of the modifications.
I wonder if it fails because also bitbang.c must be modified.
I posted this same text into github "2WIRE macros do not work #17" (https://github.com/BusPirate/Bus_Pirate/issues/17 (https://github.com/BusPirate/Bus_Pirate/issues/17))
 
Thanks.
 
Be seeing you.
 
U.Sb
Title: Re: Bus Pirate - Community Firmware 7.0
Post by: USBEprom on October 30, 2016, 09:02:46 pm
Hi guys.
About macro(1) and macro(2) issues in 2wire mode, here you go further informations.
Normally I already use LSB setting purposely doing stuff on chip cards like sle4442.
Due the problem I tried to set MSB instead of LSB and vice versa too, but nothing changes.
The output on the terminal is always wrong, it is 0x45 0xC8 0x08 0x89 instead of 0xA2 0x13 0x10  0x91.
The firmware that I built from myself acts exactly the same way as the official ones released after version 4.2.
I have no any logic analyzer so a friend of mine did some captures for me.
His analyzer does not allow for 2WIRE, or as it is the correct name that I do not know, so he used SPI how it is explained here:
 
http://dangerousprototypes.eu/forum/vie ... 914#p63509 (http://dangerousprototypes.eu/forum/viewtopic.php?f=4&t=7914#p63509)
 
For what I can see seems that macro(1) is issued correctly but then the bytes in the terminal are put always MSB with no regard to LSB/MSB setting of the Bus Pirate, indeed analyzer shows 0xA2 0x13 0x10  0x91 that is the correct answer.
So totally it depends on a wrong order while printing the results into the terminal.
 
Instead for macro(2) seems that the problem, or one of the possible problems, is that RESET is not emitted at all, so analyzer can not trigger the start event and by forcing it only clock is captured.
 
I posted a similar text into github "2WIRE macros do not work #17" (https://github.com/BusPirate/Bus_Pirate/issues/17 (https://github.com/BusPirate/Bus_Pirate/issues/17))

Thanks.

Be seeing you.

U.Sb
Title: Re: Bus Pirate - Community Firmware 7.0
Post by: USBEprom on October 30, 2016, 10:29:22 pm
Hi guys.
About the new speed into the SPI menu, a friend of mine has just checked their correctness with his logic analyzer.
Seems that from 1 to 7 all it is OK, but starting from 8 until 12 do not work.
Briefly:
 
Set speed:
1.  30KHz OK [old]
 2. 125KHz OK [old]
 3. 250KHz OK [old]
 4.  1MHz OK [old]
 5.  50KHz OK [NEW]
 6. 1.3MHz OK [NEW]
 7.  2MHz OK [NEW]

 8. 2.6MHz (DOES NOT WORK) [NEW]
 9. 3.2MHz (DOES NOT WORK) [NEW]
10.  4MHz (DOES NOT WORK) [NEW]
11. 5.3MHz (DOES NOT WORK) [NEW]
12.  8MHz (DOES NOT WORK) [NEW]

 
Perhaps I was wrong to calculate the values for the prescalers, I must check.
The logic analyzer is in the position to acquire up 24MHz so it should not have problem with those speed.
However that friend of mine said me he will check with an oscilloscope.
Sorry.
 
Duty cycle is not always 50% or near, but I guess that is pretty normal, even because using the FLASHROM program 8MHz speed behaves in the same way.
 
I posted a similar text into github "Investigate adding new bus speeds to the SPI module #25" (https://github.com/BusPirate/Bus_Pirate/issues/25 (https://github.com/BusPirate/Bus_Pirate/issues/25))
 
Thanks.
 
Be seeing you.
 
U.Sb
Title: Re: Bus Pirate - Community Firmware 7.0
Post by: USBEprom on October 31, 2016, 07:04:42 pm
Hi guys.
The usual friend of mine has rechecked with an oscilloscope and actually them all are functioning well (thanks to agatti!).
It has been a fault of his cheap logic analyzer which can manage only 5V and 3,3V levels while moving up in frequency the amplitude of the signal generated by the Bus Pirate is below its acquisition threshold.
So in the end all the entries into the menu are working in the correct way as expected.
 
Set speed:
1.  30KHz OK [old]
 2. 125KHz OK [old]
 3. 250KHz OK [old]
 4.  1MHz OK [old]
 5.  50KHz OK [NEW]
 6. 1.3MHz OK [NEW]
 7.  2MHz OK [NEW]
 8. 2.6MHz OK [NEW]
 9. 3.2MHz OK [NEW]
10.  4MHz OK [NEW]
11. 5.3MHz OK [NEW]
12.  8MHz OK [NEW]

 
Duty cycle works correctly too.
In some ranges it is far from 50% but that is pretty normal.
It behaves exactly as is to be expected, no problem.
One more time I repeat that improvement made by agatti is 100% good and functioning.
I posted a similar text into github "Investigate adding new bus speeds to the SPI module #25" (https://github.com/BusPirate/Bus_Pirate/issues/25 (https://github.com/BusPirate/Bus_Pirate/issues/25))
 
Thanks.
 
Be seeing you.
 
U.Sb
Title: Re: Bus Pirate - Community Firmware 7.0
Post by: USBEprom on October 31, 2016, 08:13:51 pm
Hi guys.
OK, thanks to agatti macro(1) now it works!
By querying a 4442 card I get 0xA2 0x13 0x10 0x91 when in Bus Pirate the order of the bytes is set for LSB, while instead 0x45 0xC8 0x08 0x89 when it is set MSB.
Issue in macro(1) is gone now, it works by honoring LSB/MSB setting (L/l syntax command of the Bus Pirate) in the right way in accordance with the type of chip card used.
Here are the output of the terminal for chip card 4442 in the case of bytes order LSB (right) and then MSB (wrong):
 
2WIRE>L
LSB set: LEAST sig bit first
2WIRE>(1)
ISO 7816-3 ATR (RESET on CS)
RESET HIGH, CLOCK TICK, RESET LOW
ISO 7816-3 reply (uses current LSB setting): 0xA2 0x13 0x10 0x91
Protocol: 2 wire
Read type: to end
Data units: 256
Data unit length (bits): 8
 
2WIRE>l
MSB set: MOST sig bit first
2WIRE>(1)
ISO 7816-3 ATR (RESET on CS)
RESET HIGH, CLOCK TICK, RESET LOW
ISO 7816-3 reply (uses current LSB setting): 0x45 0xC8 0x08 0x89
Protocol: unknown
Read type: variable length
Data units: 32768
Data unit length (bits): 1
 
Obviously macro(2) is not affected by the changes so still it does not works probably because of the failure of the chip enable select.
About that a friend of mine who own an oscilloscope is doing some verifications.
 
2WIRE>(2)
ISO 7816-3 reply (uses current LSB setting): 0xFF 0xFF 0xFF 0xFF
Protocol: RFU
Read type: variable length
Data units: RFU
Data unit length (bits): 128
 
Close up view macro(2)
 
2WIRE>(2)
ISO 7816-3 reply (uses current LSB setting): 0xFF 0xFF 0xFF 0xFF
Protocol: RFU
Read type: variable length
Data units: RFU
Data unit length (bits): 128
 
is not so different from macro(1)
 
2WIRE>(1)
ISO 7816-3 ATR (RESET on CS)
RESET HIGH, CLOCK TICK, RESET LOW
ISO 7816-3 reply (uses current LSB setting): 0xA2 0x13 0x10 0x91
Protocol: 2 wire
Read type: to end
Data units: 256
Data unit length (bits): 8
 
And last but not least, here you go a new version that I just built starting from the latest Bus_Pirate-master (https://github.com/BusPirate/Bus_Pirate ... master.zip (https://github.com/BusPirate/Bus_Pirate/archive/master.zip)) and some improvements made by agatti (https://github.com/BusPirate/Bus_Pirate ... source.zip (https://github.com/BusPirate/Bus_Pirate/files/521122/extra-spi-source.zip)).
It has even macro(1) fixed in 2WIRE menu (https://github.com/BusPirate/Bus_Pirate/issues/17 (https://github.com/BusPirate/Bus_Pirate/issues/17)).
In this release all the features are enabled, BASIC too, the command line limit is up 32 characters.
I had to set 32 characters for the command line by change the line 502 into configuration.h, lines 496-505, in this way:
 
/**
* How big the serial command buffer can be, in bytes.
*
* @warning This must be set to a power of two, ie. 256, 128, 64, 32, etc.
*/
#ifdef BUSPIRATEV3
#define BP_COMMAND_BUFFER_SIZE 32
#else
#define BP_COMMAND_BUFFER_SIZE 256
#endif /* BUSPIRATEV3 */
 
In order to enable all the features into configuration.h I had to change lines 304-319 too in this way:
 
#ifdef BUSPIRATEV3
#define BP_ENABLE_1WIRE_SUPPORT
#define BP_ENABLE_BASIC_SUPPORT
#define BP_ENABLE_DIO_SUPPORT
#define BP_ENABLE_HD44780_SUPPORT
#define BP_ENABLE_I2C_SUPPORT
#define BP_ENABLE_JTAG_SUPPORT
#define BP_ENABLE_PIC_SUPPORT
#define BP_ENABLE_PC_AT_KEYBOARD_SUPPORT
#define BP_ENABLE_RAW_2WIRE_SUPPORT
#define BP_ENABLE_RAW_3WIRE_SUPPORT
#define BP_ENABLE_SMPS_SUPPORT
#define BP_ENABLE_SPI_SUPPORT
#define BP_ENABLE_SUMP_SUPPORT
#define BP_ENABLE_UART_SUPPORT
#endif /* BUSPIRATEV3 */
 
Of course I made the changes suggested by agatti for raw2wire.c and then used his modified version for compiling the firmware that I built myself.
For me it works well.
Thanks so much to agatti!
I posted a similar text into github "2WIRE macros do not work #17" (https://github.com/BusPirate/Bus_Pirate/issues/17 (https://github.com/BusPirate/Bus_Pirate/issues/17))
 
Thanks.
 
Be seeing you.
 
U.Sb
Title: Re: Bus Pirate - Community Firmware 7.0
Post by: USBEprom on October 31, 2016, 08:25:35 pm
Hi guys.
And now another one, one different version.
It is the one that I just built starting from the latest Bus_Pirate-master (https://github.com/BusPirate/Bus_Pirate ... master.zip (https://github.com/BusPirate/Bus_Pirate/archive/master.zip)) and some improvements made by agatti (https://github.com/BusPirate/Bus_Pirate ... source.zip (https://github.com/BusPirate/Bus_Pirate/files/521122/extra-spi-source.zip)).
It has even macro(1) fixed in 2WIRE menu ((https://github.com/BusPirate/Bus_Pirate/issues/17 (https://github.com/BusPirate/Bus_Pirate/issues/17)).
In this release all the features are enabled except BASIC, the command line limit is up 256 characters.
I had to set 256 characters for the command line by change the line 502 into configuration.h, lines 496-505, in this way:
 
/**
* How big the serial command buffer can be, in bytes.
*
* @warning This must be set to a power of two, ie. 256, 128, 64, 32, etc.
*/
#ifdef BUSPIRATEV3
#define BP_COMMAND_BUFFER_SIZE 256
#else
#define BP_COMMAND_BUFFER_SIZE 256
#endif /* BUSPIRATEV3 */
 
In order to enable the selected features into configuration.h I had to change lines 304-319 too in this way:
 
#ifdef BUSPIRATEV3
#define BP_ENABLE_1WIRE_SUPPORT
#undef BP_ENABLE_BASIC_SUPPORT
#define BP_ENABLE_DIO_SUPPORT
#define BP_ENABLE_HD44780_SUPPORT
#define BP_ENABLE_I2C_SUPPORT
#define BP_ENABLE_JTAG_SUPPORT
#define BP_ENABLE_PIC_SUPPORT
#define BP_ENABLE_PC_AT_KEYBOARD_SUPPORT
#define BP_ENABLE_RAW_2WIRE_SUPPORT
#define BP_ENABLE_RAW_3WIRE_SUPPORT
#define BP_ENABLE_SMPS_SUPPORT
#define BP_ENABLE_SPI_SUPPORT
#define BP_ENABLE_SUMP_SUPPORT
#define BP_ENABLE_UART_SUPPORT
#endif /* BUSPIRATEV3 */
 
Of course I made the changes suggested by agatti for raw2wire.c and then used his modified version for compiling the firmware that I built myself.
For me it works well.
Here are the output of the terminal for chip card 4442 in the case of bytes order LSB (right) and then MSB (wrong):
 
2WIRE>L
LSB set: LEAST sig bit first
2WIRE>(1)
ISO 7816-3 ATR (RESET on CS)
RESET HIGH, CLOCK TICK, RESET LOW
ISO 7816-3 reply (uses current LSB setting): 0xA2 0x13 0x10 0x91
Protocol: 2 wire
Read type: to end
Data units: 256
Data unit length (bits): 8
 
2WIRE>l
MSB set: MOST sig bit first
2WIRE>(1)
ISO 7816-3 ATR (RESET on CS)
RESET HIGH, CLOCK TICK, RESET LOW
ISO 7816-3 reply (uses current LSB setting): 0x45 0xC8 0x08 0x89
Protocol: unknown
Read type: variable length
Data units: 32768
Data unit length (bits): 1
 
Thanks so much to agatti!
I posted a similar text into github "2WIRE macros do not work #17" (https://github.com/BusPirate/Bus_Pirate/issues/17 (https://github.com/BusPirate/Bus_Pirate/issues/17))
 
Thanks.
 
Be seeing you.
 
U.Sb
Title: Re: Bus Pirate - Community Firmware 7.0
Post by: USBEprom on November 01, 2016, 12:27:28 pm
Hi guys.
Some personal thoughts about macro(2) failure.
Because I am babo and I do not know programming, I can not but note that it appears that in macro(2) there is no trigger to start it.
I mean, in macro(1) there is something like this
 
   //Reset needs to start low
 
   bbCS(0); //bpAuxLow();
 
   bp_delay_us(0xff);
 
   //RESET HIGH
 
   bbCS(1);
 
   //clock tick
 
   bbClockTicks(1);
 
   //reset low again
 
   bbCS(0); //bpAuxLow();

 
that seems to prepare the start of the procedure, instead in macro(2) nothing.
I never saw and not even know if it is existed a firmware where macro(2) was working.
I know in firmware v4.2 macro(1) was working but macro(2) was not already in the time.
I have not the source code of v4.2, I have only the hexadecimal file, but I have the one of the official release v4.3 and is no trigger at all there for starting macro(2) inside it.
I believe some code is missing from the beginning.
I guess macro(1) and macro(2) are not so different.
More or less them perform the same task with macro(2) that is responsible for parsing the ATR string acquired.
By performing macro(1) without any card in the reader the result that can be obtained is something very similar to what is obtained with macro(2), does not matter if card is or is not inserted inside the reader.
This thing is instrumentally corroborated by logic analyzer and oscilloscope giving an evidence that actually no starting signal for the procedure is issued when performing macro(2).
Maybe it would be enough to simply copy and paste into macro(2) the same code that inside macro (1) is intended to prepare and start the procedure.
And more, maybe it would be also need to add the same or similar changes introduced to make macro(1) functioning, who knows.
I posted a similar text into github "2WIRE macros do not work #17" (https://github.com/BusPirate/Bus_Pirate/issues/17 (https://github.com/BusPirate/Bus_Pirate/issues/17))
 
Thanks.
 
Be seeing you.
 
U.Sb
Title: Re: Bus Pirate - Community Firmware 7.0
Post by: USBEprom on November 01, 2016, 10:17:57 pm
Hi guys.
Also macro(2) has been fixed by agatti, so now issue in 2WIRE menu is gone.
Thanks agatti!
Please take a look here:
https://github.com/BusPirate/Bus_Pirate/issues/17 (https://github.com/BusPirate/Bus_Pirate/issues/17)
Seems that mames for macros were wrong because related to ISO-7816 an not ISO-7813 as stated into the code.
About the possible reason because macro(2) does not have any trigger it is likely that it exists to listen for data on the bus when the ATR signal is being sent from something else, which in a way is just what the Bus Pirate was meant to be used for.

Thanks.

Be seeing you.

U.Sb
Title: Re: Bus Pirate - Community Firmware 7.0
Post by: USBEprom on November 04, 2016, 11:43:32 pm
Hi guys.
By following the latest hints from agatti (https://github.com/BusPirate/Bus_Pirate/issues/7 (https://github.com/BusPirate/Bus_Pirate/issues/7)) I was able to reach my goal to make a firmware release for the Bus Pirate v3 able to allow up 256 characters for the command line and all the available features enabled, even BASIC scripting, although with reduced RAM room compared to standard release.
So here you go this very newest version that I just built starting from the latest Bus_Pirate-master (https://github.com/BusPirate/Bus_Pirate ... master.zip (https://github.com/BusPirate/Bus_Pirate/archive/master.zip)) that alread has all the improvements made by agatti, even the last 2WIRE fix.
In this release all the features are enabled, BASIC too, the command line allows up 256 characters, there are new speeds in SPI mode and macro(1) and macro(2) in 2WIRE mode are fixed (all improvements and fix made by agatti that I thank for).
I had to set 256 characters for the command line by change the line 502 into configuration.h, lines 496-505, in this way:
 
/**
* How big the serial command buffer can be, in bytes.
*
* @warning This must be set to a power of two, ie. 256, 128, 64, 32, etc.
*/
#ifdef BUSPIRATEV3
#define BP_COMMAND_BUFFER_SIZE 256
#else
#define BP_COMMAND_BUFFER_SIZE 256
#endif /* BUSPIRATEV3 */
 
In order to enable all the features into configuration.h I had to change lines 304-319 too in this way:
 
#ifdef BUSPIRATEV3
#define BP_ENABLE_1WIRE_SUPPORT
#define BP_ENABLE_BASIC_SUPPORT
#define BP_ENABLE_DIO_SUPPORT
#define BP_ENABLE_HD44780_SUPPORT
#define BP_ENABLE_I2C_SUPPORT
#define BP_ENABLE_JTAG_SUPPORT
#define BP_ENABLE_PIC_SUPPORT
#define BP_ENABLE_PC_AT_KEYBOARD_SUPPORT
#define BP_ENABLE_RAW_2WIRE_SUPPORT
#define BP_ENABLE_RAW_3WIRE_SUPPORT
#define BP_ENABLE_SMPS_SUPPORT
#define BP_ENABLE_SPI_SUPPORT
#define BP_ENABLE_SUMP_SUPPORT
#define BP_ENABLE_UART_SUPPORT
#endif /* BUSPIRATEV3 */
 
Then I had to set 512 into line number 105 of basic.h so that it has changed like this:
 
#define PGMSIZE 512[/b][/size]

In this way I have got a firmware version for the Bus Pirate revision 3 where are allowed up 256 characters for the command line and all the available features are enabled, even BASIC scripting, althought with reduced RAM room compared to standard release (half room in this release by comparing standard line 105 in basic.h which is #define PGMSIZE 1024 before the change).
https://github.com/BusPirate/Bus_Pirate/issues/7 (https://github.com/BusPirate/Bus_Pirate/issues/7)
For me it works great (many thanks agatti!).
 
Thanks.
 
Be seeing you.
 
U.Sb
Title: Re: Bus Pirate - Community Firmware 7.0
Post by: joeblack on November 05, 2016, 01:25:32 pm
Thanks for the "gold (Full)BP3version" works like a charm with all enabled, more SPI speed working macros and up to 256 characters for the command line.
Good job!
joeblack

Note: i only got the "busPirate.FULL_s.hex" working, the other one won´t be flashed in my BPV3.
        something like checksum error....
Title: Re: Bus Pirate - Community Firmware 7.0
Post by: USBEprom on November 05, 2016, 07:33:55 pm
Hi joeblack.
Sorry, you are right, I am pretty babo!
Firmware compressed option "1" does not work because I have forgot to convert it uppercase, apologize me.
Here you go the correct one.
However it was not me, all the work was done by agatti and others, I only suggested the changes and provided the table of the prescalers for the new speeds in the SPI menu.
Thanks.

Be seeing you.

U.Sb
Title: Re: Bus Pirate - Community Firmware 7.0
Post by: joeblack on November 05, 2016, 08:07:47 pm
I know, but nevertheless I would like to thank you all and specifically you and agatti for providing latest hex files,
especially more SPI speed  is very useful for me....
most times now i use my Raspi for doing SPI stuff, but i love my smart swiss army knife (BPV3), it saved my life one year ago when i had to repair some defectiv Pogo E02 (damaged bootloader) and i learned a lot by using BP.
joeblack
Title: Re: Bus Pirate - Community Firmware 7.0
Post by: USBEprom on November 10, 2016, 10:04:08 pm
Hi guys.
By following the latest hints from agatti (https://github.com/BusPirate/Bus_Pirate/issues/16 (https://github.com/BusPirate/Bus_Pirate/issues/16)) I was able to build a firmware release for the Bus Pirate v3 where in DIO mode the message of start callback is silent.
This same release allow up 256 characters for the command line and all the available features are enabled, even BASIC scripting.
So here you go this very newest version that I just built starting from the latest Bus_Pirate-master (https://github.com/BusPirate/Bus_Pirate ... master.zip (https://github.com/BusPirate/Bus_Pirate/archive/master.zip)) that already has all the improvements made by agatti and others until now.
In this release all the features are enabled, BASIC too, the command line allows up 256 characters, there are new speeds in SPI mode, macro(1) and macro(2) in 2WIRE mode are fixed and in the end in DIO mode the message of start callback is silent (all improvements and fix made by agatti that I really thank for).
I had to set 256 characters for the command line by change the line 502 into configuration.h, lines 496-505, in this way:
 
/**
* How big the serial command buffer can be, in bytes.
*
* @warning This must be set to a power of two, ie. 256, 128, 64, 32, etc.
*/
#ifdef BUSPIRATEV3
#define BP_COMMAND_BUFFER_SIZE 256
#else
#define BP_COMMAND_BUFFER_SIZE 256
#endif /* BUSPIRATEV3 */
 
In order to enable all the features into configuration.h I had to change lines 304-319 too in this way:
 
#ifdef BUSPIRATEV3
#define BP_ENABLE_1WIRE_SUPPORT
#define BP_ENABLE_BASIC_SUPPORT
#define BP_ENABLE_DIO_SUPPORT
#define BP_ENABLE_HD44780_SUPPORT
#define BP_ENABLE_I2C_SUPPORT
#define BP_ENABLE_JTAG_SUPPORT
#define BP_ENABLE_PIC_SUPPORT
#define BP_ENABLE_PC_AT_KEYBOARD_SUPPORT
#define BP_ENABLE_RAW_2WIRE_SUPPORT
#define BP_ENABLE_RAW_3WIRE_SUPPORT
#define BP_ENABLE_SMPS_SUPPORT
#define BP_ENABLE_SPI_SUPPORT
#define BP_ENABLE_SUMP_SUPPORT
#define BP_ENABLE_UART_SUPPORT
#endif /* BUSPIRATEV3 */
 
Then I had to set 512 into line number 105 of basic.h so that it has changed like this:
 
#define PGMSIZE 512[/b][/size]
 
It has not need to change anything else because agatti already has pushed all the upgraded files into the repository.
Just download and use them.
In this way I have got a firmware version for the Bus Pirate revision 3 where are allowed up 256 characters for the command line and all the available features are enabled, even BASIC scripting, althought with reduced RAM room compared to standard release (half room in this release by comparing standard line 105 in basic.h which is #define PGMSIZE 1024 before the change).
https://github.com/BusPirate/Bus_Pirate/issues/7 (https://github.com/BusPirate/Bus_Pirate/issues/7)
As always for me it works great.
Many, many thanks agatti!
 
Thanks.
 
Be seeing you.
 
U.Sb
Title: Re: Bus Pirate - Community Firmware 7.0
Post by: USBEprom on November 12, 2016, 10:28:46 pm
Hi guys.
By following the latest hints from agatti (https://github.com/BusPirate/Bus_Pirate/issues/7 (https://github.com/BusPirate/Bus_Pirate/issues/7)) I was able to build a firmware for the Bus Pirate v3 using the new cleaned up repository (https://github.com/BusPirate/Bus_Pirate ... master.zip (https://github.com/BusPirate/Bus_Pirate/archive/master.zip)).
This release is the same as the previous I provided here into the forum (GOLDEN_DIO.zip) except that this one was built from the new cleaned repository which uses only configuration.h for the configuration.
So into configuration.h I changed lines from 304 to 319 for setting all the features I want.
 
#ifdef BUSPIRATEV3
#define BP_ENABLE_1WIRE_SUPPORT
#define BP_ENABLE_BASIC_SUPPORT
#define BP_ENABLE_DIO_SUPPORT
#define BP_ENABLE_HD44780_SUPPORT
#define BP_ENABLE_I2C_SUPPORT
#define BP_ENABLE_JTAG_SUPPORT
#define BP_ENABLE_PIC_SUPPORT
#define BP_ENABLE_PC_AT_KEYBOARD_SUPPORT
#define BP_ENABLE_RAW_2WIRE_SUPPORT
#define BP_ENABLE_RAW_3WIRE_SUPPORT
#define BP_ENABLE_SMPS_SUPPORT
#define BP_ENABLE_SPI_SUPPORT
#define BP_ENABLE_SUMP_SUPPORT
#define BP_ENABLE_UART_SUPPORT
#endif /* BUSPIRATEV3 */
 
Then I changed the line 405 too in this way in order to make room for BASIC scripting
 
#define BP_BASIC_PROGRAM_SPACE 512[/b][/size]
 
Finally I had to set line 523 for up 256 characters into the command line by changing it in this way
 
/**
* How big the serial command buffer can be, in bytes.
*
* @warning This must be set to a power of two, ie. 256, 128, 64, 32, etc.
*/
#ifdef BUSPIRATEV3
#define BP_COMMAND_BUFFER_SIZE 256
#else
#define BP_COMMAND_BUFFER_SIZE 256
#endif /* BUSPIRATEV3 */
 
I have done this more than anything else to test the new repository and become familiar with the new setting.
For me it works great.
Thanks a lot to agatti for having fixed the repository!
 
Thanks.
 
Be seeing you.
 
U.Sb
Title: Re: Bus Pirate - Community Firmware 7.0
Post by: joeblack on January 22, 2017, 11:40:30 am
Hi USBEprom, i saw there were some small improvements (like on i2c) since your last compilation from above.
Would you be so kind, compile and share the latest version for BP V3 based on changelog 7.1:
https://github.com/BusPirate/Bus_Pirate ... ANGELOG.md (https://github.com/BusPirate/Bus_Pirate/blob/master/CHANGELOG.md)

Thanks for your and agattis help to keep BPv3 allive
Joe black
Title: Re: Bus Pirate - Community Firmware 7.0
Post by: USBEprom on January 22, 2017, 09:01:48 pm
Hi joeblack.
Unfortunately due of something which is hard to identify after the applying of the improvements I2C does not work as expected.
agatti was able to produce a new code with which it is possible to enable I2C protocol via hardware, not only software.
Using his code I have built different firmware where unfortunately I2C protocol works for the hardware side but does not for the software.
When in hardware I2C then timings are right, when in software I2C then timings are too slow does not matching the code.
It seems that the culprit may be the patch #23 which was introduced in order to correct timings for the 1-WIRE protocol but that no one knows how it interferes with the I2C protocol.
agatti bought some specific hardware to solve the problem but for now there is not a solution.
At the moment is not possible build a new firmware omitting the patch #23.
Furthermore in order to unlock the hardware I2C protocol agatti introduced some workarounds (http://ww1.microchip.com/downloads/en/D ... 00470j.pdf (http://ww1.microchip.com/downloads/en/DeviceDoc/80000470j.pdf)) that do not make it safe to use the new firmware with all the Bus Pirate v3 due differences into the silicon layer of the PICs used.
For all this reason I can not share my new firmwares.
Take a look at these:
 
https://github.com/BusPirate/Bus_Pirate/issues/39 (https://github.com/BusPirate/Bus_Pirate/issues/39)
https://github.com/BusPirate/Bus_Pirate ... -269915680 (https://github.com/BusPirate/Bus_Pirate/issues/39#issuecomment-269915680)
https://github.com/BusPirate/Bus_Pirate/issues/23 (https://github.com/BusPirate/Bus_Pirate/issues/23)
https://github.com/BusPirate/Bus_Pirate ... -271163833 (https://github.com/BusPirate/Bus_Pirate/issues/23#issuecomment-271163833)

Thanks.

Be seeing you.

U.Sb
Title: Re: Bus Pirate - Community Firmware 7.0
Post by: joeblack on January 23, 2017, 04:21:33 pm
No problem, thanks for the infos, hope agatti will find a solution.
i will track the thread.
joe black
Title: Re: Bus Pirate - Community Firmware 7.0
Post by: mikeb on April 06, 2017, 09:41:36 am
Hopefully more people will discover about this project
Title: Re: Bus Pirate - Community Firmware 7.0
Post by: USBEprom on April 07, 2017, 10:24:54 pm
Hi mikeb.
I agree.
Unfortunately until now no progress about problems into the SPI and I2C protocol.
Even using the latest repository SPI and I2C still do not work on Bus Pirate revision 3.
I wonder if Bus Pirate revision 4 has not them because I have read nothing about them related with Bus Pirate revision 4.
Hoping in the future.

Be seeing you.

U.Sb
Title: Re: Bus Pirate - Community Firmware 7.0
Post by: USBEprom on April 15, 2017, 06:06:01 pm
Hi guys.
agatti has recently fixed the problems with SPI and 2WIRE protocols (https://github.com/BusPirate/Bus_Pirate/issues/45 (https://github.com/BusPirate/Bus_Pirate/issues/45)) and (https://github.com/BusPirate/Bus_Pirate/issues/46 (https://github.com/BusPirate/Bus_Pirate/issues/46)).
So I was able to build new firmwares v7.1 for the Bus Pirate revision 3 using the new repository (https://github.com/BusPirate/Bus_Pirate ... master.zip (https://github.com/BusPirate/Bus_Pirate/archive/master.zip)).
I made two versions that i named SAFE_13042017 and UNSAFE_13042017.
Both of them have all the features enabled, BASIC too, the command line allows up 256 characters.
The first one (SAFE_13042017) simply it has all the fixes provided by agatti in order to make working again the SPI and 2WIRE protocols.
So into configuration.h I changed lines from 316 to 331 in order to enable all the features available, BASIC too.

#ifdef BUSPIRATEV3
#define BP_ENABLE_1WIRE_SUPPORT
#define BP_ENABLE_BASIC_SUPPORT
#define BP_ENABLE_DIO_SUPPORT
#define BP_ENABLE_HD44780_SUPPORT
#define BP_ENABLE_I2C_SUPPORT
#define BP_ENABLE_JTAG_SUPPORT
#define BP_ENABLE_PIC_SUPPORT
#define BP_ENABLE_PC_AT_KEYBOARD_SUPPORT
#define BP_ENABLE_RAW_2WIRE_SUPPORT
#define BP_ENABLE_RAW_3WIRE_SUPPORT
#define BP_ENABLE_SMPS_SUPPORT
#define BP_ENABLE_SPI_SUPPORT
#define BP_ENABLE_SUMP_SUPPORT
#define BP_ENABLE_UART_SUPPORT
#endif /* BUSPIRATEV3 */


Then I changed the line 417 too in this way in order to make room for BASIC scripting:

#define BP_BASIC_PROGRAM_SPACE 512

Finally I had to set line 535 for up 256 characters into the command line by changing it in this way:

/**
* How big the serial command buffer can be, in bytes.
*
* @warning This must be set to a power of two, ie. 256, 128, 64, 32, etc.
*/
#ifdef BUSPIRATEV3
#define BP_COMMAND_BUFFER_SIZE 256
#else
#define BP_COMMAND_BUFFER_SIZE 256
#endif /* BUSPIRATEV3 */

 
The result that I have achieved I have called it SAFE_13042017_1.hex and SAFE_13042017_s.hex.
SAFE_13042017_1.hex was obtained by using the compression option "1" of MPLAB, while instead for SAFE_13042017_s.hex I used compression option "s".
Compression option "1" assure right timing that option "s" may not ensure.
So the firmware to use is SAFE_13042017_1.hex, SAFE_13042017_s.hex was built only for test.
For me it works great.
Thanks a lot to agatti for having fixed the repository!

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

The second one (UNSAFE_13042017) plus all the fixes provided by agatti in order to make working again the SPI and 2WIRE protocols, it has the HARDWARE mode unlocked for the I2C protocol.
Indeed in the recent past agatti taught how to free the HARDWARE mode inside I2C protocol (https://github.com/BusPirate/Bus_Pirate/issues/39 (https://github.com/BusPirate/Bus_Pirate/issues/39)).
Please read the above link carefully!
As agatti wrote:
"Dangerous Prototypes' original firmware did not use hardware I2C due to hardware bugs in PIC24FJ64GA004 chips with revision A3 or A4.
Now that hardware I2C is enabled again and the appropriate workarounds detailed here (http://ww1.microchip.com/downloads/en/D ... 00470j.pdf (http://ww1.microchip.com/downloads/en/DeviceDoc/80000470j.pdf)) have been applied, we need to test those on real hardware.

The catch: the code is experimental and it may or may not mess up with your hardware, just in case."
In order to build this new enhanced firmware into configuration.h I changed lines from 316 to 331 in order to enable all the features available, BASIC too.

#ifdef BUSPIRATEV3
#define BP_ENABLE_1WIRE_SUPPORT
#define BP_ENABLE_BASIC_SUPPORT
#define BP_ENABLE_DIO_SUPPORT
#define BP_ENABLE_HD44780_SUPPORT
#define BP_ENABLE_I2C_SUPPORT
#define BP_ENABLE_JTAG_SUPPORT
#define BP_ENABLE_PIC_SUPPORT
#define BP_ENABLE_PC_AT_KEYBOARD_SUPPORT
#define BP_ENABLE_RAW_2WIRE_SUPPORT
#define BP_ENABLE_RAW_3WIRE_SUPPORT
#define BP_ENABLE_SMPS_SUPPORT
#define BP_ENABLE_SPI_SUPPORT
#define BP_ENABLE_SUMP_SUPPORT
#define BP_ENABLE_UART_SUPPORT
#endif /* BUSPIRATEV3 */


Then I changed the line 417 too in this way in order to make room for BASIC scripting:

#define BP_BASIC_PROGRAM_SPACE 512

And then I had to set line 535 for up 256 characters into the command line by changing it in this way:

/**
* How big the serial command buffer can be, in bytes.
*
* @warning This must be set to a power of two, ie. 256, 128, 64, 32, etc.
*/
#ifdef BUSPIRATEV3
#define BP_COMMAND_BUFFER_SIZE 256
#else
#define BP_COMMAND_BUFFER_SIZE 256
#endif /* BUSPIRATEV3 */

 
Finally I had to put a remark sign ("//") inside line 382 and 391 in order to unlock the HARDWARE mode for the I2C protocol:

382 // #ifdef BUSPIRATEV4

391 // #endif /* BUSPIRATEV4 */
 
The result that I have achieved I have called it UNSAFE_13042017_1.hex and UNSAFE_13042017_s.hex.
UNSAFE_13042017_1.hex was obtained by using the compression option "1" of MPLAB, while instead for UNSAFE_13042017_s.hex I used compression option "s".
Compression option "1" assure right timing that option "s" may not ensure.
So the firmware to use is UNSAFE_13042017_1.hex, UNSAFE_13042017_s.hex was built only for test.

For me it works but you use it at your own risk, I do not take any responsibility about the possibility of damaging your Bus Pirate or whatever!
Attention please!
First to attempt to use this version of the firmware you have to evaluate what is the silicon revision of the PIC used in your device, paying much attention to the fact that you might damage your device or whatever!
For this reason the archive which contains this unsafe version of the firmware v7.1 is password protected.
The password is:

 
UNSAFE_FW
 
all uppercase.
You have to insert it in order to unpack the firmware.
By doing it you must to assume all the responsibility for your action.
You use it at your own risk, I do not take any responsibility about the possibility of damaging your Bus Pirate or whatever!


Thanks a lot to agatti for having fixed the repository and freed the HARDWARE mode inside of I2C protocol!

Be seeing you.

U.Sb
Title: Re: Bus Pirate - Community Firmware 7.0
Post by: A340 on April 16, 2017, 08:10:45 am
Hi USBEprom,

I am new to Bus Pirate. I will like to upgrade it to your 7.1 FW. Below are my current specification. I loaded 6.1 using Ds30 Loader.
However when I try to load your 7.1, I am not seeing the tick in the write program box and Ds30 is saying nothing to do.
Can you tell me how to get your 7.1 on my board please. Thanks.

Bus Pirate v3.5
Firmware v6.1 r1676  Bootloader v4.4
DEVID:0x0447 REVID:0x3046 (24FJ64GA002 B8)
http://dangerousprototypes.com (http://dangerousprototypes.com)
Title: Re: Bus Pirate - Community Firmware 7.0
Post by: USBEprom on April 16, 2017, 12:54:40 pm
Hi A340.
I know nothing about Ds30 Loader, sorry.
I use pirate-loader on Windows and it works without any problem.
Try it.
As attachment there is a pre configured environment that anyone can use with minimal changes.
Inside the archive are also provided instruction on how to use the whole thing.

Be seeing you.

U.Sb
Title: Re: Bus Pirate - Community Firmware 7.0
Post by: A340 on April 16, 2017, 04:21:53 pm
Hi USBEprom,

Thanks for the reply. I followed your instructions, as you wrote,and 7.1 loaded fine. (see Below). Thanks a lot, much appreciated. I will continue to follow this thread, as I move forward learning the Bus Pirate.

Bus Pirate v3.5
Community Firmware v7.1 - goo.gl/gCzQnW [HiZ 1-WIRE UART I2C SPI 2WIRE 3WIRE KEYB LCD PIC DIO] Bootloader v4.4
DEVID:0x0447 REVID:0x3046 (24FJ64GA00 2 B8)
http://dangerousprototypes.com (http://dangerousprototypes.com)
Title: Re: Bus Pirate - Community Firmware 7.0
Post by: USBEprom on April 17, 2017, 12:24:12 pm
Hi A340.
That is fine.
Do you mind a question?
For your upgrade have you used the "SAFE" or the "UNSAFE" version?
It would be useful to know what hardware has problems with the "UNSAFE" version and what does not.
For what it is and without any warranty with my Bus Pirate it has not problems.
However by using the "UNSAFE" version anyone must to assume all the responsibility for his action.
Use it at your own risk, I do not take any responsibility about the possibility of damaging your Bus Pirate or whatever!
Just to be clear.
Thanks.
 
Be seeing you.
 
U.Sb
Title: Re: Bus Pirate - Community Firmware 7.0
Post by: A340 on April 17, 2017, 06:25:38 pm
Hi USBEprom,

I used "SAFE" version.

A340
Title: Re: Bus Pirate - Community Firmware 7.0
Post by: marsfan on April 20, 2017, 02:52:46 am
@A340 I was told on the Github issue system that we have to use Pirate Loader, Ds30 is not supported by the community firmware.

@USBEprom, you should post/tag releases on the github page, might be easier than on this support thread.
Title: Re: Bus Pirate - Community Firmware 7.0
Post by: USBEprom on April 20, 2017, 08:19:17 pm
Hi marsfan.
I agree but, how?, where?
I know nothing about that, sorry.
 
Be seeing you.

U.Sb
Title: Re: Bus Pirate - Community Firmware 7.0
Post by: marsfan on April 25, 2017, 04:12:26 am
@USBEprom You would need to get the owner of the github repository to mark you as a contributor (not 100% sure how to do that), and then there is a way to create releases containing specific files. I know it can be done, because I have downloaded compiles programs via that before, you would need to talk with @agatti.

Here is a guide on creating releases: http://https://help.github.com/articles/creating-releases/
These guys use it a lot, and are pretty helpful, they might be able to help out with any questions if you need a person on hand: http://https://github.com/KSP-CKAN/CKAN.

I know that releases can be given tags. And I also know that you can use 3rd party systems like codeship and travis-ci to confirm builds will work, and they automatically generate new releases.
Title: Re: Bus Pirate - Community Firmware 7.0
Post by: USBEprom on May 15, 2017, 08:23:33 pm
Hi marsfan.
Sorry.
I do not understand a single word, too hard for me.
I give up, I will continue to put the new firmwares here.
I can not do anything else, sorry again.
 
Be seeing you.

U.Sb
Title: Re: Bus Pirate - Community Firmware 7.0
Post by: marsfan on June 25, 2017, 01:43:31 am
@ USBEprom

I understand, maybe in the future you could get with agatti or someone else who runs the repo and work together on it.
Title: Re: Bus Pirate - Community Firmware 7.0
Post by: USBEprom on July 16, 2017, 07:19:13 pm
Hi guys.
agatti has recently upgraded some things inside firmware v7.1.
So I was able to build new firmwares v7.1 for the Bus Pirate revision 3 using the new repository (https://github.com/BusPirate/Bus_Pirate ... master.zip (https://github.com/BusPirate/Bus_Pirate/archive/master.zip)), also because I wanted to test some modifications made by agatti on the I2C protocol.
I made two versions that i named SAFE_16072017 and UNSAFE_16072017.
Both of them have all the features enabled, BASIC too, the command line allows up 256 characters.
The first one (SAFE_16072017) is built on the configuration.h file which is in the specific folder.
So into configuration.h I changed lines from 316 to 331 in order to enable all the features available, BASIC too.

#ifdef BUSPIRATEV3
#define BP_ENABLE_1WIRE_SUPPORT
#define BP_ENABLE_BASIC_SUPPORT
#define BP_ENABLE_DIO_SUPPORT
#define BP_ENABLE_HD44780_SUPPORT
#define BP_ENABLE_I2C_SUPPORT
#define BP_ENABLE_JTAG_SUPPORT
#define BP_ENABLE_PIC_SUPPORT
#define BP_ENABLE_PC_AT_KEYBOARD_SUPPORT
#define BP_ENABLE_RAW_2WIRE_SUPPORT
#define BP_ENABLE_RAW_3WIRE_SUPPORT
#define BP_ENABLE_SMPS_SUPPORT
#define BP_ENABLE_SPI_SUPPORT
#define BP_ENABLE_SUMP_SUPPORT
#define BP_ENABLE_UART_SUPPORT
#endif /* BUSPIRATEV3 */


Then I changed the line 417 too in this way in order to make room for BASIC scripting:

#define BP_BASIC_PROGRAM_SPACE 512

Finally I had to set line 535 for up 256 characters into the command line by changing it in this way:

/**
* How big the serial command buffer can be, in bytes.
*
* @warning This must be set to a power of two, ie. 256, 128, 64, 32, etc.
*/
#ifdef BUSPIRATEV3
#define BP_COMMAND_BUFFER_SIZE 256
#else
#define BP_COMMAND_BUFFER_SIZE 256
#endif /* BUSPIRATEV3 */

 
The result that I have achieved I have called it SAFE_16072017_1.hex and SAFE_16072017_s.hex.
SAFE_16072017_1.hex was obtained by using the compression option "1" of MPLAB, while instead for SAFE_16072017_s.hex I used compression option "s".
Compression option "1" assure right timing that option "s" may not ensure.
So the firmware to use is SAFE_16072017_1.hex, SAFE_16072017_s.hex was built only for test.
For me it works great.
Thanks a lot to agatti for having upgraded the repository!

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

The second one (UNSAFE_16072017) is the same as SAFE_16072017 but also it has the HARDWARE mode unlocked for the I2C protocol..
Indeed in the recent past agatti taught how to free the HARDWARE mode inside I2C protocol (https://github.com/BusPirate/Bus_Pirate/issues/39 (https://github.com/BusPirate/Bus_Pirate/issues/39)).
Please read the above link carefully!
As agatti wrote:
"Dangerous Prototypes' original firmware did not use hardware I2C due to hardware bugs in PIC24FJ64GA004 chips with revision A3 or A4.
Now that hardware I2C is enabled again and the appropriate workarounds detailed here (http://ww1.microchip.com/downloads/en/D ... 00470j.pdf (http://ww1.microchip.com/downloads/en/DeviceDoc/80000470j.pdf)) have been applied, we need to test those on real hardware.

The catch: the code is experimental and it may or may not mess up with your hardware, just in case."
UNSAFE_16072017 is built on the configuration.h file which is in the specific folder.
In order to build it into configuration.h I changed lines from 316 to 331 in order to enable all the features available, BASIC too.

#ifdef BUSPIRATEV3
#define BP_ENABLE_1WIRE_SUPPORT
#define BP_ENABLE_BASIC_SUPPORT
#define BP_ENABLE_DIO_SUPPORT
#define BP_ENABLE_HD44780_SUPPORT
#define BP_ENABLE_I2C_SUPPORT
#define BP_ENABLE_JTAG_SUPPORT
#define BP_ENABLE_PIC_SUPPORT
#define BP_ENABLE_PC_AT_KEYBOARD_SUPPORT
#define BP_ENABLE_RAW_2WIRE_SUPPORT
#define BP_ENABLE_RAW_3WIRE_SUPPORT
#define BP_ENABLE_SMPS_SUPPORT
#define BP_ENABLE_SPI_SUPPORT
#define BP_ENABLE_SUMP_SUPPORT
#define BP_ENABLE_UART_SUPPORT
#endif /* BUSPIRATEV3 */


Then I changed the line 417 too in this way in order to make room for BASIC scripting:

#define BP_BASIC_PROGRAM_SPACE 512

And then I had to set line 535 for up 256 characters into the command line by changing it in this way:

/**
* How big the serial command buffer can be, in bytes.
*
* @warning This must be set to a power of two, ie. 256, 128, 64, 32, etc.
*/
#ifdef BUSPIRATEV3
#define BP_COMMAND_BUFFER_SIZE 256
#else
#define BP_COMMAND_BUFFER_SIZE 256
#endif /* BUSPIRATEV3 */

 
Finally I had to put a remark sign ("//") inside line 382 and 391 in order to unlock the HARDWARE mode for the I2C protocol:

382 // #ifdef BUSPIRATEV4

391 // #endif /* BUSPIRATEV4 */
 
The result that I have achieved I have called it UNSAFE_16072017_1.hex and UNSAFE_16072017_s.hex.
UNSAFE_16072017_1.hex was obtained by using the compression option "1" of MPLAB, while instead for UNSAFE_16072017_s.hex I used compression option "s".
Compression option "1" assure right timing that option "s" may not ensure.
So the firmware to use is UNSAFE_16072017_1.hex, UNSAFE_16072017_s.hex was built only for test.

For me it works but you use it at your own risk, I do not take any responsibility about the possibility of damaging your Bus Pirate or whatever!
Attention please!
First to attempt to use this version of the firmware you have to evaluate what is the silicon revision of the PIC used in your device, paying much attention to the fact that you might damage your device or whatever!
For this reason the archive which contains this unsafe version of the firmware v7.1 is password protected.
The password is:

 
UNSAFE_FW
 
all uppercase.
You have to insert it in order to unpack the firmware.
By doing it you must to assume all the responsibility for your action.
You use it at your own risk, I do not take any responsibility about the possibility of damaging your Bus Pirate or whatever!


Thanks a lot to agatti for having upgraded the repository and freed the HARDWARE mode inside of I2C protocol!

With the firmwares I also provide a pre configured environment that anyone can use with minimal changes to simplify the upgrade.
Inside the archive are also provided instructions on how to use the whole thing.

A T T E N T I O N ! ! !

July 20, 2017 I noticed that SAFE_16072017 and UNSAFE_16072017 are not fully functioning, because enter BOOTLOADER using command "$" does not work (https://github.com/BusPirate/Bus_Pirate/issues/58 (https://github.com/BusPirate/Bus_Pirate/issues/58)).
Actually it is not really a problem on the firmware side but rather of the bootloader.
In order to fix the matter it is need to upgrade the bootloader to the new revision v4.5:

viewtopic.php?f=28&t=619#p67037 (http://dangerousprototypes.com/forum/viewtopic.php?f=28&t=619#p67037)

viewtopic.php?f=28&t=8498&start=60#p67043 (http://dangerousprototypes.com/forum/viewtopic.php?f=28&t=8498&start=60#p67043)

https://github.com/BusPirate/Bus_Pirate/issues/38 (https://github.com/BusPirate/Bus_Pirate/issues/38)

https://github.com/BusPirate/Bus_Pirate/issues/58 (https://github.com/BusPirate/Bus_Pirate/issues/58)

viewtopic.php?f=28&t=8498&p=67056#p67056 (http://dangerousprototypes.com/forum/viewtopic.php?f=28&t=8498&p=67056#p67056)


So please, if for you it is a problem or you do not want or can update the bootloader to version v4.5, instead of them use SAFE_13042017 or UNSAFE_13042017 from here:
 
viewtopic.php?f=28&t=8498&start=45#p66033 (http://dangerousprototypes.com/forum/viewtopic.php?f=28&t=8498&start=45#p66033)
 
Anyway I leave SAFE_16072017 and UNSAFE_16072017 as test, I do not remove them, so anyone who wants to use them can do it for that purpose.

I apologize for the mistake, I am sorry.

Be seeing you.

U.Sb
Title: Re: Bus Pirate - Community Firmware 7.0
Post by: megafix on September 19, 2017, 07:18:43 pm
Entering bootloader mode by command does work on my BPv3.0a running UNSAFE_16072017_1.hex.

HiZ>i
Bus Pirate v3.a
Community Firmware v7.1 - goo.gl/gCzQnW [HiZ 1-WIRE UART I2C SPI 2WIRE 3WIRE KEYB LCD PIC DIO] Bootloader v4.5
DEVID:0x0447 REVID:0x3043 (24FJ64GA00 2 B5)
http://dangerousprototypes.com (http://dangerousprototypes.com)

HiZ>$
Are you sure? y
BOOTLOADER

BL4+
Title: Re: Bus Pirate - Community Firmware 7.0
Post by: USBEprom on September 19, 2017, 08:39:11 pm
Hi megafix.
Thanks for testing the firmware on a real Bus Pirate hardware v3 and for sharing the result!
On my Bus Pirate v3 Bootloader v4.4 it fails to enter into bootloader:

Community Firmware v7.1 - goo.gl/gCzQnW [HiZ 1-WIRE UART I2C SPI 2WIRE 3WIRE KEYB LCD PIC DIO] Bootloader v4.4
DEVID:0x0447 REVID:0x3046 (24FJ64GA00 2 B8)

I see that you have the bootloader v4.5 in your BusPirate, maybe that is what makes a difference, as I wrote in my Bus Pirate I have the factory version v4.4.
Anyway many thanks especially for testing the new firmware on a silicon revision B5:

http://ww1.microchip.com/downloads/en/D ... 00470j.pdf (http://ww1.microchip.com/downloads/en/DeviceDoc/80000470j.pdf)

I understand you are very, very skilled in this kind of matter, so for sure you know well what you are doing, but I have to repeat my warning about the possibility to damage the Bus Pirate by using my UNSAFE firmware.
Use it at your own risk, I do not take any responsibility.
Just another thing.
It would be interesting to know how the work around implemented by agatti for the I2C protocol work there on silicon revision B5:

https://github.com/BusPirate/Bus_Pirate/issues/39 (https://github.com/BusPirate/Bus_Pirate/issues/39)

Thanks!

Be seeing you.

U.Sb
Title: Re: Bus Pirate - Community Firmware 7.0
Post by: megafix on September 20, 2017, 03:41:23 pm
As far as I understood by now there are three different bootloaders for the BPv3 hardware. All are slight modifications of the original ds30loader 1.0.2.

4.1 is identical to 4.2
4.3 is identical to 4.4
4.5 (I don't know if 4.6 ever went into production)

We have even sublevels that are programmed at the factory during production. The odd sublevels are updates performed by users in the field. Otherwise they should be identical.

Please correct me if above assumptions are wrong.

I compared 4.4 to 4.5 and the updates are minor. A new 4 byte firmware signature check has been added into 4.5.

What exactly do you mean by "it fails to enter into bootloader"? Looking at the code it's just a few instructions being triggered by entering "$" and a reset being performed. Almost identical to entering "#". Does it reenter the firmware (application) instead of executing the bootloader?

I spent some time looking at the code and might have identified the root cause....

The inability to enter bootloader mode is caused by proc_menu.c (static bool __attribute__((address(0x27FA),persistent)) skip_pgc_pgd_check;).

It is referenced in ds30loader.s (.section *, bss, address(0x27FA) / skip_pgc_pgd_check: .space 2) of bootloader 4.5. Previous BPv3 bootloaders (<4.5) don't know anything about skip_pgc_pgd_check so it won't work without putting a jumper between the two pins.

With BPv4 you won't hit this problem because skip_pgc_pgd_check was present in it's first bootloader revision.
Title: Re: Bus Pirate - Community Firmware 7.0
Post by: megafix on September 20, 2017, 05:27:10 pm
I predict the next question :-) Why did it work with previous firmwares?

Because someone changed

asm volatile ("mov #BLJUMPADDRESS, w1 n" //bootloader location" goto w1 n");

to

skip_pgc_pgd_check = true;
asm volatile ("RESET");

The new style flags skip_pgc_pgd_check. Then it does a reset and expects the bootloader to check the contents of skip_pgc_pgd_check. It should decide to stay in the bootloader instead of branching to the application. This will only work with an updated bootloader (>=4.5).

The old style did a direct jump so it will work with any bootloader revision.
Title: Re: Bus Pirate - Community Firmware 7.0
Post by: USBEprom on September 21, 2017, 10:14:09 pm
[quote author="megafix"]As far as I understood by now there are three different bootloaders for the BPv3 hardware. All are slight modifications of the original ds30loader 1.0.2.

4.1 is identical to 4.2
4.3 is identical to 4.4
4.5 (I don't know if 4.6 ever went into production)

We have even sublevels that are programmed at the factory during production. The odd sublevels are updates performed by users in the field. Otherwise they should be identical.

Please correct me if above assumptions are wrong.[/quote]

Hi megafix.
Thank you very, very much sir, you are great!
For what I know that is correct.
I confirm that bootloader 4.1 is identical to 4.2, 4.3 is identical to 4.4 because the first is field update and the second one is factory installed.
From here:

http://dangerousprototypes.com/blog/201 ... 4-upgrade/ (http://dangerousprototypes.com/blog/2010/06/23/bus-pirate-bootloader-v4-3v4-4-upgrade/)

Bootloader v4.3 is the version of the v4.3/v4.4 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.


Thanks!

Be seeing you.

U.Sb
Title: Re: Bus Pirate - Community Firmware 7.0
Post by: USBEprom on September 24, 2017, 03:49:14 pm
Hi guys.
User megafix has recently fixed the problem while enter in bootloader mode by issuing command "$" on Bus Pirate v3  (viewtopic.php?f=28&t=619#p67037 (http://dangerousprototypes.com/forum/viewtopic.php?f=28&t=619#p67037) , viewtopic.php?f=28&t=8498&start=60#p67043 (http://dangerousprototypes.com/forum/viewtopic.php?f=28&t=8498&start=60#p67043) , https://github.com/BusPirate/Bus_Pirate/issues/38 (https://github.com/BusPirate/Bus_Pirate/issues/38) , https://github.com/BusPirate/Bus_Pirate/issues/58 (https://github.com/BusPirate/Bus_Pirate/issues/58)).
megafix kindly sent me the hexadecimal file he has obtained by compiling the new v4.5 version of the bootloader that fixes the problem and me by using it I set up a pre configured environment to make it easy to upgrade to the v4.5 bootloader on Bus Pirate v3.
Inside the compressed archive are also provided instructions and documents on how to use the whole package.
I used pirate-loader.exe on Windows for it, pirate-loader.exe is a multi platform tool which works on Linux, Apple and Windows machines, and the thing works without any problem for me.
In the same way it should be working also with ds30_Loader_GUI but I have not tested that even because there is currently a license issue with it (https://github.com/BusPirate/Bus_Pirate/issues/64 (https://github.com/BusPirate/Bus_Pirate/issues/64)).
Anyway, in the end I have checked the whole thing with ds30_Loader_GUI and I confirm it works equally the same without any problems.

DISCLAIMER
First to attempt to use this pre configured environment you have to paying much attention to the fact that you might damage your Bus Pirate v3 or whatever!
Users should follow the instructions for bootloader update carefully because in case of failure they would lose access to the device by serial programming.
It should still be possible to fix the matter but it will take specific tools as for instance PICKit programmer/debugger and so much skill, hence be very careful!
For me it works but you use it at your own risk.
Neither I nor anyone else take the responsibility about the possibility of damaging your Bus Pirate v3 or whatever!
Neither I nor anyone else will be held responsible for anything!
I repeat, you use it at your own risk and only under your own responsibility!
It is need follow the instructions for bootloader update carefully and by doing it you must to assume all the responsibility for your action.
For this reason the archive which contains the pre configured environment is password protected.
The password is:

WARNING_UNSAFE_DISCLAIMER

all uppercase.
You have to insert it in order to unpack the content.
By doing it you must to assume all the responsibility for your action.
You use it at your own risk and only under your own responsibility, neither I nor anyone else take the responsibility about the possibility of damaging your Bus Pirate v3 or whatever!


The firmware provided with the archive is the latest release I built, the version SAFE_16072017_1.hex.
If you wish you can replace it with any other release for the Bus Pirate v3, this will not alter the bootloader you have just uploaded.


Thanks a lot to megafix for having built and provided the necessary, thank you Sir!

Please note that the package is a 7z (7zip) archive because the maximum allowed size in the forum is 1 MiB.

Be seeing you.
 
U.Sb

Improved version with better instructions here:
viewtopic.php?f=28&t=8498&p=67056#p67127 (http://dangerousprototypes.com/forum/viewtopic.php?f=28&t=8498&p=67056#p67127)
Title: Re: Bus Pirate - Community Firmware 7.0
Post by: joeblack on September 24, 2017, 09:53:53 pm
Thank you both, new bootloader works fine.
--joeblack
Title: Re: Bus Pirate - Community Firmware 7.0
Post by: USBEprom on September 25, 2017, 09:23:42 pm
Thanks to you joeblack for sharing your result!

Be seeing you.

U.Sb
Title: Re: Bus Pirate - Community Firmware 7.0
Post by: USBEprom on September 25, 2017, 11:06:52 pm
Hi guys.
For Windows users here attached is a new pre configured environment that allows anyone to easily upgrade firmware on the Bus Pirate.
It can be use with minimal changes simply by drag and drop the wanted firmware.
Inside the archive are also provided instruction on how to use the whole thing.

Be seeing you.

U.Sb
Title: Re: Bus Pirate - Community Firmware 7.0
Post by: BDMaster on October 24, 2017, 09:29:52 am
Hi USBEprom,
I updated my Bus Pirate V3.6 (internal say 3.b and I don't know why) and now I cannot see the Bootloader version (Bootloader V4.5) like before about 4.4 version.
It works both ... Bootloader and Firmware 7.1 (safe verdion) so far but I saw this difference and I am afraid that something is gone wrong during the update.
What do You mean and could suggest to me to do ?
Many thanks to all af You friends for the time and efforts to get live this project ! (Kallist5, Agatti, USBEprom, Marsfan, ecc.)
With regards
Title: Re: Bus Pirate - Community Firmware 7.0
Post by: BDMaster on October 24, 2017, 08:55:06 pm
Ok ... I tried again using a PICkit3 as described into manual, after I used the pirate-loader.exe to write the
firmware :

1) PICkit3 writes Bootloader v.4.5 (all ok verifing)
2) Pirate-loader.exe writes Firmware v.7.1_1 (SAFE version) gettin Error 50

I got anyway the error 50 on last block as many as tests I have done !

This is the dump from CLI :

Erasing page 41, a400...OK
Writing page 41 row 328, a400...OK
Writing page 41 row 329, a480...OK
Writing page 41 row 330, a500...OK
Writing page 41 row 331, a580...OK
Writing page 41 row 332, a600...OK
Writing page 41 row 333, a680...OK
Writing page 41 row 334, a700...OK
Writing page 41 row 335, a780...OK
Erasing page 42, a800...ERROR [50]

Error updating firmware :(last page ...

Any suggestions ?
Thanks
Title: Re: Bus Pirate - Community Firmware 7.0
Post by: USBEprom on October 24, 2017, 10:20:11 pm
Hi BDMaster.
I am really sorry for the problem you are facing.
Actually that error message does not mean that something is wrong with the firmware.
More than a matter of bootloader it is a issue with pirate-loader or related tools.
Please read here:

viewtopic.php?f=28&t=8498&start=15 (http://dangerousprototypes.com/forum/viewtopic.php?f=28&t=8498&start=15)

and especially these with careful:

viewtopic.php?f=28&t=8498&start=15#p65317 (http://dangerousprototypes.com/forum/viewtopic.php?f=28&t=8498&start=15#p65317)

https://github.com/BusPirate/Bus_Pirate ... -248103673 (https://github.com/BusPirate/Bus_Pirate/issues/7#issuecomment-248103673)

https://github.com/BusPirate/Bus_Pirate ... -273879409 (https://github.com/BusPirate/Bus_Pirate/issues/7#issuecomment-273879409)

For what I know firmware 7.0/7.1 are working without issue on hardware Bus Pirate v3b.
About this take a look at what pixeldoc2000 wrote on day December 27, 2017:
 
https://github.com/BusPirate/Bus_Pirate/issues/7 (https://github.com/BusPirate/Bus_Pirate/issues/7)
 
Here too is discussed about support for Bus Pirate v3b:

https://github.com/BusPirate/Bus_Pirate/issues/48 (https://github.com/BusPirate/Bus_Pirate/issues/48)

The new revision v7.x seems to work even with hardware revision Bus Pirate v2go.

However for what I understand the main problem is that you can not retrieve the hardware revision and the bootloader version of your Bus Pirate while performing command "i" from the terminal.
I understand that actually hardware revision of your Bus Pirate is v3.6 but the terminal shows 3.b as well as the bootloader version is no longer displayed.
Can you confirm?
In my case with my Bus Pirate v3.6 and bootloader v4.5 while performing the command "i" the terminal shows what follow .:

i
Bus Pirate v3.5
Community Firmware v7.1 - goo.gl/gCzQnW [HiZ 1-WIRE UART I2C SPI 2WIRE 3WIRE KEYB LCD PIC DIO] Bootloader v4.5
DEVID:0x0447 REVID:0x3046 (24FJ64GA00 2 B8)

http://dangerousprototypes.com (http://dangerousprototypes.com)
HiZ>
 
Could you please post the output of your terminal by running the "i" command?
What terminal are you using?
What is the operating system you are working with?
Thanks.
One thing you can try in order to verify the matter is to replace the previous version of the firmware your Bus Pirate had before the update.
Do you remember what version was it?
Another important thing that could be useful to know and evaluate is the silicon revision of the PIC used on your Bus Pirate.
Mine has the B8 [(24FJ64GA00 2 B8)] (https://github.com/BusPirate/Bus_Pirate/issues/39 (https://github.com/BusPirate/Bus_Pirate/issues/39)).
That of yours?
Thanks.

Be seeing you.

U.Sb
Title: Re: Bus Pirate - Community Firmware 7.0
Post by: BDMaster on October 25, 2017, 01:36:35 pm
Hi USBeprom,
I want to thank You for your quickly answer and say that I found very usefull your help !
So i did all procedure using the Firmware v.6.1 always on Bootloader v.4.5 irmware v.7.1.
I programmed using PICkit3 the bootloader v.4.5 and the using the Bootloader programmed
the firmware setting the bootloader mode by terminal and $.
On Firmware v.6.1 all ok without error, but on Firmware v.7.1 I got again Error 50.
Now I can read this while performing command "i" from the terminal :


HiZ>i
Bus Pirate v3.5
Community Firmware v7.1 - goo.gl/gCzQnW [HiZ 1-WIRE UART I2C SPI 2WIRE 3WIRE KEYB LCD PIC DIO] Bootloader v4.5
DEVID:0x0447 REVID:0x3046 (24FJ64GA00 2 B8)
http://dangerousprototypes.com (http://dangerousprototypes.com)
HiZ>

So It seems that It's Ok ?
Have You some suggestions about how to use to read/write Eeprom chips by Flashrom tool ?
How can I use the BPv3 as JTAG ?
Unfortunately, I didn't find a lot of tutorials on BPv3 and I am doing tests continuosly using Pomona Soic Clip,
but results are strange as files I got are filled zeros alternating a concrete hex data, so I think are broken.
Thanks again for your courtesy and help and I will wait for your reply !
Title: Re: Bus Pirate - Community Firmware 7.0
Post by: BDMaster on October 25, 2017, 09:11:16 pm
Hi ... a little update ... I made shorters wires and now It seems working well !
I have read an SPI Eeprom MX25L1605D and verified data, so that was the issue, but wires have to
be very short (15 cm) :(
Now I will try to write too on the chip !
Regards
Title: Re: Bus Pirate - Community Firmware 7.0
Post by: USBEprom on October 25, 2017, 10:02:55 pm
Hi BDMaster.
I am really very glad to read that you have managed to fix it.

[quote author="BDMaster"]
but on Firmware v.7.1 I got again Error 50.[/quote]

Actually "Error 50" it is not a problem at all as it is explained here:

viewtopic.php?f=28&t=8498&start=15#p65317 (http://dangerousprototypes.com/forum/viewtopic.php?f=28&t=8498&start=15#p65317)

https://github.com/BusPirate/Bus_Pirate ... -248103673 (https://github.com/BusPirate/Bus_Pirate/issues/7#issuecomment-248103673)

https://github.com/BusPirate/Bus_Pirate ... -273879409 (https://github.com/BusPirate/Bus_Pirate/issues/7#issuecomment-273879409)

Erasing page 42, a800...ERROR [50]

Error updating firmware :(


Based on explanation of agatti and others, it is not a real problem!


[quote author="BDMaster"]
HiZ>i
Bus Pirate v3.5
Community Firmware v7.1 - goo.gl/gCzQnW [HiZ 1-WIRE UART I2C SPI 2WIRE 3WIRE KEYB LCD PIC DIO] Bootloader v4.5
DEVID:0x0447 REVID:0x3046 (24FJ64GA00 2 B8)
http://dangerousprototypes.com (http://dangerousprototypes.com)
HiZ>

So It seems that It's Ok ?[/quote]

That means you have succeeded fully, it is exactly the same as mine I wrote yesterday for my Bus Pirate v3.6, bootloader v4.5.
Congratulations, well done!
I confirm that all it is ok as it is supposed to be.


[quote author="BDMaster"]
Have You some suggestions about how to use to read/write Eeprom chips by Flashrom tool ?[/quote]

For what I know flashrom does only works with SPI flash, but it does that without any problem, just start the program and it does all the hard work.
I use it on Windows without any trouble.

Instead in order to manage I2C Eeprom it is need I2C protocol hence it is possible to use native commands inside the Bus Pirate or by scripting using something like I2CEEPROMWIN (viewtopic.php?f=4&t=8763 (http://dangerousprototypes.com/forum/viewtopic.php?f=4&t=8763)).
Please read carefully what I wrote about I2CEEPROMWIN just in the case you choose it.
I know little about these things, sorry.


[quote author="BDMaster"]
How can I use the BPv3 as JTAG ?[/quote]

Even this I do not know it very well, sorry.
My only suggestion is to use OPENOCD

viewtopic.php?f=4&t=8629 (http://dangerousprototypes.com/forum/viewtopic.php?f=4&t=8629)

[quote author="BDMaster"]
Unfortunately, I didn't find a lot of tutorials on BPv3 and I am doing tests continuosly using Pomona Soic Clip,
but results are strange as files I got are filled zeros alternating a concrete hex data, so I think are broken.[/quote]

Pomona Soic Clip are great, as general rule all the Pomona adapters are great value.
Luckily in the end I have read you succeeded also with it, very well!

Be seeing you.

U.Sb
Title: Re: Bus Pirate - Community Firmware 7.0
Post by: USBEprom on October 25, 2017, 10:34:43 pm
Hi guys.
Here is an improved version, better instructions, of the package BPv3-bootloaderv4xtov45-update-vb.7z for upgrading to v4.5 the bootloader of the Bus Pirate v3.
This is the final version that covering Linux, Windows and Apple.
Same as the previous (viewtopic.php?f=28&t=8498&start=75 (http://dangerousprototypes.com/forum/viewtopic.php?f=28&t=8498&start=75)) but extended instructions, the archive password is also unchanged.

DISCLAIMER
First to attempt to use this pre configured environment you have to paying much attention to the fact that you might damage your Bus Pirate v3 or whatever!
Users should follow the instructions for bootloader update carefully because in case of failure they would lose access to the device by serial programming.
It should still be possible to fix the matter but it will take specific tools as for instance PICKit programmer/debugger and so much skill, hence be very careful!
For me it works but you use it at your own risk.
Neither I nor anyone else take the responsibility about the possibility of damaging your Bus Pirate v3 or whatever!
Neither I nor anyone else will be held responsible for anything!
I repeat, you use it at your own risk and only under your own responsibility!
It is need follow the instructions for bootloader update carefully and by doing it you must to assume all the responsibility for your action.
For this reason the archive which contains the pre configured environment is password protected.
The password is:

WARNING_UNSAFE_DISCLAIMER

all uppercase.
You have to insert it in order to unpack the content.
By doing it you must to assume all the responsibility for your action.
You use it at your own risk and only under your own responsibility, neither I nor anyone else take the responsibility about the possibility of damaging your Bus Pirate v3 or whatever!


The firmware provided with the archive is still the latest working release I built, the version SAFE_16072017_1.hex.
If you wish you can replace it with any other release for the Bus Pirate v3, this will not alter the bootloader you have just uploaded.

Thanks a lot to megafix for having built and provided the necessary, thank you Sir!

Please note that the package is a 7z (7zip) archive because the maximum allowed size in the forum is 1 MiB.

Be seeing you.

U.Sb
Title: Re: Bus Pirate - Community Firmware 7.0
Post by: BDMaster on October 28, 2017, 11:33:19 am
Hi USBEprom,
You are GREAT !!!
Many thanks for all your efforts to help all of us ...
Title: Re: Bus Pirate - Community Firmware 7.0
Post by: BDMaster on November 07, 2017, 10:03:27 pm
Hi USBeprom,
I am using new firmware but I got this :

(1)>2
Clutch disengaged!!!
To finish setup, start up the power supplies with command 'W'
Ready
SPI>W
POWER SUPPLIES ON
Clutch engaged!!!
SPI>[0x9f r r r]
/CS ENABLED
WRITE: 0x9F
READ: 0xC2
READ: 0x20
READ: 0x14
CS ENABLED
SPI>

<i don't know if it's normal the last replay CS ENABLED (I remember that it would to be /CS DISABLED ???

Following this guide :

here is explained how the Bus Pirate manage its pull-ups.
As stated in the document the pull-ups are only on MOSI, CLOCK, MISO and CS.
Another point is that it is not recommended provide power supply voltage throught a pull-up resistor as you did for the whole chip.
The right connections should be these:

Bus Pirate MX25L6406E
CS<-------------->CS#
MISO<-------------->SO/SIO1
VCC<-------------->WP#
GND<-------------->Vss(GND)
MOSI<-------------->SI/SIO1
CLK<-------------->SCLK
Vcc<-------------->HOLD#
Vcc<-------------->Vcc

Course you need to choose +3,3V like power supply voltage due the fact the chip isn't +5V tolerant.
Better should be provide the Vcc to WP# and HOLD# through limitation resistors (something like 10kohm should be OK) but also connecting them together isn't bad also because of the safety specifications of the Bus Pirate's power supply stage.
About how set the Bus Pirate in my opinion 30kHz is really few, very slow.
I believe even 1MHz is good.
For the parameter "Select output type:" you must to choose "2. Normal (H=3.3V, L=GND)", then you have to issue a "W" command in order to switch on the power supply.
Please don't activate the pull-up resistors (command "P") though.
Here is the sequence:

m
1. HiZ
2. 1-WIRE
3. UART
4. I2C
5. SPI
6. 2WIRE
7. 3WIRE
8. LCD
x. exit(without change)

(1)>5
Set speed:
1. 30KHz
2. 125KHz
3. 250KHz
4. 1MHz

(1)>4
Clock polarity:
1. Idle low *default
2. Idle high

(1)>
Output clock edge:
1. Idle to active
2. Active to idle *default

(2)>
Input sample phase:
1. Middle *default
2. End

(1)>
CS:
1. CS
2. /CS *default

(2)>
Select output type:
1. Open drain (H=Hi-Z, L=GND)
2. Normal (H=3.3V, L=GND)

(1)>2
Clutch disengaged!!!
To finish setup, start up the power supplies with command 'W'

Ready
SPI>W
POWER SUPPLIES ON
Clutch engaged!!!
SPI>[0x9f r r r]
/CS ENABLED
WRITE: 0x9F
READ: 0xC2
READ: 0x20
READ: 0x17
/CS DISABLED

Mission accomplished.
Regards,
sre71

Let me know please ...
with regards
Title: Re: Bus Pirate - Community Firmware 7.0
Post by: USBEprom on November 10, 2017, 09:15:56 pm
Hi BDMaster.
Thanks for reporting this!
I am sorry for the trouble which I guess it is due to something wrong that came out during one of the many cleaning of the repository.
It is only a cosmetic issue because actually, despite the wrong message, everything works as expected.
The last working repository is dated April 10, 2017, changes subsequent to that date create the problem.
By compiling a custom firmware starting from Bus_Pirate-master repository April 10, 2017 everything works as expected.
Please see here below:

i
Bus Pirate v3.5
Community Firmware v7.1 - goo.gl/gCzQnW [HiZ 1-WIRE UART I2C SPI 2WIRE 3WIRE KEYB LCD PIC DIO] Bootloader v4.5
DEVID:0x0447 REVID:0x3046 (24FJ64GA00 2 B8)
http://dangerousprototypes.com (http://dangerousprototypes.com)
HiZ>m
1. HiZ
2. 1-WIRE
3. UART
4. I2C
5. SPI
6. 2WIRE
7. 3WIRE
8. KEYB
9. LCD
10. PIC
11. DIO
x. exit(without change)

(1)>5
Set speed:
 1.  30KHz
 2. 125KHz
 3. 250KHz
 4.  1MHz
 5.  50KHz
 6. 1.3MHz
 7.  2MHz
 8. 2.6MHz
 9. 3.2MHz
10.  4MHz
11. 5.3MHz
12.  8MHz

(1)>4
Clock polarity:
 1. Idle low *default
 2. Idle high

(1)>
Output clock edge:
 1. Idle to active
 2. Active to idle *default

(2)>
Input sample phase:
 1. Middle *default
 2. End

(1)>
CS:
 1. CS
 2. /CS *default

(2)>
Select output type:
 1. Open drain (H=Hi-Z, L=GND)
 2. Normal (H=3.3V, L=GND)

(1)>2
Clutch disengaged!!!
To finish setup, start up the power supplies with command 'W'
Ready
SPI>W
POWER SUPPLIES ON
Clutch engaged!!!
SPI>[0x9f r r r]
/CS ENABLED
WRITE: 0x9F
READ: 0xEF
READ: 0x40
READ: 0x15
/CS DISABLED
SPI>

Sadly from last few months I submitted reports about operating defects of the repositories that have gone through but so far there have been no improvements.
For instance starting from repository dated September 25, 2017, while compiling for Bus Pirate v3 there are some errors in MPLAB so that it is not possible to build the UNSAFE version and anyway for the SAFE version the message structure in the menus is totally wrong:

https://github.com/BusPirate/Bus_Pirate ... -331978946 (https://github.com/BusPirate/Bus_Pirate/issues/54#issuecomment-331978946)

I can not do anything but I expose in GITHUB the problem you wrote hoping somebody fix it because I am not in the position to do it myself, sorry:

https://github.com/BusPirate/Bus_Pirate/issues/74 (https://github.com/BusPirate/Bus_Pirate/issues/74)

About the issue you noticed at the moment the only solution I can suggest is to use SAFE_13042017 or UNSAFE_13042017 which do not have it and still have all the features available for the Bus Pirate v3, no exclusion:

viewtopic.php?f=28&t=8498&start=45#p66033 (http://dangerousprototypes.com/forum/viewtopic.php?f=28&t=8498&start=45#p66033)

Be seeing you.

U.Sb
Title: Re: Bus Pirate - Community Firmware 7.0
Post by: rom1011 on November 14, 2017, 02:09:16 am
I haven't seen any update on the status of the firmware for the BPv4 in this thread for a long time.
Is there a 7.1 firmware available for the BPv4? Or would you recommend throwing out the v4 and buying a v3?

Thanks
-Roland
Title: Re: Bus Pirate - Community Firmware 7.0
Post by: USBEprom on November 14, 2017, 09:11:28 pm
Hi Roland.
Firmware v7.x is specifically developed for Bus Pirate v4, Bus Pirate v3 is a secondary branch of it:

https://github.com/BusPirate/Bus_Pirate (https://github.com/BusPirate/Bus_Pirate)

Be seeing you.

U.Sb
Title: Re: Bus Pirate - Community Firmware 7.0
Post by: inac on January 10, 2018, 12:50:41 pm
Dear All

Is the code of the v7.1 also in git?

There is a TAG for v7.0 but not for v7.1. I downloaded v7.1 (forgot where) and compared it with the 16-07-2017 checkout and it's not the same.

Also is the SAFE_16072017 completely in git (so building commit ... will result in SAFE_16072017)? And is it the v7.1? Or is there no version number for the SAFE_16072017?
Title: Re: Bus Pirate - Community Firmware 7.0
Post by: USBEprom on January 10, 2018, 09:35:13 pm
Hi inac.
I know nothing about git and what it is, but I know for sure that the firmwares I provided and I provide, in this case specifically SAFE_16072017, are firmware v7.1 for Bus Pirate revision 3.
The early ones I provided are firmwares v7.0 until SAFE_13042017 and UNSAFE_13042017, starting with them and going haead it is v7.1.
Please pay attention to the fact that SAFE_16072017, together with later releases I provided, requires bootloader v4.5 in order to be fully functioning.
Without upgrading to v4.5 it will not be possible to jump into bootloader from terminal using command $, so that instead it will be necessary to use jumper on PGD and PGC.

Be seeing you.

U.Sb
Title: Re: Bus Pirate - Community Firmware 7.0
Post by: inac on January 11, 2018, 12:20:40 pm
Hi U.Sb,

Thanks, that clears a lot!

With git I mean. Making a clone of the GitHub repository (https://github.com/BusPirate/Bus_Pirate (https://github.com/BusPirate/Bus_Pirate)). Then in de log I see all the many commits made. I expect one of them to be v7.1. But none of the commits is TAGed as v7.1 (only v7.0 is TAGed).

All commits made after the v7.1 commit are (for me) modifications/patches to the v7.1

E.g. To me the commit at SHA-1: 01e9bda (13-08-2016) is the v7.0. All commits after that are patches to v7.0 (so e.g. v7.0.x) and not v7.0 itself. Many commits marked as the same version makes it a bit confusing (at least for me). When trying to reproduce a specific version the right commit to checkout is needed. So reproducing and building v7.0 a checkout of commit SHA-1: 01e9bda should be needed. For v7.1 it's unknown. Otherwise you can have several different firmware with the same version number.

Thanks again for your great help! I will start programming the v4.5 bootloader in my v3.6 BP.
Title: Re: Bus Pirate - Community Firmware 7.0
Post by: USBEprom on February 18, 2018, 05:47:58 pm
Hi guys.
In the beginning of the last January agatti has upgraded some things inside firmware v7.1.
So I was able to build new firmwares v7.1 for the Bus Pirate revision 3 using the repository dated 7 January, 2018 (https://github.com/BusPirate/Bus_Pirate ... master.zip (https://github.com/BusPirate/Bus_Pirate/archive/master.zip)).
I made two versions that i named S-07012018-1.hex and U-07012018-1.hex.
Both of them have all the features enabled, BASIC too, the command line allows up 256 characters.
The first one (S-07012018-1.hex), the so called SAFE version (S=SAFE), is built on the configuration.h changed as follow.
Into configuration.h I changed lines from 316 to 331 in order to enable all the features available, BASIC too.

#ifdef BUSPIRATEV3
#define BP_ENABLE_1WIRE_SUPPORT
#define BP_ENABLE_BASIC_SUPPORT
#define BP_ENABLE_DIO_SUPPORT
#define BP_ENABLE_HD44780_SUPPORT
#define BP_ENABLE_I2C_SUPPORT
#define BP_ENABLE_JTAG_SUPPORT
#define BP_ENABLE_PIC_SUPPORT
#define BP_ENABLE_PC_AT_KEYBOARD_SUPPORT
#define BP_ENABLE_RAW_2WIRE_SUPPORT
#define BP_ENABLE_RAW_3WIRE_SUPPORT

#undef BP_ENABLE_SMPS_SUPPORT[/b]
#define BP_ENABLE_SPI_SUPPORT
#define BP_ENABLE_SUMP_SUPPORT
#define BP_ENABLE_UART_SUPPORT
#endif /* BUSPIRATEV3 */


Please, pay attention that since recently the SMPS_SUPPORT for the Bus Pirate v3 has been removed, I left the line number 328 unchanged as #undef.[/b]

SMPS_SUPPORT is intended for the management of the SMPS_BOARD which is an abandoned or stalled board.
Exactly it is this:

http://dangerousprototypes.com/blog/200 ... y-6-parts/ (http://dangerousprototypes.com/blog/2009/12/04/bus-pirate-boost-converter-with-only-6-parts/)
http://dangerousprototypes.com/docs/Bus_Pirate_SMPS (http://dangerousprototypes.com/docs/Bus_Pirate_SMPS)

Then I changed the line 417 too in this way in order to make room for BASIC scripting:

#define BP_BASIC_PROGRAM_SPACE 512

Finally I had to set line 535 for up 256 characters into the command line by changing it in this way:

/**
* How big the serial command buffer can be, in bytes.
*
* @warning This must be set to a power of two, ie. 256, 128, 64, 32, etc.
*/
#ifdef BUSPIRATEV3
#define BP_COMMAND_BUFFER_SIZE 256
#else
#define BP_COMMAND_BUFFER_SIZE 256
#endif /* BUSPIRATEV3 */

 
The result that I have achieved I have called it S-07012018-1.hex.
S-07012018-1.hex was obtained by using the compression option "1" of MPLAB so to be in fully accordance with the latest recommendations issued about the compilation of the new repositories using MPLAB in order to build new firmwares for the Bus Pirate v3 and v4.
Compression option "1" assure right timing that option "s" may not ensure.
For me it works great and by the way, it fixes a bug using the Bus Pirate v3 with the I2C protocol (https://github.com/BusPirate/Bus_Pirate ... -356724617 (https://github.com/BusPirate/Bus_Pirate/issues/54#issuecomment-356724617)).
Thanks a lot to agatti for having fixed and upgraded the repository!

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

The second one (U-07012018-1.hex) is the same as S-07012018-1.hex but also it has the HARDWARE mode unlocked for the I2C protocol.
Indeed in the recent past agatti taught how to free the HARDWARE mode inside I2C protocol (https://github.com/BusPirate/Bus_Pirate/issues/39 (https://github.com/BusPirate/Bus_Pirate/issues/39)).
Please read the above link carefully!
As agatti wrote:
"Dangerous Prototypes' original firmware did not use hardware I2C due to hardware bugs in PIC24FJ64GA004 chips with revision A3 or A4.
Now that hardware I2C is enabled again and the appropriate workarounds detailed here (http://ww1.microchip.com/downloads/en/D ... 00470j.pdf (http://ww1.microchip.com/downloads/en/DeviceDoc/80000470j.pdf)) have been applied, we need to test those on real hardware.

The catch: the code is experimental and it may or may not mess up with your hardware, just in case."
U-07012018-1.hex, the so called UNSAFE version (U=UNSAFE)  is built on the configuration.h changed as follow.
Into configuration.h I changed lines from 316 to 331 in order to enable all the features available, BASIC too.

#ifdef BUSPIRATEV3
#define BP_ENABLE_1WIRE_SUPPORT
#define BP_ENABLE_BASIC_SUPPORT
#define BP_ENABLE_DIO_SUPPORT
#define BP_ENABLE_HD44780_SUPPORT
#define BP_ENABLE_I2C_SUPPORT
#define BP_ENABLE_JTAG_SUPPORT
#define BP_ENABLE_PIC_SUPPORT
#define BP_ENABLE_PC_AT_KEYBOARD_SUPPORT
#define BP_ENABLE_RAW_2WIRE_SUPPORT
#define BP_ENABLE_RAW_3WIRE_SUPPORT

#undef BP_ENABLE_SMPS_SUPPORT[/b]
#define BP_ENABLE_SPI_SUPPORT
#define BP_ENABLE_SUMP_SUPPORT
#define BP_ENABLE_UART_SUPPORT
#endif /* BUSPIRATEV3 */


Please, pay attention that since recently the SMPS_SUPPORT for the Bus Pirate v3 has been removed, I left the line number 328 unchanged as #undef.[/b]

SMPS_SUPPORT is intended for the management of the SMPS_BOARD which is an abandoned or stalled board.
Exactly it is this:

http://dangerousprototypes.com/blog/200 ... y-6-parts/ (http://dangerousprototypes.com/blog/2009/12/04/bus-pirate-boost-converter-with-only-6-parts/)
http://dangerousprototypes.com/docs/Bus_Pirate_SMPS (http://dangerousprototypes.com/docs/Bus_Pirate_SMPS)

Then I changed the line 417 too in this way in order to make room for BASIC scripting:

#define BP_BASIC_PROGRAM_SPACE 512

And then I had to set line 535 for up 256 characters into the command line by changing it in this way:

/**
* How big the serial command buffer can be, in bytes.
*
* @warning This must be set to a power of two, ie. 256, 128, 64, 32, etc.
*/
#ifdef BUSPIRATEV3
#define BP_COMMAND_BUFFER_SIZE 256
#else
#define BP_COMMAND_BUFFER_SIZE 256
#endif /* BUSPIRATEV3 */

 
Finally I had to put a remark sign ("//") inside line 382 and 391 in order to unlock the HARDWARE mode for the I2C protocol:

382 // #ifdef BUSPIRATEV4

391 // #endif /* BUSPIRATEV4 */
 
The result that I have achieved I have called it U-07012018-1.hex.
U-07012018-1.hex was obtained by using the compression option "1" of MPLAB so to be in fully accordance with the latest recommendations issued about the compilation of the new repositories using MPLAB in order to build new firmwares for the Bus Pirate v3 and v4.
Compression option "1" assure right timing that option "s" may not ensure.

For me it works great and by the way, it fixes a bug using the Bus Pirate v3 with the I2C protocol (https://github.com/BusPirate/Bus_Pirate ... -356724617 (https://github.com/BusPirate/Bus_Pirate/issues/54#issuecomment-356724617)), but you use it at your own risk, I do not take any responsibility about the possibility of damaging your Bus Pirate or whatever!

Attention please!
First to attempt to use U-07012018-1.hex (UNSAFE version of the firmware) you have to evaluate what is the silicon revision of the PIC used in your device, paying much attention to the fact that you might damage your device or whatever!
By doing it you must to assume all the responsibility for your action.
You use it at your own risk, I do not take any responsibility about the possibility of damaging your Bus Pirate or whatever!


Thanks a lot to agatti for having fixed and upgraded the repository and freed the HARDWARE mode inside of I2C protocol!

Please note that both S-07012018-1.hex and U-07012018-1.hex require the new bootloader v4.5 in order to work completely (viewtopic.php?f=28&t=8498&start=75#p67056 (http://dangerousprototypes.com/forum/viewtopic.php?f=28&t=8498&start=75#p67056) and viewtopic.php?f=28&t=8498&p=67056#p67127 (http://dangerousprototypes.com/forum/viewtopic.php?f=28&t=8498&p=67056#p67127)).
Otherwise if do not, enter BOOTLOADER using command "$" will not work (https://github.com/BusPirate/Bus_Pirate/issues/58 (https://github.com/BusPirate/Bus_Pirate/issues/58)).
Actually it is not really a problem on the firmware side but rather of the bootloader.
In order to fix the matter it is need to upgrade the bootloader to the new revision v4.5:

viewtopic.php?f=28&t=619#p67037 (http://dangerousprototypes.com/forum/viewtopic.php?f=28&t=619#p67037)

viewtopic.php?f=28&t=8498&start=60#p67043 (http://dangerousprototypes.com/forum/viewtopic.php?f=28&t=8498&start=60#p67043)

https://github.com/BusPirate/Bus_Pirate/issues/38 (https://github.com/BusPirate/Bus_Pirate/issues/38)

https://github.com/BusPirate/Bus_Pirate/issues/58 (https://github.com/BusPirate/Bus_Pirate/issues/58)

viewtopic.php?f=28&t=8498&p=67056#p67056 (http://dangerousprototypes.com/forum/viewtopic.php?f=28&t=8498&p=67056#p67056)


With the firmwares I also provide a pre configured environment that anyone can use with minimal changes to simplify the upgrade of the only firmware or together the bootloader and the firmware in a single step.
The archive also provides further improved instructions on how to use the whole thing under any operative system (Window, Linux and Apple), simply follow them :

"How to use UPGRADE_TO_BL_v4.5.bat.rtf" (specific instructions for Windows users)
"How to update with pirate-loader.rtf" (generic cross-platform instructions for Windows, Linux and Apple users)

Please note that the package is a 7z (7zip) archive because the maximum allowed size in the forum is 1 MiB.

Be seeing you.

U.Sb
Title: Re: Bus Pirate - Community Firmware 7.0
Post by: awokd on March 21, 2018, 01:04:28 pm
[quote author="USBEprom"]Hi guys.
In the beginning of the last January agatti has upgraded some things inside firmware v7.1.
So I was able to build new firmwares v7.1 for the Bus Pirate revision 3 using the repository dated 7 January, 2018
[/quote]

Thank you U.Sb and agatti! Followed the steps in the above documentation and they worked perfectly to upgrade a Buspirate 3.6 with v4.4 bootloader and v5.9 firmware. I was using Debian Stretch x64 so had to "apt install lib32z1" and chmod pirate-loader_lnx to executable before it worked, but no other problems.
Title: Re: Bus Pirate - Community Firmware 7.0
Post by: DangerByte on June 19, 2018, 10:11:03 pm
Yo, its been a while since I was last here. I see there has been some new development on BusPirate firmware. I managed to dig up my dusty BP4 and apparently it's still using firmware 3.6-beta1. I see there is version v7.0 and some even mention v7.1.

Are there v7.1 binaries available for BP4?

See ya!
Title: Re: Bus Pirate - Community Firmware 7.0
Post by: mikeb on June 25, 2018, 10:56:12 pm
[quote author="DangerByte"]Are there v7.1 binaries available for BP4?[/quote]

Hi there DangerByte, a couple of weeks ago I have rebuilt the latest firmware (both for BPv3 and BPv4) and bootloader (only for BPv4), latest github revision together with an extra I2C fix by ChristopherSamSoon which has not been merged yet - https://github.com/BusPirate/Bus_Pirate/pull/93 (https://github.com/BusPirate/Bus_Pirate/pull/93) - and unofficially named it v7.11 firmware and v4.11 bootloader at my builds

You could obtain these latest bootloader and firmware here at my updated post:
http://http://dangerousprototypes.com/forum/viewtopic.php?f=28&t=8498#p65290

Recommend " opt0 boot + opt0 firmware", that is what I have flashed to mine

I hope you already have a Pickit2 tool for directly flashing the bootloader/firmware to your Bus Pirate v4,
because that pirate-loader app is buggy and I don't think it could upgrade your bootloader, for example.
Read this instruction, it will help you a lot - http://http://dangerousprototypes.com/docs/Bus_Pirate_v4_and_Pickit2_(bootloader_and_firmware_updates)

And this another instruction - http://dangerousprototypes.com/docs/Com ... e_firmware (http://dangerousprototypes.com/docs/Compile_the_Bus_Pirate_firmware) - will help you to rebuild this stuff by yourself without having to rely on others. Its quite easy to setup your working environment if you would follow this step-by-step, and maybe you could contribute some of your developments
Title: Re: Bus Pirate - Community Firmware 7.0
Post by: mikeb on June 25, 2018, 11:12:39 pm
[quote author="awokd"]Followed the steps in the above documentation and they worked perfectly to upgrade a Buspirate 3.6 with v4.4 bootloader and v5.9 firmware[/quote] Hi my friend awokd, happy to see you here - guess the Internet is a small place :) Can't understand why you've installed v5.9 firmware while there is v7.1 available for example (or maybe I misunderstood your message and these were your versions before your upgrade?) You could even install my freshly compiled v7.1 for BPv3 (check my post above for a link) although of course I haven't tested it by myself because I only have BPv4 :P By the way, at least according to my experience, its much easier to use Pickit2 for these upgrades - instruction how to do that is also available above, written for BPv4 but should be similar for BPv3
Title: Re: Bus Pirate - Community Firmware 7.0
Post by: awokd on June 25, 2018, 11:43:54 pm
And you as well!

[quote author="mikeb"]and these were your versions before your upgrade?[/quote]

This, I upgraded to 7.1 from those old versions. :)
Title: Re: Bus Pirate - Community Firmware 7.0
Post by: DangerByte on June 26, 2018, 09:32:32 pm
Yo, so I take it 7.1 is not officially out yet.
Why is the bootloader update needed again for BP4?
I don't have pickit, I'm an AVR guy, can I update without it?
Title: Re: Bus Pirate - Community Firmware 7.0
Post by: USBEprom on June 26, 2018, 10:30:48 pm
Hi mikeb.
Happy to read you again!

[quote author="mikeb"]

You could obtain these latest bootloader and firmware here at my updated post:
http://http://dangerousprototypes.com/forum/viewtopic.php?f=28&t=8498#p65290

Recommend " opt0 boot + opt0 firmware", that is what I have flashed to mine[/quote]

On github.com it has been written that the recommended compression option for MPLAB it is level 1:

(https://github.com/BusPirate/Bus_Pirate ... ANGELOG.md (https://github.com/BusPirate/Bus_Pirate/blob/master/CHANGELOG.md))

...Firmware will now build by default with Optimisation level 1, this allows to fit more protocols on v3 boards in the default configuration.

Thanks for all the firmwares you have just provided!

Be seeing you.

U.Sb
Title: Re: Bus Pirate - Community Firmware 7.0
Post by: mikeb on June 30, 2018, 08:37:44 am
Hi there USBEprom, happy to see you there ;) [quote author="mikeb"]On github.com it has been written that the recommended compression option for MPLAB it is level 1[/quote] Yes you are right, I should have underlined that my opt0+opt0 recommendation is only for BPv4. Can't build opt0 firmware for BPv3 without sacrificing some features (btw its required to get a pro trial to build anything else than opt0, but its possible to create a disposable VM for this purpose)
Title: Re: Bus Pirate - Community Firmware 7.0
Post by: mikeb on June 30, 2018, 08:51:21 am
[quote author="DangerByte"]Yo, so I take it 7.1 is not officially out yet.
Why is the bootloader update needed again for BP4?
I don't have pickit, I'm an AVR guy, can I update without it?[/quote]
Actually 7.1 is already out (e.g. this changelog - https://github.com/BusPirate/Bus_Pirate ... ANGELOG.md (https://github.com/BusPirate/Bus_Pirate/blob/master/CHANGELOG.md) )
but there were plenty of commits after that, and I thought its a good idea to bump my locally built version from 7.1 to 7.11 .

Sorry friend, I don't know how well would be 7.1 working together with a very outdated bootloader.
Try searching this thread or check the issues at Github repo, maybe there would be some notes about it.
In any case I recommend you to get a Pickit2, it costs just a fraction of Bus Pirate price and makes the firmware updates much more convenient (+ you could install and re-install the bootloaders without any risk of bricking, can always recover) Unlike the newer P3 which is unstable and sucks, the Pickit2 is perfectly working on Linux with open source pk2cmd tool, thats very important. Also, Pickit2 could be used to debug Bus Pirate firmware in a case you would ever run into a weird issue (e.g. while using a particular function in particular way the firmware freezes; connect Pickit2, place some breakpoints and you could find out after what line its freezing and maybe introduce a fix)

P.S. I don't know if its possible to update a bootloader without Pickit2, never tried that.
Maybe its possible - but there is a risk of bricking
Title: Re: Bus Pirate - Community Firmware 7.0
Post by: USBEprom on July 01, 2018, 12:12:35 pm
Hi mikeb.
[quote author="mikeb"]I should have underlined that my opt0+opt0 recommendation is only for BPv4. [/quote]

OK, it's much clearer now, thanks!

[quote author="mikeb"]I thought its a good idea to bump my locally built version from 7.1 to 7.11 . [/quote]

Me too I agree.
Until now I could not test your just released firmware v7.11 especially in order to evaluate if it does fix the problems while using I2C protocol (https://github.com/BusPirate/Bus_Pirate/issues/23 (https://github.com/BusPirate/Bus_Pirate/issues/23) , https://github.com/BusPirate/Bus_Pirate/issues/18 (https://github.com/BusPirate/Bus_Pirate/issues/18)),problems that Bus Pirate v4 also has.
I would like to have the merged repository that you have created to get your new firmware v7.11 cause I suspect the ones you provided here in the forum have not all the features enabled and it would be useful for me to be able to evaluate the size of the firmware when compiled to have all the options enabled and 256 characters for the command line.
I hope that as soon as possible someone will merge the things in order to provide an improved repository directly on github.com.

[quote author="mikeb"]I don't know how well would be 7.1 working together with a very outdated bootloader. [/quote]

About Bus Pirate v3, I have not a Bus Pirate v4, for what I know the only issue while using new firmwares v7.1x with outdated bootloaders is that it will not be possible to jump into bootloader from terminal using command $, so that instead it will be necessary to use jumper on PGD and PGC.
In order to fix that it is need bootloader v4.5.
Of course very old bootloaders will not work with recent firmwares, as usual it is need first to update them to make it possible the thing.
Please, take a look at these:

http://dangerousprototypes.com/docs/V2_to_v4_upgrades (http://dangerousprototypes.com/docs/V2_to_v4_upgrades)
http://dangerousprototypes.com/docs/V4. ... .3_upgrade (http://dangerousprototypes.com/docs/V4.x_to_v4.3_upgrade)
viewtopic.php?f=28&t=8498&start=75#p67056 (http://dangerousprototypes.com/forum/viewtopic.php?f=28&t=8498&start=75#p67056)
viewtopic.php?f=28&t=8498&p=67056#p67127 (http://dangerousprototypes.com/forum/viewtopic.php?f=28&t=8498&p=67056#p67127)
viewtopic.php?f=28&t=8498&start=90#p67351 (http://dangerousprototypes.com/forum/viewtopic.php?f=28&t=8498&start=90#p67351)

[quote author="mikeb"]P.S. I don't know if its possible to update a bootloader without Pickit2, never tried that.
Maybe its possible - but there is a risk of bricking [/quote]

Still talking about Bus Pirate v3, me too I own a PICkit2 for every eventuality, but I am accustomed to use pirate-loader.exe when in the need to upgrade firmware or bootloader.
It works fine for me, although I must admit I fully agree with you that the safest thing to do would be to use a programmer/debugger like PICkit2, ICD2 or something like that.

Be seeing you.

U.Sb
Title: Re: Bus Pirate - Community Firmware 7.0
Post by: USBEprom on July 01, 2018, 05:25:48 pm
Hi awokd.
Sorry for the very late reply.

[quote author="awokd"]
I was using Debian Stretch x64 so had to "apt install lib32z1" and chmod pirate-loader_lnx to executable before it worked[/quote]

Thank you very, very much for sharing your experience and hint!
Based on what you wrote I have just improved the document "How to update with pirate-loader.rtf" (generic cross-platform instructions for Windows, Linux and Apple users) by adding your information.

Be seeing you.

U.Sb
Title: Re: Bus Pirate - Community Firmware 7.0
Post by: mikeb on July 02, 2018, 07:07:03 pm
[quote author="USBEprom"]Until now I could not test your just released firmware v7.11 especially in order to evaluate if it does fix the problems while using I2C protocol (https://github.com/BusPirate/Bus_Pirate/issues/23 (https://github.com/BusPirate/Bus_Pirate/issues/23) , https://github.com/BusPirate/Bus_Pirate/issues/18 (https://github.com/BusPirate/Bus_Pirate/issues/18)),problems that Bus Pirate v4 also has.
I would like to have the merged repository that you have created to get your new firmware v7.11 cause I suspect the ones you provided here in the forum have not all the features enabled and it would be useful for me to be able to evaluate the size of the firmware when compiled to have all the options enabled and 256 characters for the command line.
I hope that as soon as possible someone will merge the things in order to provide an improved repository directly on github.com[/quote]
After reviewing a pull request (https://github.com/BusPirate/Bus_Pirate/pull/93 (https://github.com/BusPirate/Bus_Pirate/pull/93)) I have just cloned this forked repository - https://github.com/ChristopherSamSoon/Bus_Pirate (https://github.com/ChristopherSamSoon/Bus_Pirate) and changed the version numbers of firmware/bootloader. Although he also changed README, so I took "README" from a primary https://github.com/BusPirate/Bus_Pirate (https://github.com/BusPirate/Bus_Pirate) repository. Compared to the primary repository, ChristopherSamSoon is behind by 2 commits - but these commits are not affecting a code, so my bootloader/firmware builds are still the latest and "fresh"

To see what features my BPv3 firmware build has, you could just look at this configuration.h file of forked repository - https://github.com/ChristopherSamSoon/B ... guration.h (https://github.com/ChristopherSamSoon/Bus_Pirate/blob/master/Firmware/configuration.h) - and search it for things like " BUSPIRATEV3 ". I have not modified this "default configuration"

Please tell me if this "default configuration" is OK, or its missing some features that your version configuration.h is providing

Luckily agatti is back, so maybe he will merge this pull request to the official branch

See you,
mikeb
Title: Re: Bus Pirate - Community Firmware 7.0
Post by: MrAureliusR on August 08, 2018, 06:27:05 pm
Not sure how useful this will be, but I just flashed the latest firmware build on the linked post, with the 12062018 build, and everything seems fine on my bpv3:

Code: [Select]
HiZ>#
RESET

Bus Pirate v3.5
Community Firmware v7.11- goo.gl/gCzQnW [HiZ 1-WIRE UART I2C SPI 2WIRE 3WIRE PIC DIO] Bootloader v4.4
DEVID:0x0447 REVID:0x3046 (24FJ64GA00 2 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.98) OK
VPU(4.94) OK
3.3V(3.33) 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!
Any key to exit
Found 0 errors.
HiZ>

I also want to give a HUGE HUGE THANKS to the people working on this. I have been very disappointed that DP abandoned what is likely their most popular project... always frustrated me that the scripting engine never worked. Instead of having to whip up a microcontroller board and write code to test a new sensor, I could have just used my BP with scripting.

So, so glad to see the community picking up the slack. No disrespect to DP -- I love Ian and DP, I have their stickers all over my lab notebooks, and I recommend the Bus Pirate all the time. I have an IR Toy and I definitely want to check out the Bus Blaster.

Do the community devs have a PayPal or other donation link? Cheers.
Title: Re: Bus Pirate - Community Firmware 7.0
Post by: MrAureliusR on August 08, 2018, 06:43:25 pm
Just noticed entering anything into the script engine seems to reboot the BP:

Code: [Select]
HiZ(BASIC)>010 PRINT "HELLO"

Bus Pirate v3.5
Community Firmware v7.11- goo.gl/gCzQnW [HiZ 1-WIRE UART I2C SPI 2WIRE 3WIRE PIC DIO] Bootloader v4.4
DEVID:0x0447 REVID:0x3046 (24FJ64GA00 2 B8)
http://dangerousprototypes.com
HiZ>
Title: Re: Bus Pirate - Community Firmware 7.0
Post by: mikeb on August 16, 2018, 03:49:54 pm
[quote author="MrAureliusR"]Just noticed entering anything into the script engine seems to reboot the BP[/quote] Please try to collect as much info about this problem as you could, and raise a new issue at devs' Github repository - https://github.com/BusPirate/Bus_Pirate (https://github.com/BusPirate/Bus_Pirate) - with a full description of your technical problem. You could also ask them how to donate, maybe not by money but by ordering some parts to their domestic address (ask them what they would prefer). A donation might significantly increase the priority of your requests
Title: Re: Bus Pirate - Community Firmware 7.0
Post by: marsfan on August 29, 2018, 05:44:58 am
Hello everyone,

I have been out of the loop on the bus pirate for some time now (about a year). Looking over this thread, I see that someone linked to a change log saying what was changed with bus pirate v7.1, suggesting that there has been an official community release of v7.1, but I cannot find a link to a main release/hex file for the 7.1 version, could someone point me to this.

In addition, I am starting to learn C, so I might be able to help out with actually testing and development, so I will start exploring the repository and seeing what I can help with.
Title: Re: Bus Pirate - Community Firmware 7.0
Post by: USBEprom on September 02, 2018, 05:04:04 pm
[quote author="mikeb"] Please tell me if this "default configuration" is OK, or its missing some features that your version configuration.h is providing[/quote]

Hi mikeb.
Sorry for the late reply!
All the changes into the configuration.h file I make to get the firmwares I share are clearly described in related posts.
It is sufficient to make the changes reported to obtain a result equal to mine without the need to change anything or to intervene elsewhere.
Sometimes, in the provided by me archive, already is the configuration.h file I used to get the firmware.
Compared to yours, my configuration.h is very different, also because I always want 256 characters for the command line and enable all features (except those deprecated, for instance SMPS_SUPPORT for the management of the abandoned SMPS_BOARD) and lately I provide a UNSAFE version too with active the I2C hardware option.
As an example, please look here:

viewtopic.php?f=28&t=8498&start=90#p67351 (http://dangerousprototypes.com/forum/viewtopic.php?f=28&t=8498&start=90#p67351)

So said, yes your firmware version is missing some features compared to mine.
I will try to build myself a new firmware by merging the necessary changes into the current repository.
Thank you for your support.

Be seeing you.

U.Sb
Title: Re: Bus Pirate - Community Firmware 7.0
Post by: USBEprom on September 02, 2018, 05:20:47 pm
[quote author="marsfan"] Looking over this thread, I see that someone linked to a change log saying what was changed with bus pirate v7.1, suggesting that there has been an official community release of v7.1, but I cannot find a link to a main release/hex file for the 7.1 version, could someone point me to this.[/quote]

Hi marsfan.
For what I know normally it is only provided a repository with whose content the user can build the firmware on his own, the hexadecimal ready to use is rarely provided.

Be seeing you.

U.Sb
Title: Re: Bus Pirate - Community Firmware 7.0
Post by: marsfan on September 02, 2018, 07:27:38 pm
Hey USBEprom,

So as long as I build from source with the slight tweaks you make in your "safe" builds, it can be considered a stable/release build?

Also, is there a page that documents configuration.h. I might have an idea I can help out with on the repo side to make the hex generation process more streamlined for people without a lot of experience doing this.
Title: Re: Bus Pirate - Community Firmware 7.0
Post by: USBEprom on September 02, 2018, 09:26:41 pm
[quote author="marsfan"]So as long as I build from source with the slight tweaks you make in your "safe" builds, it can be considered a stable/release build?[/quote]

Hi marsfan.
I am certainly not the right person to give an answer, however for me yes, it is, it can be considered a stable release built.
As far as I am concerned, within the limits of my skills and knowledge, all the firmwares that I share are tested and functioning by myself and a friend of mine of whom I have already written in the past.
Despite all, it is always possible that them hide bugs that I can not identify, also because, as it is easy to guess, as much as I can try I can not verify all the possible scenarios.
When I find problems I make it known to everyone, though.

[quote author="marsfan"]is there a page that documents configuration.h[/quote]

In my opinion configuration.h is quite explanatory by itself.
I do not know if somewhere it is explained in depth, it could also be, however I unfortunately can not add anything.
Usually when I have any doubts I ask for information directly on github.

Today I tried to build my v7.11 version of the firmware starting from the current repository by changing bitbang.c, bitbang.h and i2c.c with the same ones extrapolated from the Christopher Sam Soon repository (https://github.com/ChristopherSamSoon/Bus_Pirate (https://github.com/ChristopherSamSoon/Bus_Pirate)), but no joy.
I could not compile anything due to errors in MPLAB as in attachment.
Evidently the thing is not as simple as I had believed it.
Maybe next time.

Be seeing you.

U.Sb
Title: Re: Bus Pirate - Community Firmware 7.0
Post by: marsfan on September 03, 2018, 01:00:23 am
Cool. I am thinking about looking into creating a build script that will allow for automatic hex file compiling for the github library when new commits are added, but I will need to skim through how to use MPLAB first, as I have not worked with PICs before.
Title: Re: Bus Pirate - Community Firmware 7.0
Post by: mikeb on October 27, 2018, 10:40:40 pm
[quote author="USBEprom"]I could not compile anything due to errors in MPLAB as in attachment.[/quote] Hi U.Sb, I looked through your ERRORS.txt and maybe some patch has been applied incompletely ("BITBANG_I2C_START_ONE_SHOT undeclared" error could be a sign of this). But it doesn't matter anymore, because ChristopherSamSoon's fixes has been merged to https://github.com/BusPirate/Bus_Pirate/ (https://github.com/BusPirate/Bus_Pirate/) repository. So, if you'd just clone the latest master and try building it without any patches, everything should be fine, although I haven't tested the latest commits by myself yet
Title: Re: Bus Pirate - Community Firmware 7.0
Post by: USBEprom on October 28, 2018, 11:55:46 am
Hi mikeb.
Many thanks for the hints and for share!
For a long time I kept an eye on the repository but I did not understand the fixes of ChristopherSamSoon had been already merged.
I see that the last commit is 23 days ago, when exactly the code would have been merged and above all from which particular could be understood?
Thank you.
I ask this to learn how to deal myself with it, since I am babo as hell in this sort of matter.
I did not want to compile the repository of ChristopherSamSoon just as it is because I wanted to test all the improvements made to the firmware up to now and then anyway I would not have been able to merge them to the firmware v7.x.
So I tried to merge the fixes of ChristopherSamSoon with the v7.x firmware in my own way, but I failed.
Now that I know everything has already been prepared properly and ready I start working immediately, thank you mikeb!

Be seeing you.

U.Sb
Title: Re: Bus Pirate - Community Firmware 7.0
Post by: USBEprom on October 28, 2018, 11:46:54 pm
Hi guys.
Thanks to agatti who has just fixed the current October 28, 2018 repository(https://github.com/BusPirate/Bus_Pirate/issues/110 (https://github.com/BusPirate/Bus_Pirate/issues/110)) I was able to build new firmwares v7.1 for the Bus Pirate revision 3 (https://github.com/BusPirate/Bus_Pirate ... master.zip (https://github.com/BusPirate/Bus_Pirate/archive/master.zip)).
I made two versions that i named S_1-28102018.hex and U_1-28102018.hex.
Both of them have all the features enabled, BASIC too, the command line allows up 256 characters.
The first one (S_1-28102018.hex), the so called SAFE version (S=SAFE), is built on the configuration.h changed as follow.
Into configuration.h I changed lines from 316 to 331 in order to enable all the features available, BASIC too.

#ifdef BUSPIRATEV3
#define BP_ENABLE_1WIRE_SUPPORT
#define BP_ENABLE_BASIC_SUPPORT
#define BP_ENABLE_DIO_SUPPORT
#define BP_ENABLE_HD44780_SUPPORT
#define BP_ENABLE_I2C_SUPPORT
#define BP_ENABLE_JTAG_SUPPORT
#define BP_ENABLE_PIC_SUPPORT
#define BP_ENABLE_PC_AT_KEYBOARD_SUPPORT
#define BP_ENABLE_RAW_2WIRE_SUPPORT
#define BP_ENABLE_RAW_3WIRE_SUPPORT

#undef BP_ENABLE_SMPS_SUPPORT[/b]
#define BP_ENABLE_SPI_SUPPORT
#define BP_ENABLE_SUMP_SUPPORT
#define BP_ENABLE_UART_SUPPORT
#endif /* BUSPIRATEV3 */


Please, pay attention that since recently the SMPS_SUPPORT for the Bus Pirate v3 has been removed, I left the line number 328 unchanged as #undef.[/b]

SMPS_SUPPORT is intended for the management of the SMPS_BOARD which is an abandoned or stalled board.
Exactly it is this:

http://dangerousprototypes.com/blog/200 ... y-6-parts/ (http://dangerousprototypes.com/blog/2009/12/04/bus-pirate-boost-converter-with-only-6-parts/)
http://dangerousprototypes.com/docs/Bus_Pirate_SMPS (http://dangerousprototypes.com/docs/Bus_Pirate_SMPS)

Then I changed the line 425 too in this way in order to make room for BASIC scripting:

#define BP_BASIC_PROGRAM_SPACE 512

Finally I had to set line 561 for up 256 characters into the command line by changing it in this way:

/**
* How big the serial command buffer can be, in bytes.
*
* @warning This must be set to a power of two, ie. 256, 128, 64, 32, etc.
*/
#ifdef BUSPIRATEV3
#define BP_COMMAND_BUFFER_SIZE 256
#else
#define BP_COMMAND_BUFFER_SIZE 256
#endif /* BUSPIRATEV3 */

 
The result that I have achieved I have called it S_1-28102018.hex.
S_1-28102018.hex was obtained by using the compression option "1" of MPLAB so to be in fully accordance with the latest recommendations issued about the compilation of the new repositories using MPLAB in order to build new firmwares for the Bus Pirate v3 and v4.
Compression option "1" assure right timing that option "s" may not ensure.
For me it works great.
Thanks a lot to agatti for having fixed the repository!

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

The second one (U_1-28102018.hex) is the same as S_1-28102018.hex but also it has the HARDWARE mode unlocked for the I2C protocol.
Indeed in the recent past agatti taught how to free the HARDWARE mode inside I2C protocol (https://github.com/BusPirate/Bus_Pirate/issues/39 (https://github.com/BusPirate/Bus_Pirate/issues/39)).
Please read the above link carefully!
As agatti wrote:
"Dangerous Prototypes' original firmware did not use hardware I2C due to hardware bugs in PIC24FJ64GA004 chips with revision A3 or A4.
Now that hardware I2C is enabled again and the appropriate workarounds detailed here (http://ww1.microchip.com/downloads/en/D ... 00470j.pdf (http://ww1.microchip.com/downloads/en/DeviceDoc/80000470j.pdf)) have been applied, we need to test those on real hardware.

The catch: the code is experimental and it may or may not mess up with your hardware, just in case."
U_1-28102018.hex, the so called UNSAFE version (U=UNSAFE) is built on the configuration.h changed as follow.
Into configuration.h I changed lines from 316 to 331 in order to enable all the features available, BASIC too.

#ifdef BUSPIRATEV3
#define BP_ENABLE_1WIRE_SUPPORT
#define BP_ENABLE_BASIC_SUPPORT
#define BP_ENABLE_DIO_SUPPORT
#define BP_ENABLE_HD44780_SUPPORT
#define BP_ENABLE_I2C_SUPPORT
#define BP_ENABLE_JTAG_SUPPORT
#define BP_ENABLE_PIC_SUPPORT
#define BP_ENABLE_PC_AT_KEYBOARD_SUPPORT
#define BP_ENABLE_RAW_2WIRE_SUPPORT
#define BP_ENABLE_RAW_3WIRE_SUPPORT

#undef BP_ENABLE_SMPS_SUPPORT[/b]
#define BP_ENABLE_SPI_SUPPORT
#define BP_ENABLE_SUMP_SUPPORT
#define BP_ENABLE_UART_SUPPORT
#endif /* BUSPIRATEV3 */


Please, pay attention that since recently the SMPS_SUPPORT for the Bus Pirate v3 has been removed, I left the line number 328 unchanged as #undef.[/b]

SMPS_SUPPORT is intended for the management of the SMPS_BOARD which is an abandoned or stalled board.
Exactly it is this:

http://dangerousprototypes.com/blog/200 ... y-6-parts/ (http://dangerousprototypes.com/blog/2009/12/04/bus-pirate-boost-converter-with-only-6-parts/)
http://dangerousprototypes.com/docs/Bus_Pirate_SMPS (http://dangerousprototypes.com/docs/Bus_Pirate_SMPS)

Then I changed the line 425 too in this way in order to make room for BASIC scripting:

#define BP_BASIC_PROGRAM_SPACE 512

And then I had to set line 561 for up 256 characters into the command line by changing it in this way:

/**
* How big the serial command buffer can be, in bytes.
*
* @warning This must be set to a power of two, ie. 256, 128, 64, 32, etc.
*/
#ifdef BUSPIRATEV3
#define BP_COMMAND_BUFFER_SIZE 256
#else
#define BP_COMMAND_BUFFER_SIZE 256
#endif /* BUSPIRATEV3 */

 
Finally I had to put a remark sign ("//") inside line 382 and 391 in order to unlock the HARDWARE mode for the I2C protocol:

382 // #ifdef BUSPIRATEV4

391 // #endif /* BUSPIRATEV4 */
 
The result that I have achieved I have called it U_1-28102018.hex.
U_1-28102018.hex was obtained by using the compression option "1" of MPLAB so to be in fully accordance with the latest recommendations issued about the compilation of the new repositories using MPLAB in order to build new firmwares for the Bus Pirate v3 and v4.
Compression option "1" assure right timing that option "s" may not ensure.

For me it works great, but you use it at your own risk, I do not take any responsibility about the possibility of damaging your Bus Pirate or whatever!

Attention please!
First to attempt to use U_1-28102018.hex (UNSAFE version of the firmware) you have to evaluate what is the silicon revision of the PIC used in your device, paying much attention to the fact that you might damage your device or whatever!
By doing it you must to assume all the responsibility for your action.
You use it at your own risk, I do not take any responsibility about the possibility of damaging your Bus Pirate or whatever!


Thanks a lot to agatti for having fixed the repository and freed the HARDWARE mode inside of I2C protocol!

Please note that both S_1-28102018.hex and U_1-28102018.hex were compiled with MPLAB-X IDE v5.00 and the XC-16 v1.34 compiler because the current repository dated October 28, 2018 is not natively compatible with MPLAB-X IDE v4.xx and earlier and both of them require the new bootloader v4.5 in order to work completely (viewtopic.php?f=28&t=8498&start=75#p67056 (http://dangerousprototypes.com/forum/viewtopic.php?f=28&t=8498&start=75#p67056) and viewtopic.php?f=28&t=8498&p=67056#p67127 (http://dangerousprototypes.com/forum/viewtopic.php?f=28&t=8498&p=67056#p67127)).
Otherwise if do not, enter BOOTLOADER using command "$" will not work (https://github.com/BusPirate/Bus_Pirate/issues/58 (https://github.com/BusPirate/Bus_Pirate/issues/58)).
Actually it is not really a problem on the firmware side but rather of the bootloader.
In order to fix the matter it is need to upgrade the bootloader to the new revision v4.5:

viewtopic.php?f=28&t=619#p67037 (http://dangerousprototypes.com/forum/viewtopic.php?f=28&t=619#p67037)

viewtopic.php?f=28&t=8498&start=60#p67043 (http://dangerousprototypes.com/forum/viewtopic.php?f=28&t=8498&start=60#p67043)

https://github.com/BusPirate/Bus_Pirate/issues/38 (https://github.com/BusPirate/Bus_Pirate/issues/38)

https://github.com/BusPirate/Bus_Pirate/issues/58 (https://github.com/BusPirate/Bus_Pirate/issues/58)

viewtopic.php?f=28&t=8498&p=67056#p67056 (http://dangerousprototypes.com/forum/viewtopic.php?f=28&t=8498&p=67056#p67056)


With the firmwares I also provide a pre configured environment that anyone can use with minimal changes to simplify the upgrade of the only firmware or together the bootloader and the firmware in a single step.
The archive also provides further improved instructions on how to use the whole thing under any operative system (Window, Linux and Apple), simply follow them :

"How to use UPGRADE_TO_BL_v4.5.bat.rtf" (specific instructions for Windows users)
"How to update with pirate-loader.rtf" (generic cross-platform instructions for Windows, Linux and Apple users)

Please note that the package is a 7z (7zip) archive because the maximum allowed size in the forum is 1 MiB.

Be seeing you.

U.Sb
Title: Re: Bus Pirate - Community Firmware 7.0
Post by: USBEprom on October 29, 2018, 11:40:43 pm
Hi guys.
For your information I just tested I2C with the new firmware U_1-28102018 I built yesterday (viewtopic.php?f=28&t=8498&start=105#p67796 (http://dangerousprototypes.com/forum/viewtopic.php?f=28&t=8498&start=105#p67796)) by using the current repository dated october 28, 2018 which should have the fixes for the I2C protocol provided by Christopher Sam Soon (https://github.com/ChristopherSamSoon/Bus_Pirate (https://github.com/ChristopherSamSoon/Bus_Pirate)) which though only fix the I2C-restart problem (write then read) during read after write operations.
Sadly still there are problems as before while using I2C software.
By choosing ~5KHz, ~50KHz or ~100KHz, does not matter what of them, the I2C software clock is alway about ~700Hz, while by choosing ~400KHz it is about ~200kHz that is the half of the value set.
Instead I2C hardware seems to be good being I2C hardware clock is about ~100kHz, about ~400kHz and about ~1MHz depending on whether it is choose 100KHz, 400KHz or 1MHz, so quite good (https://github.com/BusPirate/Bus_Pirate ... -434105708 (https://github.com/BusPirate/Bus_Pirate/issues/23#issuecomment-434105708)).


Be seeing you.

U.Sb
Title: Re: Bus Pirate - Community Firmware 7.0
Post by: USBEprom on November 04, 2018, 04:16:17 pm
Hy guys.
Finally I was able to build a test firmware starting from the latest repository dated 04 November, 2018 released by Christopher Sam Soon (https://github.com/ChristopherSamSoon/Bus_Pirate (https://github.com/ChristopherSamSoon/Bus_Pirate)).
For testing I built both SAFE (only I2C software) that UNSAFE (freed I2C hardware) firmwares and here in attachment are the results.
For me all it works fine, however I will continue the tests in  order to assure there are not any sort of problem somewhere and then I will let you know.
Luckily in the end it seems that now everything is fine.

Many, many thanks to Christopher Sam Soon for having fix the whole matter, thank you sir!

Please pay attention to the fact that orange color for the caption about ~400kHz SOFTWARE mode does not mean it is working bad, simply that does not match the value into the menu.
Christopher Sam Soon has already explained there is a speed limit there so it may even be useful to change the value in the menu from ~400kHz to ~220kHz hence it would be full green as color.


https://github.com/BusPirate/Bus_Pirate/issues/23 (https://github.com/BusPirate/Bus_Pirate/issues/23)

Be seeing you.

U.Sb
Title: Re: Bus Pirate - Community Firmware 7.0
Post by: USBEprom on November 05, 2018, 10:35:32 pm
Hi guys.
Thanks to Christopher Sam Soon who has fixed and improved I2C, 2-WIRE and 3-WIRE protocol, agatti has built a new repository of the firmware v7.1 for the Bus Pirate (https://github.com/BusPirate/Bus_Pirate) so that I was able to build new firmwares v7.1 for the Bus Pirate revision 3 (https://github.com/BusPirate/Bus_Pirate/archive/master.zip).
I made two versions that i named S_1-05112018.hex and U_1-05112018.hex.
Both of them have all the features enabled, BASIC too, the command line allows up 256 characters.
The first one (S_1-05112018.hex), the so called SAFE version (S=SAFE), is built on the configuration.h changed as follow.
Into configuration.h I changed lines from 316 to 331 in order to enable all the features available, BASIC too.

#ifdef BUSPIRATEV3
#define BP_ENABLE_1WIRE_SUPPORT
#define BP_ENABLE_BASIC_SUPPORT
#define BP_ENABLE_DIO_SUPPORT
#define BP_ENABLE_HD44780_SUPPORT
#define BP_ENABLE_I2C_SUPPORT
#define BP_ENABLE_JTAG_SUPPORT
#define BP_ENABLE_PIC_SUPPORT
#define BP_ENABLE_PC_AT_KEYBOARD_SUPPORT
#define BP_ENABLE_RAW_2WIRE_SUPPORT
#define BP_ENABLE_RAW_3WIRE_SUPPORT

#undef BP_ENABLE_SMPS_SUPPORT[/b]
#define BP_ENABLE_SPI_SUPPORT
#define BP_ENABLE_SUMP_SUPPORT
#define BP_ENABLE_UART_SUPPORT
#endif /* BUSPIRATEV3 */


Please, pay attention that since recently the SMPS_SUPPORT for the Bus Pirate v3 has been removed, I left the line number 327 unchanged as #undef.[/b]

SMPS_SUPPORT is intended for the management of the SMPS_BOARD which is an abandoned or stalled board.
Exactly it is this:

http://dangerousprototypes.com/blog/200 ... y-6-parts/ (http://dangerousprototypes.com/blog/2009/12/04/bus-pirate-boost-converter-with-only-6-parts/)
http://dangerousprototypes.com/docs/Bus_Pirate_SMPS (http://dangerousprototypes.com/docs/Bus_Pirate_SMPS)

Then I changed the line 425 too in this way in order to make room for BASIC scripting:

#define BP_BASIC_PROGRAM_SPACE 512

Finally I had to set line 561 for up 256 characters into the command line by changing it in this way:

/**
* How big the serial command buffer can be, in bytes.
*
* @warning This must be set to a power of two, ie. 256, 128, 64, 32, etc.
*/
#ifdef BUSPIRATEV3
#define BP_COMMAND_BUFFER_SIZE 256
#else
#define BP_COMMAND_BUFFER_SIZE 256
#endif /* BUSPIRATEV3 */


Delay code provided by Christopher Sam Soon to the main branch is currently enabled by default, but can be switched off by undefining BP_USE_HARDWARE_DELAY_TIMER in line 576 of configuration.h.

In order to match the real speeds now used for I2C SOFTWARE, 2-WIRE and 3-WIRE in messages_v3.s line 1553 I changed ~400kHz to ~220kHz and more in general I changed all the terms KHz, which is wrong as a unit of measure, in kHz which is the right word.
 
The result that I have achieved I have called it S_1-05112018.hex.
S_1-05112018.hex was obtained by using the compression option "1" of MPLAB so to be in fully accordance with the latest recommendations issued about the compilation of the new repositories using MPLAB in order to build new firmwares for the Bus Pirate v3 and v4.
Compression option "1" assure right timing that option "s" may not ensure.
For me it works great.
Thanks a lot to Christopher Sam Soon for having fixed the matter!

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

The second one (U_1-05112018.hex) is the same as S_1-05112018.hex but also it has the HARDWARE mode unlocked for the I2C protocol.
Indeed in the recent past agatti taught how to free the HARDWARE mode inside I2C protocol (https://github.com/BusPirate/Bus_Pirate/issues/39 (https://github.com/BusPirate/Bus_Pirate/issues/39)).
Please read the above link carefully!
As agatti wrote:
"Dangerous Prototypes' original firmware did not use hardware I2C due to hardware bugs in PIC24FJ64GA004 chips with revision A3 or A4.
Now that hardware I2C is enabled again and the appropriate workarounds detailed here (http://ww1.microchip.com/downloads/en/D ... 00470j.pdf (http://ww1.microchip.com/downloads/en/DeviceDoc/80000470j.pdf)) have been applied, we need to test those on real hardware.

The catch: the code is experimental and it may or may not mess up with your hardware, just in case."
U_1-05112018.hex, the so called UNSAFE version (U=UNSAFE) is built on the configuration.h changed as follow.
Into configuration.h I changed lines from 316 to 331 in order to enable all the features available, BASIC too.

#ifdef BUSPIRATEV3
#define BP_ENABLE_1WIRE_SUPPORT
#define BP_ENABLE_BASIC_SUPPORT
#define BP_ENABLE_DIO_SUPPORT
#define BP_ENABLE_HD44780_SUPPORT
#define BP_ENABLE_I2C_SUPPORT
#define BP_ENABLE_JTAG_SUPPORT
#define BP_ENABLE_PIC_SUPPORT
#define BP_ENABLE_PC_AT_KEYBOARD_SUPPORT
#define BP_ENABLE_RAW_2WIRE_SUPPORT
#define BP_ENABLE_RAW_3WIRE_SUPPORT

#undef BP_ENABLE_SMPS_SUPPORT[/b]
#define BP_ENABLE_SPI_SUPPORT
#define BP_ENABLE_SUMP_SUPPORT
#define BP_ENABLE_UART_SUPPORT
#endif /* BUSPIRATEV3 */


Please, pay attention that since recently the SMPS_SUPPORT for the Bus Pirate v3 has been removed, I left the line number 327 unchanged as #undef.[/b]

SMPS_SUPPORT is intended for the management of the SMPS_BOARD which is an abandoned or stalled board.
Exactly it is this:

http://dangerousprototypes.com/blog/200 ... y-6-parts/ (http://dangerousprototypes.com/blog/2009/12/04/bus-pirate-boost-converter-with-only-6-parts/)
http://dangerousprototypes.com/docs/Bus_Pirate_SMPS (http://dangerousprototypes.com/docs/Bus_Pirate_SMPS)

Then I changed the line 425 too in this way in order to make room for BASIC scripting:

#define BP_BASIC_PROGRAM_SPACE 512

And then I had to set line 561 for up 256 characters into the command line by changing it in this way:

/**
* How big the serial command buffer can be, in bytes.
*
* @warning This must be set to a power of two, ie. 256, 128, 64, 32, etc.
*/
#ifdef BUSPIRATEV3
#define BP_COMMAND_BUFFER_SIZE 256
#else
#define BP_COMMAND_BUFFER_SIZE 256
#endif /* BUSPIRATEV3 */

 
Then I had to put a remark sign ("//") inside line 382 and 391 in order to unlock the HARDWARE mode for the I2C protocol:

382 // #ifdef BUSPIRATEV4

391 // #endif /* BUSPIRATEV4 */

Delay code provided by Christopher Sam Soon to the main branch is currently enabled by default, but can be switched off by undefining BP_USE_HARDWARE_DELAY_TIMER in line 576 of configuration.h.

And finally in order to match the real speeds now used for I2C SOFTWARE, 2-WIRE and 3-WIRE in messages_v3.s line 1553 I changed ~400kHz to ~220kHz and more in general I changed all the terms KHz, which is wrong as a unit of measure, in kHz which is the right word.
 
The result that I have achieved I have called it U_1-05112018.hex.
U_1-05112018.hex was obtained by using the compression option "1" of MPLAB so to be in fully accordance with the latest recommendations issued about the compilation of the new repositories using MPLAB in order to build new firmwares for the Bus Pirate v3 and v4.
Compression option "1" assure right timing that option "s" may not ensure.

For me it works great, but you use it at your own risk, I do not take any responsibility about the possibility of damaging your Bus Pirate or whatever!

Attention please!
First to attempt to use U_1-05112018.hex (UNSAFE version of the firmware) you have to evaluate what is the silicon revision of the PIC used in your device, paying much attention to the fact that you might damage your device or whatever!
By doing it you must to assume all the responsibility for your action.
You use it at your own risk, I do not take any responsibility about the possibility of damaging your Bus Pirate or whatever!


Thanks a lot to Christopher Sam Soon for having fixed the matter and agatti for having freed the HARDWARE mode inside of I2C protocol!

Please note that both S_1-05112018.hex and U_1-05112018.hex were compiled with MPLAB-X IDE v5.00 and the XC-16 v1.35 compiler on Ubuntu 18.04 computer because the latest repositories are not natively compatible with MPLAB-X IDE v4.xx and earlier and both of them require the new bootloader v4.5 in order to work completely (viewtopic.php?f=28&t=8498&start=75#p67056 (http://dangerousprototypes.com/forum/viewtopic.php?f=28&t=8498&start=75#p67056) and viewtopic.php?f=28&t=8498&p=67056#p67127 (http://dangerousprototypes.com/forum/viewtopic.php?f=28&t=8498&p=67056#p67127)).
Otherwise if do not, enter BOOTLOADER using command "$" will not work (https://github.com/BusPirate/Bus_Pirate/issues/58 (https://github.com/BusPirate/Bus_Pirate/issues/58)).
Actually it is not really a problem on the firmware side but rather of the bootloader.
In order to fix the matter it is need to upgrade the bootloader to the new revision v4.5:

viewtopic.php?f=28&t=619#p67037 (http://dangerousprototypes.com/forum/viewtopic.php?f=28&t=619#p67037)

viewtopic.php?f=28&t=8498&start=60#p67043 (http://dangerousprototypes.com/forum/viewtopic.php?f=28&t=8498&start=60#p67043)

https://github.com/BusPirate/Bus_Pirate/issues/38 (https://github.com/BusPirate/Bus_Pirate/issues/38)

https://github.com/BusPirate/Bus_Pirate/issues/58 (https://github.com/BusPirate/Bus_Pirate/issues/58)

viewtopic.php?f=28&t=8498&p=67056#p67056 (http://dangerousprototypes.com/forum/viewtopic.php?f=28&t=8498&p=67056#p67056)


With the firmwares I also provide a pre configured environment that anyone can use with minimal changes to simplify the upgrade of the only firmware or together the bootloader and the firmware in a single step.
The archive also provides further improved instructions on how to use the whole thing under any operative system (Window, Linux and Apple), simply follow them :

"How to use UPGRADE_TO_BL_v4.5.bat.rtf" (specific instructions for Windows users)
"How to update with pirate-loader.rtf" (generic cross-platform instructions for Windows, Linux and Apple users)

Please note that the package is a 7z (7zip) archive because the maximum allowed size in the forum is 1 MiB.

Be seeing you.

U.Sb
Title: Re: Bus Pirate - Community Firmware 7.0
Post by: USBEprom on November 10, 2018, 02:32:51 pm
Hi guys.
In the end I managed to test the functioning of the 1-WIRE protocol on the Pirate v3 Bus using the firmwares that I got from the current repository and therefore updated, concluding that everything works as expected.
For the tests I have followed the suggestion of agatti and I used an Arduino MEGA 2560 card borrowed from the usual friend of mine where was running a 1-WIRE SLAVE library.
Very sadly I have not in any way been able to test the 1-WIRE protocol with a real device, because despite all the attempts I made I could not read the iButton DS1990A-F5 I own.
I tried hard, I also purchased a real iButton socket probe reader provided with suppressor but no joy.
Maybe my DS1990A-F5 has something bad, even if it is weird because it is fully working using other than Bus Pirate, I do not know why it does not work with my Bus Pirate v3 which has the 2000ohm R20 pull-up resistor.
I would have liked to verify the 1-WIRE protocol with a real and not simulated device but in the end I had to resign myself to perform tests on devices emulated with Arduino.
The library that I used is here:

https://github.com/orgua/OneWireHub (https://github.com/orgua/OneWireHub)

It is the only one I could find that works with the Arduino MEGA 2560 board.
Among the other supported devices, the above library also manages the families DS1990, DS1990A and DS2401, so in the end, although only in emulation mode, I could virtually test the 1-WIRE protocol with the iButton DS1990A, because with the real one I own I have not succeeded.
For what I could see everything works correctly, even if I noticed a weirdness and could in my opinion be introduced some improvements.

(https://github.com/BusPirate/Bus_Pirate/issues/23 (https://github.com/BusPirate/Bus_Pirate/issues/23))

Be seeing you.

U.Sb
Title: Re: Bus Pirate - Community Firmware 7.0
Post by: chrismec on November 25, 2018, 05:56:38 pm
hey all, Is bit bang mode still supported in this community firmware 7.0? **Edit: And if it is still supported how do you get in? I'm needing uart bitbang and from HiZ entering 0x00 twenty times only results in syntax error. Currently working with BP4 on v7.0 or BP3 on v6.1.
Title: Re: Bus Pirate - Community Firmware 7.0
Post by: USBEprom on November 26, 2018, 10:21:12 pm
Hi chrismec.
Really sorry for the problem you are dealing.
I have just cheked it with the latest release U_1-05112018 that I have shared on the forum (viewtopic.php?f=28&t=8498&start=120#p67834 (http://dangerousprototypes.com/forum/viewtopic.php?f=28&t=8498&start=120#p67834)) and everything works perfectly as it should without any problem.
How do you enter into bitbang mode and with what type of terminal or GUI?
Standard terminal programs are not suitable for the use with bitbang, it is need something like Hercules or Buccaneer's Den:

viewtopic.php?f=4&t=6206#p56820 (http://dangerousprototypes.com/forum/viewtopic.php?f=4&t=6206#p56820)

00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 = enter bitbang mode (BBIO1)

00 = reset bitbang mode

0F = exit bitbang mode

03 = enter bitbang mode UART (ART1)

http://dangerousprototypes.com/docs/Bitbang (http://dangerousprototypes.com/docs/Bitbang)

From my side and for what I can see nothing is wrong with bitbang mode and firmware v7.x.

Be seeing you.

U.Sb
Title: Re: Bus Pirate - Community Firmware 7.0
Post by: USBEprom on November 28, 2018, 11:24:56 pm
Hi guys.
In the end I managed to test Overdrive (~160kps) on 1-WIRE protocol with the Bus Pirate v3 despite as it is now Bus Pirate v3 can not natively switch from standard to overdrive speed without turning off power supply and pull-up resistors so that the 1-WIRE slave device is indesirably deselected (https://github.com/BusPirate/Bus_Pirate/issues/117 (https://github.com/BusPirate/Bus_Pirate/issues/117) and https://github.com/BusPirate/Bus_Pirate ... 4c968ba4e1 (https://github.com/BusPirate/Bus_Pirate/commit/07c8be981fac9cfc633195c55959ca4c968ba4e1)).
In order to reach the goal I had to manually operate 3 switches and add 2 diodes type 1N4148 and one 2,2kohm resistor as in the attached picture.
Since the attached diagram is used to execute the I2C_ARDUINO_TEST procedure provided by agatti
I have also kept it for the OneWireHub-2.2.1 library by simply setting to 20  the 1-WIRE pin (pin_onewire {20};) that is among the valid interrupt pins for the Arduino MEGA 2560 board.
In this way I can do testing on both I2C and 1-WIRE protocols with no need to change connections and by only switch from an Arduino sketch to another.
This is why there are the SCL and the SDA names on the diagram although I am talking about 1-WIRE protocol.

The target 1-WIRE slave was a DS2506 64Kb Add-Only Memory simulated by an Arduino MEGA 2560 running the OneWireHub-2.2.1 library (https://github.com/orgua/OneWireHub (https://github.com/orgua/OneWireHub)) where in "OneWireHub_config.h" the overdrive support for the slaves was enabled #define OVERDRIVE_ENABLE 1 // support overdrive for the slaves.
In order to operate safety for Bus Pirate v3 and Arduino MEGA 2560 I did as follow.
First.
With the connections shown above I have set up:

a) SWITCH 3 = OPEN

b) SWITCH 2 = CLOSE

c) SWITCH 1 = CLOSE

Once did so I started the Bus Pirate v3 for 1-WIRE protocol and Standard (~16.3kbps) speed, ending turning on the power supplies with command "W" and pull-up resistors with command "P".
After this I queried the Arduino MEGA 2560 with macro (51) and (240) in order to be sure all was right.
Having verified this, I gave the command {0x3c r: 8 from the Bus Pirate v3.
As explained here in http://forum.arduino.cc/index.php?topic ... msg1486950 (http://forum.arduino.cc/index.php?topic=201776.msg1486950#msg1486950), 0x3c (Overdrive Skip ROM command) immediately puts all overdrive capable slaves on the bus into overdrive mode.
Once a slave is in overdrive mode, all subsequent communication must take place at overdrive speed, so I did this:

a) SWITCH 2 = OPEN

b) SWITCH 3 = CLOSE

c) SWITCH 1 = OPEN

Then I reset the Bus Pirate v3 with command "#" and restarted it for 1-WIRE protocol this time choosing the Overdrive (~160kps) speed and ending turning on the power supplies with command "W" and pull-up resistors with command "P".
At this point I moved switches as follow:

a) SWITCH 1 = CLOSE

b) SWITCH 3 = OPEN

c) SWITCH 2 = CLOSE

And I started to query the simulated DS2506 from the Bus Pirate v3.
Bingo!, that did the trick and everything worked as expected!
So I could send commands and capture and decode the data traffic on the bus with the logic analyzer.
In this way I was able to measure about ~90kHz for the clock speed of the data traffic.
The whole thing was 100% functioning even because I had to set the decoder of the logic analyzer to "Overdrive" because otherwise I could not decode anything.
For what I can see all is good and nothing is wrong with 1-WIRE protocol on Bus Pirate v3 with firmware v7.x.
Very, very well!
All this shows that the recently added and remodeled code works well without introducing any problems whatsoever.
(https://github.com/BusPirate/Bus_Pirate ... -container (https://github.com/BusPirate/Bus_Pirate/issues/23?_pjax=%23js-repo-pjax-container))
Many, many thanks to Christopher Sam Soon for the patch!

Be seeing you.

U.Sb
Title: Re: Bus Pirate - Community Firmware 7.0
Post by: USBEprom on March 08, 2019, 11:18:28 pm
Hi guys.
Thanks to coelner, tofurky, Rondom and andersm, agatti fixed the issue with AVRDUDE when using buspirate syntaxes (http://https://github.com/BusPirate/Bus_Pirate/issues/122) and he has released a new repository of the firmware v7.1 for the Bus Pirate (http://https://github.com/BusPirate/Bus_Pirate) so that I was able to build new firmwares v7.1 for the Bus Pirate revision 3 (http://https://github.com/BusPirate/Bus_Pirate/archive/master.zip).
andersm also corrected spi.c for bytes_to_write tested twice by mistake (http://https://github.com/BusPirate/Bus_Pirate/pull/127).
I made two versions that i named 09032019_OPT1_SAFE.hex and 09032019_OPT1_UNSAFE.hex.
Both of them have all the features enabled, BASIC too, the command line allows up 256 characters.
The first one (09032019_OPT1_SAFE.hex), the so called SAFE version (S=SAFE), is built on the configuration.h changed as follow.
Into configuration.h I changed lines from 316 to 331 in order to enable all the features available, BASIC too.

#ifdef BUSPIRATEV3
#define BP_ENABLE_1WIRE_SUPPORT
#define BP_ENABLE_BASIC_SUPPORT
#define BP_ENABLE_DIO_SUPPORT
#define BP_ENABLE_HD44780_SUPPORT
#define BP_ENABLE_I2C_SUPPORT
#define BP_ENABLE_JTAG_SUPPORT
#define BP_ENABLE_PIC_SUPPORT
#define BP_ENABLE_PC_AT_KEYBOARD_SUPPORT
#define BP_ENABLE_RAW_2WIRE_SUPPORT
#define BP_ENABLE_RAW_3WIRE_SUPPORT

#undef BP_ENABLE_SMPS_SUPPORT[/b]
#define BP_ENABLE_SPI_SUPPORT
#define BP_ENABLE_SUMP_SUPPORT
#define BP_ENABLE_UART_SUPPORT
#endif /* BUSPIRATEV3 */


Please, pay attention that since the SMPS_SUPPORT for the Bus Pirate v3 has been removed, I left the line number 327 unchanged as #undef.[/b]

SMPS_SUPPORT is intended for the management of the SMPS_BOARD which is an abandoned or stalled board.
Exactly it is this:

http://http://dangerousprototypes.com/blog/2009/12/04/bus-pirate-boost-converter-with-only-6-parts/
http://http://dangerousprototypes.com/docs/Bus_Pirate_SMPS

Then I changed the line 425 too in this way in order to make room for BASIC scripting:

#define BP_BASIC_PROGRAM_SPACE 512

Finally I had to set line 571 for up 256 characters into the command line by changing it in this way:

/**
* How big the serial command buffer can be, in bytes.
*
* @warning This must be set to a power of two, ie. 256, 128, 64, 32, etc.
*/
#ifdef BUSPIRATEV3
#define BP_COMMAND_BUFFER_SIZE 256
#else
#define BP_COMMAND_BUFFER_SIZE 256
#endif /* BUSPIRATEV3 */


Delay code provided by Christopher Sam Soon to the main branch is currently enabled by default, but can be switched off by undefining BP_USE_HARDWARE_DELAY_TIMER in line 586 of configuration.h.

In order to match the real speeds now used for I2C SOFTWARE, 2-WIRE and 3-WIRE in messages_v3.s line 1457 I changed ~400kHz to ~240kHz and more in general I changed all the terms KHz, which is wrong as a unit of measure, in kHz which is the right word.
 
The result that I have achieved I have called it 09032019_OPT1_SAFE.hex.
09032019_OPT1_SAFE.hex was obtained by using the compression option "1" of MPLAB so to be in fully accordance with the latest recommendations issued about the compilation of the new repositories using MPLAB in order to build new firmwares for the Bus Pirate v3 and v4.
Compression option "1" assure right timing that option "s" may not ensure.
For me it works great.
Thanks a lot to agatti for having fixed the matter by changing things into spi.c!
http://https://github.com/BusPirate/Bus_Pirate/issues/122
Now AVRDUDE works again with both buspirate_bb and buspirate syntaxes.
Many thanks also to andersm for correcting spi.c for bytes_to_write tested twice by mistake.
http://https://github.com/BusPirate/Bus_Pirate/pull/127

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

The second one (09032019_OPT1_UNSAFE.hex) is the same as 09032019_OPT1_SAFE.hex but also it has the HARDWARE mode unlocked for the I2C protocol.
Indeed in the past agatti taught how to free the HARDWARE mode inside I2C protocol (http://https://github.com/BusPirate/Bus_Pirate/issues/39).
Please read the above link carefully!
As agatti wrote:
"Dangerous Prototypes' original firmware did not use hardware I2C due to hardware bugs in PIC24FJ64GA004 chips with revision A3 or A4.
Now that hardware I2C is enabled again and the appropriate workarounds detailed here (http://http://ww1.microchip.com/downloads/en/DeviceDoc/80000470j.pdf) have been applied, we need to test those on real hardware.

The catch: the code is experimental and it may or may not mess up with your hardware, just in case."
U_1-05112018.hex, the so called UNSAFE version (U=UNSAFE) is built on the configuration.h changed as follow.
Into configuration.h I changed lines from 316 to 331 in order to enable all the features available, BASIC too.

#ifdef BUSPIRATEV3
#define BP_ENABLE_1WIRE_SUPPORT
#define BP_ENABLE_BASIC_SUPPORT
#define BP_ENABLE_DIO_SUPPORT
#define BP_ENABLE_HD44780_SUPPORT
#define BP_ENABLE_I2C_SUPPORT
#define BP_ENABLE_JTAG_SUPPORT
#define BP_ENABLE_PIC_SUPPORT
#define BP_ENABLE_PC_AT_KEYBOARD_SUPPORT
#define BP_ENABLE_RAW_2WIRE_SUPPORT
#define BP_ENABLE_RAW_3WIRE_SUPPORT

#undef BP_ENABLE_SMPS_SUPPORT[/b]
#define BP_ENABLE_SPI_SUPPORT
#define BP_ENABLE_SUMP_SUPPORT
#define BP_ENABLE_UART_SUPPORT
#endif /* BUSPIRATEV3 */


Please, pay attention that since the SMPS_SUPPORT for the Bus Pirate v3 has been removed, I left the line number 327 unchanged as #undef.[/b]

SMPS_SUPPORT is intended for the management of the SMPS_BOARD which is an abandoned or stalled board.
Exactly it is this:

http://http://dangerousprototypes.com/blog/2009/12/04/bus-pirate-boost-converter-with-only-6-parts/
http://http://dangerousprototypes.com/docs/Bus_Pirate_SMPS

Then I changed the line 425 too in this way in order to make room for BASIC scripting:

#define BP_BASIC_PROGRAM_SPACE 512

And then I had to set line 571 for up 256 characters into the command line by changing it in this way:

/**
* How big the serial command buffer can be, in bytes.
*
* @warning This must be set to a power of two, ie. 256, 128, 64, 32, etc.
*/
#ifdef BUSPIRATEV3
#define BP_COMMAND_BUFFER_SIZE 256
#else
#define BP_COMMAND_BUFFER_SIZE 256
#endif /* BUSPIRATEV3 */

 
Then I had to put a remark sign ("//") inside line 382 and 391 in order to unlock the HARDWARE mode for the I2C protocol:

382 // #ifdef BUSPIRATEV4

391 // #endif /* BUSPIRATEV4 */

Delay code provided by Christopher Sam Soon to the main branch is currently enabled by default, but can be switched off by undefining BP_USE_HARDWARE_DELAY_TIMER in line 586 of configuration.h.

And finally in order to match the real speeds now used for I2C SOFTWARE, 2-WIRE and 3-WIRE in messages_v3.s line 1457 I changed ~400kHz to ~220kHz and more in general I changed all the terms KHz, which is wrong as a unit of measure, in kHz which is the right word.
 
The result that I have achieved I have called it 09032019_OPT1_UNSAFE.hex.
09032019_OPT1_UNSAFE.hex was obtained by using the compression option "1" of MPLAB so to be in fully accordance with the latest recommendations issued about the compilation of the new repositories using MPLAB in order to build new firmwares for the Bus Pirate v3 and v4.
Compression option "1" assure right timing that option "s" may not ensure.

For me it works great, but you use it at your own risk, I do not take any responsibility about the possibility of damaging your Bus Pirate or whatever!
Thanks a lot to agatti for having fixed the matter by changing things into spi.c!
http://https://github.com/BusPirate/Bus_Pirate/issues/122
Now AVRDUDE works again with both buspirate_bb and buspirate syntaxes.
Many thanks also to andersm for correcting spi.c for bytes_to_write tested twice by mistake.
http://https://github.com/BusPirate/Bus_Pirate/pull/127

Attention please!
First to attempt to use 09032019_OPT1_UNSAFE.hex (UNSAFE version of the firmware) you have to evaluate what is the silicon revision of the PIC used in your device, paying much attention to the fact that you might damage your device or whatever!
By doing it you must to assume all the responsibility for your action.
You use it at your own risk, I do not take any responsibility about the possibility of damaging your Bus Pirate or whatever!



Please note that both 09032019_OPT1_SAFE.hex and 09032019_OPT1_UNSAFE.hex were compiled with MPLAB-X IDE v5.00 and the XC-16 v1.35 compiler on Ubuntu 18.04 computer because the latest repositories are not natively compatible with MPLAB-X IDE v4.xx and earlier and both of them require the new bootloader v4.5 in order to work completely (http://http://dangerousprototypes.com/forum/viewtopic.php?f=28&t=8498&start=75#p67056 and http://http://dangerousprototypes.com/forum/viewtopic.php?f=28&t=8498&p=67056#p67127).
Otherwise if do not, enter BOOTLOADER using command "$" will not work (https://github.com/BusPirate/Bus_Pirate/issues/58 (https://github.com/BusPirate/Bus_Pirate/issues/58)).
Actually it is not really a problem on the firmware side but rather of the bootloader.
In order to fix the matter it is need to upgrade the bootloader to the new revision v4.5:

http://http://dangerousprototypes.com/forum/viewtopic.php?f=28&t=619#p67037

http://http://dangerousprototypes.com/forum/viewtopic.php?f=28&t=8498&start=60#p67043

http://https://github.com/BusPirate/Bus_Pirate/issues/38

http://https://github.com/BusPirate/Bus_Pirate/issues/58

http://http://dangerousprototypes.com/forum/viewtopic.php?f=28&t=8498&p=67056#p67056


With the firmwares I also provide a pre configured environment that anyone can use with minimal changes to simplify the upgrade of the only firmware or together the bootloader and the firmware in a single step.
The archive also provides further improved instructions on how to use the whole thing under any operative system (Window, Linux and Apple), simply follow them :

"How to use UPGRADE_TO_BL_v4.5.bat.rtf" (specific instructions for Windows users)
"How to update with pirate-loader.rtf" (generic cross-platform instructions for Windows, Linux and Apple users)

Please note that the package is a 7z (7zip) archive because the maximum allowed size in the forum is 1 MiB.

May 14, 2019
Attention, please:

viewtopic.php?f=28&t=10263 (http://dangerousprototypes.com/forum/viewtopic.php?f=28&t=10263)

https://github.com/BusPirate/Bus_Pirate/issues/130 (https://github.com/BusPirate/Bus_Pirate/issues/130)

Please, read them carefully!


Be seeing you.

U.Sb
Title: Re: Bus Pirate - Community Firmware 7.0
Post by: USBEprom on March 09, 2019, 01:16:49 pm
Hi guys.
Thanks to coelner, tofurky, Rondom and andersm, agatti fixed the issue with AVRDUDE when using buspirate syntaxes (http://https://github.com/BusPirate/Bus_Pirate/issues/122) and he has released a new repository of the firmware v7.1 for the Bus Pirate (http://https://github.com/BusPirate/Bus_Pirate) so that I was able to build new firmwares v7.1 for the Bus Pirate revision 3 (http://https://github.com/BusPirate/Bus_Pirate/archive/master.zip).
andersm also corrected spi.c for bytes_to_write tested twice by mistake (http://https://github.com/BusPirate/Bus_Pirate/pull/127).
I made two versions that i named 09032019_OPT1_SAFE.hex and 09032019_OPT1_UNSAFE.hex.
Both of them have all the features enabled, BASIC too, the command line allows up 256 characters.
The first one (09032019_OPT1_SAFE.hex), the so called SAFE version (S=SAFE), is built on the configuration.h changed as follow.
Into configuration.h I changed lines from 316 to 331 in order to enable all the features available, BASIC too.

#ifdef BUSPIRATEV3
#define BP_ENABLE_1WIRE_SUPPORT
#define BP_ENABLE_BASIC_SUPPORT
#define BP_ENABLE_DIO_SUPPORT
#define BP_ENABLE_HD44780_SUPPORT
#define BP_ENABLE_I2C_SUPPORT
#define BP_ENABLE_JTAG_SUPPORT
#define BP_ENABLE_PIC_SUPPORT
#define BP_ENABLE_PC_AT_KEYBOARD_SUPPORT
#define BP_ENABLE_RAW_2WIRE_SUPPORT
#define BP_ENABLE_RAW_3WIRE_SUPPORT

#undef BP_ENABLE_SMPS_SUPPORT[/b]
#define BP_ENABLE_SPI_SUPPORT
#define BP_ENABLE_SUMP_SUPPORT
#define BP_ENABLE_UART_SUPPORT
#endif /* BUSPIRATEV3 */


Please, pay attention that since the SMPS_SUPPORT for the Bus Pirate v3 has been removed, I left the line number 327 unchanged as #undef.[/b]

SMPS_SUPPORT is intended for the management of the SMPS_BOARD which is an abandoned or stalled board.
Exactly it is this:

http://http://dangerousprototypes.com/blog/2009/12/04/bus-pirate-boost-converter-with-only-6-parts/
http://http://dangerousprototypes.com/docs/Bus_Pirate_SMPS

Then I changed the line 425 too in this way in order to make room for BASIC scripting:

#define BP_BASIC_PROGRAM_SPACE 512

Finally I had to set line 571 for up 256 characters into the command line by changing it in this way:

/**
* How big the serial command buffer can be, in bytes.
*
* @warning This must be set to a power of two, ie. 256, 128, 64, 32, etc.
*/
#ifdef BUSPIRATEV3
#define BP_COMMAND_BUFFER_SIZE 256
#else
#define BP_COMMAND_BUFFER_SIZE 256
#endif /* BUSPIRATEV3 */


Delay code provided by Christopher Sam Soon to the main branch is currently enabled by default, but can be switched off by undefining BP_USE_HARDWARE_DELAY_TIMER in line 586 of configuration.h.

In order to match the real speeds now used for I2C SOFTWARE, 2-WIRE and 3-WIRE in messages_v3.s line 1457 I changed ~400kHz to ~240kHz and more in general I changed all the terms KHz, which is wrong as a unit of measure, in kHz which is the right word.
 
The result that I have achieved I have called it 09032019_OPT1_SAFE.hex.
09032019_OPT1_SAFE.hex was obtained by using the compression option "1" of MPLAB so to be in fully accordance with the latest recommendations issued about the compilation of the new repositories using MPLAB in order to build new firmwares for the Bus Pirate v3 and v4.
Compression option "1" assure right timing that option "s" may not ensure.
For me it works great.
Thanks a lot to agatti for having fixed the matter by changing things into spi.c!
http://https://github.com/BusPirate/Bus_Pirate/issues/122
Now AVRDUDE works again with both buspirate_bb and buspirate syntaxes.
Many thanks also to andersm for correcting spi.c for bytes_to_write tested twice by mistake.
http://https://github.com/BusPirate/Bus_Pirate/pull/127

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

The second one (09032019_OPT1_UNSAFE.hex) is the same as 09032019_OPT1_SAFE.hex but also it has the HARDWARE mode unlocked for the I2C protocol.
Indeed in the past agatti taught how to free the HARDWARE mode inside I2C protocol (http://https://github.com/BusPirate/Bus_Pirate/issues/39).
Please read the above link carefully!
As agatti wrote:
"Dangerous Prototypes' original firmware did not use hardware I2C due to hardware bugs in PIC24FJ64GA004 chips with revision A3 or A4.
Now that hardware I2C is enabled again and the appropriate workarounds detailed here (http://http://ww1.microchip.com/downloads/en/DeviceDoc/80000470j.pdf) have been applied, we need to test those on real hardware.

The catch: the code is experimental and it may or may not mess up with your hardware, just in case."
U_1-05112018.hex, the so called UNSAFE version (U=UNSAFE) is built on the configuration.h changed as follow.
Into configuration.h I changed lines from 316 to 331 in order to enable all the features available, BASIC too.

#ifdef BUSPIRATEV3
#define BP_ENABLE_1WIRE_SUPPORT
#define BP_ENABLE_BASIC_SUPPORT
#define BP_ENABLE_DIO_SUPPORT
#define BP_ENABLE_HD44780_SUPPORT
#define BP_ENABLE_I2C_SUPPORT
#define BP_ENABLE_JTAG_SUPPORT
#define BP_ENABLE_PIC_SUPPORT
#define BP_ENABLE_PC_AT_KEYBOARD_SUPPORT
#define BP_ENABLE_RAW_2WIRE_SUPPORT
#define BP_ENABLE_RAW_3WIRE_SUPPORT

#undef BP_ENABLE_SMPS_SUPPORT[/b]
#define BP_ENABLE_SPI_SUPPORT
#define BP_ENABLE_SUMP_SUPPORT
#define BP_ENABLE_UART_SUPPORT
#endif /* BUSPIRATEV3 */


Please, pay attention that since the SMPS_SUPPORT for the Bus Pirate v3 has been removed, I left the line number 327 unchanged as #undef.[/b]

SMPS_SUPPORT is intended for the management of the SMPS_BOARD which is an abandoned or stalled board.
Exactly it is this:

http://http://dangerousprototypes.com/blog/2009/12/04/bus-pirate-boost-converter-with-only-6-parts/
http://http://dangerousprototypes.com/docs/Bus_Pirate_SMPS

Then I changed the line 425 too in this way in order to make room for BASIC scripting:

#define BP_BASIC_PROGRAM_SPACE 512

And then I had to set line 571 for up 256 characters into the command line by changing it in this way:

/**
* How big the serial command buffer can be, in bytes.
*
* @warning This must be set to a power of two, ie. 256, 128, 64, 32, etc.
*/
#ifdef BUSPIRATEV3
#define BP_COMMAND_BUFFER_SIZE 256
#else
#define BP_COMMAND_BUFFER_SIZE 256
#endif /* BUSPIRATEV3 */

 
Then I had to put a remark sign ("//") inside line 382 and 391 in order to unlock the HARDWARE mode for the I2C protocol:

382 // #ifdef BUSPIRATEV4

391 // #endif /* BUSPIRATEV4 */

Delay code provided by Christopher Sam Soon to the main branch is currently enabled by default, but can be switched off by undefining BP_USE_HARDWARE_DELAY_TIMER in line 586 of configuration.h.

And finally in order to match the real speeds now used for I2C SOFTWARE, 2-WIRE and 3-WIRE in messages_v3.s line 1457 I changed ~400kHz to ~220kHz and more in general I changed all the terms KHz, which is wrong as a unit of measure, in kHz which is the right word.
 
The result that I have achieved I have called it 09032019_OPT1_UNSAFE.hex.
09032019_OPT1_UNSAFE.hex was obtained by using the compression option "1" of MPLAB so to be in fully accordance with the latest recommendations issued about the compilation of the new repositories using MPLAB in order to build new firmwares for the Bus Pirate v3 and v4.
Compression option "1" assure right timing that option "s" may not ensure.

For me it works great, but you use it at your own risk, I do not take any responsibility about the possibility of damaging your Bus Pirate or whatever!
Thanks a lot to agatti for having fixed the matter by changing things into spi.c!
http://https://github.com/BusPirate/Bus_Pirate/issues/122
Now AVRDUDE works again with both buspirate_bb and buspirate syntaxes.
Many thanks also to andersm for correcting spi.c for bytes_to_write tested twice by mistake.
http://https://github.com/BusPirate/Bus_Pirate/pull/127

Attention please!
First to attempt to use 09032019_OPT1_UNSAFE.hex (UNSAFE version of the firmware) you have to evaluate what is the silicon revision of the PIC used in your device, paying much attention to the fact that you might damage your device or whatever!
By doing it you must to assume all the responsibility for your action.
You use it at your own risk, I do not take any responsibility about the possibility of damaging your Bus Pirate or whatever!



Please note that both 09032019_OPT1_SAFE.hex and 09032019_OPT1_UNSAFE.hex were compiled with MPLAB-X IDE v5.00 and the XC-16 v1.35 compiler on Ubuntu 18.04 computer because the latest repositories are not natively compatible with MPLAB-X IDE v4.xx and earlier and both of them require the new bootloader v4.5 in order to work completely (http://http://dangerousprototypes.com/forum/viewtopic.php?f=28&t=8498&start=75#p67056 and http://http://dangerousprototypes.com/forum/viewtopic.php?f=28&t=8498&p=67056#p67127).
Otherwise if do not, enter BOOTLOADER using command "$" will not work (https://github.com/BusPirate/Bus_Pirate/issues/58 (https://github.com/BusPirate/Bus_Pirate/issues/58)).
Actually it is not really a problem on the firmware side but rather of the bootloader.
In order to fix the matter it is need to upgrade the bootloader to the new revision v4.5:

http://http://dangerousprototypes.com/forum/viewtopic.php?f=28&t=619#p67037

http://http://dangerousprototypes.com/forum/viewtopic.php?f=28&t=8498&start=60#p67043

http://https://github.com/BusPirate/Bus_Pirate/issues/38

http://https://github.com/BusPirate/Bus_Pirate/issues/58

http://http://dangerousprototypes.com/forum/viewtopic.php?f=28&t=8498&p=67056#p67056


With the firmwares I also provide a pre configured environment that anyone can use with minimal changes to simplify the upgrade of the only firmware or together the bootloader and the firmware in a single step.
The archive also provides further improved instructions on how to use the whole thing under any operative system (Window, Linux and Apple), simply follow them :

"How to use UPGRADE_TO_BL_v4.5.bat.rtf" (specific instructions for Windows users)
"How to update with pirate-loader.rtf" (generic cross-platform instructions for Windows, Linux and Apple users)

Please note that the package is a 7z (7zip) archive because the maximum allowed size in the forum is 1 MiB.

May 14, 2019
Attention, please:

viewtopic.php?f=28&t=10263 (http://dangerousprototypes.com/forum/viewtopic.php?f=28&t=10263)

https://github.com/BusPirate/Bus_Pirate/issues/130 (https://github.com/BusPirate/Bus_Pirate/issues/130)

Please, read them carefully!


July 14, 2019
Please read this too:

https://github.com/BusPirate/Bus_Pirate ... -511230486 (https://github.com/BusPirate/Bus_Pirate/issues/124#issuecomment-511230486)



Be seeing you.

U.Sb
Title: Re: Bus Pirate - Community Firmware 7.0
Post by: harzoli on July 25, 2019, 11:16:54 am
Hi

I'd like to ask somebody for advice.
(I know there is a 'BP v4 vs 43' topic too, but I think the reliability of the Firmware will decide the answer - sorry.)

I need a RELIABLE and usable communication (UART, I2C, SPI) tester tool for PIC based industrial hw and sw development and teting.
And I don't want to lost a lot of time to updateing the fw repeatedly.

So, which is the better choice for me in the BP HW, the V4 or the V3.6? (Why?)

Thanks
Zoli
Title: Re: Bus Pirate - Community Firmware 7.0
Post by: USBEprom on September 07, 2019, 10:58:02 pm
Hi guys.
Today while I was doing some tests with some SPI memories I have sadly noticed that FLASHROM no longer works properly.
The latest working firmwares are version S_1-28102018.hex and U_1-28102018.hex which are located here:

http://dangerousprototypes.com/forum/index.php?topic=8498.msg67796#msg67796

All the firmwares released later do not work properly with FLASHROM probably due to some incompatibility introduced with the patch used to correct timing in the protocols 2-WIRE, 3-WIRE and 1-WIRE, as the culprit seems to be due to the management of delays:

https://github.com/BusPirate/Bus_Pirate/issues/23#issuecomment-435584095

Indeed, using the commands "&"  and "%" of the Bus Pirate directly from the terminal no delay is introduced as if they were ignored.
For its part FLASHROM in my case is able to read the chips but not to delete/write them.

Be seeing you.

U.Sb
Title: Re: Bus Pirate - Community Firmware 7.0
Post by: Gandalf on September 08, 2019, 03:35:01 pm
Hi guys,

I've got a Bus Pirate V4.0 that reports the following:

Bus Pirate v4
Firmware v6.1 r1676
DEVID:0x1019 REVID:0x0004 (24FJ256GB106 UNK)

I have access to the various .hex files and an ICD3 (I sometimes work in the MPLABX IDE).

I'm keen to have the latest firmware on my BP 4.0 but I don't care about BASIC, I really just need all the other FUNctionality.

Can I just use MPLABX IPE to program the .hex file or is it preferred to drag and drop the hex onto DragDropUpdate.bat?

What's the latest, stable, safe firmware given my requirements?

Thanks in advance :D
Title: Re: Bus Pirate - Community Firmware 7.0
Post by: Gandalf on September 08, 2019, 05:06:30 pm
I tried to update because the LCD functionality wasn't working for me and found A) that the '$' into bootmode didn't work so I added the jumper over the 2 pins and was then able to drag and drop but this was the message I got...

C:\_BusPirate\TempUD>rem Drag and drop Bus Pirate firmware to this batch file

C:\_BusPirate\TempUD>pause
Press any key to continue . . .

C:\_BusPirate\TempUD>pirate-loader.exe --dev=COM6 --hex=C:\_BusPirate\TempUD\UNSAFE_16072017_1.hex
+++++++++++++++++++++++++++++++++++++++++++
  Pirate-Loader for BP with Bootloader v4+
  Loader version: 1.0.2  OS: WINDOWS
+++++++++++++++++++++++++++++++++++++++++++

Parsing HEX file [C:\_BusPirate\TempUD\UNSAFE_16072017_1.hex]
Found 19729 words (59187 bytes)
Fixing bootloader/userprogram jumps
Opening serial device COM6...OK
Configuring serial port settings...OK
Sending Hello to the Bootloader...OK

Device ID: UNKNOWN [f1]
Bootloader version: 4,06
Unsupported device (f1:UNKNOWN), only 0xD4 PIC24FJ64GA002 is supported

C:\_BusPirate\TempUD>pause
Press any key to continue . . .

[EDIT] I managed to apply this upgrade to my BP 3.8 but that's at Bootloader 4.4. Is this an issue and how do I upgrade if necessary. Also I obviously need to do something different for BP 4.0
Title: Re: Bus Pirate - Community Firmware 7.0
Post by: USBEprom on September 08, 2019, 09:52:30 pm
Hi Gandalf.
I do not have a Bus Pirate v4, so sorry I can not say anything about that, I have a Bus Pirate v3 though.
About the Bus Pirate v3 the update of the bootloader is not really mandatory for the update to the latest firmware, more than anything else it corrects the problem you described about the impossibility of accessing the bootloader mode from the terminal using the "$" command, in order to succeded it is instead need put a jumper between PGD and PGC.
You can compile the firmware yourself according to your needs (https://github.com/BusPirate/Bus_Pirate), just as there are some already ready to use as well and in case you wanted to use just one of those I suggest you this:

http://dangerousprototypes.com/forum/index.php?topic=8498.msg67796#msg67796

The message explains what the firmware does and how it was built.
Please, read it carefully.
The archive also includes both the firmware and the bootloader and there are also instructions that explain exactly how to update one and the other.
For the firmware, if it is more convenient for you, you can surely use DragDropUpdate.bat (http://dangerousprototypes.com/forum/index.php?topic=8498.msg67068#msg67068), no problem.

Be seeing you.

U.Sb
Title: Re: Bus Pirate - Community Firmware 7.0
Post by: Coldblackice on September 28, 2019, 11:01:03 pm
I made two versions that i named 09032019_OPT1_SAFE.hex and 09032019_OPT1_UNSAFE.hex.
Both of them have all the features enabled, BASIC too, the command line allows up 256 characters.
...
Be seeing you.

U.Sb

Hi guys.
Today while I was doing some tests with some SPI memories I have sadly noticed that FLASHROM no longer works properly.
The latest working firmwares are version S_1-28102018.hex and U_1-28102018.hex which are located here:

http://dangerousprototypes.com/forum/index.php?topic=8498.msg67796#msg67796

All the firmwares released later do not work properly with FLASHROM probably due to some incompatibility introduced with the patch used to correct timing in the protocols 2-WIRE, 3-WIRE and 1-WIRE, as the culprit seems to be due to the management of delays:

https://github.com/BusPirate/Bus_Pirate/issues/23#issuecomment-435584095

Indeed, using the commands "&"  and "%" of the Bus Pirate directly from the terminal no delay is introduced as if they were ignored.
For its part FLASHROM in my case is able to read the chips but not to delete/write them.

Be seeing you.

U.Sb

U.Sb, you're doing the lord's work: thanks for all your effort + explaining/information. It's really appreciated.

On that note, I'm trying to get a handle on what's the latest development as far as these recent two posts of yours. In the first, are those SAFE + UNSAFE versions still valid? Are they the best to choose from in your opinion?

As for the issues with flashrom, prior versions of flashrom will still work with these latest firmwares, however, I'm assuming?
Title: Re: Bus Pirate - Community Firmware 7.0
Post by: USBEprom on September 29, 2019, 01:18:02 pm
Hi Coldblackice.
Sadly 09032019_OPT1_SAFE.hex and 09032019_OPT1_UNSAFE.hex. in the first link you wrote both have the problem I reported here:

http://dangerousprototypes.com/forum/index.php?topic=8498.msg70075#msg70075

For what i know the latest working firmwares are version S_1-28102018.hex and U_1-28102018.hex which are located here:

http://dangerousprototypes.com/forum/index.php?topic=8498.msg67796#msg67796

Both lack some optimizations and support for avrdude is somewhat reduced (http://dangerousprototypes.com/forum/index.php?topic=9017.0) though they work.
About avrdude perhaps it is possible to fix the matter by inserting the fix agatti provide into the repository that generated it and rebuild from there, but I am not sure if it relies on other changes introduced over the time or not.
Anyway, here it is the new S_1-29092019.hex and U_1-29092019.hex which are exactly the same S_1-28102018.hex and U_1-28102018.hex as before but rebuilt with the aagatti fix in spi.c.
Now I do not have time to check it, I will do it later.
I hope it works.
About the SAFE and UNSAFE version, please also read this:

http://dangerousprototypes.com/forum/index.php?topic=8760.msg70072#msg70072

Be seeing you.

U.Sb
Title: Re: Bus Pirate - Community Firmware 7.0
Post by: USBEprom on September 29, 2019, 06:12:47 pm
Hi guys.
S_1-29092019.hex and U_1-29092019.hex are exactly the same S_1-28102018.hex and U_1-28102018.hex as before but rebuilt with the agatti fix in spi.c.
They were obtained by using the compression option "1" of MPLAB so to be in full agreement with the latest recommendations issued about the compilation of the repositories using MPLAB in order to build new firmwares for the Bus Pirate v3 and v4.
Compression option "1" assure right timing that option "s" may not ensure.
The only differences with the previous firmware S_1-28102018.hex and U_1-28102018.hex is that the original spi.c was patched with the agatti fix (the updated version of spi.c is in the compressed archive attached):

https://github.com/BusPirate/Bus_Pirate/issues/122#issuecomment-470428292

From the checks I made Bus Pirate works, flashrom works, avrdude works, all is working, but you use them at your own risk, I do not take any responsibility about the possibility of damaging your Bus Pirate or whatever, expecially talking about of the unsafe version!
About the SAFE and UNSAFE version, please also read this:


http://dangerousprototypes.com/forum/index.php?topic=8760.msg70072#msg70072

Attention please!
First to attempt to use U_1-29092019.hex (UNSAFE version of the firmware) you have to evaluate what is the silicon revision of the PIC used in your device, paying much attention to the fact that you might damage your device or whatever!
By doing it you must to assume all the responsibility for your action, even if actually should be no side effect in activating the Hardware I2C mode without honoring the silicon hardware revision of the PIC, because simply then it would not work.
There was a warning message in case the silicon hardware revision of the PIC had not been the expected one, but I do not know if this warning is still present and active in the nowaday new firmwares and I do not have a Bus Pirate wich has one of the buggy silicon revisions of the PIC in order to check it.
You use it at your own risk, I do not take any responsibility about the possibility of damaging your Bus Pirate or whatever!


Thanks a lot to agatti for having fixed the repository and freed the HARDWARE mode inside of I2C protocol!

Please note that both S_1-29092019.hex and U_1-29092019.hex were compiled with MPLAB-X IDE v5.00 and the XC-16 v1.35 compiler on Ubuntu 18.04 computer because the latest repositories are not natively compatible with MPLAB-X IDE v4.xx and earlier and both of them require the new bootloader v4.5 in order to work completely (http://dangerousprototypes.com/forum/index.php?topic=8498.0#p67056 and http://dangerousprototypes.com/forum/index.php?topic=8498.0#p67127).
Otherwise if do not, enter BOOTLOADER using command "$" will not work (https://github.com/BusPirate/Bus_Pirate/issues/58).
Actually it is not really a problem on the firmware side but rather of the bootloader.
In order to fix the matter it is need to upgrade the bootloader to the new revision v4.5:


http://dangerousprototypes.com/forum/index.php?topic=619.0#p67037

https://github.com/BusPirate/Bus_Pirate/issues/38

https://github.com/BusPirate/Bus_Pirate/issues/58

With the firmwares was also provided a pre configured environment that anyone can use with minimal changes to simplify the upgrade of the only firmware or together the bootloader and the firmware in a single step.
The archive also provides further improved instructions on how to use the whole thing under any operative system (Window, Linux and Apple), simply follow them:

"How to use UPGRADE_TO_BL_v4.5.bat.rtf" (specific instructions for Windows users)
"How to update with pirate-loader.rtf" (generic cross-platform instructions for Windows, Linux and Apple users)

Please note that the package is a 7z (7zip) archive because the maximum allowed size in the forum is 1 MiB.


Be seeing you.

U.Sb



Title: Re: Bus Pirate - Community Firmware 7.0
Post by: Coldblackice on October 11, 2019, 11:50:28 am
Hi guys.
S_1-29092019.hex and U_1-29092019.hex are exactly the same S_1-28102018.hex and U_1-28102018.hex as before but rebuilt with the agatti fix in spi.c.
They were obtained by using the compression option "1" of MPLAB so to be in full agreement with the latest recommendations issued about the compilation of the repositories using MPLAB in order to build new firmwares for the Bus Pirate v3 and v4.
Compression option "1" assure right timing that option "s" may not ensure.
The only differences with the previous firmware S_1-28102018.hex and U_1-28102018.hex is that the original spi.c was patched with the agatti fix (the updated version of spi.c is in the compressed archive attached):

https://github.com/BusPirate/Bus_Pirate/issues/122#issuecomment-470428292

From the checks I made Bus Pirate works, flashrom works, avrdude works, all is working, but you use them at your own risk, I do not take any responsibility about the possibility of damaging your Bus Pirate or whatever, expecially talking about of the unsafe version!
About the SAFE and UNSAFE version, please also read this:


http://dangerousprototypes.com/forum/index.php?topic=8760.msg70072#msg70072

Attention please!
First to attempt to use U_1-29092019.hex (UNSAFE version of the firmware) you have to evaluate what is the silicon revision of the PIC used in your device, paying much attention to the fact that you might damage your device or whatever!
By doing it you must to assume all the responsibility for your action, even if actually should be no side effect in activating the Hardware I2C mode without honoring the silicon hardware revision of the PIC, because simply then it would not work.
There was a warning message in case the silicon hardware revision of the PIC had not been the expected one, but I do not know if this warning is still present and active in the nowaday new firmwares and I do not have a Bus Pirate wich has one of the buggy silicon revisions of the PIC in order to check it.
You use it at your own risk, I do not take any responsibility about the possibility of damaging your Bus Pirate or whatever!


Thanks a lot to agatti for having fixed the repository and freed the HARDWARE mode inside of I2C protocol!

Please note that both S_1-29092019.hex and U_1-29092019.hex were compiled with MPLAB-X IDE v5.00 and the XC-16 v1.35 compiler on Ubuntu 18.04 computer because the latest repositories are not natively compatible with MPLAB-X IDE v4.xx and earlier and both of them require the new bootloader v4.5 in order to work completely (http://dangerousprototypes.com/forum/index.php?topic=8498.0#p67056 and http://dangerousprototypes.com/forum/index.php?topic=8498.0#p67127).
Otherwise if do not, enter BOOTLOADER using command "$" will not work (https://github.com/BusPirate/Bus_Pirate/issues/58).
Actually it is not really a problem on the firmware side but rather of the bootloader.
In order to fix the matter it is need to upgrade the bootloader to the new revision v4.5:


http://dangerousprototypes.com/forum/index.php?topic=619.0#p67037

https://github.com/BusPirate/Bus_Pirate/issues/38

https://github.com/BusPirate/Bus_Pirate/issues/58

With the firmwares was also provided a pre configured environment that anyone can use with minimal changes to simplify the upgrade of the only firmware or together the bootloader and the firmware in a single step.
The archive also provides further improved instructions on how to use the whole thing under any operative system (Window, Linux and Apple), simply follow them:

"How to use UPGRADE_TO_BL_v4.5.bat.rtf" (specific instructions for Windows users)
"How to update with pirate-loader.rtf" (generic cross-platform instructions for Windows, Linux and Apple users)

Please note that the package is a 7z (7zip) archive because the maximum allowed size in the forum is 1 MiB.


Be seeing you.

U.Sb





Thanks USB, you are truly the hero Gotham deserves :D All your effort is much appreciated.

What firmware version are you currently preferring/choosing to use, out of curiosity?