Bus Pirate - Community Firmware 7.0

Bus Pirate firmware and hardware development.

Re: Bus Pirate - Community Firmware 7.0

Postby USBEprom » Tue Nov 14, 2017 3:11 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

Be seeing you.

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

Re: Bus Pirate - Community Firmware 7.0

Postby inac » Wed Jan 10, 2018 6:50 am

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?
inac
Newbie
Newbie
 
Posts: 2
Joined: Wed Jan 10, 2018 6:46 am

Re: Bus Pirate - Community Firmware 7.0

Postby USBEprom » Wed Jan 10, 2018 3:35 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
USBEprom
Full Member
Full Member
 
Posts: 151
Joined: Wed Mar 14, 2012 4:09 pm

Re: Bus Pirate - Community Firmware 7.0

Postby inac » Thu Jan 11, 2018 6:20 am

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). 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.
inac
Newbie
Newbie
 
Posts: 2
Joined: Wed Jan 10, 2018 6:46 am

Re: Bus Pirate - Community Firmware 7.0

Postby USBEprom » Sun Feb 18, 2018 11:47 am

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).
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
#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.

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/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).
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).
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) 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
#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.

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/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), 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 and 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).
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

viewtopic.php?f=28&t=8498&start=60#p67043

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

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

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
Attachments
BPv3-bootloaderv4xtov45-update-vb_ENG-f.7z
Pre configured environment to simplify the upgrade of the only firmware or together the bootloader and the firmware in a single step.
Inside are instructions on how to use the whole thing under any operative system (Window, Linux and Apple):
"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)
(471.98 KiB) Downloaded 123 times
USBEprom
Full Member
Full Member
 
Posts: 151
Joined: Wed Mar 14, 2012 4:09 pm

Re: Bus Pirate - Community Firmware 7.0

Postby awokd » Wed Mar 21, 2018 7:04 am

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


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.
awokd
Newbie
Newbie
 
Posts: 3
Joined: Sat Mar 10, 2018 12:23 pm

Re: Bus Pirate - Community Firmware 7.0

Postby DangerByte » Tue Jun 19, 2018 3:11 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!
DangerByte
Newbie
Newbie
 
Posts: 10
Joined: Fri Feb 27, 2015 2:05 pm

Re: Bus Pirate - Community Firmware 7.0

Postby mikeb » Mon Jun 25, 2018 3:56 pm

DangerByte wrote:Are there v7.1 binaries available for BP4?


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 - 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://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://dangerousprototypes.com/docs/Bus_Pirate_v4_and_Pickit2_(bootloader_and_firmware_updates)

And this another instruction - http://dangerousprototypes.com/docs/Com ... e_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
mikeb
Newbie
Newbie
 
Posts: 38
Joined: Fri Sep 09, 2016 2:50 am

Re: Bus Pirate - Community Firmware 7.0

Postby mikeb » Mon Jun 25, 2018 4:12 pm

awokd wrote: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
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
mikeb
Newbie
Newbie
 
Posts: 38
Joined: Fri Sep 09, 2016 2:50 am

Re: Bus Pirate - Community Firmware 7.0

Postby awokd » Mon Jun 25, 2018 4:43 pm

And you as well!

mikeb wrote:and these were your versions before your upgrade?


This, I upgraded to 7.1 from those old versions. :)
awokd
Newbie
Newbie
 
Posts: 3
Joined: Sat Mar 10, 2018 12:23 pm

Re: Bus Pirate - Community Firmware 7.0

Postby DangerByte » Tue Jun 26, 2018 2: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?
DangerByte
Newbie
Newbie
 
Posts: 10
Joined: Fri Feb 27, 2015 2:05 pm

Re: Bus Pirate - Community Firmware 7.0

Postby USBEprom » Tue Jun 26, 2018 3:30 pm

Hi mikeb.
Happy to read you again!

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

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


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)

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

Re: Bus Pirate - Community Firmware 7.0

Postby mikeb » Sat Jun 30, 2018 1:37 am

Hi there USBEprom, happy to see you there ;)
mikeb wrote:On github.com it has been written that the recommended compression option for MPLAB it is level 1
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)
mikeb
Newbie
Newbie
 
Posts: 38
Joined: Fri Sep 09, 2016 2:50 am

Re: Bus Pirate - Community Firmware 7.0

Postby mikeb » Sat Jun 30, 2018 1:51 am

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

Actually 7.1 is already out (e.g. this changelog - https://github.com/BusPirate/Bus_Pirate ... ANGELOG.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
mikeb
Newbie
Newbie
 
Posts: 38
Joined: Fri Sep 09, 2016 2:50 am

Re: Bus Pirate - Community Firmware 7.0

Postby USBEprom » Sun Jul 01, 2018 5:12 am

Hi mikeb.
mikeb wrote:I should have underlined that my opt0+opt0 recommendation is only for BPv4.


OK, it's much clearer now, thanks!

mikeb wrote:I thought its a good idea to bump my locally built version from 7.1 to 7.11 .


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/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.

mikeb wrote:I don't know how well would be 7.1 working together with a very outdated bootloader.


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/V4. ... .3_upgrade
viewtopic.php?f=28&t=8498&start=75#p67056
viewtopic.php?f=28&t=8498&p=67056#p67127
viewtopic.php?f=28&t=8498&start=90#p67351

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


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

PreviousNext

Return to Bus Pirate Development