adafruit / Adafruit_Wippersnapper_Arduino

WipperSnapper is a firmware for creating no-code IoT electronics projects.
https://io.adafruit.com/welcome
MIT License
31 stars 45 forks source link

Preprocessor script for printing the library versions to boot_out.txt #598

Closed brentru closed 1 month ago

brentru commented 4 months ago

Create a preprocessor script to enumerate the arduino libaries and their versions into a string. The string should be placed into a header file. The header file is then included in the firmware, compiled in, and the string should be printed to the boot_out.txt file.

  1. Create the preprocessor script 1a. Enumerate the libraries, obtain their names and versions, store in a string, generate header file containing this string
  2. Include the header file in the firmware
  3. Write the string from the header file to the boot_out.txt
  4. Modify the existing build script to accommodate the steps above

This was requested by @ladyada during the Wednesday CE meeting

tyeth commented 3 months ago

Just spotted this issue, can't believe I missed it 🤦

Looks like I can get what we need from the arduino-cli using --only-compilation-database as this outputs exactly what we need. Now sure that is doesn't just do a build anyway, it does all the precursor work but ignores generating compiled objects/binaries. Currently testing with: compile -b esp32:esp32:adafruit_metro_esp32s2 ..\examples\Wippersnapper_demo --only-compilation-database or the full command including BSPs:

arduino-cli.exe --additional-urls="https://adafruit.github.io/arduino-board-index/package_adafruit_index.json,http://arduino.esp8266.com/stable/package_esp8266com_index.json,https://raw.githubusercontent.com/espressif/arduino-esp32/gh-pages/package_esp32_dev_index.json,https://sandeepmistry.github.io/arduino-nRF5/package_nRF5_boards_index.json,https://github.com/earlephilhower/arduino-pico/releases/download/global/package_rp2040_index.json" compile -b esp32:esp32:adafruit_metro_esp32s2 ..\examples\Wippersnapper_demo --only-compilation-database

Also testing --dump-profile. Output from build with dump profile (the compilation database outputs before dump profile):

Details

output:

C:\dev\arduino\Adafruit_Wippersnapper_Arduino\src [main ≡ +1 ~0 -0 !]> arduino-cli.exe --additional-urls="https://adafruit.github.io/arduino-board-index/package_adafruit_index.json,http://arduino.esp8266.com/stable/package_esp8266com_index.json,https://raw.githubusercontent.com/espressif/arduino-esp32/gh-pages/package_esp32_dev_index.json,https://sandeepmistry.github.io/arduino-nRF5/package_nRF5_boards_index.json,https://github.com/earlephilhower/arduino-pico/releases/download/global/package_rp2040_index.json" compile -b esp32:esp32:adafruit_metro_esp32s2 ..\examples\Wippersnapper_demo --dump-profile -j0
Sketch uses 1337398 bytes (92%) of program storage space. Maximum is 1441792 bytes.
Global variables use 62348 bytes (19%) of dynamic memory, leaving 265332 bytes for local variables. Maximum is 327680 bytes.

