Step 2.1: Enable and Configure the TCP/IP Stack
In the MPLAB® Harmony Configurator (MHC) Options tab, expand the Harmony Framework Configuration > TCP/IP 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 its 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.
4
Add "ping" capability (determine if an IP address is reachable) to the TCP/IP stack. The Internet Control Message Protocol (ICMP) is used for this. Check the box beside TCP/IP Stack > ICMPv4 Client and Server, then check the boxes beside both the Client and Server options as shown in the following image.
5
Uncheck the box beside TCP/IP Stack > Use Announce Discovery Tool (see the image in step 7 below). Using this tool enables your device to broadcast its 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.
6
Check the box beside TCP/IP Stack > Use TCP\IP Commands (see the 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 the 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).
7
Change the location the HTTP server looks for its web pages. Expand the TCP/IP Stack > TCP/IP 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 Cryptographic (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 Physical Layer Transceiver (PHY) Negotiation Timeout - ms to 10.
- Change the PHY Negotiation Done Timeout - ms to 7000.
- Change the PHY Reset Clear Timeout - ms to 1000.