lwip-users
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [lwip-users] How to build LwIP1.3.0 for Xilinx PPC405


From: Kevin
Subject: Re: [lwip-users] How to build LwIP1.3.0 for Xilinx PPC405
Date: Thu, 4 Jun 2009 22:58:26 -0400

Thanks, Lou!

I tried to build it from XPS GUI, and it passed without any warnings/errors.

Is there a way to build this lwip without going through libgen? I tried to run "makefile" under lwip130/src folder inside "EDK Shell" and keep getting complains about cannot find files, so I manually add path to the include variable. Here is my modified "makefile"

>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
include Makefile.lwip
include Makefile.adapter

COMPILER=
ARCHIVER=
CP=cp
COMPILER_FLAGS=
EXTRA_COMPILER_FLAGS=

RELEASEDIR=../../../lib
INCLUDEDIR=../../../include

XILINXLIBDIR=/cygdrive/c/xilinx/10.1/edk/sw                                      ## <-------- manually added
XILINXBSPDIR=$(XILINXLIBDIR)/lib/bsp/uCOS-II_v2_86_a/src/ppc405             ## <-------- manually added
XILINXCOMMONDIR=$(XILINXLIBDIR)/XilinxProcessorIPLib/drivers/common_v1_00_a/src      ## <-------- manually added
XILINXDRIVERDIR=$(XILINXLIBDIR)/XilinxProcessorIPLib/drivers/lltemac_v1_00_b/src     ## <-------- manually added
INCLUDES=-I${INCLUDEDIR} -I$(LWIP_DIR)/src/include -I$(LWIP_DIR)/src/include/ipv4 -I$(PORT)/include \
                -I${XILINXBSPDIR} -I${XILINXCOMMONDIR} -I${XILINXDRIVERDIR}     ## <-------- manually added

#INCLUDES=-I${INCLUDEDIR} -I$(LWIP_DIR)/src/include -I$(LWIP_DIR)/src/include/ipv4 -I$(PORT)/include

EXPORT_INCLUDE_FILES =  $(LWIP_DIR)/src/include/ipv4/lwip \
            $(LWIP_DIR)/src/include/lwip \
            $(LWIP_DIR)/src/include/netif \
            contrib/ports/xilinx/include/netif \
            contrib/ports/xilinx/include/arch \
            contrib/ports/xilinx/include/lwipopts.h \

libs: liblwip4.a
    cp liblwip4.a $(RELEASEDIR)

include:
    @for i in $(EXPORT_INCLUDE_FILES); do \
    echo ${CP} -r $$i ${INCLUDEDIR}; \
    ${CP} -r $$i ${INCLUDEDIR}; \
    done

clean:
    echo "clean target for lwip"

liblwip4.a: obj_dir print_msg_lwip_base $(LWIP_OBJS) print_msg_lwip_adapter $(ADAPTER_OBJS)
    @echo "Creating archive $@"
    $(ARCHIVER) rc $@ obj/*.o

obj_dir:
    mkdir -p obj

print_msg_lwip_base:
    @echo "Compiling lwIP with $(GCC_COMPILER)"

print_msg_lwip_adapter:
    @echo "Compiling lwIP adapter for Xilinx MAC:"

.c.o:
    @echo "Compiling $<"
    @$(GCC_COMPILER) $(COMPILER_FLAGS) $(EXTRA_COMPILER_FLAGS) $(INCLUDES) -c $< -o obj/$(@F)
<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<

By running this makefile, I still get following error:
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
Compiling contrib/ports/xilinx/netif/xpqueue.c
Compiling contrib/ports/xilinx/netif/xadapter.c
In file included from /cygdrive/c/xilinx/10.1/edk/sw/XilinxProcessorIPLib/drivers/lltemac_v1_00_b/src/xlltemac.h:270,
                 from ../../../include/netif/xlltemacif.h:32,
                 from contrib/ports/xilinx/netif/xadapter.c:42:
/cygdrive/c/xilinx/10.1/edk/sw/XilinxProcessorIPLib/drivers/lltemac_v1_00_b/src/xlltemac_hw.h:53:17: error: xio.h: No such file or directory
In file included from contrib/ports/xilinx/netif/xadapter.c:42:
../../../include/netif/xlltemacif.h:33:20: error: xlldma.h: No such file or directory
../../../include/netif/xlltemacif.h:34:21: error: xllfifo.h: No such file or directory
../../../include/netif/xlltemacif.h:35:27: error: xlldma_bdring.h: No such file or directory
In file included from contrib/ports/xilinx/netif/xadapter.c:42:
../../../include/netif/xlltemacif.h:53: error: expected specifier-qualifier-list before 'XLlDma'
../../../include/netif/xlltemacif.h:70: error: expected ')' before '*' token
make: *** [contrib/ports/xilinx/netif/xadapter.o] Error 1
<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<

My target is to build this LwIP130 in EDK Shell without using Libgen, I guess a powerpc-eabi-xxx and a good makefile should work.

Now, my question is: is there a quick way to automatically let powerpc-eabi-xxx know the include path without using libgen? I am sure xps GUI deal with this somewhere, but I am new to GNU and couldn't find this underlying command. May I ask what's your "makefile" looks like?


Thank you so much!

Regards,
Kevin

On Thu, Jun 4, 2009 at 6:57 AM, Lou Cypher <address@hidden> wrote:
Kevin,
you should look for application note XAPP1026 from Xilinx, that documents and
provides code for their MAC implementation.

Be warned, however: lwIP can be included in "Software Platform Settings" (I did
it with Microblaze, I think it's way similar with PPC), but it doesn't give you
all the options for compiling lwIP.
I needed to enable LWIP_NETIF_HOSTNAME, and the only way out has been
 a) copying all the setting generated automatically by SDK for lwIP,
 b) removing lwIP from "Software Platform Settings",
 c) copying in my project sources from
"\Xilinx\10.1\EDK\sw\ThirdParty\sw_services\lwip130_v1_00_a\"
 d) patching the missing files from what I saved in step a), because some
sources are SDK generated, like file "xtopology_g.c"

Again, be careful if you use Xilinx' example code: there are unused functions,
functions that don't always return a value while they should (missing "return"),
unused variables allocated, etc., and the standard compiler settings don't even
raise a warning for such events
It's a good example of how to *not* write C code.

And it's even been worse in my case, since I had conflicting header names with
some existing source code that I can't modify, so I had to create a library for
lwIP (and it's almost undocumented how to do that in SDK).

Lou



_______________________________________________
lwip-users mailing list
address@hidden
http://lists.nongnu.org/mailman/listinfo/lwip-users


reply via email to

[Prev in Thread] Current Thread [Next in Thread]