From: Blake L. <ble...@at...> - 2008-10-01 13:56:22
|
I don't have any specific ideas, but I have seen behavior like this before. Usually, this kind of problem is from some configuration being bad, such as using the wrong part number, or using 'gdb' rather than 'avr-gdb' (I see you used the correct gdb). How are you starting avarice? I have found that starting avarice from a script sometimes causes this sort of problem, so I usually start avarice separately in a terminal window before staring gdb in emacs. I haven't figured out why this is necessary. Also, is the 164P a newly-supported part in the toolchain/avarice/gdb? That can cause trouble. Blake On Tuesday 30 September 2008, Oliver Večernik wrote: > Hi, > > I recently started with a JTAGICE mkII and "ported" the `largedemo.c' to > an ATmega164p on the STK500 and basically everthing seems to work. My > IDE is Emacs 22.1 on Ubuntu 8.04. The package for AVaRICE was 2.7 and I > had problems with it (basically the process detached when the program > was running), so after a bit of search I read that this is fixed in the > current version to 2.8. I also updated GDB to the latest version 6.8 > and compiled it with: > > $ ./configure --program-prefix=avr- --target=avr > $ make > $ sudo checkinstall > > I started the debugger with `ice-gdb --annotate=3 largedemo.elf': > > Current directory is /home/ov/work/avr/libc_examples/largedemo/ > AVaRICE version 2.8, Sep 30 2008 12:47:24 > > Defaulting JTAG bitrate to 250 kHz. > > JTAG config starting. > Found a device: JTAGICEmkII > Serial number: 00:b0:00:00:55:43 > Reported JTAG device ID: 0x940A > Configured for device ID: 0x940A atmega164p > JTAG config complete. > Erasing program memory. > Erase complete. > Preparing the target device for On Chip Debugging. > > Disabling lock bits: > LockBits -> 0xff > > Enabling on-chip debugging: > Extended Fuse byte -> 0xff > High Fuse byte -> 0x19 > Low Fuse byte -> 0x62 > Downloading FLASH image to target............... > Downloading EEPROM image to target.. > > Download complete. > Waiting for connection on port 6423. > GNU gdb 6.8 > Copyright (C) 2008 Free Software Foundation, Inc. > License GPLv3+: GNU GPL version 3 or later > <http://gnu.org/licenses/gpl.html> > This is free software: you are free to change and redistribute it. > There is NO WARRANTY, to the extent permitted by law. Type "show > copying" > and "show warranty" for details. > This GDB was configured as "--host=x86_64-unknown-linux-gnu > --target=avr"... > Connection opened by host 127.0.0.1, port 46454. > 0x00000000 in __vectors () > (gdb) b main > Breakpoint 1 at 0x3a2: file largedemo.c, line 231. > (gdb) c > Continuing. > > Breakpoint 1, main () at largedemo.c:231 > (gdb) s > (gdb) s > (gdb) s > Breakpoint 2 at 0x52a: file largedemo.c, line 515. > (gdb) l 515 > 510 > 511 if (intflags.rx_int) > 512 { > 513 intflags.rx_int = 0; > 514 > 515 if (rxbuff == 'q') > 516 { > 517 printstr_p(PSTR("\nThank you for using serial mode." > 518 " Good-bye!\n")); > 519 mode = MODE_UPDOWN; > (gdb) c > Continuing. > > As soon as I press a key from my RS232 terminal (picocom) the ATmega > freezes and GDB hangs. Without JTAGICE debugging the program works fine > as expected. > > After stopping GDB everthing seems locked up: > > <tool-bar> <stop>JTAG ICE communication failed: Connection reset by > peer > JTAG ICE communication failed: Connection reset by peer > putpkt: write failed: Broken pipe. > (gdb) ice-restart > AVaRICE version 2.8, Sep 30 2008 12:47:24 > > Defaulting JTAG bitrate to 250 kHz. > > JTAG config starting. > Failed to synchronise with the JTAG ICE (is it connected and powered?) > putpkt: write failed: Broken pipe. > (gdb) > > Only switching off the JTAGICE helps and I have to restart everything. > > What am I doing wrong? How do I restart the ICE (by software) and why > does GDB hang? Any ideas? |