@@ -101,13 +101,15 @@ jobs:
101101
102102 - name : Package firmware
103103 run : |
104- if [ -f "/github/home/.platformio/packages/framework-arduinoespressif32/tools/sdk/esp32/bin/bootloader_dio_40m.bin" ]; then
105- cp /github/home/.platformio/packages/framework-arduinoespressif32/tools/sdk/esp32/bin/bootloader_dio_40m.bin 0x01000.bin
104+ set -eux
105+ if [ -f "/github/home/.platformio/packages/framework-arduinoespressif32/tools/sdk/esp32/bin/bootloader_dio_40m.elf" ]; then
106+ cp /github/home/.platformio/packages/framework-arduinoespressif32/tools/sdk/esp32/bin/bootloader_dio_40m.elf 0x01000.elf
106107 elif [ -f "/github/home/.platformio/packages/framework-arduinoespressif32/tools/sdk/bin/bootloader_dio_40m.bin" ]; then
107108 cp /github/home/.platformio/packages/framework-arduinoespressif32/tools/sdk/bin/bootloader_dio_40m.bin 0x01000.bin
108109 else
109110 echo could not find bootloader_dio_40m.bin, new location?
110- find /github/home/.platformio/ -name "bootloader_dio_40m.bin"
111+ find /github/home/.platformio/ -name "bootloader*.bin"
112+ find /github/home/.platformio/ -name "bootloader*.elf"
111113 exit 1
112114 fi
113115 cp bin/.pio/build/esp32dev/partitions.bin 0x08000.bin
@@ -123,11 +125,15 @@ jobs:
123125 # 0x08000 0x08000.bin \
124126 # 0x0e000 0x0e000.bin \
125127 # 0x10000 0x10000.bin
126- echo Original bootloader params
127- ${ESPTOOL} --chip esp32 image_info --version 2 0x01000.bin || echo image_info for original bootloader failed
128+ ${ESPTOOL} --trace --chip esp32 elf2image \
129+ --dont-append-digest \
130+ --flash_freq 40m --flash_mode dio \
131+ 0x01000.elf
132+ echo Original bootloader params after elf2image
133+ ${ESPTOOL} --chip esp32 image_info --version 2 0x01000.bin || echo image_info for converted bootloader failed
128134 mv 0x01000.bin 0x01000.bin.org
129- ${ESPTOOL} --trace --chip esp32 merge_bin --output 0x01000.bin \
130- --flash_freq keep --flash_mode dio --flash_size 4MB \
135+ ${ESPTOOL} --trace --chip esp32 merge_bin --output 0x01000.bin \
136+ --flash_freq 40m --flash_mode dio --flash_size 4MB \
131137 --target-offset 0x01000 \
132138 0x01000 0x01000.bin.org
133139 echo OpenBikeSensor bootloader params
@@ -153,14 +159,15 @@ jobs:
153159 SONAR_TOKEN : ${{ secrets.SONAR_TOKEN }}
154160 GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
155161 run : |
162+ set -eux
156163 # Hack - point sonarqube to the real sources not the copy of it
157164 # See also https://community.sonarsource.com/t/scanning-platformio-c-embeded-projects/35141/2
158165 sed -i 's|OpenBikeSensorFirmware/bin|OpenBikeSensorFirmware|g' \
159166 sonarqube-out/build-wrapper-dump.json
160167 sed -i 's|\.pio/|bin/.pio/|g' \
161168 sonarqube-out/build-wrapper-dump.json
162169 # replace gcc with our script that reports the fake arch "le32-unknown-nacl"
163- sed -i "s|/github/home/.platformio/packages/toolchain-xtensa32 /bin/xtensa-esp32-elf-g..|`pwd`/.github/fake-cc|g" \
170+ sed -i "s|/github/home/.platformio/packages/toolchain-xtensa-esp32 /bin/xtensa-esp32-elf-g..|`pwd`/.github/fake-cc|g" \
164171 sonarqube-out/build-wrapper-dump.json
165172 ./sonarqube/sonar-scanner-${{ env.SONAR_SCANNER_VERSION }}-linux/bin/sonar-scanner \
166173 -Dsonar.host.url=https://sonarcloud.io \
@@ -196,6 +203,7 @@ jobs:
196203 LICENSE-ARDUINO-ESP32.md
197204 LICENSE-OpenSans.txt
198205 LICENSE
206+ sonarqube-out/build-wrapper-dump.json
199207 if-no-files-found : error
200208
201209 - name : Generate changelog
0 commit comments