MCU flashing guide
Synced from upstream — do not edit this file directly
This page is generated from
CARSSCenter/OpenNerve-Implantable-Pulse-Generator at Docs/MCU-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.
MCU Firmware compiling and flashing guide¶
Alex Baldwin 1/14/2026
Overview¶
The OpenNerve PCB has two microcontrollers: an STM32U5 MCU (referred to as “MCU” throughout documentation) which handles the majority of functions, and an nRF52810 (referred to as “BLE”) which handles Bluetooth Low Energy communication. This guide will describe how to compile and program (“flash”) the firmware for MCU. To open and edit the firmware source code for MCU you will need to download and install the free STM32Cube IDE (https://www.st.com/en/development-tools/stm32cubeide.html). Once you have done that follow these steps to open the project in the IDE:
- File -> import
- General -> Existing Projects into Workspace
- “Select root directory” -> point at the folder that contains FW-NIH-MCU-H2
- Make sure the project FW-NIH-MCU-H2 is checked
- Hit finish
To compile the firmware, go to Project -> Build Project or use the hammer icon at the top of the IDE. Choose “MCU” under Build Configurations, unless you are performing DVT tests or Unit Tests. A folder called “MCU” will be generated, unless it already exists. Inside that folder you will find FW-NIH-MCU-H2.hex.
MCU Flashing¶
To flash firmware to MCU, you must first download the free STM32Cube Programmer (https://www.st.com/en/development-tools/stm32cubeprog.html). You must also purchase an STLink-V3Minnie (https://www.mouser.com/ProductDetail/STMicroelectronics/STLINK-V3MINIE?qs=MyNHzdoqoQKcLQe5Jawcgw%3D%3D).
Step 1. Attach the STLink-V3 by USB to your computer and confirm that the COM port and ST-Link Debug entries are correct in the Device Manager.
Step 2. Connect the STLink’s cable to the “MCU” connector on OpenNerve. The cable will need to be correctly centered in its connector, and will be wider than the connector.
Step 3. Apply USB power to OpenNerve board, ensuring that a jumper is placed between VCHG_RAIL and the outside pin of VBAT2R to bypass the magnetic switch.
Step 4. Open STM32Cube Programmer. First, connect to the board using the STLink. Second, Erase the existing firmware. Third, Open the .hex file. Fourth, Download the hex file’s code to the MCU.
Step 5. Press the Reset button on OpenNerve to reboot the board and start using your code.