Ubuntu Linux

Install toolchain

Install the gcc toolchain by downloading the correct version from the ARM download page. Extract the toolchain to somewhere practical, say /home/${USER}/tools/gnu-toolchain. To be able to use it in different build steps you must either add it permanently to you path by adding the download path to $PATH in /etc/environments or run an export of $PATH locally when playing in the CLI. You can do that by typing:

export PATH="/home/${USER}/tools/gnu-toolchain/bin:$PATH"

You will now have the toolchain available until you close the terminal window. The reasoning behind not adding it permanently to your path might be that you have multiple versions of the toolchain installed and will break other existing installs if you overwrite the global $PATH.

Install git

Install git via Aptitude. If you want, you can add the ppa for the latest and greatest, but the repository version should also be good:

sudo apt-get install git

Install SDK

Download the nRF52 11.x SDK from Nordic Semiconductors and install it into a suitable location (The default for the Makefile is /home/${USER}/sdk/nrf52/11 but any location will do.

Pull the latest version of the EE-02 firmware

Open a command prompt and clone the firmware. We’re putting it into ~/git/ee0x-firmware:

cd ~/git
git clone https://github.com/telenordigital/ee0x-firmware.git
cd ee0x-firmware

Update the Makefile with the correct paths

The default paths in the Makefile must be set up for your environment. Open the file in your favorite editor and look for the lines with

  • GNU_INSTALL_ROOT - This is the location for the gcc toolchain. Use the path to wherever you extracted the tool. Note: Avoid using spaces in the path as the tool is sensitive towards spaces and escaping of characters in the install root path.
  • FLASH_DRIVE - this is the name of the flash drive the Segger programmer will appear as. Typically this will be /media/${USER}/JLINK.
  • NRF52_SDK_ROOT - the location where you unzipped the nRF SDK files. The full path has to be set or else the make script fails.
# =============================================================================
# Tool chain settings
GNU_INSTALL_ROOT := /home/${USER}/tools/gnu-toolchain
GNU_VERSION      := 4.9.3
GNU_PREFIX       := arm-none-eabi

# =============================================================================
# Directories
FLASH_DRIVE    := /media/$(USER)/JLINK
NRF52_SDK_ROOT := /home/$(USER)/sdk/nrf52/11
TEMPLATE_PATH  := $(NRF52_SDK_ROOT)/components/toolchain/gcc

Build the firmware

You are now ready to build the firmware. Open a command prompt, go to the directory with the firmware and type make:

cd ~/git/ee0x-firmware
info Note

You might see some warnings about that use of wchar_t values across objects may fail. As long as the file nrf52lora.hex is there you’ve completed the installation.

Congratulations, you’ve now installed what you need for the firmware!