cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
weener
Visitor
Visitor
1,756 Views
Registered: ‎07-26-2018

Run echo_server application with microBlaze, SDK shows“cannot find -llwip4”

Jump to solution
I try to follow this tutorial with SDK 2018.2 , but I met some problems: When I compiled the echo_server application. The error message said "cannot find -llwip4".

I tried lots of methods, this error still cannot be solved. I set the BSPsettings as below:1545748038(1).png

My linker flags in app includes the -llwip4

OPTION linker_flags = "-Wl,--start-group,-lxil,-llwip4,-lgcc,-lc,--end-group";

the D:\SOFTWARE\Xilinx\SDK\2018.2\data\embeddedsw\ThirdParty\sw_services\lwip202_v1_1\src\lwip-2.0.2\src\include\lwip folder exists too.

Now I am thinking that maybe I should try SDK 2015.4? Is there any problem to build this project in SDK 2018.2? Or do anyone know how to fix this error? I really need help.

Thanks.

 
 
 
 
0 Kudos
1 Solution

Accepted Solutions
okanbozkurt
Visitor
Visitor
1,679 Views
Registered: ‎12-25-2018

You can check here for patch --> https://www.xilinx.com/support/answers/71330.html

I think your problem is related to BSP instead of application src. If bsp is not compiled properly, you get library errors. 

By the way, "timeout.h" file that I said you is here --> /your_bsp/microblaze_0/libsrc/lwip202_v1_1/src/contrib/ports/xilinx/netif/xemacliteif.c

Can you try to change it to "lwip/timeouts.h" ?

View solution in original post

0 Kudos
7 Replies
okanbozkurt
Visitor
Visitor
1,735 Views
Registered: ‎12-25-2018

Can you share console output or errors with us?

Probably your problem is about Vivado 2018.2. Because there is a compile problem in Vivado 2018.2 about Lwip. Either you have to do patch to lwip from GIT or should try 2018.3.

By the way did you try to change “timers.h” to “timeouts.h” include?

0 Kudos
weener
Visitor
Visitor
1,692 Views
Registered: ‎07-26-2018

Thank you for your reply.

Here is the console output:

13:48:48 **** Auto Build of configuration Debug for project echo_server ****
make all
'Building file: ../src/echo.c'
'Invoking: MicroBlaze gcc compiler'
mb-gcc -Wall -O0 -g3 -c -fmessage-length=0 -MT"src/echo.o" -I../../echo_server_bsp/microblaze_0/include -mlittle-endian -mcpu=v10.0 -mxl-soft-mul -Wl,--no-relax -ffunction-sections -fdata-sections -MMD -MP -MF"src/echo.d" -MT"src/echo.o" -o "src/echo.o" "../src/echo.c"
'Finished building: ../src/echo.c'
' '
'Building file: ../src/i2c_access.c'
'Invoking: MicroBlaze gcc compiler'
mb-gcc -Wall -O0 -g3 -c -fmessage-length=0 -MT"src/i2c_access.o" -I../../echo_server_bsp/microblaze_0/include -mlittle-endian -mcpu=v10.0 -mxl-soft-mul -Wl,--no-relax -ffunction-sections -fdata-sections -MMD -MP -MF"src/i2c_access.d" -MT"src/i2c_access.o" -o "src/i2c_access.o" "../src/i2c_access.c"
'Finished building: ../src/i2c_access.c'
' '
'Building file: ../src/iic_phyreset.c'
'Invoking: MicroBlaze gcc compiler'
mb-gcc -Wall -O0 -g3 -c -fmessage-length=0 -MT"src/iic_phyreset.o" -I../../echo_server_bsp/microblaze_0/include -mlittle-endian -mcpu=v10.0 -mxl-soft-mul -Wl,--no-relax -ffunction-sections -fdata-sections -MMD -MP -MF"src/iic_phyreset.d" -MT"src/iic_phyreset.o" -o "src/iic_phyreset.o" "../src/iic_phyreset.c"
'Finished building: ../src/iic_phyreset.c'
' '
'Building file: ../src/main.c'
'Invoking: MicroBlaze gcc compiler'
mb-gcc -Wall -O0 -g3 -c -fmessage-length=0 -MT"src/main.o" -I../../echo_server_bsp/microblaze_0/include -mlittle-endian -mcpu=v10.0 -mxl-soft-mul -Wl,--no-relax -ffunction-sections -fdata-sections -MMD -MP -MF"src/main.d" -MT"src/main.o" -o "src/main.o" "../src/main.c"
'Finished building: ../src/main.c'
' '
'Building file: ../src/platform.c'
'Invoking: MicroBlaze gcc compiler'
mb-gcc -Wall -O0 -g3 -c -fmessage-length=0 -MT"src/platform.o" -I../../echo_server_bsp/microblaze_0/include -mlittle-endian -mcpu=v10.0 -mxl-soft-mul -Wl,--no-relax -ffunction-sections -fdata-sections -MMD -MP -MF"src/platform.d" -MT"src/platform.o" -o "src/platform.o" "../src/platform.c"
'Finished building: ../src/platform.c'
' '
'Building file: ../src/platform_mb.c'
'Invoking: MicroBlaze gcc compiler'
mb-gcc -Wall -O0 -g3 -c -fmessage-length=0 -MT"src/platform_mb.o" -I../../echo_server_bsp/microblaze_0/include -mlittle-endian -mcpu=v10.0 -mxl-soft-mul -Wl,--no-relax -ffunction-sections -fdata-sections -MMD -MP -MF"src/platform_mb.d" -MT"src/platform_mb.o" -o "src/platform_mb.o" "../src/platform_mb.c"
'Finished building: ../src/platform_mb.c'
' '
'Building file: ../src/platform_ppc.c'
'Invoking: MicroBlaze gcc compiler'
mb-gcc -Wall -O0 -g3 -c -fmessage-length=0 -MT"src/platform_ppc.o" -I../../echo_server_bsp/microblaze_0/include -mlittle-endian -mcpu=v10.0 -mxl-soft-mul -Wl,--no-relax -ffunction-sections -fdata-sections -MMD -MP -MF"src/platform_ppc.d" -MT"src/platform_ppc.o" -o "src/platform_ppc.o" "../src/platform_ppc.c"
'Finished building: ../src/platform_ppc.c'
' '
'Building file: ../src/platform_zynq.c'
'Invoking: MicroBlaze gcc compiler'
mb-gcc -Wall -O0 -g3 -c -fmessage-length=0 -MT"src/platform_zynq.o" -I../../echo_server_bsp/microblaze_0/include -mlittle-endian -mcpu=v10.0 -mxl-soft-mul -Wl,--no-relax -ffunction-sections -fdata-sections -MMD -MP -MF"src/platform_zynq.d" -MT"src/platform_zynq.o" -o "src/platform_zynq.o" "../src/platform_zynq.c"
'Finished building: ../src/platform_zynq.c'
' '
'Building file: ../src/platform_zynqmp.c'
'Invoking: MicroBlaze gcc compiler'
mb-gcc -Wall -O0 -g3 -c -fmessage-length=0 -MT"src/platform_zynqmp.o" -I../../echo_server_bsp/microblaze_0/include -mlittle-endian -mcpu=v10.0 -mxl-soft-mul -Wl,--no-relax -ffunction-sections -fdata-sections -MMD -MP -MF"src/platform_zynqmp.d" -MT"src/platform_zynqmp.o" -o "src/platform_zynqmp.o" "../src/platform_zynqmp.c"
'Finished building: ../src/platform_zynqmp.c'
' '
'Building file: ../src/sfp.c'
'Invoking: MicroBlaze gcc compiler'
mb-gcc -Wall -O0 -g3 -c -fmessage-length=0 -MT"src/sfp.o" -I../../echo_server_bsp/microblaze_0/include -mlittle-endian -mcpu=v10.0 -mxl-soft-mul -Wl,--no-relax -ffunction-sections -fdata-sections -MMD -MP -MF"src/sfp.d" -MT"src/sfp.o" -o "src/sfp.o" "../src/sfp.c"
'Finished building: ../src/sfp.c'
' '
'Building file: ../src/si5324.c'
'Invoking: MicroBlaze gcc compiler'
mb-gcc -Wall -O0 -g3 -c -fmessage-length=0 -MT"src/si5324.o" -I../../echo_server_bsp/microblaze_0/include -mlittle-endian -mcpu=v10.0 -mxl-soft-mul -Wl,--no-relax -ffunction-sections -fdata-sections -MMD -MP -MF"src/si5324.d" -MT"src/si5324.o" -o "src/si5324.o" "../src/si5324.c"
'Finished building: ../src/si5324.c'
' '
'Building target: echo_server.elf'
'Invoking: MicroBlaze gcc linker'
mb-gcc -Wl,--start-group,-lxil,-llwip4,-lgcc,-lc,--end-group -Wl,-T -Wl,../src/lscript.ld -L../../echo_server_bsp/microblaze_0/lib -mlittle-endian -mcpu=v10.0 -mxl-soft-mul -Wl,--no-relax -Wl,--gc-sections -o "echo_server.elf" ./src/echo.o ./src/i2c_access.o ./src/iic_phyreset.o ./src/main.o ./src/platform.o ./src/platform_mb.o ./src/platform_ppc.o ./src/platform_zynq.o ./src/platform_zynqmp.o ./src/sfp.o ./src/si5324.o -Wl,--start-group,-lxil,-llwip4,-lgcc,-lc,--end-group
d:/software/xilinx/sdk/2018.2/gnu/microblaze/nt/bin/../lib/gcc/microblaze-xilinx-elf/7.2.0/../../../../microblaze-xilinx-elf/bin/ld.exe: cannot find -llwip4
collect2.exe: error: ld returned 1 exit status
make: *** [echo_server.elf] 错误 1

