microsoft / vscode-arduino

Visual Studio Code extension for Arduino
Other
1.16k stars 216 forks source link

boards.local.txt file ignored #1563

Open K7MDL2 opened 1 year ago

K7MDL2 commented 1 year ago

This is something to look at for Arduino IDE 2.0 support. USB types are defined boards.txt along with many other parameters. Boards.txt are supplied in the board packages. Boards.local.txt provides a way to add or override boards.txt entries without changing the distributed version per the Arduino specs. https://arduino.github.io/arduino-cli/0.29/platform-specification/#boardslocaltxt

As of today, only boards.txt is processed, boards.local.txt is ignored. Arduino 2.0 IDE handles the .local.txt file properly assuming you clear the cached info.

For example, if I add my 3 lines of custom USB Type serial entries from boards.local.txt to boards.txt, the VS Code board manager USB Type menu will show and use the new USB type.

teensy41.menu.usb.serialserialaudio=Serial + Serial + Audio teensy41.menu.usb.serialserialaudio.build.usbtype=USB_SERIAL_SERIAL_AUDIO teensy41.menu.usb.serialserialaudio.upload_port.usbtype=USB_SERIAL_SERIAL_AUDIO

Adding these 3 lines will result in the Serial + Serial +Audio USB type to appear in the USB Type menu. Of course, to use it you must have matching section in usb_desc.h file, but that part is out of scope here.

The same local.txt file feature exists for some other config files like platform.txt.

K7MDL2 commented 11 months ago

Verified this is still an issue with Arduino extension v0.6.230727001.

Arduino IDE 2.21, TeensyDuino 0.59.3 read the boards.local.txt file correctly.