Hello Hein,
I hope you are doing good. Thank you for your response.
I am new to FreeRTOS.
I have FreeRTOSv10.3.1. Does this one has multi interfaces and multi endpoints support?
I looked for FreeRTOSIPConfig.h file and it seems like now it has been changed
to FreeRTOSIPConfigDefaults.h and did not see “ipconfigMULTI_INTERFACE”. It looks
like this version of FreeRTOS does not have multi support.
I am trying to port FreeRTOS on STM32H743 series. I would like to know which tool
are recommended to use for ST. The example of FreeRTOS demo is not available for
STM32H743.
Currently Trying to design and develop software supporting three IPs (IPv4)
over 2 interfaces.
Hardware Design:
PC <----Interface_1----> (Target with IP_1) Telnet server Port 23 and
HTTP Port 80
PC <----Interface_1----> (Target with IP_2) Telnet Serevr Port 30
PC <----Interface_2----> (Target with IP_3) FTP Server Port 22
To test above behviour, Access one application from physical ethernet port
at one time as I don not have two independent physical ports yet on the Target.
OR
PC <----- Port Interface_1---
|
(SWITCH)--------> [TARGET with IP_1, IP_2 and IP_3]
|
PC <----- Port Interface_2---
Endpoint Constants:
static const uint8_t IPAddress_1[4] = { 192, 168, 227, 125 };
static const uint8_t Netmask_1[4] = { 255, 255, 255, 0 };
static const uint8_t GatewayAddress_1[4] = { 0, 0, 0, 0};
static const uint8_t DNSServerAddress_1[4] = { 0, 0, 0, 0 };
static const uint8_t MACAddress_1[6] = { configMAC_ADDR0, configMAC_ADDR1, configMAC_ADDR2, configMAC_ADDR3, configMAC_ADDR4, configMAC_ADDR5 };
static const uint8_t IPAddress_2[4] = { 192, 168, 0, 125 };
static const uint8_t Netmask_2[4] = { 255, 255, 0, 0 };
static const uint8_t GatewayAddress_2[4] = { 0, 0, 0, 0};
static const uint8_t DNSServerAddress_@[4] = { 0, 0, 0, 0 };
static const uint8_t MACAddress_2[6] = { configMAC_ADDR0, configMAC_ADDR1, configMAC_ADDR2, configMAC_ADDR3, configMAC_ADDR4, configMAC_ADDR5 };
static const uint8_t IPAddress_3[4] = { 192, 168, 227, 100 };
static const uint8_t NetMask_3[4] = { 255, 255, 255, 0 };
static const uint8_t GatewayAddress_3[4] = { 0, 0, 0, 0};
static const uint8_t DNSServerAddress_3[4] = { 0, 0, 0, 0 };
static const uint8_t MACAddress_3[6] = { configMAC_ADDR0, configMAC_ADDR1, configMAC_ADDR2, configMAC_ADDR3, configMAC_ADDR4, configMAC_ADDR5 + 1 };
Init:
static NetworkInterface_t xInterfaces[2];
static NetworkEndPoint_t xEndPoints[3];
Create the network interfaces and fill the endpoints
stm32h7xx_FillInterfaceDescriptor(0, &(xInterfaces[0]));
FreeRTOS_FillEndPoint(&(xEndPoints[0]), IPAddress1, Netmask1, GatewayAddress1, DNSServerAddress1, MACAddress1);
xEndPoints[0].bits.bWantDHCP = pdTRUE_UNSIGNED;
FreeRTOS_FillEndPoint(&(xEndPoints[1]), IPAddress2, Netmask2, GatewayAddress2, DNSServerAddress2, MACAddress2);
xEndPoints[1].bits.bWantDHCP = pdTRUE_UNSIGNED;
stm32h7xx_FillInterfaceDescriptor(1, &(xInterfaces[1]));
FreeRTOS_FillEndPoint(&(xEndPoints[2]), IPAddress3, Netmask3, GatewayAddress3, DNSServerAddress3, MACAddress3);
xEndPoints[2].bits.bWantDHCP = pdTRUE_UNSIGNED;
FreeRTOS_IPStart();
Once above steps are done, I believe I can start using socket programming
concept by following below steps:
1. Create a socket set ( FreeRTOS_CreateSocketSet ).
2. Create 4 sockets (for telnet1 and telnet2, HTTP, FTP) and
initialize them (bind(), setsockopt(), xlisten())
0.0.0.0 Port 23
0.0.0.0 Port 30
0.0.0.0 Port 80
0.0.0.0 Port 22
3. FreeRTOS_FD_SET( xSocket, xFD_Set );
4. Create a loop for socket acceptation for each of the sockets
(FreeRTOS_accept())