Skip to content

BLE flashing guide

Synced from upstream — do not edit this file directly

This page is generated from CARSSCenter/OpenNerve-Implantable-Pulse-Generator at Docs/BLE-Flashing-Guide.md as of commit 7ab3cd3. To change it, edit the file upstream and re-run tools/sync_docs.py. Use the "Edit this page" link above to go straight to the upstream source.

Overview

This document describes how to flash the nRF52810 microcontroller (referred to as "BLE") on the OpenNerve Gen1 and Gen2 boards. Before beginning you must have the .hex file; the most recent valid firmware version is FW-BLE-250409.hex and can be found in the folder FW-BLE.

Materials needed

  • J-Link EDU Mini (https://shop-us.segger.com/product/j-link-edu-mini-8-08-91/)
  • J-Link software (https://www.segger.com/downloads/jlink)
  • nRF Connect for Desktop (https://www.nordicsemi.com/Products/Development-tools/nRF-Connect-for-Desktop/Download#infotabs)

Important Note

Power to BLE is turned on by a GPIO pin from MCU (BLE_PWRn). During MCU's startup sequence in Production mode it activates power to BLE and then polls the BLE_RDY line waiting for the nRF52810 to signal that it is ready. If BLE_RDY does not go high, the firmware continuously resets BLE (via BLE_RSTn) in a ~250 ms cycle while refreshing the IWDG (configured for a 4-second timeout) — so the watchdog never fires and the reset loop runs indefinitely. The net effect is that if MCU is flashed but BLE has not yet been flashed, MCU will hold BLE in a reset loop and never proceed to normal operation, preventing BLE from being flashed. There are several ways to work around this: 1. Flash MCU with the DVT version of firmware, then flash BLE, then re-flash MCU with Production firmware 2. Connect to MCU using an STLink and start it up in debug mode, adding a breakpoint after it sets BLE_PWRn high to maintain that state while flashing BLE 3. Physically connect the +VDD and +VDD_BLE nets, eliminating the need for MCU to power BLE. This can be easily done using a jumper wire with the female end attached to the DVDD pin J1300 and the male end inserted into the first port of the JLink's ribbon cable, or by soldering a wire to VDD_BLE at TP401.

Jumper Wire DVDD BLE

Setup

Step 1: When installing the J-Link software, ensure that the box for "Install legacy USB driver" is checked

image

When first connecting the J-Link EDU Mini to a computer, you can confirm that the driver is installed by checking Device Manager under USB Devices

image image

If the J-Link driver is not in USB devices, Start J-Link Configurator, right click on J-Link EDU Mini, Update FW -> Configure -> Select WinUSB driver -> OK

image

Step 2: Download and run nRF Connect for Desktop, and install Programmer.

image

Flashing BLE Firmware

Attach cables Attach the J-Link EDU Mini ribbon cable to the BLE J-Tag headers. Attach a jumper between VUSB and VCHG_RAIL. Apply power via USB-C.

OpenNerveBLE2

Connect and Flash: Open Programmer in nRF Connect. Select J-Link. Add the BLE hex file. Click Erase & Write.

image

Debugging

For debugging, load the file "UICR_APPROTECT_HwDisabled.hex" to disable AP Protection. The BLE firmware .hex file used for production does not include this hex file, so AP Protection remains enabled.

Please refer to the figure below for the SEGGER Embedded Studio configuration settings.

image