Jump to content
43oh

GDB OpenOCD with Eclipse on Windows


Recommended Posts

I have the Stellaris LaunchPad and I can use it successfully with CCS and IAR.  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.  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.  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.)

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.  Is there a different ICDI driver I need for OpenOCD?

 

Thanks for your help.

 

 -- Kevin

 

Link to post
Share on other sites

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 there is still more work to do.

Link to post
Share on other sites

A good practice might be to snag the linker script from Energia (http://energia.nu) in the hardware/lm4f/cores/lm4f directory and try those; they're optimized for handling C and C++ code.

 

I believe they're called lm4fcpp_blizzard.ld (Tiva-C TM4C123G and Stellaris) and lm4fcpp_snowflake.ld (Tiva-C TM4C1294 w/ Ethernet).

Link to post
Share on other sites
  • 2 weeks later...

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...