From 0899c18d38cff873a63c86a8cfe0b467d00b1da4 Mon Sep 17 00:00:00 2001 From: rusdacent <57439765+rusdacent@users.noreply.github.com> Date: Fri, 12 Feb 2021 13:04:35 +0300 Subject: [PATCH] Add dfu converter (#336) * Install hex2dfu in Dockerfile * Add convert and upload dfu files for bootloader and firmware --- .github/workflows/ci.yml | 12 ++++++++++++ docker/Dockerfile | 7 +++++++ 2 files changed, 19 insertions(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 655f8310..3d4419a3 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -37,6 +37,11 @@ jobs: with: run: make -C bootloader TARGET=f4 + - name: Generate dfu file for bootloader + uses: ./.github/actions/docker + with: + run: hex2dfu -i bootloader/.obj/f4/bootloader.hex -o bootloader/.obj/f4/bootloader.dfu + - name: Publish F4 bootloader artifacts uses: actions/upload-artifact@v2 with: @@ -45,6 +50,7 @@ jobs: bootloader/.obj/f4/bootloader.elf bootloader/.obj/f4/bootloader.bin bootloader/.obj/f4/bootloader.hex + bootloader/.obj/f4/bootloader.dfu if-no-files-found: error retention-days: 7 @@ -53,6 +59,11 @@ jobs: with: run: make -C firmware TARGET=f4 APP_RELEASE=1 + - name: Generate dfu file for firmware + uses: ./.github/actions/docker + with: + run: hex2dfu -i firmware/.obj/f4/firmware.hex -o firmware/.obj/f4/firmware.dfu + - name: Publish F4 firmware artifacts uses: actions/upload-artifact@v2 with: @@ -61,6 +72,7 @@ jobs: firmware/.obj/f4/firmware.elf firmware/.obj/f4/firmware.bin firmware/.obj/f4/firmware.hex + firmware/.obj/f4/firmware.dfu if-no-files-found: error retention-days: 7 diff --git a/docker/Dockerfile b/docker/Dockerfile index 3caef92b..b434e4fd 100644 --- a/docker/Dockerfile +++ b/docker/Dockerfile @@ -66,6 +66,13 @@ RUN apt update && \ dfu-util \ && apt-get clean && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* +# install hex2dfu + +RUN wget https://github.com/rusdacent/hex2dfu/archive/master.zip --output-document=hex2dfu.zip && \ + unzip hex2dfu.zip && \ + cd hex2dfu-master && gcc hex2dfu.c ED25519/*.c -o hex2dfu && \ + ln -s ${PWD}/hex2dfu /usr/bin/hex2dfu + COPY entrypoint.sh syntax_check.sh / RUN chmod +x /syntax_check.sh