Configuring OpenOCD for use with OSHChip

koolatron
Posts: 4
Joined: Sat Apr 09, 2016 9:21 am

Configuring OpenOCD for use with OSHChip

Postby koolatron » Mon Apr 11, 2016 4:35 am

Hi all,

I've done some work in getting OSHChip working with OpenOCD under Ubuntu Linux 15.10. I'm documenting the process here so others have the opportunity to try it too.

Right now, I only have the basics working; OpenOCD can talk to the chip and flash its contents using a .bin emitted by the arm-gcc toolchain. For this, you'll only need two things: the openocd package from current Ubuntu repositories and a config file that tells OpenOCD that we'll be talking to the OSHChip using SWD and CMSIS-DAP.

To install the openocd package, just grab it from Ubuntu's current (as of 15.10) repos:

Code: Select all

$ sudo apt-get install openocd


Next, you'll need a configuration file to tell OpenOCD how to talk to the CMSIS-DAP interface. I'm unable to attach it to this post, so here it is:

Code: Select all

# nRF51822 Target
source [find interface/cmsis-dap.cfg]
transport select swd
set WORKAREASIZE 0x400
source [find targets/nrf51.cfg]


At this point, you can now start openocd pointed at the above config

Code: Select all

$ openocd -f ./workspace/config/openocd/oshchip.cfg

Open On-Chip Debugger 0.9.0 (2015-09-02-10:42)
Licensed under GNU GPL v2
For bug reports, read
   http://openocd.org/doc/doxygen/bugs.html
Info : only one transport option; autoselect 'swd'
Warn : Transport "swd" was already selected
cortex_m reset_config sysresetreq
adapter speed: 1000 kHz
Info : CMSIS-DAP: SWD  Supported
Info : CMSIS-DAP: Interface Initialised (SWD)
Info : CMSIS-DAP: FW Version = 1.0
Info : SWCLK/TCK = 1 SWDIO/TMS = 1 TDI = 0 TDO = 0 nTRST = 0 nRESET = 1
Info : CMSIS-DAP: Interface ready
Info : clock speed 1000 kHz
Info : SWD IDCODE 0x0bb11477
Info : nrf51.cpu: hardware has 4 breakpoints, 2 watchpoints


Provided you see the above output, it's working. I'll add more information to this post once I've got gdb working and tested as well.

MarkZ
Posts: 2
Joined: Fri May 20, 2016 4:43 pm

Re: Configuring OpenOCD for use with OSHChip

Postby MarkZ » Tue Jun 07, 2016 1:44 pm

Thanks for making a start on this.

Any further progress? I would use the arg-gcc toolchain by preference and would ideally minimize the amount of wheel re-invention I do.


Return to “Debugging”

Who is online

Users browsing this forum: No registered users and 1 guest