On MacBook Pro (2019, i9), loses serial after sleep

If I leave the Bus Pirate 5 plugged in and connected and step away, once my MBP goes into sleep mode, when I come back, my serial connection to it is locked up, and reconnecting doesn’t help, I have to unplug and plug back in the BP.

The device itself seems fine as for as I’ve noticed. I believe the display is still updating.

I’m connecting like this:
cu -l /dev/cu.usbmodem1234567890121
And I’m using iTerm.

Let me know if there’s any debug info I can provide.

Bus Pirate 5 REV10
Firmware main branch (2024-04-12T13:08:29Z)
RP2040 with 264KB RAM, 128Mbit FLASH
S/N: 263845D3012961E4
https://BusPirate.com/
Storage:   0.10GB (FAT16 File System)

Thanks so much for the report. Is anyone knowledgeable about Mac and USB? I have no experience in this area.

We’re using TinyUSB as it’s packaged with the PICO development kit. It’s not 100% stock because I did some tweaks for the specific combination of device end points, but it’s pretty close to original. So I searched a bit to see if this is a common problem for RP2040 and didn’t find this exact issue.

However, I found this bug report where they discuss TinyUSB causing sleeping Macs to freeze because due to the power down/sleep SCSI commands not being acknowledged. In our case we have also not implemented any power down or sleep logic. I know the PICO probe does sleep/wake on my PC, so it should be doable, I just need to see how PICO does it.

2 Likes

I know that Intel Macs do not maintain USB connections/sessions while sleeping, so the issue is probably (I don’t have much experience) with bus pirate not “reseting” the connection properly.

I set a reminder on this one.

I have a spare Pi Pico. If I get time, I’ll try putting the debugprobe project on it and see if I can figure out what’s going on.

Or I guess I should ask, is that the right approach? I assume I need to talk to the BP somehow while it’s not talking to my laptop, without resetting it. Or maybe there’s some commands i can run from the Mac side to learn more.

It would be great to confirm if the PICO probe works correctly. Ultimately I need to spend an afternoon reading through the pico probe code and figuring out what we’re missing.