[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[avr-chat] extreme slowness debugging with avarice + avr-gdb + mega32 +
From: |
Britton Kerin |
Subject: |
[avr-chat] extreme slowness debugging with avarice + avr-gdb + mega32 + dragon? |
Date: |
Tue, 11 Sep 2007 21:59:32 -0800 |
I'm talking about 15 seconds per line of code in main (line like 'n =
42;'). Printing things out is pretty responsive (p n is almost
immediate).
I'm trying to run simple test code under debugger (trivial code at
bottom).
I have dragon and a mega32 wired straight to it as per dragon docs.
Then I
compile and write to flash:
rhino$ make
avr-gcc -I. -gstabs -mmcu=atmega32 -O0 -fpack-struct -fshort-enums
-funsigned-bitfields -funsigned-char -Wall -Wstrict-prototypes
-Wa,-ahlms=main.lst -c main.c -o main.o
avr-gcc -Wl,-Map,test.out.map -mmcu=atmega32 -lm -o test.out
main.o
rhino$ su
Password:
address@hidden:/home/bkerin/projects/intermeter/code/uc_embedded# make
writeflash
avr-objcopy -j .text \
-j .data \
-O ihex test.out test.hex
avr-objcopy -j .eeprom \
--change-section-lma .eeprom=0 \
-O ihex test.out test.ee.hex
~bkerin/local/bin/avrdude -c dragon_jtag \
-p m32 -P usb -e \
-U flash:w:test.hex
avrdude: AVR device initialized and ready to accept instructions
Reading | ################################################## | 100%
0.01s
avrdude: Device signature = 0x1e9502
avrdude: erasing chip
avrdude: reading input file "test.hex"
avrdude: input file test.hex auto detected as Intel Hex
avrdude: writing flash (264 bytes):
Writing | ################################################## | 100%
0.03s
avrdude: 264 bytes of flash written
avrdude: verifying flash memory against test.hex:
avrdude: load data flash data from input file test.hex:
avrdude: input file test.hex auto detected as Intel Hex
avrdude: input file test.hex contains 264 bytes
avrdude: reading on-chip flash data:
Reading | ################################################## | 100%
0.03s
avrdude: verifying ...
avrdude: 264 bytes of flash verified
avrdude: safemode: Fuses OK
avrdude done. Thank you.
address@hidden:/home/bkerin/projects/intermeter/code/uc_embedded#
Then I start avarice:
address@hidden:/home/bkerin# ~bkerin/local/bin/avarice-2.6 --dragon
--jtag usb --jtag-bitrate 125 :4242
AVaRICE version 2.6, Sep 10 2007 15:25:18
JTAG config starting.
Found a device: AVRDRAGON
Serial number: 00:a2:00:00:33:5a
Reported JTAG device ID: 0x9502
Configured for device ID: 0x9502 atmega32
JTAG config complete.
Preparing the target device for On Chip Debugging.
Disabling lock bits:
LockBits -> 0xff
Enabling on-chip debugging:
Extended Fuse byte -> 0xe1
High Fuse byte -> 0x19
Low Fuse byte -> 0xe1
Waiting for connection on port 4242.
I'm using the internal oscillator so I have tried a nice low bitrate.
Now I run avr-gdb:
(gdb) target remote localhost:4242
Remote debugging using localhost:4242
0x00000000 in __vectors ()
Avarice reports the connection:
Connection opened by host 127.0.0.1, port 48357.
I think all this looks good. The trouble is that executing a single
line seems to take about 15 seconds. Is this normal? If not, any
ideas what might be wrong?
Here is the C code:
static int other_func (int arg);
int
main (void)
{
int test_int = 42;
test_int *= 2;
int k = 4;
k = test_int + 2;
other_func (test_int);
return 0;
}
static int
other_func (int arg)
{
int kaboom = arg * 2;
return kaboom;
}
Thanks,
Britton Kerin
- [avr-chat] extreme slowness debugging with avarice + avr-gdb + mega32 + dragon?,
Britton Kerin <=