6.2.1.1 Building and Running the TCP Client Application
Building the Application
To build this application, open the project file
(
apps/tcp_client/firmware/tcp_client_sam_e54_xpro_rnwf02.X /
)
in MPLAB X IDE. For more details on opening the project file in MPLAB X IDE, refer
to the Opening the Project File. The following table provides details on the project file.Project Name | Description |
---|---|
tcp_client_sam_e54_xpro_rnwf02.X |
|
Running the Application
- Mount the RNWF02 Add On Board on SAM E54 Xplained Pro evaluation kit at respective header. For more details about the boards placement in the SAM E54 X-plained host board, see Figure 6-58
- Connect the debugger USB port on the SAM E54 Xplained Pro evaluation kit to computer using a micro-USB cable.
- Open the project and launch MCC Harmony3.
- Configure Home-AP credentials for STA mode, using the RNWF02 Wi-Fi configuration options. For more details about the Wi-Fi settings configuration, See Figure 3-69.
- Configure TCP Server details such as TCP server IP address and port. For more details about the Net Sock settings configuration, See Figure 3-79.
- Generate the code as illustrated below. Figure 6-11. Generating the Code
-
Build and program the code to the hardware using MPLABX IDE
Figure 6-12. Programming the Board
-
Open the Terminal application (for example, Tera Term or PuTTY) on the PC
-
Connect to the “EDBG Virtual COM Port” and configure the serial settings as follows:
-
Baud: 115200
-
Data: 8 Bits
-
Parity: None
-
Stop: 1 Bit
-
Flow Control: None
-
- As the board boots up, it will
connect to Home-AP and print the IP address obtained. The board will establish a
connection with configured TCP Server and print a success message. Once the TCP
client-server connection is successful, the application will continue listening
on the socket for incoming messages and then write them back to the server.