This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

How to compile SDK13 examples for nrf52832

For the last few months, I've been building code and testing it on an nRF52840 PDK. Our production hardware, however, will use the nRF52832, and so I need to compile my code against a different target, and program it on a custom board.

I tried to start simple: the blinky example. I can get the project to compile by replacing "52840" in the Makefile with "52832", and adding the following two lines in their respective sections:

CFLAGS += -DNRF52
ASMFLAGS += -DNRF52

Also, these lines were modified to point at the generic nrf52 rather than nrf52840 files:

SRC_FILES += \
 ...
  $(SDK_ROOT)/components/toolchain/gcc/gcc_startup_nrf52.S \
  $(SDK_ROOT)/components/toolchain/system_nrf52.c \

With those changes, the example compiles just fine, but when I program it to the custom board, nothing visible happens. If I try to debug it in Eclipse, it hardfaults:

Thread #1 57005 (Suspended : Signal : SIGTRAP:Trace/breakpoint trap)	
	HardFault_Handler() at 0x1792	
	<signal handler called>() at 0xfffffff9	
	__isr_vector() at 0x0	

Is there a tutorial, or some sort of instructions, for successfully running the examples in the SDK on the nRF52832? I feel like I'm missing something simple.

Related