Bus Pirate - Community Firmware 7.0

Bus Pirate firmware and hardware development.

Re: Bus Pirate - Community Firmware 7.0

Postby USBEprom » Sun Oct 16, 2016 9:35 am

Hi joe.
Here you go.

Be seeing you.

U.Sb
Attachments
Firmware.zip
(180.42 KiB) Downloaded 170 times
USBEprom
Full Member
Full Member
 
Posts: 158
Joined: Wed Mar 14, 2012 4:09 pm

Re: Bus Pirate - Community Firmware 7.0

Postby joeblack » Sun Oct 16, 2016 10:11 am

Thanks mate, i´ll try it out
joe
joeblack
Newbie
Newbie
 
Posts: 8
Joined: Sat Oct 15, 2016 5:23 pm

Re: Bus Pirate - Community Firmware 7.0

Postby USBEprom » Sun Oct 16, 2016 10:48 am

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)
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
Attachments
Firmware 32chrs.zip
(126.64 KiB) Downloaded 135 times
USBEprom
Full Member
Full Member
 
Posts: 158
Joined: Wed Mar 14, 2012 4:09 pm

Re: Bus Pirate - Community Firmware 7.0

Postby USBEprom » Tue Oct 18, 2016 3:00 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).
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
Attachments
Firmware 1024chrs.zip
(180.51 KiB) Downloaded 123 times
USBEprom
Full Member
Full Member
 
Posts: 158
Joined: Wed Mar 14, 2012 4:09 pm

Re: Bus Pirate - Community Firmware 7.0

Postby mikeb » Wed Oct 19, 2016 5:45 pm

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 - Flashing a BIOS chip with Bus Pirate
2) http://dangerousprototypes.com/docs/Fla ... 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). 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
mikeb
Newbie
Newbie
 
Posts: 39
Joined: Fri Sep 09, 2016 2:50 am

Re: Bus Pirate - Community Firmware 7.0

Postby USBEprom » Thu Oct 20, 2016 2:08 pm

Hi mikeb.
mikeb wrote: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 - Flashing a BIOS chip with Bus Pirate
2) http://dangerousprototypes.com/docs/Fla ... Bus_Pirate - Flashing KB9012 with Bus Pirate
(any feedback comments about them are welcome)


That is an awesome work, daebak!
My feedback can only be jjang!

mikeb wrote:By your recent messages it seems that you have figured it out. Congratulations!


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.

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


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

Re: Bus Pirate - Community Firmware 7.0

Postby USBEprom » Fri Oct 28, 2016 5:22 pm

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) and some improvements made by agatti (https://github.com/BusPirate/Bus_Pirate ... 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
Attachments
SPI_SPEED_256chrs_no_BASIC.zip
(181.13 KiB) Downloaded 116 times
USBEprom
Full Member
Full Member
 
Posts: 158
Joined: Wed Mar 14, 2012 4:09 pm

Re: Bus Pirate - Community Firmware 7.0

Postby USBEprom » Fri Oct 28, 2016 5:32 pm

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) and some improvements made by agatti (https://github.com/BusPirate/Bus_Pirate ... 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
Attachments
SPI_SPEED_32chrs_FULL.zip
(126.94 KiB) Downloaded 107 times
USBEprom
Full Member
Full Member
 
Posts: 158
Joined: Wed Mar 14, 2012 4:09 pm

Re: Bus Pirate - Community Firmware 7.0

Postby joeblack » Sat Oct 29, 2016 2:58 am

@ agatti, USBEprom
Thank you both for developing further and sharing the files.
Joe
joeblack
Newbie
Newbie
 
Posts: 8
Joined: Sat Oct 15, 2016 5:23 pm

Re: Bus Pirate - Community Firmware 7.0

Postby USBEprom » Sat Oct 29, 2016 12:04 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

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

[b] //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)

Thanks.

Be seeing you.

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

Re: Bus Pirate - Community Firmware 7.0

Postby USBEprom » Sun Oct 30, 2016 3:02 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

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)

Thanks.

Be seeing you.

U.Sb
Attachments
macro(1).jpg
USBEprom
Full Member
Full Member
 
Posts: 158
Joined: Wed Mar 14, 2012 4:09 pm

Re: Bus Pirate - Community Firmware 7.0

Postby USBEprom » Sun Oct 30, 2016 4:29 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)

Thanks.

Be seeing you.

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

Re: Bus Pirate - Community Firmware 7.0

Postby USBEprom » Mon Oct 31, 2016 1:04 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)

Thanks.

Be seeing you.

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

Re: Bus Pirate - Community Firmware 7.0

Postby USBEprom » Mon Oct 31, 2016 2:13 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) and some improvements made by agatti (https://github.com/BusPirate/Bus_Pirate ... source.zip).
It has even macro(1) fixed in 2WIRE menu (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)

Thanks.

Be seeing you.

U.Sb
Attachments
32chrs_FULL_improved_SPI_SPEED_raw2wire_macro(1) FIXED.zip
(127.29 KiB) Downloaded 100 times
USBEprom
Full Member
Full Member
 
Posts: 158
Joined: Wed Mar 14, 2012 4:09 pm

Re: Bus Pirate - Community Firmware 7.0

Postby USBEprom » Mon Oct 31, 2016 2:25 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) and some improvements made by agatti (https://github.com/BusPirate/Bus_Pirate ... source.zip).
It has even macro(1) fixed in 2WIRE menu ((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)

Thanks.

Be seeing you.

U.Sb
Attachments
256chrs_ALL_but_no_BASIC_improved_SPI_SPEED_raw2wire_macro(1) FIXED.zip
(181.6 KiB) Downloaded 897 times
USBEprom
Full Member
Full Member
 
Posts: 158
Joined: Wed Mar 14, 2012 4:09 pm

PreviousNext

Return to Bus Pirate Development