+
+
+
+
+
+
+
+
+
-
+
+
diff --git a/sdk/freertos_app_cpu0/.project b/sdk/freertos_app_cpu0/.project
index 0abd0fc8..f151f83b 100644
--- a/sdk/freertos_app_cpu0/.project
+++ b/sdk/freertos_app_cpu0/.project
@@ -49,11 +49,6 @@
2C:/Users/srich008/Information/gitMistakes/freertos-lwip/sdk/FreeRTOS-Kernel/portable/MemMang
-
- Zynq
- 2
- C:/Users/srich008/Information/gitMistakes/freertos-lwip/sdk/FreeRTOS-Plus-TCP/source/portable/NetworkInterface/Zynq
-
shared2
diff --git a/sdk/freertos_app_cpu0/src/FreeRTOSConfig.h b/sdk/freertos_app_cpu0/src/FreeRTOSConfig.h
index 5f69cf13..8fc73290 100644
--- a/sdk/freertos_app_cpu0/src/FreeRTOSConfig.h
+++ b/sdk/freertos_app_cpu0/src/FreeRTOSConfig.h
@@ -231,10 +231,25 @@ line interface. */
#define configMAC_ADDR5 0x16
/* IP address configuration. */
-#define configIP_ADDR0 172
-#define configIP_ADDR1 25
-#define configIP_ADDR2 218
-#define configIP_ADDR3 200
+#define configIP_ADDR0 192
+#define configIP_ADDR1 168
+#define configIP_ADDR2 0
+#define configIP_ADDR3 10
+
+/* Default gateway IP address configuration. Used if ipconfigUSE_DHCP is set to
+ * 0, or ipconfigUSE_DHCP is set to 1 but a DNS server cannot be contacted. */
+#define configGATEWAY_ADDR0 192
+#define configGATEWAY_ADDR1 168
+#define configGATEWAY_ADDR2 0
+#define configGATEWAY_ADDR3 1
+
+/* Default DNS server configuration. OpenDNS addresses are 208.67.222.222 and
+ * 208.67.220.220. Used in ipconfigUSE_DHCP is set to 0, or ipconfigUSE_DHCP is
+ * set to 1 but a DNS server cannot be contacted.*/
+#define configDNS_SERVER_ADDR0 208
+#define configDNS_SERVER_ADDR1 67
+#define configDNS_SERVER_ADDR2 222
+#define configDNS_SERVER_ADDR3 222
/* Netmask configuration. */
#define configNET_MASK0 255
diff --git a/sdk/freertos_app_cpu0/src/FreeRTOSIPConfig.h b/sdk/freertos_app_cpu0/src/FreeRTOSIPConfig.h
index da37e832..d67eaa9f 100644
--- a/sdk/freertos_app_cpu0/src/FreeRTOSIPConfig.h
+++ b/sdk/freertos_app_cpu0/src/FreeRTOSIPConfig.h
@@ -30,8 +30,20 @@
#ifndef FREERTOS_IP_CONFIG_H
#define FREERTOS_IP_CONFIG_H
-#define ipconfigZERO_COPY_RX_DRIVER 1
-#define ipconfigZERO_COPY_TX_DRIVER 1
+/* I put these here -Ryan */
+#define ipconfigIPv4_BACKWARD_COMPATIBLE 1
+#define ipconfigHAS_PRINTF 1
+
+#define ipconfigZERO_COPY_RX_DRIVER 1
+#define ipconfigZERO_COPY_TX_DRIVER 1
+#define ipconfigDNS_USE_CALLBACKS 0
+
+ /* Zynq driver specific parameters */
+ #define ipconfigNIC_INCLUDE_GEM ( 1 )
+ #define ipconfigNIC_N_TX_DESC ( 32 )
+ #define ipconfigNIC_N_RX_DESC ( 32 )
+ //#define ipconfigNIC_LINKSPEED100 ( 1 )
+ #define ipconfigNIC_LINKSPEED_AUTODETECT (1)
/* suppressing the use of _static as it is used for other tools like cbmc */
/* coverity[misra_c_2012_rule_21_1_violation] */
@@ -41,23 +53,6 @@
#define ipconfigUSE_ARP_REMOVE_ENTRY 1
#define ipconfigUSE_ARP_REVERSED_LOOKUP 1
-/* Set to 1 to print out debug messages. If ipconfigHAS_DEBUG_PRINTF is set to
- * 1 then FreeRTOS_debug_printf should be defined to the function used to print
- * out the debugging messages. */
-#define ipconfigHAS_DEBUG_PRINTF 0
-#if ( ipconfigHAS_DEBUG_PRINTF == 1 )
- #define FreeRTOS_debug_printf( X ) configPRINTF( X )
-#endif
-
-/* Set to 1 to print out non debugging messages, for example the output of the
- * FreeRTOS_netstat() command, and ping replies. If ipconfigHAS_PRINTF is set to 1
- * then FreeRTOS_printf should be set to the function used to print out the
- * messages. */
-#define ipconfigHAS_PRINTF 0
-#if ( ipconfigHAS_PRINTF == 1 )
- #define FreeRTOS_printf( X ) configPRINTF( X )
-#endif
-
/* Define the byte order of the target MCU (the MCU FreeRTOS+TCP is executing
* on). Valid options are pdFREERTOS_BIG_ENDIAN and pdFREERTOS_LITTLE_ENDIAN. */
#define ipconfigBYTE_ORDER pdFREERTOS_LITTLE_ENDIAN
@@ -132,14 +127,14 @@
* set to 1 if a valid configuration cannot be obtained from a DHCP server for any
* reason. The static configuration used is that passed into the stack by the
* FreeRTOS_IPInit() function call. */
-#define ipconfigUSE_DHCP 1
-#define ipconfigDHCP_REGISTER_HOSTNAME 1
-#define ipconfigDHCP_USES_UNICAST 1
+#define ipconfigUSE_DHCP 0
+#define ipconfigDHCP_REGISTER_HOSTNAME 0
+#define ipconfigDHCP_USES_UNICAST 0
/* If ipconfigDHCP_USES_USER_HOOK is set to 1 then the application writer must
* provide an implementation of the DHCP callback function,
* xApplicationDHCPUserHook(). */
-#define ipconfigUSE_DHCP_HOOK 1
+#define ipconfigUSE_DHCP_HOOK 0
/* When ipconfigUSE_DHCP is set to 1, DHCP requests will be sent out at
* increasing time intervals until either a reply is received from a DHCP server
@@ -184,7 +179,7 @@
* ipconfigINCLUDE_FULL_INET_ADDR is set to 1 then both FreeRTOS_inet_addr() and
* FreeRTOS_indet_addr_quick() are available. If ipconfigINCLUDE_FULL_INET_ADDR is
* not set to 1 then only FreeRTOS_indet_addr_quick() is available. */
-#define ipconfigINCLUDE_FULL_INET_ADDR 1
+#define ipconfigINCLUDE_FULL_INET_ADDR 0
/* ipconfigNUM_NETWORK_BUFFER_DESCRIPTORS defines the total number of network buffer that
* are available to the IP stack. The total number of network buffers is limited
diff --git a/sdk/freertos_app_cpu0/src/main.c b/sdk/freertos_app_cpu0/src/main.c
index 863a7f5b..94df18b6 100644
--- a/sdk/freertos_app_cpu0/src/main.c
+++ b/sdk/freertos_app_cpu0/src/main.c
@@ -32,6 +32,8 @@
#include "queue.h"
#include "task.h"
#include "timers.h"
+#include "FreeRTOS_IP.h"
+#include "FreeRTOS_Sockets.h"
/* Xilinx includes. */
#include "platform.h"
#include "xil_cache.h"
@@ -89,6 +91,77 @@ extern void vPortInstallFreeRTOSVectorTable(void);
#define QUEUE_LENGTH 10
#define ITEM_SIZE sizeof(uint32_t)
+/* needed for FreeRTOS-Plus-TCP */
+
+static UBaseType_t ulNextRand;
+
+UBaseType_t uxRand(void) {
+ const uint32_t ulMultiplier = 0x015a4e35UL, ulIncrement = 1UL;
+ /* Utility function to generate a pseudo random number. */
+ ulNextRand = (ulMultiplier * ulNextRand) + ulIncrement;
+ return((int) (ulNextRand) & 0x7fffUL );
+}
+
+BaseType_t xApplicationGetRandomNumber(uint32_t *pulNumber) {
+ *pulNumber = (uint32_t) uxRand();
+ return pdTRUE;
+}
+
+uint32_t ulApplicationGetNextSequenceNumber(uint32_t ulSourceAddress, uint16_t usSourcePort, uint32_t ulDestinationAddress, uint16_t usDestinationPort) {
+ return ( uint32_t ) uxRand();
+}
+
+void vApplicationIPNetworkEventHook(eIPCallbackEvent_t eNetworkEvent) {
+ static BaseType_t xTasksAlreadyCreated = pdFALSE;
+ /* If the network has just come up...*/
+ if ((eNetworkEvent == eNetworkUp) && (xTasksAlreadyCreated == pdFALSE)) {
+ /* Do nothing. Just a stub. */
+ xTasksAlreadyCreated = pdTRUE;
+ }
+}
+
+/* Default MAC address configuration. The demo creates a virtual network
+ * connection that uses this MAC address by accessing the raw Ethernet data
+ * to and from a real network connection on the host PC. See the
+ * configNETWORK_INTERFACE_TO_USE definition for information on how to configure
+ * the real network connection to use. */
+const uint8_t ucMACAddress[6] =
+{
+ configMAC_ADDR0,
+ configMAC_ADDR1,
+ configMAC_ADDR2,
+ configMAC_ADDR3,
+ configMAC_ADDR4,
+ configMAC_ADDR5
+};
+
+/* The default IP and MAC address used by the code. It is used as a place holder.
+ */
+static const uint8_t ucIPAddress[4] = {
+ configIP_ADDR0,
+ configIP_ADDR1,
+ configIP_ADDR2,
+ configIP_ADDR3
+};
+static const uint8_t ucNetMask[4] = {
+ configNET_MASK0,
+ configNET_MASK1,
+ configNET_MASK2,
+ configNET_MASK3
+};
+static const uint8_t ucGatewayAddress[4] = {
+ configGATEWAY_ADDR0,
+ configGATEWAY_ADDR1,
+ configGATEWAY_ADDR2,
+ configGATEWAY_ADDR3
+};
+static const uint8_t ucDNSServerAddress[4] = {
+ configDNS_SERVER_ADDR0,
+ configDNS_SERVER_ADDR1,
+ configDNS_SERVER_ADDR2,
+ configDNS_SERVER_ADDR3
+};
+
int main(void)
{
/* initialise hardware */
@@ -132,6 +205,9 @@ int main(void)
// BEGIN USER CODE HERE //
/////////////////////////
+ FreeRTOS_printf(("FreeRTOS_IPInit\n"));
+ FreeRTOS_IPInit(ucIPAddress, ucNetMask, ucGatewayAddress, ucDNSServerAddress, ucMACAddress);
+
commands_start_msg();
/* command sets */