forked from Lign17314/pico-rndis-use-freerots
-
Notifications
You must be signed in to change notification settings - Fork 1
/
CMakeLists.txt
73 lines (66 loc) · 2.28 KB
/
CMakeLists.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
cmake_minimum_required(VERSION 3.13)
set(PICO_BOARD pico_w)
include(pico_sdk_import.cmake)
project(test)
add_executable(test)
pico_sdk_init()
set(TOP ${PICO_SDK_PATH})
SET(FREERTOS_KERNEL_PATH "${PICO_SDK_PATH}/lib/FreeRTOS-Kernel")
if (NOT FREERTOS_KERNEL_PATH AND NOT DEFINED ENV{FREERTOS_KERNEL_PATH})
message("Skipping Pico W FreeRTOS examples as FREERTOS_KERNEL_PATH not defined")
else()
include(FreeRTOS_Kernel_import.cmake)
set(TOP ${PICO_SDK_PATH})
include(${TOP}/lib/tinyusb/hw/bsp/family_support.cmake)
#add_subdirectory(iperf)
#add_subdirectory(ping)
pico_enable_stdio_usb(test 0)
pico_enable_stdio_uart(test 1)
target_compile_definitions(test PRIVATE
NO_SYS=0 # don't want NO_SYS (generally this would be in your lwipopts.h)
LWIP_SOCKET=1
LWIP_PROVIDE_ERRNO=1
#LWIP_NETCONN=1
#LWIP_NETIF_API=1
LWIP_IPV4=1
#LWIP_TCP=1
DEFAULT_TCP_RECVMBOX_SIZE=12
DEFAULT_ACCEPTMBOX_SIZE=12
#TCPIP_THREAD_PRIO=9
#LIB_CMSIS_CORE =1
)
target_include_directories(test PUBLIC
${CMAKE_CURRENT_SOURCE_DIR}
${CMAKE_CURRENT_SOURCE_DIR}/include
#${PICO_LWIP_CONTRIB_PATH}/../src/include
${PICO_LWIP_CONTRIB_PATH}/apps/ping
${TOP}/lib/lwip/src/include/
#${PICO_LWIP_CONTRIB_PATH}/ports/freertos
${TOP}/lib/tinyusb/lib/networking
${FREERTOS_KERNEL_PATH}/include
${FREERTOS_KERNEL_PATH}/portable/ThirdParty/GCC/RP2040/include
)
target_sources(test PUBLIC
${CMAKE_CURRENT_SOURCE_DIR}/main.c
${CMAKE_CURRENT_SOURCE_DIR}/freertos_hook.c
${CMAKE_CURRENT_SOURCE_DIR}/usb_descriptors.c
#${CMAKE_CURRENT_SOURCE_DIR}/sys_arch.c
${PICO_LWIP_CONTRIB_PATH}/apps/ping/ping.c
${TOP}/lib/tinyusb/lib/networking/dhserver.c
${TOP}/lib/tinyusb/lib/networking/dnserver.c
${TOP}/lib/tinyusb/lib/networking/rndis_reports.c
${TOP}/src/rp2_common/pico_cyw43_arch/cyw43_arch_freertos.c
)
target_link_libraries(test PUBLIC
pico_stdlib
cmsis_core
FreeRTOS-Kernel-Heap4
pico_lwip_iperf
pico_lwip
pico_lwip_contrib_freertos
tinyusb_device
tinyusb_board
pico_cyw43_arch_lwip_sys_freertos
)
pico_add_extra_outputs(test)
endif()