avarice icon indicating copy to clipboard operation
avarice copied to clipboard

[bug #30] 2.14 compiling issues and atmel-ice usb not found

Open avrs-admin opened this issue 3 years ago • 1 comments

christian26 <None> 2020-11-17 15:01:37.474000

Hi,

Thank you for adding Atmel-ICE support to avarice, that is great news!

I was trying to compile 2.14 on a Ubuntu 18.04 machine. gcc version Ubuntu 7.5.0-3ubuntu1~18.04. packages binutils-dev libusb-dev installed for library support.

Compiled with command:

./configure
make -lusb

gcc breaks with this error:

g++ -DHAVE_CONFIG_H -I.  -Wall -Wextra   -g -O2 -MT devdescr.o -MD -MP -MF .deps/devdescr.Tpo -c -o devdescr.o devdescr.cc
devdescr.cc:36:51: error: _Pragma takes a parenthesized string literal
 PRAGMA_DIAG_IGNORED("-Wmissing-field-initializers")
                                                   ^
In file included from jtag.h:31:0,
                 from devdescr.cc:29:
pragma.h:33:38: error: ‘_Pragma’ does not name a type
 #      define PRAGMA_DIAG_IGNORED(x) _Pragma(GCC diagnostic ignored x)
                                      ^
devdescr.cc:36:1: note: in expansion of macro ‘PRAGMA_DIAG_IGNORED’
 PRAGMA_DIAG_IGNORED("-Wmissing-field-initializers")

By editing pragma.h such that it uses the pragmas for gcc version 4, it compiles, but then breaks again with this error:

jtagrw.cc: In member function ‘virtual uchar* jtag1::jtagRead(long unsigned int, unsigned int)’:
jtagrw.cc:134:13: error: cannot convert ‘bool’ to ‘uchar* {aka unsigned char*}’ in return
      return false;

Modifying this line to return NULL instead seems to solve the problem. This lead to a working binary. However, an AVR-ICE connected to the USB port is not recognized:

dev:avarice-2.12$ src/avarice --jtag usb
AVaRICE version 2.12, Nov 17 2020 09:54:27

Defaulting JTAG bitrate to 250 kHz.

did not find any USB device "usb"
USB device not found

Probably just something I am doing wrong... right?

Again, great work from you guys, keep it up!

-- Christian

This issue was migrated from https://sourceforge.net/p/avarice/bugs/30/

avrs-admin avatar Jan 26 '22 21:01 avrs-admin

joerg_wunsch 2020-11-17 22:49:40.081000

You write you are trying to compile AVaRICE 2.14, but your final command messages indicate it's actually 2.12. Also, all the compile errors you mentioned seem to be old ones that have been fixed in the current codebase.

avrs-admin avatar Jan 26 '22 21:01 avrs-admin