Skip to content

Feature request: USB mass storage #54

@vickash

Description

@vickash

Building on #48, and also taking inspiration from CircuitPyhon, it would be nice if the storage partition shows up as a removable drive. This would eliminate the need for IDF, if you just want to modify mruby code. Of course, this only works on chips with native USB (S2 and S3 for now), not the original ESP32.

I spent a day earlier this year playing around, to see how feasible this would be. I got it to:

  • Act as USB-CDC and USB-MSC simultaneously. This would be enough if you just want to edit and then manually reset.
  • Reload when Ctrl+C is received over the USB-CDC connection

Issues:

  • Didn't figure out how to reload on file changes like CircuitPython does yet.
  • Reloading, even with Ctrl+C, requires a separate supervisor task to be running that cleans up after and manages the mruby task.
  • There were still some issues, with either Wi-Fi, MQTT, or both, that would cause the board to reset (MSC drive disconnects and reconnects) when Ctrl+C is pressed.

I'll try to extract the minimum (just expose the storage partition over MSC) from my experimentation and make a PR as soon as I have time.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions