Allow board specific define, for boards without unique ARDUINO_BOARDNAME or no matching entry in boards.txt
Some boards use the generic module FQBN or the ARDUINO_BOARD define for a generic module/devkit, when they have differing pinouts.
We need to be able to distinguish between them during compilation, which we do via ci-arduino build targets with FQBN.
It's possible to override the boards.txt entries for a single board, or even add new boards, using a boards.local.txt file installed into the platform folder (where boards.txt resides).
This issue was raised after a user added the DFRobot ESP32C3 which uses the same board define as the Espressif C3 devkit.
I've added an argument to build-platforms.py in ci-arduino, --boards-local-txt, with an optional file argument (or defaults to CWD\boards.local.txt).
- If the argument/flag is supplied, then the test-examples function also looks for an example specific boards.local.txt file, or preferably a board specific version
.{PLATFORM}.boards.local.txtlike the .skip files (and .generate which is for UF2)
ci-arduino PR https://github.com/adafruit/ci-arduino/pull/217
wipper PR https://github.com/adafruit/Adafruit_Wippersnapper_Arduino/pull/784
I tested with a boards.local.txt at project root, and the updated CI task to use the flag, using a wippersnapper DFrobot C3 specific define (WS_UNIQUE_BOARD_ID) and the plain ESP32C3_DEV separated into two entries in Wippersnapper_Boards.h, one with a broken board ID, and watched them come online with the different id, then swapped the broken one. Then restored to both being dfrobot c3, but now we can add the c3 devkit or other boards using the ESP32C3_DEV define.
Related: https://github.com/espressif/arduino-esp32/pull/6883 #771
@brentru this is probably worth going over together, but you can see the test stages in the commit history.
Here are two assets (runnable on any C3) that cover the two situations I created in commit history, where I used the boards.local.txt to override the board defines for the DFRobot.
build-files-dfrobot_beetle_esp32c3.1.0.0-beta.109-9-ga7d554ca-bad-robot-if-boards-txt-worked.zip build-files-dfrobot_beetle_esp32c3.1.0.0-beta.109-8-g452f3d33-correct-robot-if-local-boards-file-worked.zip
https://github.com/adafruit/Adafruit_Wippersnapper_Arduino/blob/8afd334f1012eb1f36bf9ad9770ff6f85c4b495d/boards.local.txt#L1-L17
Tagging @ladyada as mentioned in the meeting. For now the CI-Arduino PR does not take the change into main branch, but will happily afterwards if it's desired (which it sounds like it is).
yep understood!
@tyeth Ping me in slack when you're back from holiday and we'll go over this