Bus Pirate - Community Firmware 7.0

Bus Pirate firmware and hardware development.

Re: Bus Pirate - Community Firmware 7.0

Postby USBEprom » Sun Jul 01, 2018 10:25 am

Hi awokd.
Sorry for the very late reply.

awokd wrote:I was using Debian Stretch x64 so had to "apt install lib32z1" and chmod pirate-loader_lnx to executable before it worked


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
Attachments
How to update with pirate-loader.zip
New furthermore improved version of the document "How to update with pirate-loader.rtf" (generic cross-platform instructions for Windows, Linux and Apple users), many, many thanks to awokd!
(708.21 KiB) Downloaded 78 times
USBEprom
Full Member
Full Member
 
Posts: 172
Joined: Wed Mar 14, 2012 4:09 pm

Re: Bus Pirate - Community Firmware 7.0

Postby mikeb » Mon Jul 02, 2018 12:07 pm

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

After reviewing a pull request (https://github.com/BusPirate/Bus_Pirate/pull/93) I have just cloned this forked repository - 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 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 - 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
mikeb
Newbie
Newbie
 
Posts: 40
Joined: Fri Sep 09, 2016 2:50 am

Re: Bus Pirate - Community Firmware 7.0

Postby MrAureliusR » Wed Aug 08, 2018 11:27 am

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 all
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.
MrAureliusR
Newbie
Newbie
 
Posts: 4
Joined: Tue Jan 28, 2014 8:00 pm

Re: Bus Pirate - Community Firmware 7.0

Postby MrAureliusR » Wed Aug 08, 2018 11:43 am

Just noticed entering anything into the script engine seems to reboot the BP:

Code: Select all
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>
MrAureliusR
Newbie
Newbie
 
Posts: 4
Joined: Tue Jan 28, 2014 8:00 pm

Re: Bus Pirate - Community Firmware 7.0

Postby mikeb » Thu Aug 16, 2018 8:49 am

MrAureliusR wrote:Just noticed entering anything into the script engine seems to reboot the BP
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 - 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
mikeb
Newbie
Newbie
 
Posts: 40
Joined: Fri Sep 09, 2016 2:50 am

Re: Bus Pirate - Community Firmware 7.0

Postby marsfan » Tue Aug 28, 2018 10:44 pm

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.
marsfan
Newbie
Newbie
 
Posts: 7
Joined: Wed Apr 19, 2017 5:44 pm

Re: Bus Pirate - Community Firmware 7.0

Postby USBEprom » Sun Sep 02, 2018 10:04 am

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


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

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

Re: Bus Pirate - Community Firmware 7.0

Postby USBEprom » Sun Sep 02, 2018 10:20 am

marsfan wrote: 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.


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

Re: Bus Pirate - Community Firmware 7.0

Postby marsfan » Sun Sep 02, 2018 12:27 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.
marsfan
Newbie
Newbie
 
Posts: 7
Joined: Wed Apr 19, 2017 5:44 pm

Re: Bus Pirate - Community Firmware 7.0

Postby USBEprom » Sun Sep 02, 2018 2:26 pm

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


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.

marsfan wrote:is there a page that documents configuration.h


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), 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
Attachments
ERRORS.txt
(7.1 KiB) Downloaded 43 times
USBEprom
Full Member
Full Member
 
Posts: 172
Joined: Wed Mar 14, 2012 4:09 pm

Re: Bus Pirate - Community Firmware 7.0

Postby marsfan » Sun Sep 02, 2018 6:00 pm

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.
marsfan
Newbie
Newbie
 
Posts: 7
Joined: Wed Apr 19, 2017 5:44 pm

Re: Bus Pirate - Community Firmware 7.0

Postby mikeb » Sat Oct 27, 2018 3:40 pm

USBEprom wrote:I could not compile anything due to errors in MPLAB as in attachment.
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/ 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
mikeb
Newbie
Newbie
 
Posts: 40
Joined: Fri Sep 09, 2016 2:50 am

Re: Bus Pirate - Community Firmware 7.0

Postby USBEprom » Sun Oct 28, 2018 5:55 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
USBEprom
Full Member
Full Member
 
Posts: 172
Joined: Wed Mar 14, 2012 4:09 pm

Re: Bus Pirate - Community Firmware 7.0

Postby USBEprom » Sun Oct 28, 2018 5:46 pm

Hi guys.
Thanks to agatti who has just fixed the current October 28, 2018 repository(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).
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
#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 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).
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_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
#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 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 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-g.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)
(475.79 KiB) Downloaded 16 times
USBEprom
Full Member
Full Member
 
Posts: 172
Joined: Wed Mar 14, 2012 4:09 pm

Re: Bus Pirate - Community Firmware 7.0

Postby USBEprom » Mon Oct 29, 2018 5:40 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) 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) 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).


Be seeing you.

U.Sb
Attachments
I2C.jpg
Screenshots taken with a logic analyzer
USBEprom
Full Member
Full Member
 
Posts: 172
Joined: Wed Mar 14, 2012 4:09 pm

PreviousNext

Return to Bus Pirate Development