-
-
Notifications
You must be signed in to change notification settings - Fork 8.3k
Open
Labels
enhancementFeature requests, new feature implementationsFeature requests, new feature implementations
Description
Description
I have got micropython prompt from this simple code.
"mpremote" connects and prompt works.
but mpremote cp or ls doesn't work, it would
be great if it works so full file management can be done.
I tried to run this from main.py and works as prompt
but file management results in some error...
import os
import machine
import sys
sys.path.extend(['/lib'])
# string indices in the default descriptor
i_str_manuf = 0x01
i_str_product = 0x02
i_str_serial = 0x03
# module ID (will be read from DIP switches)
module_id = 0x11
# make strings
str_module_id = f'{module_id:02x}'
str_unique_id = f'{int.from_bytes(machine.unique_id()):x}'
str_serial = f'{str_unique_id}_{str_module_id}'
str_product = f'proto_meter_{module_id:02x}'
str_manuf = 'TheStumbler'
mystrings = {}
mystrings[0] = None # need this for language
mystrings[i_str_manuf] = str_manuf
mystrings[i_str_product] = str_product
mystrings[i_str_serial] = str_serial
#for s in mystrings.items(): print(s)
usbdev = machine.USBDevice()
desc_dev = usbdev.BUILTIN_DEFAULT.desc_dev
desc_cfg = usbdev.BUILTIN_DEFAULT.desc_cfg
usbdev.active(False)
usbdev.builtin_driver = usbdev.BUILTIN_DEFAULT
usbdev.config(
desc_dev, desc_cfg, \
desc_strs=mystrings \
)
usbdev.active(True)
Code Size
No response
Implementation
I hope the MicroPython maintainers or community will implement this feature
Code of Conduct
Yes, I agree
fabse-hack
Metadata
Metadata
Assignees
Labels
enhancementFeature requests, new feature implementationsFeature requests, new feature implementations