You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
To customize the board i think a firmware configuration file could come handy.
The file should stay in the botsel part of the storage and should allow some basic configuration of the device.
The configuration should be applied on each firmware update so the configuration will always be the same even if the defaults in the firmware itself changes.
It could look like this
`
[GENERAL]
FileSystem="FS Label"
See also #1015 about making USB descriptors configurable. I think we favored the idea of doing it in Python code from boot.py over having a "configuration file" in another language.
Note that the filesystem label is set just once when the storage is initially formatted (or re-formatted via storage.erase_filesystem()) rather than each time the device is plugged in.
If it is possible to edit those settings within boot.py i'm fine with it. I thought, the configuration needs to be available at the time circuit python is installed/updated.
The idea behind the bot-sel storge was that this configuration cannot be accidentally deleted and it would be easier to deploy because you just need to copy the configuration an the firmwarefile to the same directory.
The UF2 file is copied to a fake drive so no other files can be copied with it. boot.py runs before USB starts, so it can change what the USB device is configured as.
Configuring this in boot.py definitely makes sense. As far as I can tell, what is missing is just a python API for setting/overriding USB_VID, USB_PID, USB_PRODUCT, USB_MANUFACTURER; probably in the supervisor module.
It's interesting that usb_build_device_descriptor already has parameters for setting USB_VID and USB_PID at runtime, but it is only ever called once (and with static arguments).
These values could be non-const variables that can be updated (in RAM only) with something like e.g.:
Activity
deshipu commentedon Mar 14, 2021
Maybe it would be best to keep this information in the bootloader? https://github.com/Microsoft/uf2/blob/master/cf2.md
jepler commentedon Mar 15, 2021
See also #1015 about making USB descriptors configurable. I think we favored the idea of doing it in Python code from boot.py over having a "configuration file" in another language.
Note that the filesystem label is set just once when the storage is initially formatted (or re-formatted via storage.erase_filesystem()) rather than each time the device is plugged in.
tannewt commentedon Mar 16, 2021
Why do you want this?
boot.pyis meant to store settings too.bitboy85 commentedon Mar 16, 2021
If it is possible to edit those settings within boot.py i'm fine with it. I thought, the configuration needs to be available at the time circuit python is installed/updated.
The idea behind the bot-sel storge was that this configuration cannot be accidentally deleted and it would be easier to deploy because you just need to copy the configuration an the firmwarefile to the same directory.
tannewt commentedon Mar 16, 2021
The UF2 file is copied to a fake drive so no other files can be copied with it.
boot.pyruns before USB starts, so it can change what the USB device is configured as.s-ol commentedon Apr 5, 2022
Configuring this in
boot.pydefinitely makes sense. As far as I can tell, what is missing is just a python API for setting/overridingUSB_VID,USB_PID,USB_PRODUCT,USB_MANUFACTURER; probably in thesupervisormodule.It's interesting that
usb_build_device_descriptoralready has parameters for settingUSB_VIDandUSB_PIDat runtime, but it is only ever called once (and with static arguments).These values could be non-const variables that can be updated (in RAM only) with something like e.g.: