This directory contains the build system for compiling the EPD-nRF5 firmware for nRF52 devices on Linux using ARM GCC.
On Arch/Manjaro:
sudo pacman -S arm-none-eabi-gcc arm-none-eabi-binutils arm-none-eabi-newlibOn Ubuntu/Debian:
sudo apt-get install gcc-arm-none-eabi binutils-arm-none-eabiOr download from ARM:
- Download from: https://developer.arm.com/tools-and-software/open-source-software/developer-tools/gnu-toolchain/gnu-rm
- Extract and add to PATH, or set
GNU_INSTALL_ROOTin the Makefile
On Arch/Manjaro:
sudo pacman -S nrf-command-line-toolsOn Ubuntu/Debian:
- Download from: https://www.nordicsemi.com/Software-and-tools/Development-Tools/nRF-Command-Line-Tools
- Or install via package manager if available
Verify installation:
mergehex --version
nrfjprog --versionarm-none-eabi-gcc --versionShould show version 9.x or later.
From the build-nrf52 directory:
makeThis will:
- Compile all source files
- Link the firmware
- Generate
_build/EPD-nRF52.hex(application only) - Generate
_build/EPD-nRF52.bin(binary format) - Generate
_build/EPD-nRF52.map(memory map)
To create a complete firmware file that includes bootloader, softdevice, and application:
make fullThis creates _build/EPD-nRF52-full.hex which can be flashed directly to a blank chip.
For this bootloader flow, make full also generates:
_build/EPD-nRF52-settings.hex(bootloader settings page)_build/EPD-nRF52-ota.zip(signed OTA package)
make full requires:
nrfutilavailable and working- A private signing key matching the bootloader public key
By default it expects ../tools/priv.pem. Override with:
make full KEY_FILE=/absolute/path/to/priv.pemOther merge options:
# Softdevice + Application (no bootloader)
make sd
# MBR + Softdevice + Application (no bootloader, with MBR)
make mbr-sdIf your ARM GCC toolchain is not in /usr/bin, you can override it:
make GNU_INSTALL_ROOT=/path/to/toolchain/binmake cleanmake helpAfter building, you'll find in _build/:
EPD-nRF52.hex- Application only (Intel HEX format)EPD-nRF52.bin- Application binary formatEPD-nRF52.out- ELF executableEPD-nRF52.map- Linker memory map
After running make full, you'll also have:
EPD-nRF52-full.hex- Complete firmware (Bootloader + SoftDevice + Application)EPD-nRF52-sd.hex- SoftDevice + Application (if you ranmake sd)EPD-nRF52-mbr-sd.hex- MBR + SoftDevice + Application (if you ranmake mbr-sd)
If you built the complete firmware with make full:
# Erase chip
nrfjprog --eraseall
# Flash complete firmware (bootloader + softdevice + application)
nrfjprog --program _build/EPD-nRF52-full.hex
# Reset
nrfjprog --reset# Erase chip
nrfjprog --eraseall
# Flash softdevice (only needed once)
nrfjprog --program ../SDK/17.1.0_ddde560/components/softdevice/s112/hex/s112_nrf52_7.3.0_softdevice.hex
# Flash bootloader (only needed once)
nrfjprog --program ../tools/bootloader/bl_nrf52811_xxaa_s112.hex
# Flash application
nrfjprog --program _build/EPD-nRF52.hex
# Reset
nrfjprog --reset# Flash application only
nrfjprog --program _build/EPD-nRF52.hex --sectorerase
# Reset
nrfjprog --reset# Connect and flash complete firmware
JLinkExe -device nRF52811 -if SWD -speed 4000 -autoconnect 1
loadfile _build/EPD-nRF52-full.hex
r
g
exit# Flash complete firmware
openocd -f interface/jlink.cfg -f target/nrf52.cfg \
-c "program _build/EPD-nRF52-full.hex verify reset exit"The Makefile is configured for nRF52811_xxAA. To change the target:
- Update
CFLAGSto change theNRF52811_XXAAdefine - Update the linker script path in
LDFLAGS - Update the startup file in
ASM_FILES
Currently configured for SoftDevice S112 (v7.3.0). The linker script automatically accounts for the softdevice memory layout.
-
Flash: 0x00000000 - 0x00030000 (192 KB total)
- SoftDevice: 0x00000000 - 0x00019000 (100 KB)
- Application: 0x00019000 - 0x00030000 (92 KB)
-
RAM: 0x20000000 - 0x20006000 (24 KB)
- SoftDevice: 0x20000000 - 0x200022D8
- Application: 0x200022D8 - 0x20006000
Install the ARM GCC toolchain (see Prerequisites).
- Check that all source files are included in
SRC_FILES - Verify include paths in
INC_FOLDERS - Check that the linker script path is correct
- Verify that
PROJECT_ROOTandSDK_ROOTpaths are correct - Check that source files exist at the specified paths
Your nrfutil Python package is incomplete/broken. Reinstall it, for example:
python3 -m pip install --user --upgrade nrfutil- Ensure the softdevice hex file is flashed first
- Check that all required SDK components are included
- Verify compiler defines match the Keil project configuration
build-nrf52/
├── Makefile # Build configuration
├── README.md # This file
└── _build/ # Build output (generated)
├── EPD-nRF52.hex
├── EPD-nRF52.bin
├── EPD-nRF52.out
└── EPD-nRF52.map
This Makefile uses:
- GCC instead of ARMCC/Keil compiler
- GCC-specific files:
app_error_handler_gcc.cinstead ofapp_error_handler_keil.cSEGGER_RTT_Syscalls_GCC.cinstead ofSEGGER_RTT_Syscalls_KEIL.c
- GNU linker with GCC linker script format
- Standard Make instead of Keil's build system
The output should be functionally equivalent to the Keil build.