Step 2.1: Enable and Configure the TCP/IP Stack
In MHC's "Options" tab, expand the Harmony Framework Configuration > TCPIP Stack selection tree. Check the Use TCP\IP Stack? box.
After you check this box, all TCP/IP stack configuration options become visible. Note the "Use TCP/IP Stack?" selection option is now highlighted, indicating this selection has been changed from it's default value.
MHC default values are determined by the MHC configuration files (e.g.: tcpip_stack.hconfig). These files can be found in these folders:
<harmony install path>/framework/<module>/config
However, if you choose to use a specific Board Support Package (BSP), the corresponding BSP hconfig file will be used instead. Please search "hconfig" in the Harmony Help file for more information.
You will note there are a lot of configuration options for the TCP/IP stack! Fortunately, the vast majority of these selections have been made for you.
Add "ping" capability (determine if an IP address is reachable) to the TCP/IP stack. The ICMP (Internet Control Message Protocol) is used for this. Check the box beside TCPIP Stack > ICMPv4 Client and Server, then check the boxes beside both the client and server options as shown in the following image.
Uncheck the box beside TCPIP Stack > Use Announce Discovery Tool (see image in step 7 below). Using this tool enables your device to broadcast it's IP address on the local network. Although this can be a very useful option, you do not need it for this tutorial.
The TCP/IP Discoverer Utility (found in the <harmony install path>/utilities/tcpip_discoverer folder) allows your PC to see all embedded devices running the Announce protocol on your local network. It forces all embedded devices to broadcast their MAC and IP addresses when the "Discover Devices" button is pushed. For more information on this see the "Utilities" volume in the Harmony Help file.
Check the box beside TCPIP Stack > Use TCP\IP Commands (see image in step 7 below). Checking this box enables the TCP/IP stack to send and receive messages using the Console System Service (USB serial port with terminal emulator in this case). This is how you will learn the IP address assigned to the development board.
Note that when you enable TCP/IP Commands, MHC automatically enables the Command Processor System Service for you (expand System Services > Command if you would like to verify this).
Change the location the HTTP server looks for its web pages. Expand the TCPIP Stack > TCPIP File System Wrapper selection tree and change the Web Server Mount Path to /mnt/myDrive1.
Expand the following section to see descriptions of all TCP/IP configuration options.
Step 2.2: Configure the Crypto Library
Future Harmony versions will be improved to completely configure the Crypto Library for you. If you are using a version newer than v1.08, you may be able to skip this step.
The Cryptographic library is required by the HTTP Server. When you enabled the HTTP server, MHC automatically enabled this library for you.
In MHC's "Options" tab, expand the Harmony Framework Configuration > Cryptographic (Crypto) Library selection tree. Check the Use Random Number Functions? and Use Cryptographic Library boxes.
Expand the following section to see descriptions of all Crypto library configuration options.
Step 2.3: Configure the Timer Driver
Future Harmony versions will be improved to completely configure the Timer System service for you. If you are using a version newer than v1.08, you may be able to skip this step.
The Timer System service is required by the TCP/IP stack to keep track of time. When you enabled the TCP/IP stack, MHC automatically enabled this library for you.
In MHC's "Options" tab, expand the Harmony Framework Configuration > Drivers > Timer > Use Timer Driver? > TMR Driver Instance 0 selection tree. Change the Interrupt Priority to INT_PRIORITY_LEVEL4.
Step 2.4: Enable and Configure the Internal Ethernet MAC Driver
Future Harmony versions will be improved to completely enable and configure the Internal Ethernet MAC driver for you. If you are using a version newer than v1.08, you may be able to skip this step.
You configured the TCP/IP stack to use the internal PIC32 MAC for the network interface. You need to enable and configure the driver associated with this MAC.
In MHC's "Options" tab, expand the Harmony Framework Configuration > Drivers > Internal Ethernet MAC Driver selection tree.
- Check the Internal Ethernet MAC Driver? box.
- Change the PHY Negotiation Time-out - ms to 10
- Change the PHY Negotiation Done Time-out - ms to 7000
- Change the PHY Reset Clear Time-out - ms to 1000