How to Flash a Firmware with OpenOCD
This is a guide for flashing images for Redox Wireless rev2.0WHS. This should apply to other similar keyboards that uses nRF51.
Clone or download the precompiled images at https://github.com/mattdibi/redox-w-firmware
Connect a programmer to the board pin header with 3.3V, GND, CLK, IO.
Run
openocd -f interface/cmsis-dap.cfg -f target/nrf51.cfgReplace interface/cmsis-dap.cfg according to the programmer you use. For example, if you use an ST-LINK/V2, you should use interface/stlink-v2.cfg.
The terminal should show
Open On-Chip Debugger 0.11.0
Licensed under GNU GPL v2
For bug reports, read
http://openocd.org/doc/doxygen/bugs.html
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 = 2.0.0
Info : CMSIS-DAP: Interface Initialised (SWD)
Info : SWCLK/TCK = 1 SWDIO/TMS = 1 TDI = 1 TDO = 0 nTRST = 0 nRESET = 1
Info : CMSIS-DAP: Interface ready
Info : clock speed 1000 kHz
Info : SWD DPIDR 0x0bb11477
Info : nrf51.cpu: hardware has 4 breakpoints, 2 watchpoints
Info : starting gdb server for nrf51.cpu on 3333
Info : Listening on port 3333 for gdb connectionsOpen another terminal and run
It shows
So now, we can send commands
The terminal should show
Another way to flash the image is to run
The terminal should show
You should also flash the right side, and the receiver with the respective image file.
If you prefer to flash it without telnet, you can use the -c flag with openocd, so you can flash an image with a one-liner command.
Links
Last updated
Was this helpful?