I’ve observed a few issues with a Rev10 that I got in the mail early last week running very recent firmware (ci-buspirate5-main-f0b33d2).
First up:
it is giving an unexpected response to the MX25L6406E RDID command (datasheet) when nothing is attached to the BP in SPI mode as well as an unexpected response when attached to the above chip.
BP IO ports free:
Bus Pirate 5 REV10
Firmware main branch (2024-03-24T15:52:54Z)
RP2040 with 264KB RAM, 128Mbit FLASH
S/N: 283221D3012961E4
https://BusPirate.com/
Storage: 0.10GB (FAT16 File System)
Configuration file: Loaded
Available modes: HiZ 1-WIRE UART HDPLXUART I2C SPI 2WIRE LED
Active mode: HiZ ()=()
Display format: Auto
HiZ> m
Mode selection
1. HiZ
2. 1-WIRE
3. UART
4. HDPLXUART
5. I2C
6. SPI
7. 2WIRE
8. LED
x. Exit
Mode > 6
Use previous settings?
SPI speed: 100 kHz
Data bits: 8
Clock polarity: Idle LOW
Clock phase: LEADING edge
Chip select: Active LOW (/CS)
y/n, x to exit (Y) >
Actual speed: 122kHz
Mode: SPI
SPI> [0x9f r:3]
CS Enabled
TX: 0x9F
RX: 0x68 0x88 0xA8
CS Disabled
BP IO ports attached to a MX25L6406E:
SPI> W
Power supply
Volts (0.80V-5.00V)
x to exit (3.30) >
Maximum current (0mA-500mA), <enter> for none
x to exit (none) >
3.30V requested, closest value: 3.30V
Current limit:Disabled
Power supply:Enabled
Vreg output: 3.3V, Vref/Vout pin: 3.3V, Current: 72.4mA
SPI> [0x9f r:3]
CS Enabled
TX: 0x9F
RX: 0x68 0x88 0xA8
CS Disabled
I would expect in the first scenario to not get an RX, and in the second scenario to get the ID in the RX, so 0xc2 0x20 0x17
not 0x68 0x88 0xA8
. As a sanity check that the chip is still good, I used flashrom to read the data to a file using a BP 3.5 and verified that the expected data was still there.
Second up:
I’ve also found that I can’t apply a current limit without it immediately tripping, hence why I have don’t have a limit set in the examples above.
Third up:
I can’t get flashrom to work with the Rev10, I’ve tried both ttyACM0 and ttyACM1. I tried with ttyACM1 first, but it hangs fairly quickly, never getting a response:
flashrom v1.2 on Linux 6.6.10-76060610-generic (x86_64)
flashrom is free software, get the source code at https://flashrom.org
flashrom was built with libpci 3.7.0, GCC 11.2.0, little endian
Command line (7 args): flashrom -r test.bin -VVV -p buspirate_spi:dev=/dev/ttyACM1,spispeed=1M -c MX25L6406E/MX25L6408E
Using clock_gettime for delay loops (clk_id: 1, resolution: 1ns).
Initializing buspirate_spi programmer
buspirate_sendrecv: write 1, read 0 Sending 0x00
buspirate_sendrecv: write 1, read 0 Sending 0x00
buspirate_sendrecv: write 1, read 0 Sending 0x00
buspirate_sendrecv: write 1, read 0 Sending 0x00
buspirate_sendrecv: write 1, read 0 Sending 0x00
buspirate_sendrecv: write 1, read 0 Sending 0x00
buspirate_sendrecv: write 1, read 0 Sending 0x00
buspirate_sendrecv: write 1, read 0 Sending 0x00
buspirate_sendrecv: write 1, read 0 Sending 0x00
buspirate_sendrecv: write 1, read 0 Sending 0x00
buspirate_sendrecv: write 1, read 0 Sending 0x00
buspirate_sendrecv: write 1, read 0 Sending 0x00
buspirate_sendrecv: write 1, read 0 Sending 0x00
buspirate_sendrecv: write 1, read 0 Sending 0x00
buspirate_sendrecv: write 1, read 0 Sending 0x00
buspirate_sendrecv: write 1, read 0 Sending 0x00
buspirate_sendrecv: write 1, read 0 Sending 0x00
buspirate_sendrecv: write 1, read 0 Sending 0x00
buspirate_sendrecv: write 1, read 0 Sending 0x00
buspirate_sendrecv: write 1, read 0 Sending 0x00
buspirate_sendrecv: write 0, read 4
Whereas ttyACM0 responds, but I suspect that it’s because it’s getting garbage from the serial connection. Admittedly, I haven’t looked at the flashrom repo to see if it just needs to be added, but thought I’d bring it up for good measure.
Fourth up:
The flash command seems to be broken at the moment:
HiZ> m
Mode selection
1. HiZ
2. 1-WIRE
3. UART
4. HDPLXUART
5. I2C
6. SPI
7. 2WIRE
8. LED
x. Exit
Mode > 6
Use previous settings?
SPI speed: 2000 kHz
Data bits: 8
Clock polarity: Idle LOW
Clock phase: LEADING edge
Chip select: Active LOW (/CS)
y/n, x to exit (Y) >
Actual speed: 1953kHz
Mode: SPI
SPI> help mode
Peer to peer 3 or 4 wire full duplex protocol. Very
high clockrates upto 20MHz are possible.
More info: https://en.wikipedia.org/wiki/Serial_Peripheral_Interface_Bus
BPCMD {,] | DATA (1..32bit) | },]
CMD START| D7 | D6 | D5 | D4 | D3 | D2 | D1 | D0 | STOP
MISO ---{#|##}{#|##}{#|##}{#|##}{#|##}{#|##}{#|##}{#|##}--|------
MOSI ---{#|##}{#|##}{#|##}{#|##}{#|##}{#|##}{#|##}{#|##}--|------
CLK _____|__""_|__""_|__""_|__""_|__""_|__""_|__""_|__""_|______
CS ""___|_____|_____|_____|_____|_____|_____|_____|_____|___"""
Current mode is spi_clock_phase=0 and spi_clock_polarity=0
Connection:
MOSI ------------------ MOSI
MISO ------------------ MISO
{BP} CLK ------------------ CLK {DUT}
CS ------------------ CS
GND ------------------ GND
Available mode commands:
flash Erase, write, read and verify SPI flash chips
SPI> flash read
flash command is currently only available in SPI mode
And lastly:
The IO pins listed in the docs (https://firmware.buspirate.com/overview/io-pins) don’t appear to match the IO pins on the device.
Device in SPI mode:
IO4 -> MISO
IO5 -> CS
IO6 -> CLK
IO7 -> MOSI
Docs:
IO4 -> SCLK
IO5 -> CDO
IO6 -> CDI
IO7 -> CS