-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
test: script to build devices firmwares
- Loading branch information
Showing
3 changed files
with
80 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
ARG IMAGE=ubuntu:22.04 | ||
FROM ${IMAGE} AS builder | ||
|
||
# Install dependencies | ||
RUN apt-get update && \ | ||
export DEBIAN_FRONTEND=noninteractive && \ | ||
apt-get install -y \ | ||
build-essential \ | ||
gcc-arm-none-eabi \ | ||
cmake \ | ||
git \ | ||
python3 \ | ||
python3-pip \ | ||
ninja-build && \ | ||
apt-get clean && \ | ||
rm -rf /var/lib/apt/lists/* && \ | ||
update-alternatives --install /usr/bin/python python /usr/bin/python3 1 | ||
|
||
SHELL [ "/bin/bash", "-o", "pipefail", "-c" ] | ||
|
||
WORKDIR /firmware | ||
COPY . /firmware | ||
|
||
RUN git clone https://github.com/IRNAS/pulseox-firmware.git && \ | ||
cd /firmware/pulseox-firmware && \ | ||
git submodule init && \ | ||
git submodule update && \ | ||
patch -s -p1 < ../pulseox-firmware-patch.diff && \ | ||
mkdir -p build && cd build && \ | ||
cmake -DCMAKE_TOOLCHAIN_FILE=../cmake/toolchains/arm-none-eabi.cmake .. && \ | ||
make | ||
|
||
WORKDIR /firmware | ||
|
||
RUN git clone https://github.com/CodethinkLabs/bloodlight-firmware.git && \ | ||
cd /firmware/bloodlight-firmware && \ | ||
git submodule init && \ | ||
git submodule update && \ | ||
make -C firmware/libopencm3 && \ | ||
make -C firmware | ||
|
||
FROM ${IMAGE} | ||
COPY --from=builder /firmware/pulseox-firmware/build/src/firmware.elf /output/pulseox-firmware.elf | ||
COPY --from=builder /firmware/bloodlight-firmware/firmware/bloodlight-firmware.elf /output/bloodlight-firmware.elf |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
#!/bin/bash | ||
|
||
set -e | ||
|
||
script_dir=$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd) | ||
docker build -t firmware-builder ${script_dir} | ||
docker create --name firmware-builder firmware-builder | ||
docker cp firmware-builder:/output/pulseox-firmware.elf pulseox-firmware.elf | ||
docker cp firmware-builder:/output/bloodlight-firmware.elf bloodlight-firmware.elf | ||
docker rm firmware-builder |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
diff --git a/ld/stm32f030f4p6.ld b/ld/stm32f030f4p6.ld | ||
index 554697c..d4d1378 100644 | ||
--- a/ld/stm32f030f4p6.ld | ||
+++ b/ld/stm32f030f4p6.ld | ||
@@ -1,6 +1,6 @@ | ||
MEMORY | ||
{ | ||
- rom (rx) : ORIGIN = 0x08000000, LENGTH = 16K | ||
+ rom (rx) : ORIGIN = 0x08000000, LENGTH = 32K | ||
ram (xrw) : ORIGIN = 0x20000000, LENGTH = 4K | ||
} | ||
|
||
Submodule libopencm3 contains modified content | ||
diff --git a/libopencm3/Makefile b/libopencm3/Makefile | ||
index ea51f6d9..2cc5b536 100644 | ||
--- a/libopencm3/Makefile | ||
+++ b/libopencm3/Makefile | ||
@@ -25,7 +25,7 @@ STYLECHECKFLAGS := --no-tree -f --terse --mailback | ||
|
||
space:= | ||
space+= | ||
-SRCLIBDIR:= $(subst $(space),\$(space),$(realpath lib)) | ||
+SRCLIBDIR:= $(subst $(space),$(space),$(realpath lib)) | ||
|
||
TARGETS := stm32/f0 stm32/f1 stm32/f2 stm32/f3 stm32/f4 stm32/f7 | ||
TARGETS += stm32/l0 stm32/l1 stm32/l4 |