SparkFun Forums 

Where electronics enthusiasts find answers.

Open source ARM Debugger
By kkrambo
#172225
I have TI's Stellaris LaunchPad and I can use it successfully with Code Composer Studio and IAR Embedded Workbench. Now I am trying to setup the Eclipse CDT with the GNU ARM Eclipse plug-ins, GCC ARM toolchain, and OpenOCD on my Windows system. I have been following the instructions at the GNU ARM Eclipse plug-ins website (http://gnuarmeclipse.livius.net/blog/). I have successfully created and built a project from the plug-in's generic ARM Cortex-M Project template. But now I am stuck trying to run the debugger with the OpenOCD GDB Server.

I created a debugger configuration as described on the GNU ARM Eclipse Plug-ins instructions, here http://gnuarmeclipse.livius.net/blog/openocd-debugging/. Except on the Debugger tab in the OpenOCD Settings groupbox I set the Other Options field to "-f board/ek_lm4f120xl.cfg". When I attempt to debug with this configuration, I get the following output in the console window. (The launchpad is connected and powered on.)
Code: Select all
Open On-Chip Debugger 0.8.0 (2014-04-28-08:39)
Licensed under GNU GPL v2
For bug reports, read
	http://openocd.sourceforge.net/doc/doxygen/bugs.html
Info : This adapter doesn't support configurable speed
Info : ICDI Firmware version: 9270
Info : lm4f120h5qr.cpu: hardware has 6 breakpoints, 4 watchpoints
Info : accepting 'gdb' connection from 3333
undefined debug reason 7 - target needs reset
target state: halted
target halted due to debug-request, current mode: Thread 
xPSR: 0x01000000 pc: 0x00002000 msp: 0x20007904
semihosting is enabled
Error: memory write failed: 0x7
Error: memory write failed: 0x7
Error: memory read failed: 0x7
Error: memory read failed: 0x7
Error: memory read failed: 0x7
Error: memory read failed: 0x7
Error: memory read failed: 0x7
target state: halted
target halted due to debug-request, current mode: Thread 
xPSR: 0x01000000 pc: 0x00002000 msp: 0x20007904, semihosting
Error: Memory write failure!
What do I need to do to get this working?

This is on a Windows 7 system. I had previously installed the Stellaris ICDI driver from TI when I was using CCS. I'm assuming that same ICDI driver is what OpenOCD uses to interface with the board.

Thanks for your help.

-- Kevin
By kkrambo
#172226
I figured out part of the problem. When I used the generic ARM Cortex-M Project template from GNU ARM Eclipse Plug-ins to create my project, it created a linker script with FLASH originating at 0x08000000, which is appropriate for STM32F* but is incorrect for Stellaris and Tiva microcontrollers. I changed the FLASH origin to 0x00000000 and now the debugger seems to start correctly and I can begin to step through the code. However, the program doesn't run correctly so I still more work to do.