Used library               Version       Path
Adafruit WipperSnapper     1.0.0-beta.88 C:\Users\tyeth\Documents\Arduino\libraries\Adafruit_WipperSnapper
Adafruit MQTT Library      2.5.8         C:\Users\tyeth\Documents\Arduino\libraries\Adafruit_MQTT_Library
Adafruit SleepyDog Library 1.6.5         C:\Users\tyeth\Documents\Arduino\libraries\Adafruit_SleepyDog_Library
SPI                        3.0.3         C:\Users\tyeth\AppData\Local\Arduino15\packages\esp32\hardware\esp32\3.0.3\libraries\SPI
Adafruit DotStar           1.2.5         C:\Users\tyeth\Documents\Arduino\libraries\Adafruit_DotStar
Adafruit BusIO             1.16.1        C:\Users\tyeth\Documents\Arduino\libraries\Adafruit_BusIO
Adafruit NeoPixel          1.12.3        C:\Users\tyeth\Documents\Arduino\libraries\Adafruit_NeoPixel
Adafruit TinyUSB Library   3.3.2         C:\Users\tyeth\Documents\Arduino\libraries\Adafruit_TinyUSB_Library
ArduinoJson                7.1.0         C:\Users\tyeth\Documents\Arduino\libraries\ArduinoJson
Wire                       3.0.3         C:\Users\tyeth\AppData\Local\Arduino15\packages\esp32\hardware\esp32\3.0.3\libraries\Wire
Adafruit Unified Sensor    1.1.14        C:\Users\tyeth\Documents\Arduino\libraries\Adafruit_Unified_Sensor
Adafruit ADT7410 Library   1.3.1         C:\Users\tyeth\Documents\Arduino\libraries\Adafruit_ADT7410_Library
Adafruit AHTX0             2.0.5         C:\Users\tyeth\Documents\Arduino\libraries\Adafruit_AHTX0
hp_BH1750                  1.0.2         C:\Users\tyeth\Documents\Arduino\libraries\hp_BH1750
Adafruit BME280 Library    2.2.4         C:\Users\tyeth\Documents\Arduino\libraries\Adafruit_BME280_Library
Adafruit BME680 Library    2.0.4         C:\Users\tyeth\Documents\Arduino\libraries\Adafruit_BME680_Library
Adafruit BMP280 Library    2.6.8         C:\Users\tyeth\Documents\Arduino\libraries\Adafruit_BMP280_Library
Adafruit BMP3XX Library    2.1.5         C:\Users\tyeth\Documents\Arduino\libraries\Adafruit_BMP3XX_Library
Adafruit DPS310            1.1.4         C:\Users\tyeth\Documents\Arduino\libraries\Adafruit_DPS310
Adafruit DS248x            1.0.0         C:\Users\tyeth\Documents\Arduino\libraries\Adafruit_DS248x
ENS160 - Adafruit Fork     3.0.1         C:\Users\tyeth\Documents\Arduino\libraries\ENS160_-_Adafruit_Fork
Adafruit HTS221            0.1.5         C:\Users\tyeth\Documents\Arduino\libraries\Adafruit_HTS221
Adafruit HTU21DF Library   1.1.2         C:\Users\tyeth\Documents\Arduino\libraries\Adafruit_HTU21DF_Library
Adafruit HTU31D Library    1.1.3         C:\Users\tyeth\Documents\Arduino\libraries\Adafruit_HTU31D_Library
Adafruit INA219            1.2.3         C:\Users\tyeth\Documents\Arduino\libraries\Adafruit_INA219
Adafruit LC709203F         1.3.4         C:\Users\tyeth\Documents\Arduino\libraries\Adafruit_LC709203F
Adafruit LPS2X             2.0.6         C:\Users\tyeth\Documents\Arduino\libraries\Adafruit_LPS2X
Adafruit LPS35HW           1.0.6         C:\Users\tyeth\Documents\Arduino\libraries\Adafruit_LPS35HW
Adafruit LTR329 and LTR303 2.0.1         C:\Users\tyeth\Documents\Arduino\libraries\Adafruit_LTR329_and_LTR303
Adafruit LTR390 Library    1.1.2         C:\Users\tyeth\Documents\Arduino\libraries\Adafruit_LTR390_Library
Adafruit MAX1704X          1.0.3         C:\Users\tyeth\Documents\Arduino\libraries\Adafruit_MAX1704X
Adafruit MCP3421           1.0.0         C:\Users\tyeth\Documents\Arduino\libraries\Adafruit_MCP3421
Adafruit MCP9808 Library   2.0.2         C:\Users\tyeth\Documents\Arduino\libraries\Adafruit_MCP9808_Library
Adafruit MPL115A2          2.0.2         C:\Users\tyeth\Documents\Arduino\libraries\Adafruit_MPL115A2
Adafruit MPRLS Library     1.2.2         C:\Users\tyeth\Documents\Arduino\libraries\Adafruit_MPRLS_Library
Adafruit MS8607            1.0.4         C:\Users\tyeth\Documents\Arduino\libraries\Adafruit_MS8607
Adafruit NAU7802 Library   1.0.4         C:\Users\tyeth\Documents\Arduino\libraries\Adafruit_NAU7802_Library
Adafruit PCT2075           1.0.5         C:\Users\tyeth\Documents\Arduino\libraries\Adafruit_PCT2075
Adafruit PM25 AQI Sensor   1.1.0         C:\Users\tyeth\Documents\Arduino\libraries\Adafruit_PM25_AQI_Sensor
Adafruit SCD30             1.0.11        C:\Users\tyeth\Documents\Arduino\libraries\Adafruit_SCD30
Sensirion I2C SCD4x        0.4.0         C:\Users\tyeth\Documents\Arduino\libraries\Sensirion_I2C_SCD4x
Sensirion Core             0.7.1         C:\Users\tyeth\Documents\Arduino\libraries\Sensirion_Core
Sensirion I2C SEN5X        0.3.0         C:\Users\tyeth\Documents\Arduino\libraries\Sensirion_I2C_SEN5X
Adafruit SGP30 Sensor      2.0.3         C:\Users\tyeth\Documents\Arduino\libraries\Adafruit_SGP30_Sensor
Adafruit SGP40 Sensor      1.1.3         C:\Users\tyeth\Documents\Arduino\libraries\Adafruit_SGP40_Sensor
arduino-sht                1.2.5         C:\Users\tyeth\Documents\Arduino\libraries\arduino-sht
Adafruit Si7021 Library    1.5.3         C:\Users\tyeth\Documents\Arduino\libraries\Adafruit_Si7021_Library
Adafruit seesaw Library    1.7.8         C:\Users\tyeth\Documents\Arduino\libraries\Adafruit_seesaw_Library
Adafruit TMP117            1.0.3         C:\Users\tyeth\Documents\Arduino\libraries\Adafruit_TMP117
Adafruit TSL2591 Library   1.4.5         C:\Users\tyeth\Documents\Arduino\libraries\Adafruit_TSL2591_Library
Adafruit VCNL4020 Library  1.0.1         C:\Users\tyeth\Documents\Arduino\libraries\Adafruit_VCNL4020_Library
Adafruit VCNL4040          1.0.4         C:\Users\tyeth\Documents\Arduino\libraries\Adafruit_VCNL4040
Adafruit VEML7700 Library  2.1.6         C:\Users\tyeth\Documents\Arduino\libraries\Adafruit_VEML7700_Library
Adafruit_VL53L0X           1.2.4         C:\Users\tyeth\Documents\Arduino\libraries\Adafruit_VL53L0X
Adafruit VL53L1X           3.1.1         C:\Users\tyeth\Documents\Arduino\libraries\Adafruit_VL53L1X
STM32duino VL53L4CD        1.0.3         C:\Users\tyeth\Documents\Arduino\libraries\STM32duino_VL53L4CD
STM32duino VL53L4CX        1.1.0         C:\Users\tyeth\Documents\Arduino\libraries\STM32duino_VL53L4CX
Adafruit_VL6180X           1.4.3         C:\Users\tyeth\Documents\Arduino\libraries\Adafruit_VL6180X
DallasTemperature          3.9.0         C:\Users\tyeth\Documents\Arduino\libraries\DallasTemperature
OneWire                    2.3.8         C:\Users\tyeth\Documents\Arduino\libraries\OneWire
Adafruit SPIFlash          4.3.4         C:\Users\tyeth\Documents\Arduino\libraries\Adafruit_SPIFlash
WiFi                       3.0.3         C:\Users\tyeth\AppData\Local\Arduino15\packages\esp32\hardware\esp32\3.0.3\libraries\WiFi
Networking                 3.0.3         C:\Users\tyeth\AppData\Local\Arduino15\packages\esp32\hardware\esp32\3.0.3\libraries\Network
NetworkClientSecure        3.0.3         C:\Users\tyeth\AppData\Local\Arduino15\packages\esp32\hardware\esp32\3.0.3\libraries\NetworkClientSecure
SdFat - Adafruit Fork      2.2.3         C:\Users\tyeth\Documents\Arduino\libraries\SdFat_-_Adafruit_Fork

Used platform Version Path
esp32:esp32   3.0.3   C:\Users\tyeth\AppData\Local\Arduino15\packages\esp32\hardware\esp32\3.0.3

profiles:
  adafruit_metro_esp32s2:
    fqbn: esp32:esp32:adafruit_metro_esp32s2
    platforms:
      - platform: esp32:esp32 (3.0.3)
        platform_index_url: https://espressif.github.io/arduino-esp32/package_esp32_dev_index.json
    libraries:
      - Adafruit WipperSnapper (1.0.0-beta.88)
      - Adafruit MQTT Library (2.5.8)
      - Adafruit SleepyDog Library (1.6.5)
      - Adafruit DotStar (1.2.5)
      - Adafruit BusIO (1.16.1)
      - Adafruit NeoPixel (1.12.3)
      - Adafruit TinyUSB Library (3.3.2)
      - ArduinoJson (7.1.0)
      - Adafruit Unified Sensor (1.1.14)
      - Adafruit ADT7410 Library (1.3.1)
      - Adafruit AHTX0 (2.0.5)
      - hp_BH1750 (1.0.2)
      - Adafruit BME280 Library (2.2.4)
      - Adafruit BME680 Library (2.0.4)
      - Adafruit BMP280 Library (2.6.8)
      - Adafruit BMP3XX Library (2.1.5)
      - Adafruit DPS310 (1.1.4)
      - Adafruit DS248x (1.0.0)
      - ENS160 - Adafruit Fork (3.0.1)
      - Adafruit HTS221 (0.1.5)
      - Adafruit HTU21DF Library (1.1.2)
      - Adafruit HTU31D Library (1.1.3)
      - Adafruit INA219 (1.2.3)
      - Adafruit LC709203F (1.3.4)
      - Adafruit LPS2X (2.0.6)
      - Adafruit LPS35HW (1.0.6)
      - Adafruit LTR329 and LTR303 (2.0.1)
      - Adafruit LTR390 Library (1.1.2)
      - Adafruit MAX1704X (1.0.3)
      - Adafruit MCP3421 (1.0.0)
      - Adafruit MCP9808 Library (2.0.2)
      - Adafruit MPL115A2 (2.0.2)
      - Adafruit MPRLS Library (1.2.2)
      - Adafruit MS8607 (1.0.4)
      - Adafruit NAU7802 Library (1.0.4)
      - Adafruit PCT2075 (1.0.5)
      - Adafruit PM25 AQI Sensor (1.1.0)
      - Adafruit SCD30 (1.0.11)
      - Sensirion I2C SCD4x (0.4.0)
      - Sensirion Core (0.7.1)
      - Sensirion I2C SEN5X (0.3.0)
      - Adafruit SGP30 Sensor (2.0.3)
      - Adafruit SGP40 Sensor (1.1.3)
      - arduino-sht (1.2.5)
      - Adafruit Si7021 Library (1.5.3)
      - Adafruit seesaw Library (1.7.8)
      - Adafruit TMP117 (1.0.3)
      - Adafruit TSL2591 Library (1.4.5)
      - Adafruit VCNL4020 Library (1.0.1)
      - Adafruit VCNL4040 (1.0.4)
      - Adafruit VEML7700 Library (2.1.6)
      - Adafruit_VL53L0X (1.2.4)
      - Adafruit VL53L1X (3.1.1)
      - STM32duino VL53L4CD (1.0.3)
      - STM32duino VL53L4CX (1.1.0)
      - Adafruit_VL6180X (1.4.3)
      - DallasTemperature (3.9.0)
      - OneWire (2.3.8)
      - Adafruit SPIFlash (4.3.4)
      - SdFat - Adafruit Fork (2.2.3)
C:\dev\arduino\Adafruit_Wippersnapper_Arduino\src [main ≡ +1 ~0 -0 !]>