46
Bus Pirate Support / Re: Scripting the Bus Pirate from Perl, Python, etc
I added two log files. With CLI the reading of status register is working(CLI.log): I first read 4 bytes( { 3 0 0 0 0 0 0 }), then Enable WriteLatch({ 6 }), read status register ({ 5 0 }), disable WriteLatch ({ 4 }) and reread Status register. It works! The second one is my script with bitbang mode. I added both Nibble and bulk functions to read status register to SPIread.pl. Then I run `SPIread.pl -b 4` to read first 4 bytes. There are some debug info. here is in brief:
Reading with the nibble method:
Quote
< send high nibble of Byte %Here is with Bulk read:
! RS232 write incomplete! 0x01!=0x02
< send low nibble of Byte and EEPROM read status
< RAWrsTxRx(0011)(0x25=0b00100101=37) rawRx:0xff [ ]
RDSR 1: ff
Quote
< SPIbulkTxRx(1)...
& decodeBPCmdH:0b0001 Bulk SPI transfer: 0+1 bulk bytes follow
< RAWrsTxRx(0111)(0x10=0b00010000=16) rawRx:0x01 [ ]
< RAWrsTxRx(0011)(0x05=0b00000101=5) rawRx:0xff [ ]
RDSR 2: ff
and at the end I red same 4 bytes as in CLI(bulk sending EEPROM READ cmd and the address then with nibble reading...):
Quote
& Read bytes:0x0004(4) addr:0000 eesize:0x2000(8192) file:dump_r.binThere are "! RS232 write incomplete! 0x01!=0x02" lines, but I am not sure are they wrong or not, because reading and writing to flash is working...
< EE cmd:0x03[0b0011] addr:0000 arr[0x03 00 00 ]
< SPIbulkTxRx(3)...
& decodeBPCmdH:0b0001 Bulk SPI transfer: 2+1 bulk bytes follow
< rsTxRx(0101)(0x12=0b00010010=18) [ACK 0x01]
< rsTxRx(0001)(0x03=0b00000011=3) [NAK 0xff]
< rsTxRx(0001)(0x00=0b00000000=0) [NAK 0xff]
< rsTxRx(0001)(0x00=0b00000000=0) [NAK 0xff]
# NIBBLE METHOD
& decodeBPCmdH:0b0011 High 4 bits:0x0_
< rsTxRx(0101)(0x30=0b00110000=48) [ACK 0x01]
< RAWrsTxRx(0011)(0x20=0b00100000=32) rawRx:0x1e [^]
< RAWrsTxRx(0011)(0x20=0b00100000=32) rawRx:0x9e [ ]
< RAWrsTxRx(0011)(0x20=0b00100000=32) rawRx:0x02 [ ]
< RAWrsTxRx(0011)(0x20=0b00100000=32) rawRx:0x0b [ ]
I do not have oscilloscope and can not check what is happening at the wires

BR,
Anton Todorov