How can I let my pyboard be registered as a USB Flash Drive while connecting through UART

The official pyboard running MicroPython.
This is the reference design and main target board for MicroPython.
You can buy one at the store.
Target audience: Users with a pyboard.
Post Reply
Gowther
Posts: 2
Joined: Mon Jun 03, 2019 8:07 pm

How can I let my pyboard be registered as a USB Flash Drive while connecting through UART

Post by Gowther » Mon Jun 03, 2019 9:16 pm

Hello
The pyboard can as you know be recognized as a USB Flash Drive when you connect it with your PC. But because I need the USB Port of my board for another task I (think I) need to use a UART connection to connect the board to the USB of my PC. My question now is, what needs to be done that the file system of the pyboard is accessible by the PC as if the connection was through the USB Port of the board.
Thanks for your help ;)

User avatar
dhylands
Posts: 3821
Joined: Mon Jan 06, 2014 6:08 pm
Location: Peachland, BC, Canada
Contact:

Re: How can I let my pyboard be registered as a USB Flash Drive while connecting through UART

Post by dhylands » Tue Jun 04, 2019 1:07 am

The USB Mass Storage capability can only be accessed through the USB interface.

However, there are tools like rshell http://github.com/dhylands/rshell or ampy https://github.com/pycampers/ampy and others which will allow you to copy files to/from the filesystem over a serial interface (Disclaimer: I wrote rshell).

Gowther
Posts: 2
Joined: Mon Jun 03, 2019 8:07 pm

Re: How can I let my pyboard be registered as a USB Flash Drive while connecting through UART

Post by Gowther » Mon Jun 10, 2019 8:09 pm

Hi and thanks for your help
Just one further question:
Is it possible to transfer data from a Pyboard to another (through a UART connection) using these tools?

User avatar
dhylands
Posts: 3821
Joined: Mon Jan 06, 2014 6:08 pm
Location: Peachland, BC, Canada
Contact:

Re: How can I let my pyboard be registered as a USB Flash Drive while connecting through UART

Post by dhylands » Mon Jun 10, 2019 10:24 pm

Those tools won't let you transfer directly from one pybaord to another.

I know with rshell that you can connect to 2 pyboards at the same time and use rshell to copy from pyboard to another. Both pyboards need to be connected to the same host computer.

You could write your own code to transfer directly from one pyboard to another either using the same technique as rshell (using the raw REPL), or youcould write your own code to send the file.

Post Reply