adafruit / Adafruit_TinyUSB_Arduino

Arduino library for TinyUSB
MIT License
449 stars 119 forks source link

(MSC) setStartStopCallback -- callback is never called #380

Closed acscd closed 4 months ago

acscd commented 5 months ago

Operating System

Linux

Arduino IDE version

1.8.19

Board

Raspberry Pi Pico

ArduinoCore version

arduino-pico 3.0.7

TinyUSB Library version

2.3.0

Sketch as ATTACHED TXT

msc_sdcard_test.ino.txt

Compiled Log as ATTACHED TXT

log.txt

What happened ?

In the attached sketch, I set a startStop callback with setStartStopCallback (so the drive can be made to disappear like it should upon eject), but it is never called. Attempting to eject the mass storage device fails with an error message and the device remains available.

How to reproduce ?

  1. run sketch
  2. attempt to eject drive
  3. message from callback does not appear
  4. computer gives error message, device remains available

Debug Log

No response

Screenshots

Screenshot_2024-02-07_21-21-10

hathach commented 4 months ago

Liunx may not send out start/stop command as part of eject procedure. Try out windows to see if it does not trigger callback. Feel free to re-open issue if you are sure you see the START/STOP command in the bus data, and callback still is not invoked.

acscd commented 4 months ago

My bad, I did a little probing and it looks like Linux sends a Prevent/Allow Medium Removal command instead. Should I open a feature request on base TinyUSB about support for that command?

usb log2.txt