Skip to content

Commit e885708

Browse files
committed
simplify
1 parent 461f665 commit e885708

2 files changed

Lines changed: 10 additions & 12 deletions

File tree

.github/workflows/build.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ jobs:
2020
run: docker run --platform linux/amd64 --env "PUBLIC_KEY_HEX=${{ secrets.PUBLIC_KEY_HEX }}" --name firmware-container si-moko
2121

2222
- name: Copy firmware from container
23-
run: docker cp firmware-container:/spaceinvader/firmware.bin $GITHUB_WORKSPACE/firmware.bin
23+
run: docker cp firmware-container:/spaceinvader/dist/firmware.bin $GITHUB_WORKSPACE/firmware.bin
2424

2525
- name: Create Release
2626
id: create_release

build.sh

Lines changed: 9 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -7,29 +7,27 @@ set -e
77
WORKSPACE=/spaceinvader
88
cd $WORKSPACE
99

10-
# make a directory for hexadecimal files
10+
# Make directories for hexadecimal files and the final binary
1111
mkdir $WORKSPACE/hex
12+
mkdir $WORKSPACE/dist
1213

1314
# Initialize and update git submodules
1415
git submodule init
1516
git submodule update
1617

1718
# Compile micro-ecc library
18-
cd $WORKSPACE/apps/secure_bootloader/micro-ecc-build
19-
make
19+
make --directory=$WORKSPACE/apps/secure_bootloader/micro-ecc-build
2020

2121
# Set the public key for the secure bootloader
2222
sed -i "s/\/\* PUBLIC_KEY_PLACEHOLDER \*\//$PUBLIC_KEY_HEX/" $WORKSPACE/apps/firmware/dfu_images/public_key.c
2323

2424
# Compile secure bootloader
25-
cd $WORKSPACE/apps/secure_bootloader/build
26-
make
27-
cp $WORKSPACE/apps/secure_bootloader/build/_build/secure_bootloader_moko.hex $WORKSPACE/hex
25+
make --directory=$WORKSPACE/apps/secure_bootloader/build
26+
mv $WORKSPACE/apps/secure_bootloader/build/_build/secure_bootloader_moko.hex $WORKSPACE/hex
2827

2928
# Compile firmware
30-
cd $WORKSPACE/apps/firmware/build
31-
make
32-
cp $WORKSPACE/apps/firmware/build/_build/nrf52810_xxaa.hex $WORKSPACE/hex
29+
make --directory=$WORKSPACE/apps/firmware/build
30+
mv $WORKSPACE/apps/firmware/build/_build/nrf52810_xxaa.hex $WORKSPACE/hex
3331

3432
# Make hexadecimal files
3533
cd $WORKSPACE/hex
@@ -39,7 +37,7 @@ nrfutil settings generate --family NRF52810 --application nrf52810_xxaa.hex --ap
3937

4038
# Merge hex files
4139
cp $WORKSPACE/nRF5_SDK_17.0.2_d674dde/components/softdevice/s112/hex/s112_nrf52_7.2.0_softdevice.hex $WORKSPACE/hex
42-
mergehex -m bl_settings.hex secure_bootloader_moko.hex nrf52810_xxaa.hex s112_nrf52_7.2.0_softdevice.hex --output full_dfu.hex
40+
mergehex --merge bl_settings.hex secure_bootloader_moko.hex nrf52810_xxaa.hex s112_nrf52_7.2.0_softdevice.hex --output firmware.hex
4341

4442
# Convert the HEX file to a BIN file
45-
arm-none-eabi-objcopy -I ihex -O binary full_dfu.hex $WORKSPACE/firmware.bin
43+
arm-none-eabi-objcopy --input-target=ihex --output-target=binary firmware.hex $WORKSPACE/dist/firmware.bin

0 commit comments

Comments
 (0)