From d7190d770b0ad438abc4832362b97f39ea69df03 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20=C3=96ster?= Date: Sun, 31 Aug 2025 15:37:39 +0300 Subject: [PATCH 1/2] Remove obsolete compile all hardware workflow --- .github/workflows/compile-all-hardware.yml | 93 ---------------------- 1 file changed, 93 deletions(-) delete mode 100644 .github/workflows/compile-all-hardware.yml diff --git a/.github/workflows/compile-all-hardware.yml b/.github/workflows/compile-all-hardware.yml deleted file mode 100644 index 8e1895f7..00000000 --- a/.github/workflows/compile-all-hardware.yml +++ /dev/null @@ -1,93 +0,0 @@ -# This is the name of the workflow, visible on GitHub UI. -name: 🤖 Compile All Hardware - -# Here we tell GitHub when to run the workflow. -on: - # The workflow is run when a commit is pushed or for a - # Pull Request. - - push - - pull_request - -# This is the list of jobs that will be run concurrently. -jobs: - # This pre-job is run to skip workflows in case a workflow is already run, i.e. because the workflow is triggered by both push and pull_request - skip-duplicate-actions: - runs-on: ubuntu-latest - # Map a step output to a job output - outputs: - should_skip: ${{ steps.skip_check.outputs.should_skip }} - steps: - - id: skip_check - uses: fkirc/skip-duplicate-actions@v5 - with: - # All of these options are optional, so you can remove them if you are happy with the defaults - concurrent_skipping: 'never' - skip_after_successful_duplicate: 'true' - do_not_skip: '["pull_request", "workflow_dispatch", "schedule"]' - - # Since we use a build matrix, the actual number of jobs - # started depends on how many configurations the matrix - # will produce. - - # This is the name of the job. - build-hardware: - needs: skip-duplicate-actions - if: needs.skip-duplicate-actions.outputs.should_skip != 'true' - - # Here we tell GitHub that the jobs must be determined - # dynamically depending on a matrix configuration. - strategy: - # The matrix will produce one job for each combination of parameters. - matrix: - # This is the development board hardware for which the code will be compiled. - # FBQN stands for "fully qualified board name", and is used by Arduino to define the hardware to compile for. - fqbn: - - esp32:esp32:esp32 - # further ESP32 chips - #- esp32:esp32:esp32c3 - #- esp32:esp32:esp32c2 - #- esp32:esp32:esp32c6 - #- esp32:esp32:esp32h2 - #- esp32:esp32:esp32s3 - # These are the batteries for which the code will be compiled. - battery: - - NISSAN_LEAF_BATTERY - # These are the emulated inverter communication protocols for which the code will be compiled. - inverter: - - BYD_CAN - # These are the supported hardware platforms for which the code will be compiled. - hardware: - - HW_LILYGO - - HW_STARK - - HW_3LB - - HW_DEVKIT - - # This is the platform GitHub will use to run our workflow. - runs-on: ubuntu-latest - - # This is the list of steps this job will run. - steps: - # First we clone the repo using the `checkout` action. - - name: Checkout - uses: actions/checkout@v5 - - # Copy USER_SECRETS.TEMPLATE.h to USER_SECRETS.h - - name: Copy USER_SECRETS.TEMPLATE.h to USER_SECRETS.h - run: cp ./Software/USER_SECRETS.TEMPLATE.h ./Software/USER_SECRETS.h - - # We use the `arduino/setup-arduino-cli` action to install and - # configure the Arduino CLI on the system. - - name: Setup Arduino CLI - uses: arduino/setup-arduino-cli@v2 - - # We then install the platform. - - name: Install platform - run: | - arduino-cli core update-index - arduino-cli core install esp32:esp32 - - # Finally, we compile the sketch, using the FQBN that was set - # in the build matrix, and using build flags to define the - # battery and inverter set in the build matrix. - - name: Compile Sketch - run: arduino-cli compile --fqbn ${{ matrix.fqbn }} --build-property build.partitions=min_spiffs --build-property upload.maximum_size=1966080 --build-property "build.extra_flags=-Wall -Wextra -Wpedantic -Werror -DESP32 -D${{ matrix.battery}} -D${{ matrix.inverter}} -D${{ matrix.hardware}}" ./Software From e5678d24062007f9484d953415e8553a9cc2bda3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20=C3=96ster?= Date: Sun, 31 Aug 2025 15:45:15 +0300 Subject: [PATCH 2/2] Add workflow for T-2CAN --- .../compile-common-image-lilygo-2CAN.yml | 58 +++++++++++++++++++ ...l => compile-common-image-lilygo-TCAN.yml} | 2 +- .github/workflows/release-assets.yml | 14 ++++- .../boards => boards}/esp32s3_flash_16MB.json | 0 platformio.ini | 2 +- 5 files changed, 72 insertions(+), 4 deletions(-) create mode 100644 .github/workflows/compile-common-image-lilygo-2CAN.yml rename .github/workflows/{compile-common-image-lilygo.yml => compile-common-image-lilygo-TCAN.yml} (97%) rename {Software/src/devboard/hal/boards => boards}/esp32s3_flash_16MB.json (100%) diff --git a/.github/workflows/compile-common-image-lilygo-2CAN.yml b/.github/workflows/compile-common-image-lilygo-2CAN.yml new file mode 100644 index 00000000..9972c4c4 --- /dev/null +++ b/.github/workflows/compile-common-image-lilygo-2CAN.yml @@ -0,0 +1,58 @@ +name: 🔋 Compile Common Image for Lilygo 2CAN + +on: + # The workflow is run when a commit is pushed or for a + # Pull Request. + - push + - pull_request + +# This is the list of jobs that will be run concurrently. +jobs: + # This pre-job is run to skip workflows in case a workflow is already run, i.e. because the workflow is triggered by both push and pull_request + skip-duplicate-actions: + runs-on: ubuntu-latest + # Map a step output to a job output + outputs: + should_skip: ${{ steps.skip_check.outputs.should_skip }} + steps: + - id: skip_check + uses: fkirc/skip-duplicate-actions@v5 + with: + # All of these options are optional, so you can remove them if you are happy with the defaults + concurrent_skipping: 'never' + skip_after_successful_duplicate: 'true' + do_not_skip: '["pull_request", "workflow_dispatch", "schedule"]' + + build-common-image: + # This is the platform GitHub will use to run our workflow. + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v5 + name: Checkout code + + - uses: actions/cache@v4 + with: + path: | + ~/.cache/pip + ~/.platformio/.cache + key: ${{ runner.os }}-pio + + - uses: actions/setup-python@v5 + with: + python-version: '3.11' + - name: Install PlatformIO Core + run: pip install --upgrade platformio + + # Copy USER_SECRETS.TEMPLATE.h to USER_SECRETS.h + - name: Copy USER_SECRETS.TEMPLATE.h to USER_SECRETS.h + run: cp ./Software/USER_SECRETS.TEMPLATE.h ./Software/USER_SECRETS.h + + - name: Build image for Lilygo + run: pio run -e lilygo_2CAN_330 + + - name: Upload artifact + uses: actions/upload-artifact@v4 + with: + name: battery-emulator-lilygo.bin + path: .pio/build/lilygo_2CAN_330/firmware.bin diff --git a/.github/workflows/compile-common-image-lilygo.yml b/.github/workflows/compile-common-image-lilygo-TCAN.yml similarity index 97% rename from .github/workflows/compile-common-image-lilygo.yml rename to .github/workflows/compile-common-image-lilygo-TCAN.yml index 43c0cd44..aee0a9bc 100644 --- a/.github/workflows/compile-common-image-lilygo.yml +++ b/.github/workflows/compile-common-image-lilygo-TCAN.yml @@ -1,4 +1,4 @@ -name: 🔋 Compile Common Image for Lilygo +name: 🔋 Compile Common Image for Lilygo T-CAN on: # The workflow is run when a commit is pushed or for a diff --git a/.github/workflows/release-assets.yml b/.github/workflows/release-assets.yml index c87b029b..fcbf4684 100644 --- a/.github/workflows/release-assets.yml +++ b/.github/workflows/release-assets.yml @@ -51,16 +51,26 @@ jobs: - name: Copy USER_SECRETS.TEMPLATE.h to USER_SECRETS.h run: cp ./Software/USER_SECRETS.TEMPLATE.h ./Software/USER_SECRETS.h - - name: 🛠 Build ota image for Lilygo + - name: 🛠 Build ota image for Lilygo T-CAN run: | pio run -e lilygo_330 cp .pio/build/lilygo_330/firmware.bin output/BE_${{ steps.vars.outputs.tag }}_LilygoT-CAN485.ota.bin - - name: 🛠 Build factory image for Lilygo + - name: 🛠 Build factory image for Lilygo T-CAN run: | esptool --chip esp32 merge-bin -o .pio/build/lilygo_330/factory.bin --flash-mode dio --flash-freq 40m --flash-size 4MB 0x1000 .pio/build/lilygo_330/bootloader.bin 0x8000 .pio/build/lilygo_330/partitions.bin 0xe000 ~/.platformio/packages/framework-arduinoespressif32/tools/partitions/boot_app0.bin 0x10000 .pio/build/lilygo_330/firmware.bin mv .pio/build/lilygo_330/factory.bin output/BE_${{ steps.vars.outputs.tag }}_LilygoT-CAN485.factory.bin + - name: 🛠 Build ota image for Lilygo 2-CAN + run: | + pio run -e lilygo_2CAN_330 + cp .pio/build/lilygo_2CAN_330/firmware.bin output/BE_${{ steps.vars.outputs.tag }}_LilygoT-2CAN.ota.bin + + - name: 🛠 Build factory image for Lilygo 2-CAN + run: | + esptool --chip esp32 merge-bin -o .pio/build/lilygo_2CAN_330/factory.bin --flash-mode dio --flash-freq 40m --flash-size 4MB 0x1000 .pio/build/lilygo_2CAN_330/bootloader.bin 0x8000 .pio/build/lilygo_2CAN_330/partitions.bin 0xe000 ~/.platformio/packages/framework-arduinoespressif32/tools/partitions/boot_app0.bin 0x10000 .pio/build/lilygo_2CAN_330/firmware.bin + mv .pio/build/lilygo_2CAN_330/factory.bin output/BE_${{ steps.vars.outputs.tag }}_LilygoT-2CAN.factory.bin + - name: 🛠 Build ota image for Stark run: | pio run -e stark_330 diff --git a/Software/src/devboard/hal/boards/esp32s3_flash_16MB.json b/boards/esp32s3_flash_16MB.json similarity index 100% rename from Software/src/devboard/hal/boards/esp32s3_flash_16MB.json rename to boards/esp32s3_flash_16MB.json diff --git a/platformio.ini b/platformio.ini index 16aaf9ab..b411b41c 100644 --- a/platformio.ini +++ b/platformio.ini @@ -51,7 +51,7 @@ framework = arduino build_flags = -I include -DHW_STARK -DCOMMON_IMAGE -DDEBUG_VIA_USB lib_deps = -[env:lilygo_2can_330] +[env:lilygo_2CAN_330] platform = https://github.com/pioarduino/platform-espressif32/releases/download/55.03.30/platform-espressif32.zip board = esp32s3_flash_16MB monitor_speed = 115200