AnsweredAssumed Answered

Add lwIP to a Project on MCUXpresso

Question asked by Gustavo Costa on Oct 10, 2017
Latest reply on Nov 13, 2017 by Alice_Yang

Hello there,

 

I'm trying to implement a lwIP stack to my project using KSDK2.2.

 

When testing the TCPECHO example it works just fine, but when I copy the lwIP folder to my project, and add the paths to "MCU C Compiler -> Includes" and to "MCU Assembler -> General", the build fails with the following console error:

 

Building target: MK64FN1M0xxx12_Project.axf
Invoking: MCU Linker
arm-none-eabi-gcc -nostdlib -Xlinker -Map="MK64FN1M0xxx12_Project.map" -Xlinker --gc-sections -Xlinker -print-memory-usage -mcpu=cortex-m4 -mfpu=fpv4-sp-d16 -mfloat-abi=hard -mthumb -T MK64FN1M0xxx12_Project_Debug.ld -o "MK64FN1M0xxx12_Project.axf" ./utilities/fsl_debug_console.o ./utilities/fsl_notifier.o ./utilities/fsl_shell.o ./twrk64f120m/board.o ./twrk64f120m/clock_config.o ./twrk64f120m/pin_mux.o ./startup/startup_mk64f12.o ./source/MK64FN1M0xxx12_Project.o ./freertos/croutine.o ./freertos/event_groups.o ./freertos/fsl_tickless_lptmr.o ./freertos/fsl_tickless_systick.o ./freertos/heap_4.o ./freertos/list.o ./freertos/port.o ./freertos/queue.o ./freertos/tasks.o ./freertos/timers.o ./drivers/fsl_adc16.o ./drivers/fsl_clock.o ./drivers/fsl_cmp.o ./drivers/fsl_common.o ./drivers/fsl_dspi.o ./drivers/fsl_dspi_freertos.o ./drivers/fsl_enet.o ./drivers/fsl_flash.o ./drivers/fsl_gpio.o ./drivers/fsl_pit.o ./drivers/fsl_smc.o ./drivers/fsl_sysmpu.o ./drivers/fsl_uart.o ./drivers/fsl_uart_freertos.o ./drivers/fsl_wdog.o ./CMSIS/system_MK64F12.o
Memory region Used Size Region Size %age Used
PROGRAM_FLASH: 32108 B 1 MB 3.06%
SRAM_UPPER: 40228 B 192 KB 20.46%
./source/MK64FN1M0xxx12_Project.o: In function `Init_task':
SRAM_LOWER: 0 GB 64 KB 0.00%
C:\workspace.MCUXpresso\MK64FN1M0xxx12_Project\Debug/../source/MK64FN1M0xxx12_Project.c:485: undefined reference to `tcpip_init'
C:\workspace.MCUXpresso\MK64FN1M0xxx12_Project\Debug/../source/MK64FN1M0xxx12_Project.c:492: undefined reference to `netif_remove'
C:\workspace.MCUXpresso\MK64FN1M0xxx12_Project\Debug/../source/MK64FN1M0xxx12_Project.c:488: undefined reference to `netif_add'
C:\workspace.MCUXpresso\MK64FN1M0xxx12_Project\Debug/../source/MK64FN1M0xxx12_Project.c:499: undefined reference to `dhcp_start'
C:\workspace.MCUXpresso\MK64FN1M0xxx12_Project\Debug/../source/MK64FN1M0xxx12_Project.c:504: undefined reference to `lwip_strerr'
C:\workspace.MCUXpresso\MK64FN1M0xxx12_Project\Debug/../source/MK64FN1M0xxx12_Project.c:515: undefined reference to `ip4addr_ntoa'
C:\workspace.MCUXpresso\MK64FN1M0xxx12_Project\Debug/../source/MK64FN1M0xxx12_Project.c:516: undefined reference to `ip4addr_ntoa'
C:\workspace.MCUXpresso\MK64FN1M0xxx12_Project\Debug/../source/MK64FN1M0xxx12_Project.c:517: undefined reference to `ip4addr_ntoa'
C:\workspace.MCUXpresso\MK64FN1M0xxx12_Project\Debug/../source/MK64FN1M0xxx12_Project.c:519: undefined reference to `netif_set_default'
C:\workspace.MCUXpresso\MK64FN1M0xxx12_Project\Debug/../source/MK64FN1M0xxx12_Project.c:526: undefined reference to `ethernet_input'
C:\workspace.MCUXpresso\MK64FN1M0xxx12_Project\Debug/../source/MK64FN1M0xxx12_Project.c:526: undefined reference to `ethernetif_init'
./source/MK64FN1M0xxx12_Project.o: In function `UDP1_Task':
C:\workspace.MCUXpresso\MK64FN1M0xxx12_Project\Debug/../source/MK64FN1M0xxx12_Project.c:691: undefined reference to `netif_set_up'
C:\workspace.MCUXpresso\MK64FN1M0xxx12_Project\Debug/../source/MK64FN1M0xxx12_Project.c:694: undefined reference to `netconn_new_with_proto_and_callback'
C:\workspace.MCUXpresso\MK64FN1M0xxx12_Project\Debug/../source/MK64FN1M0xxx12_Project.c:695: undefined reference to `sys_assert'
C:\workspace.MCUXpresso\MK64FN1M0xxx12_Project\Debug/../source/MK64FN1M0xxx12_Project.c:698: undefined reference to `netconn_bind'
C:\workspace.MCUXpresso\MK64FN1M0xxx12_Project\Debug/../source/MK64FN1M0xxx12_Project.c:711: undefined reference to `netconn_recv'
C:\workspace.MCUXpresso\MK64FN1M0xxx12_Project\Debug/../source/MK64FN1M0xxx12_Project.c:713: undefined reference to `netbuf_data'
FLEX_RAM: 0 GB 4 KB 0.00%
C:\workspace.MCUXpresso\MK64FN1M0xxx12_Project\Debug/../source/MK64FN1M0xxx12_Project.c:722: undefined reference to `netbuf_delete'
./source/MK64FN1M0xxx12_Project.o: In function `main':
C:\workspace.MCUXpresso\MK64FN1M0xxx12_Project\Debug/../source/MK64FN1M0xxx12_Project.c:886: undefined reference to `sys_thread_new'
collect2.exe: error: ld returned 1 exit status
make: *** [MK64FN1M0xxx12_Project.axf] Error 1

 

I already checked the paths and don't know what to do anymore.

 

Any idea would be of plenty help.

 

Thank you.

 

Best Regards,

Gustavo Cossta

R&D Engineer

Outcomes