Blinky nRF52

dev board Adafruit Feather Bluefruit
chip nRF52

Before starting

Dependancies

Ensure the following requirements are available:

Description

Create a blinky LED with Adafruit Bluefruit nRF52 breakout board.

Ensure the boards URL is added in Arduino IDE / CLI:

https://www.adafruit.com/package_adafruit_index.json

To use command line arduino-cli, install Adafruit nRF52 nrfutil with pip3:

pip3 install --user adafruit-nrfutil

Code

Download code
void setup() {
  Serial.begin(9600);
  while (!Serial) {}

  pinMode(LED_BUILTIN, OUTPUT);
}

void loop() {
  Serial.println("HIGH");
  digitalWrite(LED_BUILTIN, HIGH);
  delay(1000);

  Serial.println("LOW");
  digitalWrite(LED_BUILTIN, LOW);
  delay(1000);
}

Makefile

BOARD?=adafruit:nrf52:feather52832
PORT?=/dev/tty.SLAB_USBtoUART
BUILD=build
# Arduino CLI version 0.14.0 is used.

.PHONY: default lint all flash clean

default: lint all flash clean

lint:
	cpplint --extensions=ino --filter=-legal/copyright *.ino

all:
	arduino-cli compile --fqbn $(BOARD) --output-dir $(BUILD) ./

flash:
	adafruit-nrfutil dfu genpkg --dev-type 0x0052 --application $(BUILD)/*.hex dfu-package.zip
	adafruit-nrfutil dfu serial --package dfu-package.zip -p $(PORT) -b 115200

clean:
	rm -rf build
	rm dfu-package.zip

Serial console

Serial output from the firmware.

Blinky nRF52 serial console

Arduino IDE settings

Ensure the following IDE settings before flashing.

Blinky nRF52 Arduino IDE settings

Prototype

A photo of the actual setup.

Blinky nRF52 prototype

References

Watch