Currently I’m using FreeRTOS10 on the Zedboard dev board (Zynq).
This is the FreeRTOS that comes with Vitis 2022.1.0 IDE.
I’m having trouble getting FreeRTOS+TCP library to work.
Eventually I’d like to set up two static IP (IPv4) on the Ethernet interface on the Zedboard:
One IP address as a TCP server, and the other as a UDP client.
However, for now I’m just trying to get one static IP address on my interface.
I started with the Tutorial. For example:
https://www.freertos.org/Documentation/03-Libraries/02-FreeRTOS-plus/02-FreeRTOS-plus-TCP/04-Tutorial/04-Initialization
A couple issues I’ve noticed so far:
(1) After doing the initialization (see link above), when I use my Windows or Linux computer to ping the zedboard at the static IP address I set up, I get a “Request Time out”
indicating to me that the static IP address either didn’t get setup correctly, or the Zynq is not responding to pings.
However, I do get this message on the console:
FreeRTOS_AddEndPoint: MAC: 44-55 IPv4: a6464a0ip
(a6464a0 Converted to IPv4 format is 10.100.100.160. This is what I want)
(2) If the ipconfigIP_TASK_PRIORITY is a higher priority than my other FreeRTOS tasks, then those other tasks never run.
I had to make the other tasks equal or higher priority to have them run.
(3) I tried to use the Zynq as a TCP client and connect to a Server running on my PC.
When I ran my application in debug mode, it never returned from FreeRTOS_connect().
(Investigating further I followed down the rabbit hole of FreeRTOS_connect()-> prvTCPConnectStart()-> FreeRTOS_bind() → xEventGroupWaitBits().
At this point I stopped following the hole.)
Below is some of my configuration settings:
For the FreeRTOSConfig.h, I just used the default one that FreeRTOS created for me.
Only change I made was adding
#define INCLUDE_xTaskGetCurrentTaskHandle 1
For the FreeRTOSIPConfig.h, I started with the one included in one of the demos
(the demo called “FreeRTOS_Plus_TCP_Echo_Posix”)
and then made a few changes.
Here are the changes from the demo version
#define ipconfigUSE_IPv6 ( 0 )
#define ipconfigUSE_LLMNR ( 0 )
#define ipconfigUSE_NBNS ( 0 )
#define ipconfigUSE_DHCP ( 0 )
#define ipconfigUSE_DNS ( 0 )
#define ipconfigSUPPORT_OUTGOING_PINGS ( 1 )
In order to build the project I also had to add the following:
#define ipconfigZERO_COPY_TX_DRIVER ( 1 )
#define ipconfigZERO_COPY_RX_DRIVER ( 1 )
#ifndef pdFREERTOS_ERRNO_EAFNOSUPPORT
#define pdFREERTOS_ERRNO_EAFNOSUPPORT 97
#endif
As well as this
// Taken from amazon-freertos/vendors/xilinx/boards/microzed/aws_demos/config_files/FreeRTOSIPConfig.h at main · aws/amazon-freertos · GitHub
#define ipconfigNIC_N_TX_DESC ( 32 )
#define ipconfigNIC_N_RX_DESC ( 32 )
I also created a .c file that defined a bunch of stubs I needed.
I can provide the definitions I filled out if anyone asks. (Trying to keep this initial post as short as I can).
void vApplicationPingReplyHook( ePingReplyStatus_t eStatus,
uint16_t usIdentifier )
BaseType_t xApplicationGetRandomNumber( uint32_t * pulNumber )
extern uint32_t ulApplicationGetNextSequenceNumber( uint32_t ulSourceAddress,
uint16_t usSourcePort,
uint32_t ulDestinationAddress,
uint16_t usDestinationPort )
UBaseType_t uxRand( void )
void vApplicationIPNetworkEventHook_Multi( eIPCallbackEvent_t eNetworkEvent,
struct xNetworkEndPoint * pxEndPoint )
eDHCPCallbackAnswer_t xApplicationDHCPHook_Multi( eDHCPCallbackPhase_t eDHCPPhase,
struct xNetworkEndPoint * pxEndPoint,
IP_Address_t * pxIPAddress )
BaseType_t xApplicationDNSQueryHook_Multi( struct xNetworkEndPoint * pxEndPoint,
const char * pcName )
uint64_t ullGetHighResolutionTime( void )