Skip to content

Instantly share code, notes, and snippets.

@gmarull
Created May 2, 2020 16:15
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save gmarull/8a2681d1ed926590db4da365d60509c3 to your computer and use it in GitHub Desktop.
Save gmarull/8a2681d1ed926590db4da365d60509c3 to your computer and use it in GitHub Desktop.
Zephyr CircleCI Example (out of tree application)
version: 2.0
jobs:
build:
docker:
- image: teslabs/CUSTOM_IMAGE_NAME:latest
steps:
- checkout
- restore_cache:
key: west-{{ checksum "west.yml" }}
- run:
name: initialize
command: |
west init -l .
cd ..
west update
- save_cache:
key: west-{{ checksum "west.yml" }}
paths:
- "~/zephyr"
- "~/modules"
- restore_cache:
key: pip-{{ checksum "../zephyr/scripts/requirements.txt" }}
- run:
name: install Zephyr dependencies
command: pip3 install -r ../zephyr/scripts/requirements.txt
- save_cache:
key: pip-{{ checksum "../zephyr/scripts/requirements.txt" }}
paths:
- "~/.cache/pip"
- run:
name: build
command: |
source env.sh
west build
- store_artifacts:
path: build/zephyr/zephyr.elf
FROM ubuntu:20.04
ARG DEBIAN_FRONTEND=noninteractive
# install dependencies
RUN apt-get update && apt-get install -y \
# CircleCI
software-properties-common \
wget \
git \
openssh-client \
ca-certificates \
sudo \
# Zephyr
cmake \
ninja-build \
python3 \
python3-pip \
device-tree-compiler \
gperf \
&& rm -rf /var/lib/apt/lists/*
# install ARM Embedded GCC Toolchain
RUN wget -q https://developer.arm.com/-/media/Files/downloads/gnu-rm/9-2019q4/RC2.1/gcc-arm-none-eabi-9-2019-q4-major-x86_64-linux.tar.bz2 && \
mkdir /tools && \
tar -jxf gcc-arm-none-eabi-9-2019-q4-major-x86_64-linux.tar.bz2 -C /tools && \
rm gcc-arm-none-eabi-9-2019-q4-major-x86_64-linux.tar.bz2
ENV PATH "/tools/gcc-arm-none-eabi-9-2019-q4-major/bin:$PATH"
# install West
RUN pip3 install west
#!/bin/sh
export ZEPHYR_TOOLCHAIN_VARIANT="gnuarmemb"
export GNUARMEMB_TOOLCHAIN_PATH="$(dirname "$(which arm-none-eabi-gcc)")/.."
source ../zephyr/zephyr-env.sh
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment