Bus Pirate firmware auto build: main branch

@grymoire - is this issue still ongoing? Sorry, I didn’t notice the posts in this thread.

Yes. It’s still a problem. I just installed the lasted main firmware, connected to the BP, typed “#”, and I was unable to reconnect to the BP unless I reboot my Linux laptop.

I’ve been looking at the system logs. When I can connect, I see mtp-probe indicate this


10:08:57 mtp-probe: checking bus 1, device 7: "/sys/devices/pci0000:00/0000:00:14.0/usb1/1-2"
10:08:57 mtp-probe: bus: 1, device: 7 was not an MTP device
10:08:59 systemd-udevd[3538]: sda: Process '/usr/bin/unshare -m /usr/bin/snap auto-import --mount=/\
dev/sda' failed with exit code 1.
10:09:01 systemd-udevd[3554]: sda1: Process '/usr/bin/unshare -m /usr/bin/snap auto-import --mount=\
/dev/sda1' failed with exit code 1.
10:09:01 udisksd[789]: Mounted /dev/sda1 at /media/grymoire/5021-0000 on behalf of uid 1000

But after I issue the “#” command, the BP disconnects, and never reconnects. For some reason - the mtp-probe daemon never runs when the BP is plugged in.

It has to do with my udev rules. I currently have

SUBSYSTEM=="tty", ATTRS{idVendor}=="1209", ATTRS{idProduct}=="7332", ATTRS{serial}=="123456789012",\
 ENV{ID_USB_INTERFACE_NUM}=="00",  SYMLINK+="buspirate-text", TAG+="uaccess"
SUBSYSTEM=="tty", ATTRS{idVendor}=="1209", ATTRS{idProduct}=="7332", ATTRS{serial}=="123456789012",\
 ENV{ID_USB_INTERFACE_NUM}=="02",  SYMLINK+="buspirate-binary", TAG+="uaccess"

[Edited]
If I execute

systemctl restart systemd-udevd.service

I no longer have to reboot. I think the problem with my rules is that the BP is sometimes a TTY device and also a MTP (media transfer protocol) device.
The odd thing is I changed the rules March 30 and haven’t had a problem until the new file sync code was inserted.

1 Like

Here’s a fresh compile from ‘main’: "Recognizable serial name and disk label

Added command to set disk label.
Changed serial name and default disk label"
ci-buspirate5-main-f249c75.zip

Build time: 44.14 seconds

Git pull log @f249c75:
Updating c667f1f…f249c75
Fast-forward
commands.c | 3 ±
commands/global/disk.c | 85 ++++++++++++++++++++++++++++++++++++++++++++++++
commands/global/disk.h | 3 ±
commands/global/h_help.c | 1 +
fatfs/ffconf.h | 2 ±
pirate/storage.c | 8 ++±-
pirate/storage.h | 4 +++
translation/base.h | 4 +++
translation/bs-ba.h | 4 +++
translation/en-us.h | 4 +++
translation/en-us.json | 4 +++
translation/pl-pl.h | 4 +++
translation/zh-cn.h | 4 +++
usb_descriptors.c | 2 ±
14 files changed, 126 insertions(+), 6 deletions(-)

Here’s a fresh compile from ‘main’: “delete bugfix”
ci-buspirate5-main-b1e8b90.zip

Build time: 37.7 seconds

Git pull log @b1e8b90:
Updating f249c75…b1e8b90
Fast-forward
ui/ui_term.c | 10 +±-------
1 file changed, 2 insertions(+), 8 deletions(-)

Here’s a fresh compile from ‘main’: “script/macro/tutorial in help menu”
ci-buspirate5-main-f037d3e.zip

Build time: 40.27 seconds

Git pull log @f037d3e:
Updating b1e8b90…f037d3e
Fast-forward
commands/global/h_help.c | 11 ±
translation/base.h | 813 +++++++++++++++++++++++±----------------------
translation/bs-ba.h | 803 ++++++++++++++++++++++±----------------------
translation/en-us.h | 7 ±
translation/en-us.json | 791 +++++++++++++++++++++±----------------------
translation/it-it.h | 795 +++++++++++++++++++++±----------------------
translation/pl-pl.h | 803 ++++++++++++++++++++++±----------------------
translation/zh-cn.h | 803 ++++++++++++++++++++++±----------------------
8 files changed, 2431 insertions(+), 2395 deletions(-)

I like the new help pages. And now when I plug in the BP, the disk name is “BUS_PIRATE5” - that’s nice. BTW, what happens if I plug in a second one?

I’m still having problem getting it into boot mode using “$”. Once I type this, I can’t mount the file system. If I just unplug and re-plug, my Linux system refuses to mount it. One of the errors:

