beginner help: openocd and eclipse and lm3s8962

Hello,

I need some starting-advice.

it seems I have to configure my openocd to run with my lm3s8962.

I have discovered that there are “Board” “Interface” and “Target” cfg files.

Can somebody please tell me which steps i have to take in ordner to configure my openocd so i can connect my eclipse c++ enviroment with my evaluation board?

Thanks a lot!

p.s.: i was following this tutorial, which made it appear like it would work without special configuration http://www.freertos.org/index.html?http … lipse.html

Hello Phexx,

I know where you are comming from.

I want to do LM3S6918 (Micromint Eagle 100 board)

debugging with a ARM-USB-JTAG TINY.

So far I have had some limited success.

But for various reasons, I have been resistant to using the freeRTOS example (maybe this is my own fault)

Here is my reason:

I think the example is far too elaborate for a beginning attempt

at running an embedded program.

I instead substitued my own program that just blinks an LED

on my board. Also I wanted to use as new a version of eclipse as

I could, and as new a version of openOCD as I could.

I have Eclipse Ganymede and openOCD 0.1.0

I think the freeRTOS example uses an older version of openOCD,

which they supply as part of their downloadable .zip file

I ran into some problems with Eclipse Ganymede in getting my tool chain to compile, but have overcome them - (If this is an issue for you let me know.)

I have working .cfg files which I would be willing to give you as examples

they allow me to download to the flash of my LM3S6918 and I can stop

and start execution of my program , but breakpoints ( a feature

required for any decent debugger ) are not working.

See my post:

viewtopic.php?t=16068

or here are my config files directly:======================

The latter posts in this thread show among other things:

####Eagle100_jtag_tiny-setup.cfg ==================

From Source file: “olimex-jtag-tiny-a.cfg”------------------------

REFERENCE: http://www.olimex.com/dev/arm-usb-tiny.html

interface ft2232

ft2232_device_desc “Olimex OpenOCD JTAG TINY A”

ft2232_layout olimex-jtag

#------------------------------------------------------------------

From Source file: “joes_Eagle100BoardTrial1.cfg”------------------

My test board has a “Rev1” tap id.

set BSTAPID 0x16410041

source [find target/jmk_lm3s6918.cfg] (will just include into this…)

#------------------------------------------------------------------

From Source file: jmk_lm3s6918.cfg (in target directory)

script for luminary lm3s6918

if { [info exists CHIPNAME] } {

set _CHIPNAME $CHIPNAME

} else {

set _CHIPNAME lm3s6918

}

if { [info exists ENDIAN] } {

set _ENDIAN $ENDIAN

} else {

this defaults to a little endian

set _ENDIAN little

}

if { [info exists CPUTAPID ] } {

set _CPUTAPID $CPUTAPID

} else {

force an error till we get a good number

set _CPUTAPID 0x3ba00477

}

jtag speed

jtag_khz 500

jtag_nsrst_delay 100

jtag_ntrst_delay 100

#LM3S6918 Evaluation Board has only srst

reset_config srst_only

#jtag scan chain

jtag newtap $_CHIPNAME cpu -irlen 4 -ircapture 1 -irmask 0xf -expected-id $_CPUTAPID

THIS WAS IN THE “makeController-debug.cfg” but is deprecated in openOCD0.10

#daemon startup reset

#this config option has been removed, simply adding init' and reset halt’ to the end

#of your config script will give the same behaviour as using `daemon_startup reset’

#and `target cortex_m3 little reset_halt 0’.

the luminary variant causes a software reset rather than asserting SRST

this stops the debug registers from being cleared

this will be fixed in later revisions of silicon

set _TARGETNAME [format “%s.cpu” $_CHIPNAME]

target create $_TARGETNAME cortex_m3 -endian $_ENDIAN -chain-position $_TARGETNAME -variant lm3s

4k working area at base of ram

$_TARGETNAME configure -work-area-virt 0 -work-area-phys 0x20000000 -work-area-size 0x4000 -work-area-backup 0

#flash configuration

flash bank stellaris 0 0 0 0 0

#recommded by Duane Ellis of openOCD

#This tells openocd to inform GDB where ‘flash lives’ - thus GDB will attempt to#use hardware breakpoints.

#----

gdb_memory_map enable

#----

Then the following of these is sent next to openOCD:

  1. DebugPgm.cfg:

telnet_port 4444

gdb_port 3333

init

reset

Or

  1. ErasePgm.cfg

#define our ports

telnet_port 4444

gdb_port 3333

tcl_port 6666

echo “before init”

init

halt

sleep 200

wait_halt

flash probe 0

flash erase_check 0

This cmd below seems not to work (but it did not really matter):

“Error: failed setting protection for areas 8 to 255 (-901)”

#flash protect 0 8 255 off

But this did work:

flash erase_sector 0 0 255

sleep 200

flash erase_check 0

reset run

shutdown

=============================================

On Saturday I did an attempt at using the older version of openOCD,

and older config files like the kind they use in the freeRTOS example,

but did not see any improvement in my breakpoint problems.

I am working with some openOCD developers, and may, If I am

lucky get them to help me. I think openOCD is sort of a volunteer

project , so the time frame of when help will come in is t.b.d.

Hints

"I have discovered that there are “Board” “Interface” and “Target” cfg files. " -->>

The basic idea is

At a dos prompt

openOCD -f configFile1.cfg -f ConfigFile2.cfg -f ConfigFile3.cfg.

These are usually combined to set up the complete

configuration of openOCD, In my example I found .cfg files

that looked to be close to my target hardware and JTAG and

tweeked them in hope my target would work - it does sort of.

I combined and re-arranged some things but my example will give you ideas of what to do, and !!! what order the things sent to open ocd should be in !!!

Also this can be setup automatically in Eclipse via certain configuration windows.

Read my post and you may need to make some small mods

to my example config files, but not many.

At the end of my post I describe my .cfg files

If you are not making a log file for an openOCD guru to examine,

they can be executed from a dos window as follows,

or put these into a .bat file if desired.

With my example config files

To run gdb first start openOCD in a dos window

put openOCD.exe in the directory where your program is, this is what

the freeRTOS folks do:

For debug if your chip is already programed:

openocd -f Eagle100_jtag_tiny-setup.cfg -f DebugPgm.cfg

To erase any junk on your target, to reprogram;

openocd -f Eagle100_jtag_tiny-setup.cfg -f ErasePgm.cfg

Next start gdb in a separate dos window:

$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$

Next

I executed the following gdb commands from dos window

=====

Specify the ELF file…

=====

(gdb) file blinky.out.

=====

Specify the target

=====

(gdb) target remote localhost:3333

=====

Tell openocd to HALT the target

=====

(gdb) mon halt

=====

Tell openocd to RESET the target.

=====

(gdb) mon reset

=====

And i tell it to halt again…

=====

(gdb) mon halt

=====

Load my program - this actually programs the flash

=====

(gdb) load

=====

Set a breakpoint at “blinky.c line24”

=====

(gdb) break blinky.c:24

=====

Tell GDB to continue - see the NOTE from GDB…

=====

(gdb) cont

=====

I did not hit my breakpoint…

=====

It required using contorl C to stop running.

=====

Does not work yet, please help…

=====

Good Luck to you,

JoeEE