public inbox for ecos-discuss@sourceware.org
 help / color / mirror / Atom feed
* [ECOS] Problem with GDB/insight debugging standalone interrupt driven code
@ 2006-09-21  9:39 Miklos.Pflancer
  2006-09-21 10:40 ` Nick Garnett
  0 siblings, 1 reply; 4+ messages in thread
From: Miklos.Pflancer @ 2006-09-21  9:39 UTC (permalink / raw)
  To: ecos-discuss

HI

Target - ARM LPC2292 Embest development board running Redboot

I think I have a problem with gdb stubs in redboot.

I can load and run a  standalone application which uses interrupts 
into external ram  using gdb, however If I set breakpoints or try to 
single step the application stops and gdb becomes unresponsive. 

I can burn the same application into flash and load with Redboot and 
this works fine.

I was wondering if  there are options in the configtool which should 
be selected but are'nt. I am not familiar with many of these 
settings. 

Can anyone offer any advice on this matter

Best Regards

Miklos

Miklos Pflancer
Electronics Engineer

--------------------------------------------------
email : miklos@dbresearch.co.uk
--------------------------------------------------
dB Research Ltd
Concept House
Merton Road
Bootle
Liverpool L20 3BG
UK

Tel (+44)(0)151 330 0800
Fax (+44)(0)151 330 0808
--------------------------------------------------

-- 
Before posting, please read the FAQ: http://ecos.sourceware.org/fom/ecos
and search the list archive: http://ecos.sourceware.org/ml/ecos-discuss

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [ECOS] Problem with GDB/insight debugging standalone interrupt driven code
  2006-09-21  9:39 [ECOS] Problem with GDB/insight debugging standalone interrupt driven code Miklos.Pflancer
@ 2006-09-21 10:40 ` Nick Garnett
  2006-09-22  7:55   ` Miklos.Pflancer
  0 siblings, 1 reply; 4+ messages in thread
From: Nick Garnett @ 2006-09-21 10:40 UTC (permalink / raw)
  To: Miklos.Pflancer; +Cc: ecos-discuss

Miklos.Pflancer@dBResearch.co.uk writes:

> HI
> 
> Target - ARM LPC2292 Embest development board running Redboot
> 
> I think I have a problem with gdb stubs in redboot.
> 
> I can load and run a  standalone application which uses interrupts 
> into external ram  using gdb, however If I set breakpoints or try to 
> single step the application stops and gdb becomes unresponsive. 
> 
> I can burn the same application into flash and load with Redboot and 
> this works fine.
> 
> I was wondering if  there are options in the configtool which should 
> be selected but are'nt. I am not familiar with many of these 
> settings. 
> 
> Can anyone offer any advice on this matter


It is likely that your standalone application is reprogramming the
hardware under the stubs feet. Perhaps it is changing the serial line
baud rate, perhaps it is redirecting the exception vectors to its own
code, perhaps it is overwriting RedBoot's data area. Any of these
would cause the stubs to fail to catch an exception or fail to
communicate.

You need to take a close look at what the application does during
startup. You may also need to single step it from its entry point
until you find where it messes up the hardware. 


-- 
Nick Garnett                                 eCos Kernel Architect
http://www.ecoscentric.com            The eCos and RedBoot experts


-- 
Before posting, please read the FAQ: http://ecos.sourceware.org/fom/ecos
and search the list archive: http://ecos.sourceware.org/ml/ecos-discuss

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [ECOS] Problem with GDB/insight debugging standalone interrupt driven code
  2006-09-21 10:40 ` Nick Garnett
@ 2006-09-22  7:55   ` Miklos.Pflancer
  2006-09-22 16:17     ` Nick Garnett
  0 siblings, 1 reply; 4+ messages in thread
From: Miklos.Pflancer @ 2006-09-22  7:55 UTC (permalink / raw)
  To: Nick Garnett; +Cc: ecos-discuss

Hi Nick

