Experiment with automated mcu flashing

Also, it adds no value. Being rare, it is not a priority. The focus of this change would have been on first-time setups, as many users struggle with the settings. Of course a benefit for updating as well.

Especially in combination with Katapult and a little bit of bash scripting, you could easily automate this. Something along these lines:

#!/bin/bash

CONFIG_FILE="ebb42.config"

error_exit() {
    echo "$1"
    exit 1
}
make clean KCONFIG_CONFIG="$CONFIG_FILE" || error_exit "Failed to clean old build."
make olddefconfig KCONFIG_CONFIG="$CONFIG_FILE" || error_exit "Failed to update make arguments."
make KCONFIG_CONFIG="$CONFIG_FILE" || error_exit "Firmware build failed."
make flash FLASH_DEVICE="<id string>" KCONFIG_CONFIG="$CONFIG_FILE" || error_exit "Flash failed. Check the device path."
  • The relevant configurations need to be created once, e.g. with make menuconfig KCONFIG_CONFIG=ebb42.config
  • This script is largely untested, written from top of my head.
  • If it doesn’t work, feel free to ask ChatGPT.
  • You can extend this script with as many configurations as you would like.

Edit: Little fix. make menuconfig in the script seems unneeded.
Edit2: Let’s add a make clean to be on the safe side.

2 Likes