Are these two independent? When I change to
pyb.usb_mode('VCP')
in boot.py, I can use the virtual drive /flash while using rshell, and then I do not get a pop up window for a USB "drive", so I am thinking yes independent.
Is there still a reason to change mode to
pyb.usb_mode(None)
to avoid file corruption, or is that just a preference of some here?
I'd rather use the REPL via USB, but want to avoid the file corruption problem when data logging to files on flash.
This post from a year ago:
viewtopic.php?f=2&t=3233&p=19019&hilit= ... age#p19019
suggests there is no way to safely retrieve a data logging file from USB MSC mode from the host computer.
Is the situation still the same?
USB MSC mode, #define MICROPY_HW_USB_FS, datalogging
USB MSC mode, #define MICROPY_HW_USB_FS, datalogging
John Griessen blog.kitmatic.com
- pythoncoder
- Posts: 5956
- Joined: Fri Jul 18, 2014 8:01 am
- Location: UK
- Contact:
Re: USB MSC mode, #define MICROPY_HW_USB_FS, datalogging
I use
and have never experienced file corruption. It's MSC mode which is the culprit because the PC and the Pyboard vie for control: the USB file access standard assumes a dumb file store rather than another master.
Files can be retrieved from the Pyboard, for example using Dave Hylands' rshell but (of course) the code will need to close the file before this can reliably be done.
Code: Select all
pyb.usb_mode('VCP')
Files can be retrieved from the Pyboard, for example using Dave Hylands' rshell but (of course) the code will need to close the file before this can reliably be done.
Peter Hinch
Index to my micropython libraries.
Index to my micropython libraries.
Re: USB MSC mode, #define MICROPY_HW_USB_FS, datalogging
Thanks, this is helpful and not easy to find in the docs. So, it seems a good way to do a data logger is have a user button trigger an interrupt driven python function that closes the datalogging file for some minutes, or until another button press. Then the user of the system can copy it out using rshell from the virtual filesystem /flash location.Files can be retrieved from the Pyboard, for example using Dave Hylands' rshell but (of course) the code will need to close the file before this can reliably be done.
John Griessen blog.kitmatic.com