OpenOCD Windows

From ElectroDragon Wiki
Revision as of 22:21, 23 June 2020 by Chao (talk | contribs) (Created page with "* Get from here: https://gnutoolchains.com/arm-eabi/openocd/ * Reference to remove protect from here: https://stackoverflow.com/questions/52308978/problem-flashing-nrf52-chip-...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

Step by Step

  • Connect Hardware DAPLink 3.3V / GND / DIO / CLK / ?RST to NRF52832
  • Run OpenOCD in windows: E:\HE\Download\openocd-20200530\OpenOCD-20200530-0.10.0\bin>openocd.exe -d2 -f interface/cmsis-dap.cfg -f target/nrf52.cfg
  • And get:
Info : auto-selecting first available session transport "swd". To override use 'transport select <transport>'.
Info : Listening on port 6666 for tcl connections
Info : Listening on port 4444 for telnet connections
Info : CMSIS-DAP: SWD  Supported
Info : CMSIS-DAP: JTAG Supported
Info : CMSIS-DAP: FW Version = 1.0
Info : CMSIS-DAP: Interface Initialised (SWD)
Info : SWCLK/TCK = 1 SWDIO/TMS = 1 TDI = 1 TDO = 1 nTRST = 0 nRESET = 1
Info : CMSIS-DAP: Interface ready
Info : clock speed 1000 kHz
Info : SWD DPIDR 0x2ba01477
Error: Could not find MEM-AP to control the core
Info : starting gdb server for nrf52.cpu on 3333
Info : Listening on port 3333 for gdb connections
  • Connect by telnet with any software, and run below:
Connecting to 127.0.0.1:4444...
Connection established.
To escape to local shell, press 'Ctrl+Alt+]'.
Open On-Chip Debugger
> nrf52.dap apreg 1 0x04
0x00000000

> nrf52.dap apreg 1 0x04 0x01
> nrf52.dap apreg 1 0x04
0x00000001

> 
  • Now the protection is removed