[En-Nut-Discussion] Can't correctly build NutOS 4.8.9 on Fedora 14 for Ethernut 2.1b

Bernard Fouché bernard.fouche at kuantic.com
Mon Apr 18 15:33:31 CEST 2011


Hi Harald,

Le 16/04/2011 16:04, Harald Kipp a écrit :
> On Ubuntu I simply use
>    sudo apt-get install gcc-avr
>    sudo apt-get install avr-libc
Because of the 'usual' avr-gcc mess (one never clearly knows what 
patches are required to build a working compilation chain and many 
packaged compilation chain were not built with the required patchees), I 
was used to build it from WinAVR included patches... Now Atmel ships Avr 
Studio 5 with avr-gcc binaries and because of the GPL they setup a 
website where one is supposed to be able to get the patches.

>
> Same problem here when using Nut/OS 4.8.9 with avr-gcc 4.3.4 and
> avr-libc 1.6.7. For some reason something is broken with relative paths.
>
> Please try absolute paths
>
>    Repository: /home/bernard/ethernut/nut/conf/repository.nut
>    Source Directory: /home/bernard/ethernut/nut
>    Platform: avr-gcc
>    Build directory: /home/bernard/ethernut/nutbld
>    Appl. Directory: /home/bernard/ethernut/nutapp
>    Programmer: avr-dude
>
> All other settings should be left empty.
It does not work either: the compilation breaks reporting absolute paths 
instead of relative ones ;-) :

14:39:34: Nut/OS Configurator Version 2.0.9
14:39:34: Linked to wxWidgets 2.8.11
14:39:34: Running on Linux 2.6.35.12-88.fc14.i686.PAE i686
14:39:34: Working in /home/bernard/ethernut/ethernut-4.8.9
14:39:35: Failed to load help file
14:39:43: Loading /home/bernard/ethernut/nut/conf/repository.nut
14:39:43: Loading 
/home/bernard/ethernut/ethernut-4.8.9/conf/ethernut21b.conf
14:39:43: OK
14:40:12: Creating Makefiles for avr-gcc in /home/bernard/ethernut/nutbld
14:40:12: Creating header files in /home/bernard/ethernut/nutbld
14:40:12: OK
14:40:13: ----- Running 'make clean' -----
14:40:13: ----- 'make clean' terminated successfully -----
14:40:13: ----- Running 'make all' -----
/home/bernard/ethernut/nut/arch/avr/os/context_gcc.c:114:20: error: 
cfg/os.h: No such file or directory
/home/bernard/ethernut/nut/arch/avr/os/context_gcc.c:115:24: error: 
cfg/memory.h: No such file or directory

I try running NutConf with absolute path from /home/bernard/ethernut or 
/home/bernard/ethernut/nut.

Thanks to strace(1) I see that make(1) enters nutbld/arch . Since 
avr-gcc is launched without any '-I../..whatever_is_needed', it can't 
find the header files. I have added in UserConf.mk:

CFLAGS+=-I../../nut/include

But then avr-gcc does not know what MCU is concerned, I have to add to 
the previous string:

-mmcu=atemega128

And then it fails because 'NUT_CPU_FREQ' is unknown, etc.

It seems that defining that I use an Ethernut 2.1b does not bring in all 
the 2.1b stuff and every define which is target related is ignored by 
the build process. When I define:

-DNUT_CPU_FREQ=14745600

Then the compilation fails reporting :

15:28:53: ----- Running 'make clean' -----
15:28:53: ----- 'make clean' terminated successfully -----
15:28:53: ----- Running 'make all' -----
/home/bernard/ethernut/nut/arch/avr/dev/ahdlc0.c:74: error: 
'AhdlcAvrWrite_P' undeclared here (not in a function)
/home/bernard/ethernut/nut/arch/avr/dev/ahdlc0.c:75: warning: 
initialization from incompatible pointer type
/home/bernard/ethernut/nut/arch/avr/dev/ahdlc0.c:76: warning: 
initialization from incompatible pointer type
/home/bernard/ethernut/nut/arch/avr/dev/ahdlc0.c:78: warning: excess 
elements in struct initializer
/home/bernard/ethernut/nut/arch/avr/dev/ahdlc0.c:78: warning: (near 
initialization for 'devAhdlc0')
make[1]: *** [avr/dev/ahdlc0.o] Error 1
make: *** [all] Error 2
15:28:53: ----- 'make all' failed with error 2 -----

Modifying UserConf.mk seems a dead end, there is always something missing...

What is problematic with nutconf is the difficulty to get a trace of 
what tool runs in what directory, what file is processed before running 
make(1), etc...

At this time I still don't have a working NutOs!!

     Bernard



More information about the En-Nut-Discussion mailing list