May 21 09:25:06 X270 kernel: [ 251.069359] sd 0:0:0:0: [sda] Attached SCSI removable disk
May 21 09:25:07 X270 kernel: [ 252.013170] usb 1-2: USB disconnect, device number 12
May 21 09:25:07 X270 kernel: [ 252.013378] sd 0:0:0:0: [sda] Unaligned partial completion (resid=3712, sector_sz=512)
May 21 09:25:07 X270 kernel: [ 252.013385] sd 0:0:0:0: [sda] tag#0 CDB: Read(10) 28 00 00 00 00 08 00 00 08 00
May 21 09:25:07 X270 kernel: [ 252.013392] sd 0:0:0:0: [sda] tag#0 FAILED Result: hostbyte=DID_ERROR driverbyte=DRIVER_OK cmd_age
=0s
May 21 09:25:07 X270 kernel: [ 252.013396] sd 0:0:0:0: [sda] tag#0 CDB: Read(10) 28 00 00 00 00 08 00 00 08 00
May 21 09:25:07 X270 kernel: [ 252.013399] I/O error, dev sda, sector 8 op 0x0:(READ) flags 0x80700 phys_seg 1 prio class 2
May 21 09:25:07 X270 kernel: [ 252.013445] device offline error, dev sda, sector 8 op 0x0:(READ) flags 0x0 phys_seg 1 prio class
2
May 21 09:25:07 X270 kernel: [ 252.013452] Buffer I/O error on dev sda, logical block 1, async page read

The sectors, logical blocks, etc vary each time. The value of flags stays the same. I also see this - indicating a corrupted FAT file system:

May 21 09:24:34 X270 systemd-udevd[6176]: sda1: Process ‘/usr/bin/unshare -m /usr/bin/snap auto-import --mount=/dev/sda1’ failed w
ith exit code 1.
May 21 09:24:35 X270 kernel: [ 219.619475] FAT-fs (sda1): Volume was not properly unmounted. Some data may be corrupt. Please run
fsck.

And of course if I use the boot button on the bottom while plugging in, I can recover and install new firmware.

Here’s a fresh compile from ‘main’: “add -b option to pause for button press (it’s good to be back!)”
ci-buspirate5-main-3a04b32.zip

Build time: 40.32 seconds

Git pull log @3a04b32:
Updating f037d3e…3a04b32
Fast-forward
commands/global/pause.c | 15 ++++++++++++±-
translation/base.h | 1 +
translation/bs-ba.h | 3 +±
translation/en-us.h | 1 +
translation/en-us.json | 3 +±
translation/it-it.h | 1 +
translation/pl-pl.h | 3 +±
translation/zh-cn.h | 3 +±
8 files changed, 24 insertions(+), 6 deletions(-)

Here’s a fresh compile from ‘main’: “button && || key to continue, x to exit options”
ci-buspirate5-main-de0ffa6.zip

Build time: 39.72 seconds

Git pull log @de0ffa6:
Updating 3a04b32…de0ffa6
Fast-forward
commands.c | 2 ±
commands/global/pause.c | 46 +++++++++++++++++++++++++++++++++++±---------
translation/base.h | 1 +
translation/bs-ba.h | 1 +
translation/en-us.h | 1 +
translation/en-us.json | 1 +
translation/it-it.h | 1 +
translation/pl-pl.h | 1 +
translation/zh-cn.h | 1 +
9 files changed, 44 insertions(+), 11 deletions(-)

Here’s a fresh compile from ‘main’: “pause extended help”
ci-buspirate5-main-850aadc.zip

Build time: 38.88 seconds

Git pull log @850aadc:
Updating de0ffa6…850aadc
Fast-forward
commands/global/pause.c | 12 +++++++++±-
translation/base.h | 3 +++
translation/bs-ba.h | 5 +++±
translation/en-us.h | 6 ++++±
translation/en-us.json | 7 ++++±-
translation/it-it.h | 3 +++
translation/pl-pl.h | 5 +++±
translation/zh-cn.h | 5 +++±
8 files changed, 38 insertions(+), 8 deletions(-)

Build Failed! Logs are attached. Happy debugging!

ci-buspirate5-main-f072f99.zip

Build time: 13.14 seconds

Git pull log @f072f99:
Updating 850aadc…f072f99
Fast-forward
msc_disk.c | 52 +++++++++++++±-------------------------------------
1 file changed, 14 insertions(+), 38 deletions(-)

Build Failed! Logs are attached. Happy debugging!

ci-buspirate5-main-69d057e.zip

Build time: 3.75 seconds

Git pull log @69d057e:
Updating f072f99…69d057e
Fast-forward
commands/global/cmd_selftest.c | 8 +++++++
usb_descriptors.c | 52 +++++++++++++++++++++++++++++±-----------
2 files changed, 45 insertions(+), 15 deletions(-)

