Skip to content

Commit d43bf2e

Browse files
[MCUX-82885] Enable freertos-plus-tcp middleware repo for the MCUXpresso SDK 26.03.00 release
Signed-off-by: Michal Princ <michal.princ@nxp.com>
1 parent c32f8a4 commit d43bf2e

File tree

8 files changed

+113
-187
lines changed

8 files changed

+113
-187
lines changed

.gitmodules

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +0,0 @@
1-
[submodule "tools/CMock"]
2-
path = tools/CMock
3-
url = https://github.com/ThrowTheSwitch/CMock
4-
update = none
5-
[submodule "test/FreeRTOS-Kernel"]
6-
path = test/FreeRTOS-Kernel
7-
url = https://github.com/FreeRTOS/FreeRTOS-Kernel
8-
update = none

CMakeLists.txt

Lines changed: 13 additions & 177 deletions
Original file line numberDiff line numberDiff line change
@@ -1,178 +1,14 @@
1-
2-
cmake_minimum_required(VERSION 3.21)
3-
cmake_policy(SET CMP0048 NEW) # project version
4-
cmake_policy(SET CMP0076 NEW) # full paths
5-
6-
list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_LIST_DIR}/cmake_modules")
7-
8-
########################################################################
9-
# Project Details
10-
project(FreeRTOS-Plus-TCP
11-
VERSION 3.1.0
12-
DESCRIPTION "FreeRTOS TCP/UDP Network Layer"
13-
HOMEPAGE_URL https://freertos.org/FreeRTOS-Plus/FreeRTOS_Plus_TCP/index.html
14-
LANGUAGES C)
15-
16-
# Do not allow in-source build.
17-
if( ${PROJECT_SOURCE_DIR} STREQUAL ${PROJECT_BINARY_DIR} )
18-
message( FATAL_ERROR "In-source build is not allowed. Please build in a separate directory, such as ${PROJECT_SOURCE_DIR}/build." )
1+
#
2+
# Copyright 2024 NXP
3+
#
4+
# SPDX-License-Identifier: MIT
5+
#
6+
7+
if (CONFIG_MCUX_COMPONENT_middleware.freertos.freertos-plus-tcp)
8+
mcux_add_source(
9+
SOURCES source/*.* source/include/*.*
10+
)
11+
mcux_add_include(
12+
INCLUDES source/include
13+
)
1914
endif()
20-
21-
# Options
22-
option(FREERTOS_PLUS_TCP_BUILD_TEST "Build the test for FreeRTOS Plus TCP" OFF)
23-
option(FREERTOS_PLUS_TCP_ENABLE_BUILD_CHECKS "Enable the build checks for FreeRTOS-Plus-TCP" OFF)
24-
25-
# Configuration
26-
# Override these at project level with:
27-
# Optional: set(FREERTOS_PLUS_TCP_BUFFER_ALLOCATION "1" CACHE STRING "" FORCE)
28-
# Optional: set(FREERTOS_PLUS_TCP_COMPILER "" CACHE STRING "" FORCE)
29-
# Required: set(FREERTOS_PLUS_TCP_NETWORK_IF "POSIX" CACHE STRING "" FORCE)
30-
31-
# Select the appropriate buffer allocation method.
32-
# See: https://freertos.org/FreeRTOS-Plus/FreeRTOS_Plus_TCP/Embedded_Ethernet_Buffer_Management.html
33-
if (NOT FREERTOS_PLUS_TCP_BUFFER_ALLOCATION)
34-
message(STATUS "Using default FREERTOS_PLUS_TCP_BUFFER_ALLOCATION = 2")
35-
set(FREERTOS_PLUS_TCP_BUFFER_ALLOCATION "2" CACHE STRING "FreeRTOS buffer allocation model number. 1 .. 2.")
36-
endif()
37-
38-
# Select the Compiler - if left blank will detect using CMake
39-
# Note relies on CMake to detect over any setting here.
40-
# Valid options are:
41-
# FREERTOS_PLUS_TCP_COMPILER | Detected | CMake
42-
# -------------------------------------------------
43-
# CCS | No | ?TBD?
44-
# GCC | Yes | GNU
45-
# IAR | Yes | IAR
46-
# Keil | Yes | ARMCC
47-
# MSVC | Yes | MSVC # Note only for MinGW
48-
# Renesas | No | ?TBD?
49-
# Will always a attempt to detect and if detectable double checks that the compiler is set correctly.
50-
set(FREERTOS_PLUS_TCP_COMPILER "" CACHE STRING "FreeRTOS Plus TCP Compiler Selection")
51-
52-
53-
# Select the appropriate network interface
54-
# This will fail the CMake preparation step if not set to one of those values.
55-
set(FREERTOS_PLUS_TCP_NETWORK_IF "" CACHE STRING "FreeRTOS Plus TCP Network Interface selection")
56-
set(FREERTOS_PLUS_TCP_NETWORK_IF_LIST
57-
A_CUSTOM_NETWORK_IF
58-
ATSAM43 ATSAME5x # AT
59-
DRIVER_SAM
60-
ESP32
61-
KSZ8851SNL
62-
LIBSLIRP
63-
LOOPBACK
64-
LPC17xx LPC18xx LPC54018
65-
M487
66-
MPS2_AN385
67-
MPS3_AN552
68-
MW300_RD
69-
NXP1060
70-
PIC32MZEF_ETH PIC32MZEF_WIFI
71-
POSIX WIN_PCAP # Native Linux & Windows respectively
72-
RX
73-
SH2A
74-
STM32 # ST Micro
75-
MSP432
76-
TM4C
77-
XILINX_ULTRASCALE ZYNQ # AMD/Xilinx
78-
)
79-
80-
if(NOT FREERTOS_PLUS_TCP_NETWORK_IF)
81-
# Attempt to detect the system.
82-
if(UNIX)
83-
message(STATUS "Detected UNIX/Posix system setting FREERTOS_PLUS_TCP_NETWORK_IF = POSIX")
84-
set(FREERTOS_PLUS_TCP_NETWORK_IF POSIX)
85-
elseif(MINGW)
86-
message(STATUS "Detected Windows MinGW system setting FREERTOS_PLUS_TCP_NETWORK_IF = WIN_PCAP")
87-
set(FREERTOS_PLUS_TCP_NETWORK_IF WIN_PCAP)
88-
endif()
89-
endif()
90-
91-
if(NOT FREERTOS_PLUS_TCP_NETWORK_IF IN_LIST FREERTOS_PLUS_TCP_NETWORK_IF_LIST )
92-
message(FATAL_ERROR " FREERTOS_PLUS_TCP_NETWORK_IF is '${FREERTOS_PLUS_TCP_NETWORK_IF}'.\n"
93-
" Please specify it from top-level CMake file (example):\n"
94-
" set(FREERTOS_PLUS_TCP_NETWORK_IF POSIX CACHE STRING \"\")\n"
95-
" or from CMake command line option:\n"
96-
" -DFREERTOS_PLUS_TCP_NETWORK_IF=POSIX\n"
97-
" \n"
98-
" Available port options: (Tested means compiled with that variant)\n"
99-
" A_CUSTOM_NETWORK_IF Target: User Defined\n"
100-
" ATSAM4E Target: ATSAM4E Tested: TODO\n"
101-
" ATSAME5x Target: ATSAME5x Tested: TODO\n"
102-
" DRIVER_SAM Target: Driver SAM Tested: TODO\n"
103-
" ESP32 Target: ESP-32 Tested: TODO\n"
104-
" KSZ8851SNL Target: ksz8851snl Tested: TODO\n"
105-
" LIBSLIRP Target: libslirp Tested: TODO\n"
106-
" POSIX Target: linux/Posix\n"
107-
" LOOPBACK Target: loopback Tested: TODO\n"
108-
" LPC17xx Target: LPC17xx Tested: TODO\n"
109-
" LPC18xx Target: LPC18xx Tested: TODO\n"
110-
" LPC54018 Target: LPC54018 Tested: TODO\n"
111-
" M487 Target: M487 Tested: TODO\n"
112-
" MPS2_AN385 Target: MPS2_AN385 Tested: TODO\n"
113-
" MPS3_AN552 Target: MPS3_AN552"
114-
" MW300_RD Target: mw300_rd Tested: TODO\n"
115-
" NXP1060 Target: NXP1060 Tested: TODO\n"
116-
" PIC32MZEF_ETH Target: pic32mzef ethernet Tested: TODO\n"
117-
" PIC32MZEF_WIFI Target: pic32mzef Wifi Tested: TODO\n"
118-
" RX Target: RX Tested: TODO\n"
119-
" SH2A Target: SH2A Tested: TODO\n"
120-
" STM32 Target: STM32 Tested: TODO\n"
121-
" MSP432 Target: MSP432 Tested: TODO\n"
122-
" TM4C Target: TM4C Tested: TODO\n"
123-
" WIN_PCAP Target: Windows Tested: TODO\n"
124-
" XILINX_ULTRASCALE Target: Xilinx Ultrascale Tested: TODO\n"
125-
" ZYNQ Target: Xilinx Zynq")
126-
elseif((FREERTOS_PORT STREQUAL "A_CUSTOM_PORT") AND (NOT TARGET freertos_kernel_port) )
127-
message(FATAL_ERROR " FREERTOS_PLUS_TCP_NETWORK_IF is set to A_CUSTOM_NETWORK_IF.\n"
128-
" Please specify the custom network interface target with all necessary files.\n"
129-
" For example, assuming a directory of:\n"
130-
" FreeRTOSCustomNetworkInterface/\n"
131-
" CMakeLists.txt\n"
132-
" NetworkInterface.c\n\n"
133-
" Where FreeRTOSCustomNetworkInterface/CMakeLists.txt is a modified version of:\n"
134-
" add_library(freertos_plus_tcp_network_if STATIC)\n\n"
135-
" target_sources(freertos_plus_tcp_network_if\n"
136-
" PRIVATE\n"
137-
" NetworkInterface.c)\n\n"
138-
" target_include_directories(freertos_plus_tcp_network_if\n"
139-
" PUBLIC\n"
140-
" .)\n\n"
141-
" target_link_libraries(freertos_plus_tcp_network_if\n"
142-
" PUBLIC\n"
143-
" freertos_plus_tcp_port\n"
144-
" freertos_plus_tcp_network_if_common\n"
145-
" PRIVATE\n"
146-
" freertos_kernel)")
147-
endif()
148-
149-
# There is also the need to add a target - typically an interface library that describes the
150-
# Configuration for FreeRTOS-Kernel and FreeRTOS-Plus-TCP.
151-
# This is called freertos_config
152-
153-
########################################################################
154-
# External Dependencies
155-
# Note: For backwards compatibility - still have .gitmodules defining submodules
156-
# To support fetching content in a higher level project see
157-
# README.md `Consume with CMake`
158-
# This will allow you to upgrade submodules and have one common submodule for
159-
# all your builds despite multiple submodules having different versions.
160-
include(FetchContent)
161-
162-
FetchContent_Declare( freertos_kernel
163-
GIT_REPOSITORY https://github.com/FreeRTOS/FreeRTOS-Kernel.git
164-
GIT_TAG main
165-
)
166-
167-
FetchContent_Declare( cmock
168-
GIT_REPOSITORY https://github.com/ThrowTheSwitch/CMock
169-
GIT_TAG v2.5.3
170-
)
171-
172-
add_subdirectory(source)
173-
add_subdirectory(tools)
174-
add_subdirectory(test)
175-
176-
if(PROJECT_IS_TOP_LEVEL)
177-
FetchContent_MakeAvailable(freertos_kernel cmock)
178-
endif()

Kconfig

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
#
2+
# Copyright 2024 NXP
3+
#
4+
# SPDX-License-Identifier: MIT
5+
#
6+
7+
menuconfig MCUX_COMPONENT_middleware.freertos.freertos-plus-tcp
8+
bool "freertos-plus-tcp"
9+
default n
10+
help
11+
Thread safe FreeRTOS TCP/IP stack working on top of the FreeRTOS-Kernel
12+
to implement the TCP/IP protocol
13+
select MCUX_COMPONENT_middleware.freertos-kernel

README.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
MCUXpresso SDK: FreeRTOS-Plus-TCP Library
2+
==========================================
3+
4+
This repository is a fork of FreeRTOS-Plus-TCP library (https://github.com/FreeRTOS/freertos-plus-tcp)(4.3.3). Modifications have been made to adapt to NXP MCUXpresso SDK. CMakeLists.txt and Kconfig added to enable FreeRTOS-Plus-TCP repo sources build in MCUXpresso SDK. It is part of the MCUXpresso SDK overall delivery which is composed of several sub-repositories/projects. Navigate to the top/parent repository mcuxsdk-manifests(https://github.com/nxp-mcuxpresso/mcuxsdk-manifests) for the complete delivery of MCUXpresso SDK.
5+
16
## FreeRTOS-Plus-TCP Library
27
FreeRTOS-Plus-TCP is a lightweight TCP/IP stack for FreeRTOS. It provides a familiar Berkeley sockets interface, making it as simple to use and learn as possible. FreeRTOS-Plus-TCP's features and RAM footprint are fully scalable, making FreeRTOS-Plus-TCP equally applicable to smaller lower throughput microcontrollers as well as larger higher throughput microprocessors.
38

SBOM.spdx.json

Lines changed: 69 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,69 @@
1+
{
2+
"SPDXID": "SPDXRef-DOCUMENT",
3+
"spdxVersion": "SPDX-2.3",
4+
"creationInfo": {
5+
"created": "2025-06-17T09:36:39Z",
6+
"creators": [
7+
"Organization: NXP"
8+
],
9+
"licenseListVersion": "3.20"
10+
},
11+
"name": "freertos-plus-tcp-v25.06.00",
12+
"dataLicense": "CC0-1.0",
13+
"documentNamespace": "https://nxp.com/spdx/3f7ab5fc-dc33-4a36-a4c2-9f560bd2942f",
14+
"packages": [
15+
{
16+
"SPDXID": "SPDXRef-package-3f7ab5fc-dc33-4a36-a4c2-9f560bd2942f",
17+
"name": "freertos-plus-tcp",
18+
"versionInfo": "v25.06.00",
19+
"licenseConcluded": "(MIT)",
20+
"licenseDeclared": "(MIT)",
21+
"downloadLocation": "https://github.com/nxp-mcuxpresso/freertos-plus-tcp",
22+
"originator": "Organization: NXP",
23+
"supplier": "NOASSERTION",
24+
"externalRefs": [],
25+
"filesAnalyzed": false
26+
},
27+
{
28+
"SPDXID": "SPDXRef-package-1a03577d-28b5-4681-bc3d-6fa9e53c32a5",
29+
"name": "FreeRTOS Real Time Kernel",
30+
"versionInfo": "V4.3.3",
31+
"licenseConcluded": "MIT",
32+
"licenseDeclared": "NOASSERTION",
33+
"homepage": "https://sourceforge.net/projects/freertos",
34+
"downloadLocation": "https://github.com/FreeRTOS/FreeRTOS-Plus-TCP/releases/tag/V4.3.3",
35+
"originator": "Organization: freertos",
36+
"supplier": "NOASSERTION",
37+
"externalRefs": [
38+
{
39+
"referenceCategory": "SECURITY",
40+
"referenceLocator": "cpe:2.3:a:freertos:freertos_plus_tcp:4.3.3:*:*:*:*:*:*:*",
41+
"referenceType": "cpe23Type"
42+
},
43+
{
44+
"referenceCategory": "PACKAGE-MANAGER",
45+
"referenceLocator": "pkg:github/FreeRTOS/FreeRTOS-Plus-TCP@V4.3.3",
46+
"referenceType": "purl"
47+
},
48+
{
49+
"referenceCategory": "OTHER",
50+
"referenceLocator": "a88e2314-e439-4fc2-9ca2-4f9422ca2ce3",
51+
"referenceType": "BlackDuck-ComponentOrigin"
52+
}
53+
],
54+
"filesAnalyzed": false
55+
}
56+
],
57+
"relationships": [
58+
{
59+
"spdxElementId": "SPDXRef-DOCUMENT",
60+
"relationshipType": "DESCRIBES",
61+
"relatedSpdxElement": "SPDXRef-package-3f7ab5fc-dc33-4a36-a4c2-9f560bd2942f"
62+
},
63+
{
64+
"spdxElementId": "SPDXRef-package-3f7ab5fc-dc33-4a36-a4c2-9f560bd2942f",
65+
"relationshipType": "CONTAINS",
66+
"relatedSpdxElement": "SPDXRef-package-1a03577d-28b5-4681-bc3d-6fa9e53c32a5"
67+
}
68+
]
69+
}

SCR.txt

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
NXP Software Content Register
2+
3+
Package: freertos-plus-tcp
4+
Version: 4.3.3
5+
Outgoing License: MIT
6+
License File: LICENSE.md
7+
Type of Content: source code, header files
8+
Description and comments: FreeRTOS Plus TCP
9+
Release Location: https://github.com/nxp-mcuxpresso/freertos-plus-tcp
10+
Origin:
11+
NXP (MIT)
12+
Amazon (MIT) - https://github.com/FreeRTOS/freertos-plus-tcp
13+

test/FreeRTOS-Kernel

Lines changed: 0 additions & 1 deletion
This file was deleted.

tools/CMock

Lines changed: 0 additions & 1 deletion
This file was deleted.

0 commit comments

Comments
 (0)