Skip to content

Latest commit

 

History

History
105 lines (82 loc) · 4.09 KB

readme.md

File metadata and controls

105 lines (82 loc) · 4.09 KB

Install build-tools


Install platform-tools


@todo Make GNU tools automated download/docker dependency

  • Nordic nRF52 SDK is automatically downloaded from the Cmake, if you have it pre-installed define environment variable nRF5_SDK_ROOT={path-to-SDK}

Install programming-tools

Serial DFU

JTag FLash

Build

Powershell:

mkdir -p build
cd build
cmake -G Ninja ..
cmake --build . --target flash_nrf52_Test_App1

Program

JTag Flash

Each executable shall have an associated target 'flash_*'

DFU

@todo Make CMake target Example flashing BOTH SoftDevice+Application command to package and flash the 'merge' binary

cmake --build . -t merge
nrfutil pkg generate --hw-version 52 --sd-req 0x80 --application-version 4 --application test_app1/test_app1_merged.hex dfu_test.zip
nrfutil dfu serial -pkg dfu_test.zip -p COM3

... Or Adafruit tool:

cmake --build . -t merge
adafruit-nrfutil dfu genpkg --dev-type 0x0052 --application test_app1/test_app1_merged.hex dfu_test.zip
adafruit-nrfutil dfu serial --package dfu_test.zip -p COM3 -b 115200

nRF52 CMake Library Tree

    Application
       |  |
nRF5_SDK   SOFTDEVICE(s132_7.0.1)
    |        |  
  BOARD(pca10040) 
         |
PLATFORM(nrf52832_xxAA) 
         |
  ARCH(cortex-m4f)

Troubleshooting

Undefined reference to `SystemInit'

  • During link of application i.e nrf52_Test_App1
  • gcc_startup_nrf52.S ASM file references function called 'SystemInit' which is not part of the build
$GNU Tools/.../bin/../lib/gcc/arm-none-eabi/9.2.1/../../../../arm-none-eabi/bin/ld.exe: ../libnrf52832_xxAA.a(gcc_startup_nrf52.S.obj): in function `Reset_Handler':
$nRF5_SDK_16.0.0_98a08e2/modules/nrfx/mdk/gcc_startup_nrf52.S:272: undefined reference to `SystemInit'

Problem

PLATFORM (e.g. nrf52832_xxAA) links in gcc_startup_nrf52.S for startup sequence but depends on the 'SystemInit' function that is defined system_nrf52.c by the BOARD (e.g. pca10040)

Solution

PLATFORM shall supply gcc_startup_nrf52.S as PUBLIC for linkage further up the dependency chain.