README.md
1## Disclaimer :
2
3Please note that MSP432 port has not been tested with IPv6, Multiple endpoint and interfaces which are supported by the latest TCP release V4.0.0. This needs to be used with caution in IPv6 environment as there can be potential compatibility issues.
4
5## Last Git Release :
6
7You can find the last release supporting this port on our GitHub repository here : [V3.1.0](https://github.com/FreeRTOS/FreeRTOS-Plus-TCP/releases/tag/V3.1.0). Visit the mentioned link to access the repository and download the version supporting MSP432 port to use it.
8
9## Contribution and Support :
10
11If you are interested in contributing to the development of this port or have any question regarding this port, feel free to post on [FreeRTOS forum](https://forums.freertos.org/). Your inputs are valuable to us and we encourage collaboration and discussion within the community.
12
13# Scope
14This is a driver and network middleware for the MSP432E401Y microcontroller
15with built-in Ethernet MAC.
16
17# Prerequisites
18
19Ensure that driverlib for the MSP432E4 is installed and added to the include
20path for the project.
21
22# Recommendation
23When a MAC address changes or when there is a change in the network setup,
24it is recommended to perform a hard reset of the microcontroller in lieu
25of resetting only the MAC hardware.
26
27# List of Tasks
28
29The tasks listed in the table below are implemented internally by the driver (NetworkInterface.c).
30
31| Task Name | Purpose |
32|---------------------------------------|-------------------------------------------------------------------|
33| prvEMACDeferredInterruptHandlerTaskRX | RX Task |
34| prvEMACDeferredInterfaceOutputTaskTX | TX Task |
35| prvCheckLinkUpOrDownNetStateTask | Network State Checking Task (link up/down, network state & reset) |
36
37The tasks listed in the table below are implemented by additional code provided as an example
38related to how the driver might be used in an application (NetworkMiddleware.c).
39The additional code does not have to be used and is only provided to be useful.
40
41| Task Name | Purpose |
42|---------------------------------------|-------------------------------------------------------------------|
43| prvNetworkResetTask | Task to periodically reset the network (if required)
44
45# Example Code
46
47```
48#include "NetworkInterface.h"
49#include "NetworkMiddleware.h"
50
51void setup_wired_ethernet()
52{
53 struct InternalNetworkInterfaceMSP432EConfig config;
54 vGetInternalNetworkInterfaceMSP432EConfigDefaults(&config);
55 config.setMACAddrInternal = false; /* true if the MAC address is to be read from microcontroller flash */
56 config.MACAddr[0] = 0x70; /* replace with a custom MAC address */
57 config.MACAddr[1] = 0xFF;
58 config.MACAddr[2] = 0x76;
59 config.MACAddr[3] = 0x1C;
60 config.MACAddr[4] = 0xC1;
61 config.MACAddr[5] = 0xD0;
62 vPublicSetupEMACNetwork(config);
63
64 /* setup the network stack middleware */
65 const char *devname = "device";
66 struct InternalNetworkMiddlewareData setupData;
67 strncpy(setupData.deviceName, devname, strlen(devname));
68 setupData.resetNetworkTaskEveryXSeconds = 86400; /* Restart the network every 24 hours (86400 seconds) only when setupData.resetNetworkTaskRunning == true */
69 setupData.resetNetworkTaskRunning = false; /* Run the network task to reset the network every so often (i.e. to periodically obtain a new IP address) */
70
71 /* set the static IP address */
72 vConvertOctetsToAddr(setupData.ucIPAddress, 192, 168, 1, 9);
73 vConvertOctetsToAddr(setupData.ucNetMask, 255, 255, 255, 0);
74 vConvertOctetsToAddr(setupData.ucGatewayAddress, 192, 168, 1, 1);
75 vConvertOctetsToAddr(setupData.ucDNSServerAddress, 192, 168, 1, 1);
76
77 vPublicSetupFreeRTOSTasks(setupData);
78 /*
79 Start the RTOS scheduler by calling vTaskStartScheduler()
80 Use publicPreventNetworkReset() to block the network reset during a critical section of the code
81 Set the device name using vPublicSetupDeviceName()
82 */
83}
84
85```
86# Contact
87Nicholas J. Kinar (n.kinar@usask.ca) or FreeRTOS Forums
88