From: Matthias B. <mat...@po...> - 2021-10-23 14:22:18
|
Hi Marian, that was a good hint, thanks to solve the main problem! _To document the needed steps if anyone else runs into this problem:_ sudo apt-get install libhidapi* (libhidapi-hidraw0, libhidapi-hidraw0 and libhidapi-libusb0) Checkout r392 ( https://sourceforge.net/p/avarice/code/HEAD/tree/trunk/avarice/ ). (!392! not the current avarice-2.14 (==r388) because of compile problems!) ./Bootstrap ./automake ./configure make sudo make install Remember to update the udev rules for your device (thanks Istvan Retaller for the hint!). Now you can start avarice (no need to start it from gdb, use a standard linux shell): *avarice --jtag usb --edbg :4242* (remember to use sudo here if no udev rules are defined for your USB device) It should output something like this: *AVaRICE version 2.14svn20200906, Oct 23 2021 14:58:21** ** Defaulting JTAG bitrate to 250 kHz.** ** JTAG config starting.** ** Found a device, serial number: J42700041897** ** Reported device ID: 0x9705** ** Configured for device ID: 0x9705 atmega1284p** ** JTAG config complete.** ** Preparing the target device for On Chip Debugging.** ** IDR dirty: 0x80** ** Waiting for connection on port 4242. *And if you then connect with eclipse you'll see * * *Connection opened by host 127.0.0.1, port 55730.** ** IDR dirty: 0x01** * I don't know if the output *IDR dirty:... *does have any negative effects or how to solve it!? I've just seen this the very first debug session, might be not relevant. Starting a debug session now often fails after "Preparing the target device for On Chip Debugging." and a second call of avarice --jtag usb --edbg :4242 mostly succeeds. That's a bit strange. Another thing I've never seen before are lots of *Target went to sleep *and *Target went out of sleep *prints in the shell during debugging. Yes, I'm excessively using different power down states for this project, but I'm not interested to get this state printed because I might miss relevant output. Is there a possibility to turn this off? At the moment it feels like debugging with my mkII was somehow easier and worked directly. But in the end I'm really glad that I'm now able to use the new debugger! :-) So thanks for your help and kind regards, Matthias On 10/23/21 2:32 PM, Marian Buschsieweke wrote: > Hi Matthias, > > the new Atmel ICE is the first debugger using hidapi if I recall > correctly. Maybe you didn't compile AVaRICE without hidapi headers > installed? This would also explain why it works fine with older debuggers. > > I remember having had the same issue and there was no error message or > similar to indicate the cause of the issue, which resulted in some > time spent debugging until I figured out the cause. > > Kind regards, > Marian > > On 23 October 2021 14:19:22 CEST, "Matthias B." <mat...@po...> > wrote: > > Hi, > > I had problems with flash programming with my old MKII and > therefore bought a new Atmel-ICE. > My PC is running on linux and I can use this new debugger with > your version Version 6.3-20171130 for programming but somehow not > for debugging. > > So at the moment I can use my mkII for debugging and the Atmel-ICE > for programming - it's somehow weird and I need to solve this > problem for the Atmel-ICE ;-) > > For the MKII I use the sequence > * avarice --jtag usb --mkII :4242* > and was afterwards able to start debugging via eclipse. Very simple. > > If I adapt this sequence for the new debugger > *avarice --jtag usb --edbg :4242* > just nothing happens, which means the output is > * AVaRICE version 2.14svn20200906, Sep 28 2021 > 21:09:28** > ** Defaulting JTAG bitrate to 250 kHz.* > and it ends. > > I read (https://sourceforge.net/p/avarice/bugs/29/ , Joerg > Wunsch) I might have to use this out of a gdb session like > *gdb avrice* > and then > *(gdb) run -1 -j usb :4242 > *the output is* > Starting program: /usr/local/bin/avarice -1 -j > usb :4242 > [Thread debugging using libthread_db enabled] > Using host libthread_db library > "/lib/x86_64-linux-gnu/libthread_db.so.1". > AVaRICE version 2.14svn20200906, Sep 28 2021 21:09:28 > Defaulting JTAG bitrate to 250 kHz. > did not find any USB device "usb" > [Inferior 1 (process 260701) exited with code 01] > *Looking up the atmel-ice usb device: > *(gdb) run -1 -j /dev/bus/usb/001/048 :4242** > *the output is* > Starting program: /usr/local/bin/avarice -1 -j > /dev/bus/usb/001/048 :4242 > [Thread debugging using libthread_db enabled] > Using host libthread_db library > "/lib/x86_64-linux-gnu/libthread_db.so.1". > AVaRICE version 2.14svn20200906, Sep 28 2021 21:09:28 > Defaulting JTAG bitrate to 250 kHz. > [Inferior 1 (process 260758) exited with code 01] > > *So in summary I got stuck somehow and don't really know how to go on. > Can someone point me into the right direction how to initiate a > debug session with avarice and the Atmel-ICE? > > Kind regards, > Matthias > > > > -- Via smartphone. |