Skip to content

Commit

Permalink
Merge pull request #1 from calotlea/build_automation
Browse files Browse the repository at this point in the history
Use GitHub actions to build firmware to ease build environment setup
  • Loading branch information
Onwrikbaar authored Sep 23, 2024
2 parents 2515dcd + ac89334 commit ed6ffaa
Show file tree
Hide file tree
Showing 3 changed files with 54 additions and 1,273 deletions.
51 changes: 51 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
#
# Author lea_calot
#
name: FirmwareBuild

on:
push:
branches: [ ]
tags:
- 'v*'
workflow_dispatch:

jobs:
build_firmware:
runs-on: ubuntu-22.04
steps:
- name: Install Arm GNU Toolchain (arm-none-eabi-gcc)
uses: carlosperate/arm-none-eabi-gcc-action@v1
with:
release: '11.2-2022.02'

- name: Install SEGGER J-Link RTT
run: |
wget --post-data "accept_license_agreement=accepted" -c https://www.segger.com/downloads/jlink/JLink_Linux_V792_x86_64.tgz
tar xvzf JLink_Linux_V792_x86_64.tgz
tar xvzf JLink_Linux_V792_x86_64/Samples/RTT/SEGGER_RTT_V792.tgz
cp SEGGER_RTT_V792/Config/SEGGER_RTT_Conf.h SEGGER_RTT_V792/RTT/
- name: Install CubeMX G0
run: |
git clone --recursive -b v1.6.0 https://github.com/STMicroelectronics/STM32CubeG0.git
- name: Check out repository
uses: actions/checkout@v4
with:
path: NeoDK

- name: Build Firmware
run: |
echo $(pwd)
cd NeoDK/firmware
SEGGER=~/work/NeoDK/NeoDK/SEGGER_RTT_V792/RTT/ STM32CUBE_G0=~/work/NeoDK/NeoDK/STM32CubeG0 GNU_INSTALL_ROOT=$(dirname $(which arm-none-eabi-gcc))/ make
- name: Upload firmware artifact
uses: actions/upload-artifact@v4
with:
name: neodk_firmware
compression-level: 9
path: |
NeoDK/firmware/build/neodk_g071.bin
NeoDK/firmware/build/neodk_g071.hex
6 changes: 3 additions & 3 deletions firmware/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ MAO_LIB_SRC := maolib/src
PROJ_DIR_INC := inc
PROJ_DIR_SRC := src
STM32REPO := $(HOME)/STM32Cube/Repository
STM32CUBE_G0 := $(STM32REPO)/STM32Cube_FW_G0_V1.6.0
SEGGER := $(HOME)/SEGGER_RTT
STM32CUBE_G0 ?= $(STM32REPO)/STM32Cube_FW_G0_V1.6.0
SEGGER ?= $(HOME)/SEGGER_RTT

$(OUTPUT_DIRECTORY)/neodk_g071.out: \
LINKER_SCRIPT := STM32G071_FLASH.ld
Expand Down Expand Up @@ -47,7 +47,7 @@ STM32G0xx_INC += \
$(STM32CUBE_G0)/Drivers/CMSIS/Core/Include \
$(STM32CUBE_G0)/Drivers/CMSIS/Device/ST/STM32G0xx/Include \
$(STM32CUBE_G0)/Drivers/STM32G0xx_HAL_Driver/Inc \
$(HOME)/gcc-arm/arm-none-eabi/include \
$(GNU_INSTALL_ROOT)/../include \
$(SEGGER) \

# Libraries common to all targets
Expand Down
Loading

0 comments on commit ed6ffaa

Please sign in to comment.