nRF52805 — Build and Develop Quickstart with Pre-loaded Development Image

Build and flash nRF52805 hardware with a pre-loaded VM image that includes the nRF52805 toolchain right out of the box

Jason L
3 min readJan 24, 2023
nRF52805 WLCSP chip

If you’re here you probably have the nRF52805 or other nRF52 custom hardware and have found that the setup instructions out there are outdated or are just running into issues with versions.

This article provides a known good VirtualBox VM Linux (Ubuntu) image with the minimal needed nRF52805 toolchain already baked in so you can test and program your board with a working Bluetooth example immediately out of the box without headache.

Prerequisites

  • nRF52805 Hardware
  • Segger J-Link Programmer (or nRF52 DK with onboard J-Link)

Virtual Box Setup

  1. Download and install VirtualBox Software. At the time of this writing the latest VirtualBox version is 7.0.6–155176.
  2. Download and install VirtualBox Extension Pack. At the time of this writing the latest ExtPack is 7.0.6.
  3. Open VirtualBox and click “New” to create a new Virtual OS.
  4. Virtual Machine Name — Enter anything for “Name” and do not select an ISO Image. Select “Linux” and “Ubuntu (64-Bit)” in the dropdowns and click “Next”.
  5. Hardware — Allocate the memory you would like (>2048 MB is best) and leave processors at 1 CPU
  6. Virtual Hard Disk — Now click “Use an Existing Virtual Hard Disk File”. Click folder icon to open a Hard Disk Selector prompt and find your “Ubuntu20_nRF.vdi” image extracted from the zip that was provided and finish the setup.
  7. Now before launching your image, click “Settings → Display” and change Video Memory to 128MB for the image.
  8. Hit “Start” to launch your Ubuntu VirtualBox loaded with all necessary nRF52805 developer tools for building and flashing. The sudo password is “nrf”.

Building and Flashing an nRF52805 BLE Example

We are going to flash a working bluetooth example for the nRF52805 with the Ubuntu VirtualBox now launched.

1. Connect your Segger J-Link programmer to your development machine. In order for the VirtualBox VM to use the programmer, in the VirtualBox Menu at the top of the Ubuntu screen, use “Devices → USB” to select Segger J-Link [xxxx].

2. So that the VM will automatically connect to the programmer in the future, use “Devices → USB → USB Settings…” and click on the plus icon to Add Segger J-Link [xxxx] into the USB Device Filters list.

3. Now open a terminal and navigate to the ble_app_uart example:

cd ~/Documents/nrf5_sdk/examples/ble_peripheral/ble_app_uart/pca10040e_nrf52805/s112/armgcc

4. With the J-Link connected to your target board, enter the following commands into the terminal:

make erase
make flash_softdevice
make flash

5. The nRF52805 hardware is now successfully flashed and with the mobile “nRF Connect” app, you can verify that the nRF52 is now advertising with the device name “Nordic UART”. To use this example as a starting point just use the main.c file in pca10040e_nrf52805 directory.

Troubleshooting and Other Notes

  • Your J-Link may need to be updated with the latest J-Link firmware during the initial erase. Please make sure that you have set the USB Device Filters, you may also need to set it again after the J-Link is updated to have it automatically connect
  • For this example you will need to use J-Link but I may add support for CMSIS-DAP with OpenOCD or other programming toolchains.
  • Instead of developing inside the desktop of the virtual image, I would suggest using SSH or VScode with SSH as your IDE as the main way of interacting with the VM image.
  • This example is specifically for the nRF52805 chip but you can use the other examples within the provided folder to do development for other nRF52 chips such as the nRF52840, nRF52810, etc. This also works with modules using the chip such as the Fanstel BC805M, Raytac MDBT42T or MDBT42TV, etc.
  • The toolchain for the provided image uses nRF SDK 17.0.0 and gcc-arm-none-eabi-10.3

--

--