My startup code only sets up the stacks and copies the IRQ vector 
instruction
		 ldr     PC, [PC,#-0xFF0]  

to the IRQ vector (after remap)
		  ldr     r0,=0xe51ffff0
             ldr	r1,=0x40000018
		  str     r0,[r1]           

I the zero .bss and copy .data and jump to main

When I step through my code the following instruction which enables 
IRQ's causes GDB to hang

asm volatile (" msr  cpsr, %0" : /* no outputs */ : "r" (val)  );

As I mentioned earlier, the code seems to work fine when I use gdb to 
load and run this application


Best regards



To:             	Miklos.Pflancer@dbresearch.co.uk
Copies to:      	ecos-discuss@sourceware.org
Subject:        	Re: [ECOS] Problem with GDB/insight debugging standalone interrupt driven code
From:           	Nick Garnett <nickg@ecoscentric.com>
Date sent:      	21 Sep 2006 11:40:26 +0100

Miklos.Pflancer@dBResearch.co.uk writes:

> HI
> 
> Target - ARM LPC2292 Embest development board running Redboot
> 
> I think I have a problem with gdb stubs in redboot.
> 
> I can load and run a  standalone application which uses interrupts 
> into external ram  using gdb, however If I set breakpoints or try 
to 
> single step the application stops and gdb becomes unresponsive. 
> 
> I can burn the same application into flash and load with Redboot 
and 
> this works fine.
> 
> I was wondering if  there are options in the configtool which 
should 
> be selected but are'nt. I am not familiar with many of these 
> settings. 
> 
> Can anyone offer any advice on this matter


It is likely that your standalone application is reprogramming the
hardware under the stubs feet. Perhaps it is changing the serial line
baud rate, perhaps it is redirecting the exception vectors to its own
code, perhaps it is overwriting RedBoot's data area. Any of these
would cause the stubs to fail to catch an exception or fail to
communicate.

You need to take a close look at what the application does during
startup. You may also need to single step it from its entry point
until you find where it messes up the hardware. 


-- 
Nick Garnett                                 eCos Kernel Architect
http://www.ecoscentric.com            The eCos and RedBoot experts


Miklos Pflancer
Electronics Engineer

--------------------------------------------------
email : miklos@dbresearch.co.uk
--------------------------------------------------
dB Research Ltd
Concept House
Merton Road
Bootle
Liverpool L20 3BG
UK

Tel (+44)(0)151 330 0800
Fax (+44)(0)151 330 0808
--------------------------------------------------

-- 
Before posting, please read the FAQ: http://ecos.sourceware.org/fom/ecos
and search the list archive: http://ecos.sourceware.org/ml/ecos-discuss

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [ECOS] Problem with GDB/insight debugging standalone interrupt driven code
  2006-09-22  7:55   ` Miklos.Pflancer
@ 2006-09-22 16:17     ` Nick Garnett
  0 siblings, 0 replies; 4+ messages in thread
From: Nick Garnett @ 2006-09-22 16:17 UTC (permalink / raw)
  To: Miklos.Pflancer; +Cc: ecos-discuss

Miklos.Pflancer@dBResearch.co.uk writes:

> Hi Nick
> 
> My startup code only sets up the stacks and copies the IRQ vector 
> instruction
> 		 ldr     PC, [PC,#-0xFF0]  
> 
> to the IRQ vector (after remap)
> 		  ldr     r0,=0xe51ffff0
>              ldr	r1,=0x40000018
> 		  str     r0,[r1]           
> 
> I the zero .bss and copy .data and jump to main
> 
> When I step through my code the following instruction which enables 
> IRQ's causes GDB to hang
> 
> asm volatile (" msr  cpsr, %0" : /* no outputs */ : "r" (val)  );
> 
> As I mentioned earlier, the code seems to work fine when I use gdb to 
> load and run this application

RedBoot enables receive interrupts on the serial device being used for
GDB just before passing control to the application. This is so that
you can use Ctrl-C to interrupt execution. eCos has code in its
interrupt system to deal with these apparently spurious interrupts and
pass them on to RedBoot. Since your application presumably does not
deal with these interrupts, then this may explain why it fails, since
there may be a pending interrupt remaining after the transfer of
control.

The simple solution is to program the interrupt controller to mask all
interrupt sources before enabling IRQs in the CPU. A more complex
alternative is to duplicate the eCos code to permit Ctrl-C handling to
still work.


-- 
Nick Garnett                                 eCos Kernel Architect
http://www.ecoscentric.com            The eCos and RedBoot experts


-- 
Before posting, please read the FAQ: http://ecos.sourceware.org/fom/ecos
and search the list archive: http://ecos.sourceware.org/ml/ecos-discuss

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2006-09-22 16:17 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2006-09-21  9:39 [ECOS] Problem with GDB/insight debugging standalone interrupt driven code Miklos.Pflancer
2006-09-21 10:40 ` Nick Garnett
2006-09-22  7:55   ` Miklos.Pflancer
2006-09-22 16:17     ` Nick Garnett

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).