-
Notifications
You must be signed in to change notification settings - Fork 3
02 ‐ Developer quick start
- Recommended: Ubuntu/Debian Linux or WSL2 (Windows Subsystem for Linux)
- Windows: Possible with adapted tools (ARM GCC for Windows, nRF Command Line Tools for Windows), but not officially supported. Use WSL2 for the best experience.
-
Docker: A
Dockerfileis provided with all tools pre-installed (see below).
- Git
- ARM GCC Toolchain (gcc-arm-none-eabi 10.3-2021.10)
- CMake 3.13+
-
nRF5 SDK 17.0.2 (included in
ports/nrf52840/drivers/) - nrfjprog + mergehex (nRF Command Line Tools, for flashing)
- nrfutil + nrf5sdk-tools plugin (for DFU package generation)
- J-Link (for SWD flashing)
All tools above (except Git and J-Link hardware) can be installed automatically with the setup script (see below).
git clone <repository-url> linkit-v4-core
cd linkit-v4-coreThe setup script detects, downloads, and configures everything needed:
./scripts/setup_environment.shOr for non-interactive (auto-install everything):
./scripts/setup_environment.sh --autoThis will:
- Install ARM GCC Toolchain 10.3 (downloaded from ARM, not apt)
- Install build tools (
make,cmake,ninja,crc32,xxd) - Install nrfutil + nrf5sdk-tools plugin (for DFU builds)
- Install nRF Command Line Tools (
nrfjprog,mergehex) - Generate
build_config.shwith detected tool paths - Update
.vscode/tasks.jsonwith correct PATH - Update SDK
Makefile.posixwith toolchain paths
Use the build scripts for each board variant:
LinkIt V4 with KIM (default)
./scripts/build_linkitv4_kim.sh
LinkIt V4 with SMD
./scripts/build_linkitv4_smd.sh
LinkIt V4 with LoRa
./scripts/build_linkitv4_lora.sh
RSPB
./scripts/build_rspb.shOr build manually with CMake (see Building for all options):
mkdir -p ports/nrf52840/build/LINKIT && cd ports/nrf52840/build/LINKIT
cmake -DCMAKE_TOOLCHAIN_FILE=../../toolchain_arm_gcc_nrf52.cmake \
-DBOARD=LINKIT -DENABLE_AXL_SENSOR=ON \
-DCMAKE_BUILD_TYPE=Debug -DDEBUG_LEVEL=4 ../..
make -j$(nproc)Each board has its own bootloader. Build it once before flashing:
LinkIt V4 bootloader
cd ports/nrf52840/bootloader/secure_bootloader/linkitv4_v1.0/armgcc
make mergehex
RSPB bootloader
cd ports/nrf52840/bootloader/secure_bootloader/rspbtracker_v1.0/armgcc
make mergehexOnce the bootloader is built, the build scripts (step 3) automatically generate a merged hex file containing bootloader + SoftDevice + application in a single file.
The merged hex is the recommended way to flash -- a single file with everything:
Flash merged hex (bootloader + SoftDevice + application)
nrfjprog --recover
nrfjprog -f nrf52 --program ports/nrf52840/build/LINKIT/LinkIt_board_merged-*.hex --sectorerase
nrfjprog -f nrf52 --resetReplace LINKIT with the appropriate build directory (LINKIT_SMD, LINKIT_LORA, RSPB) and adapt the file name accordingly (e.g., LinkIt_RSPB_board_merged-*.hex).
For development (bootloader already on device, faster iteration):
Flash application only (preserves bootloader + SoftDevice)
nrfjprog -f nrf52 --program ports/nrf52840/build/LINKIT/LinkIt_board-*.hex --sectorerase
nrfjprog -f nrf52 --resetFor DFU update over BLE (no J-Link needed), see Programming.
Connect to the device via BLE using pylinkit or the LinkIt GUI tool. DTE commands follow this format:
List all parameter keys
$PARML#000;
Read all parameters
$PARMR#000;
Read specific parameters
$PARMR#00A;GNP01,ARP01
Write a parameter
$PARMW#010;GNP01=1,ARP01=2
See DTE Commands Reference for the full command set.
| Script | Board | Communication | Build Dir |
|---|---|---|---|
scripts/build_linkitv4_kim.sh |
LinkIt V4 | KIM (Argos) | build/LINKIT/ |
scripts/build_linkitv4_smd.sh |
LinkIt V4 | SMD (Argos) | build/LINKIT_SMD/ |
scripts/build_linkitv4_lora.sh |
LinkIt V4 | LoRa RAK3172 | build/LINKIT_LORA/ |
scripts/build_rspb.sh |
RSPB | SMD (Argos) | build/RSPB/ |
scripts/build_unit_tests.sh |
- | - | tests/build/ |
All build scripts source build_config.sh (generated by setup_environment.sh) for toolchain paths.
./scripts/build_unit_tests.sh
cd tests/build && ln -sf ../data . && ./TrackerTests -vOr with the test runner script:
./scripts/run_unit_tests.shIf using VSCode, all build/flash/test tasks are available via Ctrl+Shift+B. The setup script automatically configures the PATH in .vscode/tasks.json.
A Dockerfile is provided at the project root with all build tools pre-installed (ARM GCC 10.3, nrfutil, nrfjprog, mergehex, CMake, Ninja).
docker build -t linkit-v4-build .docker run --rm -v $(pwd):/workspace linkit-v4-build ./scripts/build_linkitv4_kim.sh
docker run --rm -v $(pwd):/workspace linkit-v4-build ./scripts/build_rspb.sh
docker run --rm -v $(pwd):/workspace linkit-v4-build ./scripts/build_linkitv4_smd.sh
docker run --rm -v $(pwd):/workspace linkit-v4-build ./scripts/build_linkitv4_lora.shdocker run --rm -v $(pwd):/workspace linkit-v4-build bash -c "./scripts/build_unit_tests.sh && cd tests/build && ln -sf ../data . && ./TrackerTests -v"docker run --rm -it -v $(pwd):/workspace linkit-v4-build bashNote: Flashing via JLink is not possible from inside Docker (requires USB passthrough). Use nrfjprog on the host after building in Docker.
- Building the Project - Full CMake configuration reference
- Board Variants — Hardware specs, parameters, and configuration per board
- DTE Commands Reference - Complete command documentation
- Architecture Overview - Understand the firmware design