2 Armstart's CMSIS-DAP firmware implementation in gcc and makefile.
4 [http://www.armstart.com](http://www.armstart.com)
6 [IBDAP](https://hackaday.io/project/6578-ibdap-affordable-cmsis-dap-jtagswd-debug-probe) is a fully CMSIS-DAP compatible debug adapter. It provides vendor independent debug interface between your PC over USB and target ARM device over JTAG/SWD pins. You can do debugging functions like stepping, breakpoints, watch points and firmware download etc. It's fully supported by Keil, OpenOCD, GNU GDB, IAR and other commonly used debugging tools.
10 Debug adapters are expensive, some could cost thousands of dollars, some may not be compatible among different vendors. Luckily, ARM standardized the debugging interface which is called CMSIS-DAP and released the firmware implementation on some processors, however, you still need a Keil MDK Professional edition software in order to build the firmware, even the open source one provided by mbed and the price for Keil Professional is intimidating. All these barriers has become the first issue that every inventor is facing, and we need a solution!
11 IBDAP's objective is to become an affordable open source & open hardware CMSIS-DAP JTAG/SWD debug probe implementation using gcc & makefile. Anyone can modify and embed a debug probe on its own device easily with everything under its control.
13 Besides being functioning as a JTAG/SWD debug probe, IBDAP could also be used as a general development board. It has an ARM Cortex M0 processor running at 48Mhz and has peripherals like UART, I2C, SPI, USB. It can be used in many applications like USB audio devices, USB mouse/keyboards, USB mass storage devices, USB-TTL adapter device and many many more. Moreover, the 10-bit high precision ADC peripheral also makes IBDAP an ideal device for any sensor projects.
15 ![IBDAP pinmap](https://s3.amazonaws.com/armstart/Debug+Tools/IBDAP-LPC11U35/7.jpg)
22 sudo apt-get install build-essential
24 sudo apt-get install autotools-dev autoconf automake libtool
26 sudo apt-get install texinfo libudev-dev libusb-1.0-0-dev libfox-1.6-dev
29 ## Download FTDI driver
32 http://www.intra2net.com/en/developer/libftdi/download.php
33 tar xf libftdi1-1.2.tar.bz2
39 git clone git://github.com/signal11/hidapi.git
46 ## Build and Install OpenOCD
49 git clone git://git.code.sf.net/p/openocd/code
55 ../code/configure --with-ftd2xx-linux-tardir=../libftdi1-1.2 --prefix=/opt/openocd --enable-jlink --enable-ftdi --enable-stlink --enable-ti-icdi --enable-ulink --enable-usb-blaster-2 --enable-cmsis-dap --enable-bcm2835gpio
61 ### Prepare extra OpenOCD cfg commands
63 create file openocd.cfg with following contents:
66 $_TARGETNAME configure -event gdb-attach {
72 ### Start OpenOCD server to Debug LPC11U35
75 sudo openocd -f interface/jlink.cfg -c "transport select swd" -f target/lpc11xx.cfg -f openocd.cfg
81 - First, flash debug firmware on board
87 flash write_image erase /home/yliu/projects/ib51822/IBDAP-FW/Firmware/IBDAP/Debug/IBDAP.bin 0x0
92 - Second, debug using the commands:
95 target remote localhost:3333
101 http://wiki.paparazziuav.org/wiki/DevGuide/GDB_OpenOCD_Debug
103 ### Breakpoint limits
106 set remote hardware-breakpoint-limit 4
107 set remote hardware-watchpoint-limit 2
110 ### gdbtui GUI debugging
112 http://fun-tech.se/stm32/OpenOCD/gdb.php
115 ## OpenOCD nRF51822 using IBDAP
120 $ sudo openocd -f interface/cmsis-dap.cfg -c "transport select swd" -f target/nrf51.cfg
127 yliu@yliu-xbtu:~$ sudo openocd -f interface/cmsis-dap.cfg -c "transport select swd" -f target/nrf51.cfg
128 [sudo] password for yliu:
129 Open On-Chip Debugger 0.10.0-dev-00001-g70a14db (2015-06-23-16:35)
130 Licensed under GNU GPL v2
131 For bug reports, read
132 http://openocd.org/doc/doxygen/bugs.html
133 Info : only one transport option; autoselect 'swd'
134 Warn : Transport "swd" was already selected
136 cortex_m reset_config sysresetreq
137 adapter speed: 1000 kHz
138 Info : CMSIS-DAP: SWD Supported
139 Info : CMSIS-DAP: JTAG Supported
140 Info : CMSIS-DAP: Interface Initialised (SWD)
141 Info : CMSIS-DAP: FW Version = 1.0
142 Info : SWCLK/TCK = 1 SWDIO/TMS = 1 TDI = 1 TDO = 1 nTRST = 0 nRESET = 1
143 Info : CMSIS-DAP: Interface ready
144 Info : clock speed 1000 kHz
145 Info : SWD IDCODE 0x0bb11477
146 Info : nrf51.cpu: hardware has 4 breakpoints, 2 watchpoints
147 Info : accepting 'telnet' connection on tcp/4444
152 yliu@yliu-xbtu:~$ telnet localhost 4444
154 Connected to localhost.
155 Escape character is '^]'.
156 Open On-Chip Debugger
159 target halted due to debug-request, current mode: Thread
160 xPSR: 0xc1000000 pc: 0x000006d0 msp: 0x000007c0
162 Unknown device (HWID 0x00000057)
163 flash 'nrf51' found at 0x00000000