Here’s a fresh compile from ‘main’: "Set custom linker script to memmap_buspirate5.ld

Set the custom linker script ‘memmap_buspirate5.ld’ for buspirate5. There is no need to patch pico SDK for that"
ci-buspirate5-main-75949ac.zip

Build time: 38.32 seconds

Git pull log @75949ac:
Updating 69d057e…75949ac
Fast-forward
CMakeLists.txt | 2 +
mode/logicanalyzer.c | 2 ±
pirate/memmap_buspirate5.ld | 251 ++++++++++++++++++++++++++++++++++++++++++++
readme.md | 12 —
4 files changed, 254 insertions(+), 13 deletions(-)
create mode 100644 pirate/memmap_buspirate5.ld

Strange, two build failures, but the latest does work. All pull requests passed automated testing on github. I’ll keep an eye on it, maybe the build server needs a whack.

Here’s a fresh compile from ‘main’: “fix base conversion binary fail”
ci-buspirate5-main-92ad4b5.zip

Build time: 39.39 seconds

Git pull log @92ad4b5:
Updating 75949ac…92ad4b5
Fast-forward
ui/ui_cmdln.c | 2 ±
1 file changed, 1 insertion(+), 1 deletion(-)

Here’s a fresh compile from ‘main’: "addressing #35 - adding pager to help on screen

first pass on it, works but really needs to be ‘any key’"
ci-buspirate5-main-ab588ee.zip

Build time: 41.35 seconds

Git pull log @ab588ee:
Updating 92ad4b5…ab588ee
Fast-forward
commands/global/disk.c | 39 ++++++++++++++++++±-----------
readme.md | 2 ±
translation/base.h | 1 +
translation/bs-ba.h | 1 +
translation/en-us.h | 1 +
translation/it-it.h | 1 +
translation/pl-pl.h | 1 +
translation/zh-cn.h | 1 +
ui/ui_help.c | 63 +++++++++++++++++++++++++++±---------------------
ui/ui_term.c | 9 ++++++++
ui/ui_term.h | 1 +
11 files changed, 77 insertions(+), 43 deletions(-)

Here’s a fresh compile from ‘main’: “Run json2h.py to push new translation line into en-us.json.”
ci-buspirate5-main-929d4c5.zip

Build time: 39.72 seconds

Git pull log @929d4c5:
Updating ab588ee…929d4c5
Fast-forward
translation/base.h | 2 ±
translation/bs-ba.h | 2 ±
translation/en-us.json | 1 +
translation/it-it.h | 2 ±
translation/pl-pl.h | 2 ±
translation/zh-cn.h | 2 ±
6 files changed, 6 insertions(+), 5 deletions(-)

Here’s a fresh compile from ‘main’: “disconnect storage device before jump to bootloader.”
ci-buspirate5-main-967019d.zip

Build time: 46.01 seconds

Git pull log @967019d:
Updating 929d4c5…967019d
Fast-forward
commands/global/cmd_mcu.c | 2 ++
msc_disk.c | 6 ++++++
msc_disk.h | 3 +++
3 files changed, 11 insertions(+)

Here’s a fresh compile from ‘main’: “Updated button_irq_callback to handle RISE and FALL, calculating the time between press and release. Added logic in pirate.c to run bulong.scr instead of button.scr on long press”
ci-buspirate5-main-5eadbb7.zip

Build time: 41.03 seconds

Git pull log @5eadbb7:
Updating 967019d…5eadbb7
Fast-forward
commands/global/button_scr.c | 44 ++++++++++++++++++++++++±-------------
commands/global/button_scr.h | 2 ±
commands/global/script.c | 4 +±-
commands/global/script.h | 4 +±-
pirate.c | 8 ++++±–
pirate/button.c | 49 ++++++++++++++++++++++++++++++++++±--------
pirate/button.h | 12 +++++++++±
7 files changed, 89 insertions(+), 34 deletions(-)

Here’s a fresh compile from ‘main’: "Revert “Merge pull request #59 from jrelo/button_longpress”

This reverts commit 5eadbb73201c57963fd341efdac1f04ff06a4602, reversing
changes made to 967019d62a5fbbc8fa7090606d6e74b2e51f8857."
ci-buspirate5-main-add9c1b.zip

Build time: 39.92 seconds

Git pull log @add9c1b:
Updating 5eadbb7…add9c1b
Fast-forward
commands/global/button_scr.c | 44 +++++++++++++±------------------------
commands/global/button_scr.h | 2 ±
commands/global/script.c | 4 +±-
commands/global/script.h | 4 +±-
pirate.c | 8 ++±----
pirate/button.c | 49 ++++++++±----------------------------------
pirate/button.h | 12 ±---------
7 files changed, 34 insertions(+), 89 deletions(-)