EmbeddedRelated.com
Forums
Memfault Beyond the Launch

Debugging lpc2368 problem using OpenOCD

Started by ragh...@signal-networks.com June 19, 2008
Dear all,

We are working on keil MCB2300 (lpc2368) board. Following tools are used to build target image:

Software:
gcc 4.3.1
gdb 6.8
open ocd latest
newlib 1.16
binutils 2.18.50

Hardware:
Keil MCB2300
parallel wiggler jtag

All source codes for above software are downloaded from net and tool chain is made for arm processor using x86 host machine and Cent OS 5(gcc 4.1.2).

GPIO demo example given with keil kit is converted build using gcc.
Aim of the example is to glow LED connected to port2.0 to port2.7 one by one.

Following observations are noted:

Built with No optimization with delay functions able to glow LED. works fine. Able to debug through openocd using gdb step by step.
Built with optimization level one or above with delay functions program is not working properly.
Built with No optimization with timer interrupt (no delay functions). interrupt function is not going to be called. corresponding registers values are read through openocd
it seems to be timer is working(This might be error in startup files).

my question is
1) Why with optimization not able to debug?
2) Timer register is found to be getting updated but timer interrupt function not triggered(verified interrupt vector table and found to be fine)

can any one help to resolve this issues?

thanks in advance
Rags.

An Engineer's Guide to the LPC2100 Series

Hello Rags.

to 1):
For debugging you need debug symbols (e.g. dwarf-2). Make sure
you have something like this when invoking GCC: "gcc -gdwarf-2 ..."
I'm also not sure whether debbuging will work at all with optimize.
to 2):
-enable a timer match interrupt in TxIR
-write VicVectAddrX
-write a "1" to the corresponding bit in VicIntEnable

hope this helps.
n.focking

--- In l..., raghavendra@... wrote:
>
> Dear all,
>
> We are working on keil MCB2300 (lpc2368) board. Following tools are
used to build target image:
>
> Software:
> gcc 4.3.1
> gdb 6.8
> open ocd latest
> newlib 1.16
> binutils 2.18.50
>
> Hardware:
> Keil MCB2300
> parallel wiggler jtag
>
> All source codes for above software are downloaded from net and tool
chain is made for arm processor using x86 host machine and Cent OS
5(gcc 4.1.2).
>
> GPIO demo example given with keil kit is converted build using gcc.
> Aim of the example is to glow LED connected to port2.0 to port2.7
one by one.
>
> Following observations are noted:
>
> Built with No optimization with delay functions able to glow LED.
works fine. Able to debug through openocd using gdb step by step.
> Built with optimization level one or above with delay functions
program is not working properly.
> Built with No optimization with timer interrupt (no delay
functions). interrupt function is not going to be called.
corresponding registers values are read through openocd
> it seems to be timer is working(This might be error in startup files).
>
> my question is
> 1) Why with optimization not able to debug?
> 2) Timer register is found to be getting updated but timer interrupt
function not triggered(verified interrupt vector table and found to be
fine)
>
> can any one help to resolve this issues?
>
> thanks in advance
> Rags.
>

Dear focking

Thanks for your suggestions. These problem are fixed by enabling interrupt bit in user mode in startup files.

With regards,
rags

----- Original Message -----
From: n.focking
To: l...
Sent: Thursday, June 19, 2008 8:22 PM
Subject: [lpc2000] Re: Debugging lpc2368 problem using OpenOCD
Hello Rags.

to 1):
For debugging you need debug symbols (e.g. dwarf-2). Make sure
you have something like this when invoking GCC: "gcc -gdwarf-2 ..."
I'm also not sure whether debbuging will work at all with optimize.
to 2):
-enable a timer match interrupt in TxIR
-write VicVectAddrX
-write a "1" to the corresponding bit in VicIntEnable

hope this helps.
n.focking

--- In l..., raghavendra@... wrote:
>
> Dear all,
>
> We are working on keil MCB2300 (lpc2368) board. Following tools are
used to build target image:
>
> Software:
> gcc 4.3.1
> gdb 6.8
> open ocd latest
> newlib 1.16
> binutils 2.18.50
>
> Hardware:
> Keil MCB2300
> parallel wiggler jtag
>
> All source codes for above software are downloaded from net and tool
chain is made for arm processor using x86 host machine and Cent OS
5(gcc 4.1.2).
>
> GPIO demo example given with keil kit is converted build using gcc.
> Aim of the example is to glow LED connected to port2.0 to port2.7
one by one.
>
> Following observations are noted:
>
> Built with No optimization with delay functions able to glow LED.
works fine. Able to debug through openocd using gdb step by step.
> Built with optimization level one or above with delay functions
program is not working properly.
> Built with No optimization with timer interrupt (no delay
functions). interrupt function is not going to be called.
corresponding registers values are read through openocd
> it seems to be timer is working(This might be error in startup files).
>
> my question is
> 1) Why with optimization not able to debug?
> 2) Timer register is found to be getting updated but timer interrupt
function not triggered(verified interrupt vector table and found to be
fine)
>
> can any one help to resolve this issues?
>
> thanks in advance
> Rags.
>



Memfault Beyond the Launch