Page 9 of 9

Re: Bus Pirate - Community Firmware 7.0

PostPosted: Sun Nov 04, 2018 10:16 am
by USBEprom
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).
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

Be seeing you.

U.Sb

Re: Bus Pirate - Community Firmware 7.0

PostPosted: Mon Nov 05, 2018 4:35 pm
by USBEprom
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
#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.

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


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

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


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

Re: Bus Pirate - Community Firmware 7.0

PostPosted: Sat Nov 10, 2018 8:32 am
by USBEprom
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

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)

Be seeing you.

U.Sb

Re: Bus Pirate - Community Firmware 7.0

PostPosted: Sun Nov 25, 2018 11:56 am
by chrismec
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.

Re: Bus Pirate - Community Firmware 7.0

PostPosted: Mon Nov 26, 2018 4:21 pm
by USBEprom
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) 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

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

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

Be seeing you.

U.Sb

Re: Bus Pirate - Community Firmware 7.0

PostPosted: Wed Nov 28, 2018 5:24 pm
by USBEprom
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 and https://github.com/BusPirate/Bus_Pirate ... 4c968ba4e1).
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) 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, 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)
Many, many thanks to Christopher Sam Soon for the patch!

Be seeing you.

U.Sb

Re: Bus Pirate - Community Firmware 7.0

PostPosted: Fri Mar 08, 2019 5:18 pm
by USBEprom
Hi guys.
Thanks to coelner, tofurky, Rondom and andersm, agatti fixed the issue with AVRDUDE when using buspirate syntaxes (https://github.com/BusPirate/Bus_Pirate/issues/122) and he has released 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).
andersm also corrected spi.c for bytes_to_write tested twice by mistake (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
#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.

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/2009/12/04/bus-pirate-boost-converter-with-only-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 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!
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.
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 (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/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
#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.

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/2009/12/04/bus-pirate-boost-converter-with-only-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 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!
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.
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://dangerousprototypes.com/forum/viewtopic.php?f=28&t=8498&start=75#p67056 and 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).
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/viewtopic.php?f=28&t=619#p67037

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

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

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

Please, read them carefully!


Be seeing you.

U.Sb

Re: Bus Pirate - Community Firmware 7.0

PostPosted: Sat Mar 09, 2019 7:16 am
by USBEprom
Hi guys.
Thanks to coelner, tofurky, Rondom and andersm, agatti fixed the issue with AVRDUDE when using buspirate syntaxes (https://github.com/BusPirate/Bus_Pirate/issues/122) and he has released 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).
andersm also corrected spi.c for bytes_to_write tested twice by mistake (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
#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.

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/2009/12/04/bus-pirate-boost-converter-with-only-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 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!
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.
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 (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/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
#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.

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/2009/12/04/bus-pirate-boost-converter-with-only-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 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!
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.
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://dangerousprototypes.com/forum/viewtopic.php?f=28&t=8498&start=75#p67056 and 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).
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/viewtopic.php?f=28&t=619#p67037

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

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

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



Be seeing you.

U.Sb

Re: Bus Pirate - Community Firmware 7.0

PostPosted: Thu Jul 25, 2019 4:16 am
by harzoli
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