MicroMod nRF52840 Processor Hookup Guide

Pages
Contributors: El Duderino, MAKIN-STUFF
Favorited Favorite 1

Arduino Software Setup

In this section we'll outline how to install the MicroMod nRF52840 board definitions and drivers. As we mentioned in the Hardware Overview section, the nRF52840 Processor ships with the same bootloader found on the Arduino Nano 33 BLE and takes advantage of Arduino's Mbed Core but we'll need to modify the board files a bit to add the MicroMod nRF52840 Processor to Arduino.

Arduino Mbed Core Installation

Heads up! If this is your first time using Arduino IDE or board add-ons, please review the following tutorials.

Before we can use the nRF52840 Processor, we need to install the Arduino Mbed Core. The easiest way to do that is to use the Boards Manager tool in Arduino. Open the tool by navigating to the Tools > Boards menu and select Boards Manager at the top of the list. With the Boards Manager tool opened, search for "Arduino Nano 33 BLE", select the board package titled "Arduino mbed-enabled Boards" and click "Install".

Heads Up! The board package used for this guide has been depreciated by Arduino. SparkFun is aware of compile errors caused by this update and we are working on a fix. This section will be updated once that is completed. In the meantime, using v1.3.1 of the Arduino mbed-enabled Boards package still works.

Arduino Boards Manager Tool with Arduino Mbed Core shown installed.

Installation may take a few minutes as all necessary source files for the Mbed Core, plus all of the compiler and software-upload tools needed to use the boards package with Arduino, are included with this install.

Once the board definitions have been installed, you should see a new set of Arduino Mbed OS Boards under your Tools > Board menu. However, you won't see an option for the SparkFun MicroMod nRF52840 Processor as we need to manually add the board to the Arduino Mbed OS board package.

Adding the MicroMod nRF52840 Board Definition

Now that the Arduino Mbed Core is installed, we need to modify it to add the MicroMod nRF52840 Processor. To do this we need to add and replace a few files in the Arduino Mbed Core.

If you are familiar with modifying an Arduino boards package with a custom board, you can skip the following instructions and use the links below to get the necessary files from the Hardware GitHub repo.

To modify the Arduino Mbed Core we need the necessary files from the nRF52840 Processor Hardware GitHub Repository. You can download the repository from the GitHub following the link above or you can download the repository in a ZIP by clicking the button below:

With the GitHub repository downloaded we need to open the Arduino Mbed Core folder. If you used the Boards Manager tool to install it, the folder should be in the following location:

  • Windows: %LOCALAPPDATA%\Arduino15\packages\arduino\hardware\mbed\<version>
  • OSX: ~/Library/Arduino15/packages/arduino/hardware/mbed/<version>
  • Linux: ~/.arduino15/packages/arduino/hardware/mbed/<version>

If you installed the core manually into your Arduino sketchbook, it will be in "hardware/arduino/mbed".

Note: Windows users struggling to locate the AppData folder should make sure they have their View settings to show Hidden Items and are logged in as an administrative user.

Open the folder with the version number (v1.3.1 at the time of this writing). We need to replace or modify the boards.txt file and add the SF_MM_nRF52840_PB folder to the Variants folder.

To replace the boards.txt file simply delete the boards.txt file in the mbed/<version> folder and copy/paste the boards.txt file from the nRF Hardware GitHub Repository folder. Alternatively, you can modify the boards.txt in the mbed/<version> folder by opening the file in a text editor, scrolling to the bottom of the file and copy/pasting the below to the file:

language:text
##############################################################

sfnrf52840pb.name=SparkFun MicroMod nRF52840 Processor Board
sfnrf52840pb.build.core=arduino
sfnrf52840pb.build.crossprefix=arm-none-eabi-
sfnrf52840pb.build.compiler_path={runtime.tools.arm-none-eabi-gcc.path}/bin/

sfnrf52840pb.build.variant=SF_MM_nRF52840_PB
sfnrf52840pb.build.mcu=cortex-m4
sfnrf52840pb.build.extra_flags=
sfnrf52840pb.build.architecture=cortex-m4
sfnrf52840pb.build.fpu=fpv4-sp-d16
sfnrf52840pb.build.float-abi=softfp
sfnrf52840pb.build.board=ARDUINO_NANO33BLE
sfnrf52840pb.build.ldscript=linker_script.ld
sfnrf52840pb.compiler.mbed.arch.define=-DARDUINO_ARCH_NRF52840
sfnrf52840pb.compiler.mbed.defines={build.variant.path}/defines.txt
sfnrf52840pb.compiler.mbed.ldflags={build.variant.path}/ldflags.txt
sfnrf52840pb.compiler.mbed.cflags={build.variant.path}/cflags.txt
sfnrf52840pb.compiler.mbed.cxxflags={build.variant.path}/cxxflags.txt
sfnrf52840pb.compiler.mbed.includes={build.variant.path}/includes.txt
sfnrf52840pb.compiler.mbed.extra_ldflags=-lstdc++ -lsupc++ -lm -lc -lgcc -lnosys
sfnrf52840pb.compiler.mbed="{build.variant.path}/libs/libmbed.a" "{build.variant.path}/libs/libcc_310_core.a" "{build.variant.path}/libs/libcc_310_ext.a" "{build.variant.path}/libs/libcc_310_trng.a"
sfnrf52840pb.vid.0=0x2341
sfnrf52840pb.pid.0=0x005a
sfnrf52840pb.vid.1=0x2341
sfnrf52840pb.pid.1=0x805a

sfnrf52840pb.upload.tool=bossac
sfnrf52840pb.upload.protocol=
sfnrf52840pb.upload.use_1200bps_touch=true
sfnrf52840pb.upload.wait_for_upload_port=true
sfnrf52840pb.upload.native_usb=true
sfnrf52840pb.upload.maximum_size=983040
sfnrf52840pb.upload.maximum_data_size=262144

sfnrf52840pb.bootloader.tool=openocd
sfnrf52840pb.bootloader.extra_action.preflash=echo INFO:removed_mass-erase
sfnrf52840pb.bootloader.config=-f target/nrf52.cfg
sfnrf52840pb.bootloader.programmer=-f interface/cmsis-dap.cfg
sfnrf52840pb.bootloader.file=nano33ble/bootloader.hex

With the boards file updated or replaced, add the SF_MM_nRF52840_PB folder to mbed/<version>/variants.

Screenshot of SparkFun nRF52840 Variant folder added to Arduino mbed Variant folder.

After completing these steps, restart the Arduino IDE if it was open. After restarting, you should be able to select "SparkFun MicroMod nRF52840 Processor Board" from the Boards menu.