Compare commits

...

2 Commits

Author SHA1 Message Date
9a3ec2410c feat : Automate Zigbee firmware build and deployment
Some checks failed
CC2530 Zigbee Firmware Build / build (push) Failing after 1m13s
- The updated workflow is designed to automate the building and deployment of Zigbee firmware for a specific device.
2025-02-22 11:16:08 +01:00
93055f73b7 chore 📦: Update compiler settings and build rules
- This commit updates the compiler settings, object files, and build rules for the project.
2025-02-22 11:15:35 +01:00
2 changed files with 83 additions and 7 deletions

66
.gitea/workflows/ci.yml Normal file
View File

@@ -0,0 +1,66 @@
name: CC2530 Zigbee Firmware Build
on:
push:
branches:
- main # Triggers the action when code is pushed to the main branch
pull_request:
branches:
- main # Triggers the action for pull requests targeting the main branch
jobs:
build:
runs-on: ubuntu-latest # You can use `windows-latest` or `macos-latest` as well if your toolchain is compatible
steps:
- name: Checkout Code
uses: actions/checkout@v4 # Checkout the code from your GitHub repository
with:
github-server-url: ${{ vars.GIT_SERVER_URL }}
- name: Set up toolchain (IAR or CCS)
run: |
# Install dependencies for IAR or CCS toolchain
# Example: For IAR Workbench you might need to install some packages or configure environment variables.
sudo apt-get update
sudo apt-get install -y gcc-arm-none-eabi build-essential
# You would also install the necessary firmware building tools if they are available
# or set up cross-compilation for ARM
- name: Build Firmware (For IAR or CCS)
run: |
# Run the build command for your firmware
# Assuming you're using IAR or CCS, you'd need to invoke the build system here.
# For example:
# make
# Or use IAR's compiler directly (e.g., via command line invocation)
# Example for make-based build system:
make all
- name: Check Build Results
run: |
if [ ! -f "build/firmware.hex" ]; then
echo "Build failed: Firmware not found!"
exit 1
else
echo "Build successful!"
rm build/firmware.hex
fi
# - name: Flash Firmware to CC2530 (optional)
# run: |
# # If you have a setup to flash the firmware to a CC2530 device over USB or other methods, you can set that up here
# # This would require a USB device with the CC2530 or CC2530 development board connected to your machine
# # Example of flashing tool (modify accordingly):
# # python flash_tool.py build/firmware.hex
# echo "Flashing firmware would go here (not implemented)"
# - name: Upload Firmware Artifact (optional)
# uses: actions/upload-artifact@v2
# with:
# name: firmware
# path: build/firmware.hex

View File

@@ -1,14 +1,24 @@
CC = msp430-gcc
CFLAGS = -Wall -Os
LIBS = -lZStack -lhal
# Compiler settings
CC = msp430-gcc # MSP430 compiler
CFLAGS = -Wall -Os # Enable all warnings, Optimize for size
LDFLAGS =
LIBS = -lZStack -lhal # ZStack for Zigbee communication, lhal for Hardware Abstraction Layer library
SRCS = main.c zigbee_comm.c sensors/bme280.c sensors/wind_vane.c sensors/rain_gauge.c sensors/anemometer.c
HEADERS = main.h zigbee_comm.h sensors/bme280.h sensors/wind_vane.h sensors/rain_gauge.h sensors/anemometer.h config.h
OBJS = $(SRCS:.c=.o) # create a list of object files from the source files
all: main
all: main.elf
main: $(SRCS) $(HEADERS)
$(CC) $(CFLAGS) $(SRCS) $(LIBS) -o main.elf
main.elf: $(OBJS)
$(CC) $(LDFLAGS) $(OBJS) $(LIBS) -o $@
%.o: %.c $(HEADERS)
$(CC) $(CFLAGS) -c $< -o $@
clean:
rm -f main.elf
rm -f main.elf $(OBJS)
# Optionally add a rule to flash your device (if applicable)
# flash: $(EXEC)
# ./flash_tool $(EXEC) # This is just a placeholder if needed