Porting a TCP/IP stack
This section provides instruction for porting and testing on-board TCP/IP stacks. If your platform offloads TCP/IP and TLS functionality to a separate network processor or module, you can skip this porting section and visit Porting the Network Transport Interface.
FreeRTOS+TCP
Porting FreeRTOS+TCP
FreeRTOS+TCP is a native TCP/IP stack for the FreeRTOS kernel. For more information,
see FreeRTOS.org
Prerequisites
To port the FreeRTOS+TCP library, you need the following:
-
An IDE project that includes the vendor-supplied Ethernet or Wi-Fi drivers.
For information about setting up a test project, see Setting up your workspace and project for porting.
A validated configuration of the FreeRTOS kernel.
For information about configuring the FreeRTOS kernel for your platform, see Configuring a FreeRTOS kernel port.
Porting
Before you start porting the FreeRTOS+TCP library, check the
GitHub
If a port does not exist, do the following:
-
Follow the Porting FreeRTOS+TCP to a Different Microcontroller
instructions on FreeRTOS.org to port FreeRTOS+TCP to your device. -
If necessary, follow the Porting FreeRTOS+TCP to a New Embedded C Compiler
instructions on FreeRTOS.org to port FreeRTOS+TCP to a new compiler. -
Implement a new port that uses the vendor-supplied Ethernet or Wi-Fi drivers in a file called
NetworkInterface.c
. Visit the GitHubrepository for a template.
After you create a port, or if a port already exists, create FreeRTOSIPConfig.h
,
and edit the configuration options so they are correct for your platform. For more information about the configuration options, see
FreeRTOS+TCP Configuration
Testing
Whether you use FreeRTOS+TCP library or a third party library, follow the steps below for testing:
Provide an implementation for
connect/disconnect/send/receive
APIs in transport interface tests.Setup an echo server in plain text TCP connection mode, and run transport interface tests.
Note
To officially qualify a device for FreeRTOS, if your architecture requires to port a TCP/IP software stack,
you need to validate the device's ported source code against transport interface tests in plain text
TCP connection mode with Amazon IoT Device Tester. Follow the instructions in
Using Amazon IoT Device Tester for
FreeRTOS in the FreeRTOS User Guide to set up Amazon IoT Device Tester for port validation.
To test a specific library's port, the correct test group must be enabled in the device.json
file
in the Device Tester configs
folder.