-
Notifications
You must be signed in to change notification settings - Fork 598
Flashing nRF with OpenOCD ST Link
Some nRF chips in a small form factor need to be flashed manually. Either by using a J-Link (which can be expensive) or a cheaper ST-Link in combination with openocd.
-
Connect the pins to the correct ST-Link pins. A sample schematic of an nRF52 Beacon can be found below
-
Build your firmware with the correct keys
-
Run
openocdwith the correct configurationopenocd -f share/openocd/scripts/interface/stlink.cfg -f share/openocd/scripts/target/nrf52.cfg
The first parameter here uses the configuration file for the connected interface (stlink-v2) and the second parameter loads the config file for the nrf52 boards
-
Now
openocdis running. You can connect to it using telnet:telnet localhost 4444
5.1 You can get all available commands using the help command
6. Stop the execution with halt
7. You can backup the existing firmware:
bash dump_image /Your/File/Path/flash.bin 0 0x40000`
8. Erase the flash using
nrf5 mass_erase