diff --git a/.cargo/config.toml b/.cargo/config.toml index de8eca6872180644052c69f949fd82647b52b12b..0e39871e051954f5546fa3795c17d442cf9b7b36 100644 --- a/.cargo/config.toml +++ b/.cargo/config.toml @@ -9,3 +9,7 @@ target = "thumbv7em-none-eabihf" # Cortex-M4F and Cortex-M7F (with FPU) [target.'cfg(all(target_arch = "arm", target_os = "none"))'] runner = "arm-none-eabi-gdb -x openocd.gdb" + +[target.arm-unknown-linux-gnueabihf] +linker = "arm-linux-gnueabihf-gcc" + diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index deead844c8227ec726f7d57a0a5e87b21c945599..9def2288de0780728f004b82a818bd2cb429b743 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -1,14 +1,18 @@ image: "rust:latest" +variables: + GIT_SUBMODULE_STRATEGY: normal + stages: - lint - build - build-flasher before_script: - - apt update && apt install -y binutils-arm-none-eabi gcc-mingw-w64-x86-64-win32 + - apt update && apt install -y binutils-arm-none-eabi gcc-mingw-w64-x86-64-win32 gcc-arm-linux-gnueabihf - rustup target add thumbv7em-none-eabihf - - rustup target add x86_64-pc-windows-gnu + - rustup target add arm-unknown-linux-gnueabihf # Raspberry Pi + - rustup target add x86_64-pc-windows-gnu # Windows PC - rustup component add rustfmt - rustup component add clippy - cargo install flip-link @@ -32,16 +36,14 @@ build: build-flasher: stage: build-flasher script: - - mkdir flasher - - cd .. - - git clone https://gitlab.scd31.com/cats/firmware-flasher - - cd firmware-flasher - - cp ../mobile-transceiver-software/firmware.bin firmware.bin - - cargo build --release + - rm -rf flasher; mkdir flasher + - cd firmware-flasher # cd into submodule + - cp ../firmware.bin firmware.bin + - cargo build --release --target arm-unknown-linux-gnueabihf - cargo build --release --target x86_64-pc-windows-gnu - - cp target/release/stm32-firmware-flasher ../mobile-transceiver-software/flasher/flasher-linux - - strip ../mobile-transceiver-software/flasher/flasher-linux - - cp target/x86_64-pc-windows-gnu/release/stm32-firmware-flasher.exe ../mobile-transceiver-software/flasher/flasher-windows.exe + - cp target/arm-unknown-linux-gnueabihf/release/stm32-firmware-flasher ../flasher/flasher-linux + - arm-linux-gnueabihf-strip ../flasher/flasher-linux + - cp target/x86_64-pc-windows-gnu/release/stm32-firmware-flasher.exe ../flasher/flasher-windows.exe artifacts: paths: - flasher/* diff --git a/.gitmodules b/.gitmodules new file mode 100644 index 0000000000000000000000000000000000000000..99effa4abab547a0f7100d446330110223540b95 --- /dev/null +++ b/.gitmodules @@ -0,0 +1,3 @@ +[submodule "firmware-flasher"] + path = firmware-flasher + url = https://gitlab.scd31.com/cats/firmware-flasher diff --git a/firmware-flasher b/firmware-flasher new file mode 160000 index 0000000000000000000000000000000000000000..87fb2352473381232e46592a75f6876a816cc171 --- /dev/null +++ b/firmware-flasher @@ -0,0 +1 @@ +Subproject commit 87fb2352473381232e46592a75f6876a816cc171