Why the file I created is not created?

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.
User avatar
Roberthh
Posts: 3667
Joined: Sat May 09, 2015 4:13 pm
Location: Rhineland, Europe

Re: Why the file I created is not created?

Post by Roberthh » Wed Jan 27, 2021 10:29 am

One note ahead: Managing files both on the device and form the PC using e.g. explorer turned out to be a reliable way to corrupt teh files system on your pyboard. That's wha for instance Adafruit decided to make the access exclusive. If PC file access is enabled, any board-local changes are suppressed, and vice versa. But that's another story.

Besides that: Windows and other OSes assume that it is the only instance to change the content of an attached file system. So if you do that on the board, the PC will not expect that and will not take notice of if. Refreshing the file window with F5 should help. And also you should sync the files before resetting or removing the board.

Still, sooner or later you will end up with FS corruption. That's why most people decide after a while disable MSC mode and use other tools for copying files in and out.

rpr
Posts: 99
Joined: Sat Oct 27, 2018 5:17 pm

Re: Why the file I created is not created?

Post by rpr » Wed Jan 27, 2021 5:27 pm

Roberthh wrote:
Wed Jan 27, 2021 10:29 am
One note ahead: Managing files both on the device and form the PC using e.g. explorer turned out to be a reliable way to corrupt teh files system on your pyboard. That's wha for instance Adafruit decided to make the access exclusive. If PC file access is enabled, any board-local changes are suppressed, and vice versa. But that's another story.

Besides that: Windows and other OSes assume that it is the only instance to change the content of an attached file system. So if you do that on the board, the PC will not expect that and will not take notice of if. Refreshing the file window with F5 should help. And also you should sync the files before resetting or removing the board.

Still, sooner or later you will end up with FS corruption. That's why most people decide after a while disable MSC mode and use other tools for copying files in and out.
Thanks. I don't have my RPi Pico yet but I assume the following will work to disable MSC:

Code: Select all

import pyboard as pyb
pyb.usb_mode('VSC')

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

Re: Why the file I created is not created?

Post by dhylands » Wed Jan 27, 2021 7:03 pm

Opening a file by double clicking it is specific to the OS you're using on your host machine.

Normally there is a notion of applications associated with a file extension.

For Windows you'd follow something like this:
https://www.computerhope.com/issues/ch000572.htm

I don't recognize the OS that you're using based on the screenshot.

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

Re: Why the file I created is not created?

Post by dhylands » Wed Jan 27, 2021 7:05 pm

rpr wrote:
Wed Jan 27, 2021 5:27 pm
Thanks. I don't have my RPi Pico yet but I assume the following will work to disable MSC:

Code: Select all

import pyboard as pyb
pyb.usb_mode('VSC')
VSC isn't a valid mode. I think you meant VCP

rpr
Posts: 99
Joined: Sat Oct 27, 2018 5:17 pm

Re: Why the file I created is not created?

Post by rpr » Wed Jan 27, 2021 7:09 pm

You are correct. Typo on my part. It should be VCP.

User avatar
pythoncoder
Posts: 5956
Joined: Fri Jul 18, 2014 8:01 am
Location: UK
Contact:

Re: Why the file I created is not created?

Post by pythoncoder » Thu Jan 28, 2021 6:14 am

rpr wrote:
Wed Jan 27, 2021 5:27 pm
...
Thanks. I don't have my RPi Pico yet but I assume the following will work to disable MSC:

Code: Select all

import pyboard as pyb
pyb.usb_mode('VSC')
See this post. MSC mode isn't implemented on the Pico. Thank goodness. It's more trouble than it's worth.
Peter Hinch
Index to my micropython libraries.

Post Reply