Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- FROM ubuntu:20.04
- RUN ln -snf /usr/share/zoneinfo/$CONTAINER_TIMEZONE /etc/localtime && echo $CONTAINER_TIMEZONE > /etc/timezone
- # Download tools and prerequisites
- RUN apt-get update && \
- apt-get install -y curl git unzip bzip2 build-essential gcc-multilib srecord pkg-config python3 libusb-1.0.0 python-is-python3 && \
- apt-get clean all
- # Download and install ARM toolchain matching the SDK
- RUN curl -SL https://armkeil.blob.core.windows.net/developer/Files/downloads/gnu-rm/9-2019q4/gcc-arm-none-eabi-9-2019-q4-major-x86_64-linux.tar.bz2 > /tmp/gcc-arm-none-eabi-9-2019-q4-major-linux.tar.bz2 && \
- tar xvjf /tmp/gcc-arm-none-eabi-9-2019-q4-major-linux.tar.bz2 -C /usr/local/ && \
- rm /tmp/gcc-arm-none-eabi-9-2019-q4-major-linux.tar.bz2
- # Download NRF5 SDK v16.0.0 and extract nRF5 SDK to/nrf5/sdk/v16.0
- RUN curl -SL http://developer.nordicsemi.com/nRF5_SDK/nRF5_SDK_v16.x.x/nRF5_SDK_16.0.0_98a08e2.zip > /tmp/SDK_16.0.0.zip && \
- mkdir -p /nrf5/sdk/v16.0 && \
- unzip -q /tmp/SDK_16.0.0.zip -d /nrf5/sdk/v16.0 && \
- rm /tmp/SDK_16.0.0.zip
- # Patch around what is likely to be an oversight in Nordic's SDK
- # https://devzone.nordicsemi.com/f/nordic-q-a/68352/gcc-toolchain-version-for-sdk-17-0-2-on-posix
- RUN \
- echo "GNU_INSTALL_ROOT ?= /usr/local/gcc-arm-none-eabi-9-2019-q4-major/bin/" > /nrf5/sdk/v16.0/components/toolchain/gcc/Makefile.posix && \
- echo "GNU_VERSION ?= 9.2.1" >> /nrf5/sdk/v16.0/components/toolchain/gcc/Makefile.posix && \
- echo "GNU_PREFIX ?= arm-none-eabi" >> /nrf5/sdk/v16.0/components/toolchain/gcc/Makefile.posix
- # Add micro-ecc to SDK and build it
- RUN curl -SL https://github.com/kmackay/micro-ecc/archive/v1.0.zip > /tmp/micro-ecc_v1.0.zip && \
- unzip -q /tmp/micro-ecc_v1.0.zip -d /nrf5/sdk/v16.0/external/micro-ecc && \
- mv /nrf5/sdk/v16.0/external/micro-ecc/micro-ecc-1.0 /nrf5/sdk/v16.0/external/micro-ecc/micro-ecc && \
- make -C /nrf5/sdk/v16.0/external/micro-ecc/nrf51_armgcc/armgcc && \
- make -C /nrf5/sdk/v16.0/external/micro-ecc/nrf51_iar/armgcc && \
- make -C /nrf5/sdk/v16.0/external/micro-ecc/nrf51_keil/armgcc && \
- make -C /nrf5/sdk/v16.0/external/micro-ecc/nrf52hf_armgcc/armgcc && \
- make -C /nrf5/sdk/v16.0/external/micro-ecc/nrf52hf_iar/armgcc && \
- make -C /nrf5/sdk/v16.0/external/micro-ecc/nrf52hf_keil/armgcc && \
- make -C /nrf5/sdk/v16.0/external/micro-ecc/nrf52nf_armgcc/armgcc && \
- make -C /nrf5/sdk/v16.0/external/micro-ecc/nrf52nf_iar/armgcc && \
- make -C /nrf5/sdk/v16.0/external/micro-ecc/nrf52nf_keil/armgcc && \
- rm /tmp/micro-ecc_v1.0.zip
- # JLink and debug setup
- COPY JLink_Linux_V760f_x86_64.deb /tmp/
- RUN apt install -y /tmp/JLink_Linux_V760f_x86_64.deb && \
- apt install -y libncurses5
- # Install nRF Tools (makes it easy to build a DFU package)
- RUN apt-get update && apt-get install -y python3-pip && \
- pip install nrfutil
- # Install nRF programming tools
- RUN curl -SL https://www.nordicsemi.com/-/media/Software-and-other-downloads/Desktop-software/nRF-command-line-tools/sw/Versions-10-x-x/10-15-2/nrf-command-line-tools_10.15.2_amd64.deb > /tmp/nrf-cli.deb && \
- dpkg -i /tmp/nrf-cli.deb
- # The environment variables
- ENV GCC_PATH /usr/local/gcc-arm-none-eabi-9-2019-q4-major
- ENV NRF_PATH /nrf5/sdk
Advertisement
Add Comment
Please, Sign In to add comment