Step 5: Build, Program and Observe the Output
Build, Hardware Setup, and Program
Build the project by clicking the Clean and Build drop-down arrow, then select Clean and Build Main Project. Verify that the project builds successfully.
At this point, the application is ready to be implemented on the hardware. Check whether the lab builds and programs successfully, and verify the build results in the output dialog box.
The PIC32CM LS00 Curiosity Nano+ Touch Evaluation Kit allows the Embedded Debugger (nEDBG) to be used for debugging. Connect the Type-A male to USB Type-C® cable to the debug USB port to power and debug the PIC32CM LS00 Curiosity Nano+ Touch Evaluation Kit.
In MPLAB® X IDE, navigate to File > Project Properties, and ensure that PIC32CM LS00 Curiosity Nano+ Touch Evaluation Kit EDBG is chosen as the debugger under Connected Hardware Tools, and XC32 is selected as the Compiler Toolchain for XC32.

Program the application to the device by clicking the Make and Program button, as shown in the accompanying image. Check whether the lab builds and programs successfully and verify the build results in the output dialog box.
Observe the Output
Now, open the Tera Term terminal application on the PC (from the Windows® Start menu by pressing the Start button). Select the Serial Port as shown in the accompanying image.
Once the COM port is connected, click on Setup > Serial port. In the Tera Term: Additional settings window that appears, change the baud rate to 115200, as shown in the accompanying image.
Observe the following message displayed on the serial terminal.

Enter 10 characters in the Tera Term terminal. Once all 10 characters have been entered, the system echoes the same characters back to the terminal in the same order.
During the echo-back operation, the LED toggles its state. If the LED is initially OFF, it turns ON when the echo-back occurs. Conversely, if the LED is initially ON, it turns OFF during the echo-back event.