2011-03-01 02:30:01     debugging Bare-Metal Application using gnICE

Document created by Aaronwu Employee on Oct 16, 2013
Version 1Show Document
  • View in full screen mode

2011-03-01 02:30:01     debugging Bare-Metal Application using gnICE

Chandrashekhar Lavania (INDIA)

Message: 98482   

 

Hi,

 

I was trying to debug a simple bare metal app using gnICE, but I face some issues:

 

When I run the bfin-elf-gdb I get the following messages

 

(gdb) target remote :2000

Remote debugging using :2000

0xffffffff in ?? ()

(gdb) c

Continuing.

 

Program received signal SIGTRAP, Trace/breakpoint trap.

0xffffffff in ?? ()

(gdb) c

Continuing.

 

Program received signal SIGTRAP, Trace/breakpoint trap.

0xffffffff in ?? ()

(gdb) c

Continuing.

 

Program received signal SIGTRAP, Trace/breakpoint trap.

0xffffffff in ?? ()

(gdb)

 

 

The corresponding messages when the gdbproxy command is being run are:

 

Found USB cable: gnICE

Connected to libftdi driver.

IR length: 5

Chain length: 1

Device Id: 00100010011111100000000011001011 (0x227E00CB)

  Manufacturer: Analog Devices, Inc. (0x0CB)

  Part(0):      BF527 (0x27E0)

  Stepping:     2

  Filename:     /opt/uClinux/bfin-uclinux/bin/../share/urjtag/analog/bf527/bf527

warning:   bfin: no board selected, BF527 is detected

notice:    bfin: jc: waiting on TCP port 2001

notice:    bfin: jc:  (you must connect GDB before using jtag console)

notice:    bfin-gdbproxy: waiting on TCP port 2000

notice:    bfin-gdbproxy: connected

info:      bfin: [0] a double fault has occured EMUPC [0xFFFFFFFF]

info:      bfin: [0] a double fault has occured EMUPC [0xFFFFFFFF]

info:      bfin: [0] a double fault has occured EMUPC [0xFFFFFFFF]

 

 

Now, I put no break points in the app.

 

What could be causing the error "Program received signal SIGTRAP, Trace/breakpoint trap." ?

 

I am using 2010R1-RC4.

 

Regards,

Shekhar

 

PS: I exuted the gdb using command->    bfin-elf-gdb <appname>

PPS: I executed gdb proxy using -> bfin-gdbproxy -q bfin

PPPS: Both these commands were executed as root.

QuoteReplyEditDelete

 

 

2011-03-01 02:41:25     Re: debugging Bare-Metal Application using gnICE

Mike Frysinger (UNITED STATES)

Message: 98483   

 

gdbproxy told you the problem -- the core is double faulting

 

pass --reset to gdbproxy so that it will reset the core when you connect via gdb

QuoteReplyEditDelete

 

 

2011-03-01 02:56:47     Re: debugging Bare-Metal Application using gnICE

Chandrashekhar Lavania (INDIA)

Message: 98484   

 

Hi Mike,

 

I tried using --reset and still got the following result

 

 

 

Found USB cable: gnICE

 

Connected to libftdi driver.

 

IR length: 5

 

Chain length: 1

 

Device Id: 00100010011111100000000011001011 (0x227E00CB)

 

  Manufacturer: Analog Devices, Inc. (0x0CB)

 

  Part(0):      BF527 (0x27E0)

 

  Stepping:     2

 

  Filename:     /opt/uClinux/bfin-uclinux/bin/../share/urjtag/analog/bf527/bf527

 

warning:   bfin: no board selected, BF527 is detected

 

notice:    bfin: jc: waiting on TCP port 2001

 

notice:    bfin: jc:  (you must connect GDB before using jtag console)

 

notice:    bfin-gdbproxy: waiting on TCP port 2000

 

notice:    bfin-gdbproxy: connected

 

info:      [0] core fault: DBGSTAT [0xFFFF]

 

info:      Resetting ...

 

info:      bfin: [0] a double fault has occured EMUPC [0xFFFFFFFF]

 

info:      bfin: [0] a double fault has occured EMUPC [0xFFFFFFFF]

 

 

 

corresponding bfin-elf-gdb commands were:

 

(gdb) target remote :2000

 

Remote debugging using :2000

 

0xffffffff in ?? ()

 

(gdb) c

 

Continuing.

 

 

 

Program received signal SIGTRAP, Trace/breakpoint trap.

 

0xffffffff in ?? ()

 

(gdb) c

 

Continuing.

 

 

 

Program received signal SIGTRAP, Trace/breakpoint trap.

 

0xffffffff in ?? ()

 

(gdb)

 

 

So same issue I guess..

 

 

 

I also tried it with 2009R1. For that scenario I got two extra info messages apart from the standard double fault message:

 

info: bfin: [0] watchpoint event occured : PC [0xFFFFFFFF]   FP [0xFFFFFFFF]

 

info: bfin: [0] EMUEXCPT instruction was executed: PC [0xEF000746] FP [0xFFB00FF4]

 

Note that they occured in different attempts to do the debugging and not at the same time.

 

 

 

Regards,

 

Shekhar

QuoteReplyEditDelete

 

 

2011-03-01 03:03:50     Re: debugging Bare-Metal Application using gnICE

Mike Frysinger (UNITED STATES)

Message: 98485   

 

have you done any work to validate your hardware first ?  if things are crashing at that level, it usually indicatesa hardware problem.

 

you could also try slowing down the jtag port with --frequency=500000, forcing sanity checks with --check-emuready, and adding delays with --wait-clocks=100

QuoteReplyEditDelete

Attachments

    Outcomes