Open jhnet opened 7 years ago
Hi, I tried to install tinyos from source on an Ubuntu 17.04. Compilation of TinyOS works fine. After installation I tried to compile the Blink App for a TelosB mote, which also works fine.
When I try to compile for the iris mote, the avr/io.h complains about "device type not found". I installed gcc-avr and avr-libc from the official ubuntu repositories.
Different motes/platforms use different toolchains. The Iris toolchain uses the avr toolchain. Something changed in the toolchain installed via Ubuntu 17.04 so it no longer recognizes the device type used on the IRIS.
I don't have the installation to figure this out. So I'd like to encourage you to do the research to figure this out.
Hi! I am also getting the same issue in ubuntu 16.04. I am using this command to install the avr-toolchain. sudo apt-get install gcc-avr binutils-avr gdb-avr avr-libc avrdude
Is there any update on this issue. Looking forward for your help.
Thanks
there is no update.
as I've said someone needs to figure out what the avr toolchain needs to recognize the chip being compiled for.
the iris platform calls out the atmega1281 cpu via -mmcu=atmega1281 in support/make/platforms/iris.platform
I don't know what the command line sequence for the new avr compiler looks like. You will have to do the research into that.
You can see exactly what is being fed to the toolchain by doing "make iris verbose"
I have neither the time nor the set up to look into this. Someone who is actively building for the atmegas will have to do the research into the toolchain.
I did a quick google search for "avr-gcc command line options". Got to this page [https://gcc.gnu.org/onlinedocs/gcc/AVR-Options.html] and then searched for "atmega1281" and found avr51.
So change the -mmcu=atmega1281 to -mmcu=avr51 in iris.platform.
that might work.
Seriously, you guys need to put some effort into this. I have no incentive to get this to work, I don't use the avr chips. I'm using ARMs.
Actually the version of avr-gcc I installed still accepts -mmcu=atmega1281 instead of -mmcu=avr51. Verified this by compiling non-Tinyos avr blinking program. atmega1281 options compiles fine, avr51 not.
well that would have been easy.
You'll have to dig in there and figure out what this line is bitching about:
/usr/lib/gcc/avr/4.9.2/../../../avr/include/avr/io.h:623:6: warning: #warning "device type not defined"
When the basic machine definitions are messed up the whole compile blows up.
The warning is thrown, if no AVR has been defined. This is the corresponding section:
#else
# if !defined(__COMPILING_AVR_LIBC__)
# warning "device type not defined"
# endif
#endif
It comes after many ifdefs to check which AVR has been defined. I uploaded the complete file. I thought that one of these devices should be defined by setting the -mmcu. io.txt
it isn't matching any of the AVR_
the -mmcu is supposed to set something (I don't know the linkage) that then defines the AVR_
but I see from above that you got a non-TinyOS program working with -mmcu=atmega1281 that is good to know.
please upload the command line you used to compile the non-TinyOS avr blink program
and upload the output of "make iris verbose"
also what source are you compiling from?
this sounds like something got wedged in the tinyos make system.
The command for compiling the non-TinyOs blink program is:
avr-gcc -g -Os -mmcu=atmega1281 test.c
The complete log of
make iris verbose
can be found here:
https://gist.github.com/jhnet/5b3441a83c6fe5d7016829fa4e28b073
the "make iris verbose" is using -mmcu=avr51
can you rerun it and fix -mmcu to be atmega1281?
should be in support/make/platforms/iris.platform.
Sorry, forgot to change this back to atmega1281 fom the test with avr51. Here is the actual log https://gist.github.com/jhnet/6c8d08ccefb102c54a89cceedc99c126
It seems that the avr51 is still used by some commands, although atmega1281 is set in iris.platform.
how did you install the avr toolchain?
and what source are you using?
Sorry for the very late reply, I missed the notification.. AVR toolchain was installed from the official repositories, tinyos source is the one cloned from github.
Hi, I tried to install tinyos from source on an Ubuntu 17.04. Compilation of TinyOS works fine. After installation I tried to compile the Blink App for a TelosB mote, which also works fine.
When I try to compile for the iris mote, the avr/io.h complains about "device type not found". I installed gcc-avr and avr-libc from the official ubuntu repositories. The complete error message is: