...
As indicated in the Figure - µC/HTTPs Source Code, all the files in the Source folder must be added to your project tree. Furthermore, all the files in the chosen File System type folder must be added to your project tree ans the . Finally, http-s_os.c file of the selected RTOS must be added as well as the generic http-s_os.h file that can be found in the OS folder.
SecondAfter, add the following include paths to your project’s C compiler settings:
\Micrium\Software\uC-HTTPs
\Micrium\Software\uC-HTTPs\OS\<OS type>
\Micrium\Software\uC-HTTPs\FS\<File System type >
Tasks Priority
The net_cfg.c file includes the three network task configurations. You will need to defined the priority of each of those tasks. The priorities will depend on the other tasks already present in your application. Refer to section Network Tasks Configuration for all the details on configuring the network tasks and their priority.
Sample Project Setup
The purpose of this sample project is to setup a network host on the target board to allow it to communicate with other hosts on the network. Figure - Sample Application Setup shows the project test setup for a Ethernet wired interface. The target board is wire-connected to an Ethernet switch or via an Ethernet cross-over cable to a Windows-based PC. The PC’s IP address is set to 10.10.10.111 and the target’s addresses will be configure to 10.10.10.64 as it will be shown in the next section Adding µC/TCP-IP application function.
This sample project contains enough code to be able to ping the board. Therefore, after successfully running the project, You will be able to issue the following command form a command-prompt:
ping 10.10.10.64
Ping (on the PC) should reply back with the ping time to the target. µC/TCP-IP target projects connected to the test PC on the same Ethernet switch or Ethernet cross-over cable achieve ping times of less than 2 milliseconds.
After you have successfully completed and run the sample project, you can use it as a starting point to run other µC/TCP-IP demos you may have purchased.
Adding Additional includes
Since the µC/TCP-IP module was added to the sample project, the following include must be added to the app.c file :
#include <KAL/kal.h>
#include <Source/net.h>
#include <net_dev_????.h>
#include <net_phy_????.h>
#include <net_dev_cfg.h>
#include <net_bsp.h>
...
Before running the sample application, you will need to add the new funtion, AppInit_TCPIP()
, in your app.c file to initialize and setup the µC/TCP-IP stack. Section Tasks and Objects Initialization gives an example of the main application task inside which the AppInit_TCPIP()
function will be called. Section Ethernet Sample Application gives an AppInit_TCPIP() example for a wired Ethernet interface.
Those code examples will need to be modified in accordance with your project setup. For example, when adding an interface, your network device configuration object name (inside net_dev_cfg.c
) will need to be specify and the IP address used in the example could need to be change to match your network.
Once the source code is built and loaded into the target, the target will respond to ICMP Echo (ping) requests.
Copying and Modifying Template Files
Copy the files from the uC-TCPIP HTTPs configuration folder into your application as illustrated in Figure - Copying Template Files.
...
The µC/TCP-IP stack uses additional heap memory space. Therefore, it is possible that your sample application will require more allocation of heap memory. If ti is the case, you can increase the value of the #define LIB_MEM_CFG_HEAP_SIZE inside the lib_cfg.h file of your sample project. You can refer to section µC/LIB Memory Heap Configuration for more details on the heap usage of the µC/TCP-IP stack.
Adding µC/TCP-IP application function
Before running the sample application, you will need to add the new funtion, AppInit_TCPIP()
, in your app.c file to initialize and setup the µC/TCP-IP stack. Section Tasks and Objects Initialization gives an example of the main application task inside which the AppInit_TCPIP()
function will be called. Section Ethernet Sample Application gives an AppInit_TCPIP() example for a wired Ethernet interface.
Those code examples will need to be modified in accordance with your project setup. For example, when adding an interface, your network device configuration object name (inside net_dev_cfg.c
) will need to be specify and the IP address used in the example could need to be change to match your network.
Once the source code is built and loaded into the target, the target will respond to ICMP Echo (ping) requests.
Tasks Priority
The http-s_cfg.c file includes the three network task configurations. You will need to defined the priority of each of those tasks. The priorities will depend on the other tasks already present in your application. Refer to section Network Tasks Configuration for all the details on configuring the network tasks and their priority.
Sample Project Setup
The purpose of this sample project is to setup a network host on the target board to allow it to communicate with other hosts on the network. Figure - Sample Application Setup shows the project test setup for a Ethernet wired interface. The target board is wire-connected to an Ethernet switch or via an Ethernet cross-over cable to a Windows-based PC. The PC’s IP address is set to 10.10.10.111 and the target’s addresses will be configure to 10.10.10.64 as it will be shown in the next section Adding µC/TCP-IP application function.
This sample project contains enough code to be able to ping the board. Therefore, after successfully running the project, You will be able to issue the following command form a command-prompt:
ping 10.10.10.64
Ping (on the PC) should reply back with the ping time to the target. µC/TCP-IP target projects connected to the test PC on the same Ethernet switch or Ethernet cross-over cable achieve ping times of less than 2 milliseconds.
After you have successfully completed and run the sample project, you can use it as a starting point to run other µC/TCP-IP demos you may have purchased.
Adding Additional includes
Since the µC/TCP-IP module was added to the sample project, the following include must be added to the app.c file :
#include <KAL/kal.h>
#include <Source/net.h>
#include <net_dev_????.h>
#include <net_phy_????.h>
#include <net_dev_cfg.h>
#include <net_bsp.h>
DEVELOP