Open lalten opened 5 years ago
Any updates on this issue?
I found a solution: https://stackoverflow.com/questions/53278298/cant-override-board-vendor-usb-manufacturer-via-platformio-ini/76049354#76049354
platformio.ini
[env:adafruit_neotrinkey_m0]
platform = atmelsam
board = adafruit_neotrinkey_m0
framework = arduino
extra_scripts = pre:setUSB.py
setUSB.py
Import("env")
board_config = env.BoardConfig()
board_config.update("build.hwids", [
["0x27B8", "0x01ED"]
])
board_config.update("build.usb_product", "NeoPixel Trinkey M0-XXX")
board_config.update("vendor", "Adafruit-X")
result:
system_profiler SPUSBDataType
USB:
USB 3.1 Bus:
Host Controller Driver: AppleT6000USBXHCI
NeoPixel Trinkey M0-XXX:
Product ID: 0x01ed
Vendor ID: 0x27b8
Version: 1.00
Serial Number:
Speed: Up to 12 Mb/s
Manufacturer: Adafruit-X
Location ID: 0x02100000 / 1
Current Available (mA): 500
Current Required (mA): 100
Extra Operating Current (mA): 0
I agree with @lalten that it should be possible to override this from platformio.ini
. From the docs:
You can override any board option declared in manifest file using the next format board_{OBJECT.PATH}, where {OBJECT.PATH} is an object path in JSON manifest. Please navigate to “boards” folder of PlatfomIO development platforms and open JSON file to list all available options.
As noted above, the correct defines appear in .vscode/c_cpp_properties.json
, but USB_MANUFACTURER
is not applied on upload.
I want to override the
USB_PRODUCT
andUSB_MANUFACTURER
strings on my Sparkfun Pro Micro.According to the docs (http://docs.platformio.org/en/latest/boards/atmelavr/sparkfun_promicro16.html#configuration), I can
The Pro Micro's board settings json have the
build.usb_product
andvendor
fields (defaults areSparkFun Pro Micro
andSparkFun
).I can override the
USB_PRODUCT
with thisplatformio.ini
:The correct defines will show up in
.vscode/c_cpp_properties.json
:But as
dmesg
shows, onlyUSB_PRODUCT
is applied, notUSB_MANUFACTURER
:The relevant code is at https://github.com/platformio/platform-atmelavr/blob/master/builder/frameworks/arduino.py#L40. It looks like the
build_vendor
setting should work?What am I missing?