[Buildable TCP/IP and FAT FS Examples]
Don't have any hardware? You can still try the RTOS TCP and FAT examples
now by using the
Win32 demo, which uses free tools, and runs in a Windows environment.
The Zynq FreeRTOS+TCP and FreeRTOS+FAT demo includes the following standard examples:
FreeRTOS+FAT is used to create and format a RAM disk, then mount both the RAM disk and a FAT formatted SD card in the same virtual file system. The mounted file systems then provide the storage for both the FreeRTOS+TCP FTP and HTTP server examples.
The RAM disk is accessible even if an SD card is not inserted.
The project builds using the free Xilinx SDK GCC based development tools, and hardware projects are provided that allow the demo to run on either the ZC702 or lower cost MicroZed evaluation boards.
Important Note: Due to the combination of memory caching and DMA requiring 32-byte multiples, it is necessary to use BufferAllocation_1.c with this demo.
Click the "Finish" button to close the Import dialogue.
Right click the "RTOSDemo" project in the Eclipse Project Explorer window once more. This time select "Build Project" from the pop-up menu.
If a DHCP server is present on the network to which the Zynq is connected then set ipconfigUSE_DHCP to 1 in FreeRTOSIPConfig.h, and no further IP address configuration is necessary. It is not necessary to know the IP address allocated to the Zynq by the DHCP server if a hostname is configured, because the Zynq can be located by its name directly. The IP address can however be viewed, as it is output using the UDP logging facility.
If there is no DHCP server connected to the network then set ipconfigUSE_DHCP to 0 in FreeRTOSIPConfig.h, then configure the IP address and netmask manually. The IP address and netmask are set using the configIP_ADDR0/3 and configNET_MASK0/3 constants respectively in FreeRTOSConfig.h. Note the IP address setting is in FreeRTOSConfig.h rather than FreeRTOSIPConfig.h because it is related to the application, rather than being a TCP/IP stack configuration option.
When manually setting the IP address it is necessary to ensure the chosen IP address is compatible with the netmask. In most cases a compatible IP address will be one that uses the same first three octets as the host computer. For example, if the IP address of the host computer is 192.168.0.100 then any 192.168.0.nnn address (other than when nnn is 0 or 255, and any other address already present on the network) will be compatible.
It is also necessary to set a gateway address that is also compatible with the netmask. This step is necessary even if the gateway does not actually exist on the network (otherwise an internal sanity check will trigger a configASSERT() failure). The gateway address is set using the configGATEWAY_ADDR0/3 constants in FreeRTOSConfig.h.
If only one embedded target that is running the example is connected to the network then it will not be necessary to modify the MAC address.
If multiple embedded targets that are running FreeRTOS+TCP examples are connected to the same network then it will be necessary to ensure each computer has a unique MAC address.
If only one embedded device that is running a FreeRTOS+TCP example is connected to the network then it will not be necessary to modify the default hostname, which is "RTOSDemo". If multiple embedded devices that are running the example are connected to the same network then it will be necessary to assign a different hostname to each embedded device.
The hostname is set by the mainHOST_NAME constant at the top of the main.c source file. Depending on the network topology, it may also be possible to use a second hostname set by the mainDEVICE_NICK_NAME constant, which is also defined at the top of main.c.
Log messages are buffered for transmission by a low priority background RTOS task.
Log output can be viewed in many different terminal programs. UDPTerm, from Cinetix, it a convenient free standing utility that can be used for this purpose.
Select "Debug Configurations..." from the IDE's "Run" menu. The Debug Configurations dialogue will appear.
To ping the device, open a command prompt and type "ping RTOSDemo", assuming the hostname has not be changed from the default of RTOSDemo.
If a ping reply is not received then turn DHCP off, assign the target a static IP address, and try again using the assigned IP address in place of the host name.
Instructions describing how to set a static IP address, and how to set a hostname, are provided in the setup instructions on this page.