And I didn't try to change “timers.h” to “timeouts.h” include. Where can I do this? I didn't find any ' #include "lwip/timers.h" 'or ' #include "lwip/timers.h" ' under the src folder in echo_server application project.

Or you said to do patch to lwip from GIT. I am sorry I do not know how to do it. Do you have some tutorials for this?

0 Kudos
okanbozkurt
Visitor
Visitor
1,680 Views
Registered: ‎12-25-2018

You can check here for patch --> https://www.xilinx.com/support/answers/71330.html

I think your problem is related to BSP instead of application src. If bsp is not compiled properly, you get library errors. 

By the way, "timeout.h" file that I said you is here --> /your_bsp/microblaze_0/libsrc/lwip202_v1_1/src/contrib/ports/xilinx/netif/xemacliteif.c

Can you try to change it to "lwip/timeouts.h" ?

View solution in original post

0 Kudos
weener
Visitor
Visitor
1,651 Views
Registered: ‎07-26-2018

OK,I tried to change it to "lwip/timeouts.h" , but it didn't work. I think you are right there are some errors when I regenerated BSP source, here is the console message:

"Compiling emaclite"
"Running Make libs in microblaze_0/libsrc/intc_v3_7/src"
make -C microblaze_0/libsrc/intc_v3_7/src -s libs "SHELL=CMD" "COMPILER=mb-gcc" "ARCHIVER=mb-ar" "COMPILER_FLAGS= -O2 -c -mcpu=v10.0 -mlittle-endian -mxl-soft-mul" "EXTRA_COMPILER_FLAGS=-ffunction-sections -fdata-sections -Wall -Wextra"
"Compiling intc"
"Running Make libs in microblaze_0/libsrc/lwip202_v1_1/src"
make -C microblaze_0/libsrc/lwip202_v1_1/src -s libs "SHELL=CMD" "COMPILER=mb-gcc" "ARCHIVER=mb-ar" "COMPILER_FLAGS= -O2 -c -mcpu=v10.0 -mlittle-endian -mxl-soft-mul" "EXTRA_COMPILER_FLAGS=-ffunction-sections -fdata-sections -Wall -Wextra"
"Compiling lwip src and adapter files"
contrib/ports/xilinx/netif/xadapter.c: In function 'eth_link_detect':
contrib/ports/xilinx/netif/xadapter.c:347:7: error: 'xemacp' undeclared (first use in this function); did you mean 'xemac'?
if ((xemacp->IsReady != (u32)XIL_COMPONENT_IS_READY) ||
^~~~~~
xemac
contrib/ports/xilinx/netif/xadapter.c:347:7: note: each undeclared identifier is reported only once for each function it appears in
contrib/ports/xilinx/netif/xadapter.c:351:20: warning: implicit declaration of function 'phy_link_detect'; did you mean 'eth_link_detect'? [-Wimplicit-function-declaration]
phy_link_status = phy_link_detect(xemacp, phyaddrforemac);
^~~~~~~~~~~~~~~
eth_link_detect
contrib/ports/xilinx/netif/xadapter.c:367:5: warning: implicit declaration of function 'phy_autoneg_status' [-Wimplicit-function-declaration]
phy_autoneg_status(xemacp, phyaddrforemac)) {
^~~~~~~~~~~~~~~~~~
contrib/ports/xilinx/netif/xadapter.c:337:18: warning: unused variable 'xemac' [-Wunused-variable]
struct xemac_s *xemac = (struct xemac_s *)(netif->state);
^~~~~
contrib/ports/xilinx/netif/xadapter.c:336:8: warning: unused variable 'link_speed' [-Wunused-variable]
u32_t link_speed, phy_link_status;
^~~~~~~~~~
make[1]: *** [xadapter.o] 错误 1
contrib/ports/xilinx/netif/xemacliteif.c: In function 'configure_IEEE_phy_speed_emaclite':
contrib/ports/xilinx/netif/xemacliteif.c:790:6: warning: unused variable 'phylinkspeed' [-Wunused-variable]
u16 phylinkspeed;
^~~~~~~~~~~~
contrib/ports/xilinx/netif/xemacliteif.c:789:6: warning: unused variable 'status' [-Wunused-variable]
u16 status;
^~~~~~
contrib/ports/xilinx/netif/xemacliteif.c: In function 'xemacliteif_init':
contrib/ports/xilinx/netif/xemacliteif.c:863:16: warning: assignment from incompatible pointer type [-Wincompatible-pointer-types]
netif->output = xemacliteif_output;
^
make[1]: 由于错误目标“libs”并未重新创建。
make: *** [microblaze_0/libsrc/lwip202_v1_1/src/make.libs] 错误 2
"Running Make libs in microblaze_0/libsrc/standalone_v6_7/src"
make -C microblaze_0/libsrc/standalone_v6_7/src -s libs "SHELL=CMD" "COMPILER=mb-gcc" "ARCHIVER=mb-ar" "COMPILER_FLAGS= -O2 -c -mcpu=v10.0 -mlittle-endian -mxl-soft-mul" "EXTRA_COMPILER_FLAGS=-ffunction-sections -fdata-sections -Wall -Wextra"
"Compiling standalone";
microblaze_sleep.c:74:9: note: #pragma message: For the sleep routines, assembly instructions are used
#pragma message ("For the sleep routines, assembly instructions are used")
^~~~~~~

 

and an error in /my_bsp/microblaze_0/libsrc/lwip202_v1_1/src/contrib/ports/xilinx/netif/xadapter.c :

 if ((xemacp->IsReady != (u32)XIL_COMPONENT_IS_READY) ||
(eth_link_status == ETH_LINK_UNDEFINED))
return;

error is:  xemacp undeclared

I read the website you provided to patch. I think I need some time to understand, but I saw 'xemacp', maybe it relates to my error.

If you have any other advices please tell me, thank you very much.

0 Kudos
okanbozkurt
Visitor
Visitor
1,633 Views
Registered: ‎12-25-2018

OK, just like I though! Your BSP is not being compiled, so lwip library is not properly formed. That's the error.

Pls, download the file that I attached(xadapter.c) and just replace it with yours and compile it! If it works you can accepted a new year gift from me :)

BUT do NOT generate BSP again. If you do so, xadapter.c file is converted to original one. 

0 Kudos
weener
Visitor
Visitor
1,624 Views
Registered: ‎07-26-2018

Thank you so much.

I checked here for patch --> https://www.xilinx.com/support/answers/71330.html

And it worked!

0 Kudos
LYL
Newbie
Newbie
640 Views
Registered: ‎11-07-2020

Hello!

Recently I have been doing the experimento of echo_server by Nexy4 ddr,and I have met the same problem.Fortunately I found your answer.So could you teach me how to use the patchto solve this problem?

By the way,are you still learning Nexy4,maybe we can exchange wechat to learn together.

Thank you very much!

 

 

0 Kudos