U-PHY Quick Start Guide on MPLAB® Harmony v3
Introduction
Thank you for taking the time to evaluate our U-PHY solution on MPLAB® Harmony v3.
This guide provides instructions on how to:
- Run a pre-built U-PHY demo application
- Use a diagnostic tool to view the device
- Run the demo application as a PROFINET®, EtherNET/IP® or MODBUS® device and establish an IO connection with CODESYS® SoftPLC®
- Build and debug the demo application
Setup Instructions
Set up the Board
Please refer to the board-specific section below as needed to connect the peripherals described in the following steps.
SAM9X75 Curiosity LAN Kit (EV31H43A)
- Connect the LAN8840 EDS2 Daughter Card to the Gigabit Ethernet J17 connector.
- Attach an Ethernet cable to the RJ45 connector on the LAN8840 EDS2 Daughter Card.
- Plug the other end of the Ethernet cable into the PC.
- Connect a serial-to-USB dongle (FTDI-like) to the UART DEBUG J35 header on one side and to the PC on the other.
- Ensure that jumpers J9 and J10 are open to prevent booting from NAND and Quad Serial Peripheral Interface (QSPI) Flash.
- Use a USB Type-A to Micro-USB cable to connect the J2 Micro-USB port for power.
- Press the START pushbutton.

SAM9X60 Curiosity Kit (EV40E67A)
- Connect an Ethernet cable to the RJ45 connector J6.
- Plug the other end of the Ethernet cable into the PC.
- Connect a serial-to-USB dongle (FTDI-like) to the Universal Asynchronous Receiver/Transmitter (UART) DEBUG J11 header on one side and to the PC on the other.
- Ensure that jumper J4 is open to prevent booting from NAND Flash.
- Use a USB Type-A to Micro-USB cable to connect the J1 Micro-USB port for power.
- Press the START pushbutton.

SAMA7D65 Curiosity kit (EV63J76A)
- Connect an Ethernet cable to the RJ45 connector J14.
- Plug the other end of the Ethernet cable into the PC.
- Connect a serial-to-USB dongle (FTDI-like) to the UART DEBUG J35 header on one side and to the PC on the other.
- Ensure that jumpers J36 and J39 are open to prevent booting from NAND and QSPI Flash.
- Use a USB Type-A to USB Type-C® cable to connect the J3 USB Type-C port for power.
- Press the START pushbutton.

SAMA7G54 Evaluation Kit (EV2118A)
- Connect an Ethernet cable to the Gigabit Ethernet RJ45 connector J5.
- Plug the other end of the Ethernet cable into the PC.
- Connect a serial-to-USB dongle (FTDI-like) to the UART DEBUG J20 header on one side and to the PC on the other.
- Use a USB Type-A to Micro-USB cable to connect the J7 USB Micro-USB port for power.
- Press the START pushbutton.

Set up the Serial Terminal
On your PC, open a serial terminal and configure it with the following settings:
- Baud Rate: 115200
- Data: 8-bit
- Parity: None
- Stop Bits: 1
- Flow Control: None
To set up the serial terminal on a Windows PC with PuTTY:
- Open Windows Device Manager to identify the correct COM port.
- Connect and disconnect the serial-to-USB dongle, and note which COMxx port appears and disappears (for example, COM10 is used in this guide; please use the COM port that matches your setup).
- Open PuTTY and go to Category > Connection > Serial.
- Configure the serial connection parameters as shown in the accompanying image, making sure to select the COM port that corresponds to your local setup.

- Go to Terminal and enable the Implicit CR in every LF option.

- Go to Category > Session and choose Serial for Connection type, then press Open.

Configure a static IP address for the Windows PC Ethernet interface connected to the U-PHY device.
Go to Windows Settings > Network & internet. Select the appropriate Ethernet interface, change the IP configuration to Manual, and configure the IP address and Subnet mask accordingly.

Running the Pre-Built Demo Application
Download the ZIP release package file from SW87R19A and extract its content.
Format the SD card to FAT32 by adhering to the guidelines provided in the dedicated "How to Format and Partition an SD Card Larger Than 32GB Using DiskPart in Windows® for MPU" page.
Program the binaries to the SD card.
Copy boot.bin from the board-specific folder located at uphy-stack-h3/bin/<devicename>/deps to the SD card.
Copy harmony.bin from the board-specific folder located at uphy-stack-h3/bin/<devicename> to the SD card.
Insert the SD card into the board.
Press the RESET button on the board to initiate a reset.
The sample application will display a startup message on the serial terminal, as illustrated in the accompanying image.

Selecting Desired Industrial Protocol for U-PHY
Enter the protocol you want to use in the terminal and press enter:
uphy_set_pnet for Profinet Device
uphy_set_enip for EtherNET/IP Adapter
uphy_set_mbus for Modbus TCP Server
Enter "uphy_get" to know the currently activated protocol.
Restart the board by pressing RESET button. The output will look like the accompanying image.

Observing U-PHY PROFINET With PRONETA BASIC
Enter "uphy_set_pnet" in the terminal and reset the board to select PROFINET protocol.
Download PRONETA BASIC 3.8 (or higher) from Siemens by logging in with a free account.
Locate the ZIP file in the downloads section and extract its contents.
Run PRONETA.exe, if prompted, to install the Npcap driver. Click Yes to proceed.
Once the PRONETA window opens, navigate to the Settings menu.

In the Network Adapter pane, select the network adapter that is connected to the PROFINET device.

Navigate to the Network Analysis menu and select the Online tab.
The PC running PRONETA and the device running the PROFINET demo application will be displayed.

Right click on the device and select Start Flashing LED.
The LED on the development kit will blink three times at a frequency of 1 Hz and will continue blinking with a short pause between cycles until you right click on the device and select Stop Flashing LED.

Setting a Static IP Address for the U-PHY Device
Set a static IP address for the device. You can use your preferred IP address and netmask is set to 255.255.255.0.
The required IP address will be set.

Observing U-PHY EtherNET/IP With Hilsher EtherNET/IP Tool
Enter "uphy_set_enip" in the terminal and reset the board to select EtherNET/IP protocol.
Download latest Hilscher EtherNET/IP Tool and extract its contents.
Run EtherNetIPTool.exe. Click Preferences and choose the IP address of your interface in the Local NIC drop-down menu.

Click on Send ListIdentity Request (UDP broadcast). Our device will be visible under List of identified devices. Click on it to view the device details.

Establishing I/O Connection
Download CODESYS Development System V3 and install it on the Windows machine.
In the Windows taskbar system tray, right click the CODESYS Control Win SysTray icon and select Start PLC.

Click OK if the following window appears.

Launch CODESYS from the Start menu.
Navigate to Tools > CODESYS Installer, and install the CODESYS Control Win add-on.

Navigate to Tools > Device Repository.
PROFINET case:
Click Install and select the GSD file (GSDML-V2.44-RT-Labs-U-Phy-DIGIO-Sample-20260223.xml) located in uphy-stack-h3/share to install the PROFINET device.


EtherNet/IP case:
Select U-Phy DIGIO Sample.eds located in uphy-stack-h3/share to install the EtherNet/IP adapter.

Navigate to File > Open Project and select uphy-stack-h3/codesys/uphy_demo_controller_win.project to load the project.
If the following window appears, click Set All to Newest and then click OK.

The project is now loaded.

Double click on Device (CODESYS Control Win…).
In the Communication Settings section, click Scan Network and select your PC from the list.

This will display the following result:

Double click on Ethernet.
In the General tab, click Browse.

Select the network adapter connected to the U-PHY device.
The IP address will be updated accordingly.

Double click on PN_Controller.
In the General tab, click Adjust to set proper values for Default Slave IP Parameter.

This configuration should result in the following:

Go to Ethernet > PN_Controller > U_Phy_DIGIO_Sample.
In the General tab, set an IP address for the PROFINET device. In this guide, we use 192.168.0.50.

Go to Ethernet > EtherNet_IP_Scanner > U_Phy_DIGIO_Sample_1.
In the General tab, set the IP address to the same value that was set on the device using the command uphy_set_ip.

Go to Ethernet > Modbus_TCP_Client > Modbus_TCP_Server.
In the General tab, set the IP address to the same value that was set on the device using the command uphy_set_ip.

Go to the Online menu and select Login.
If prompted by a confirmation window, click Yes.

Go to the Debug menu and select Start.

The PLC on the Windows PC will be in RUN mode, as indicated in the status bar at the bottom of the CODESYS window.

Follow these steps for the PROFINET use case.
Enter "uphy_set_pnet" in the terminal and reset the board to select PROFINET protocol.
Go to Ethernet > PN_Controller > U_Phy_DIGIO_Sample.
In the General tab, the Status will be OK if a PROFINET connection is established to the U-PHY device.

Go to Step 16.
Follow these steps for the EtherNet/IP use case.
Enter "uphy_set_enip" in the terminal and reset the board to select EtherNET/IP protocol.
Go to Ethernet > EtherNet_IP_Scanner > U_Phy_DIGIO_Sample_1.
In the Status tab, the status will be Running if a connection is established to the U-PHY device.

Go to Step 16.
Follow these steps for the MODBUS use case.
Enter "uphy_set_mbus" in the terminal and reset the board to select MODBUS protocol.
Go to Ethernet > Modbus_TCP_Client > Modbus_TCP_Server.
In the Status tab, click Acknowledge. Then the ModbusTCPServer status will be Running if a connection is established to the U-PHY device.

Go to Step 16.
This step is common for all use cases.
Double click on PLC_PRG to look at the project code.

The User LED will now be toggling.
If the U-PHY device is reset, the User LED will be either toggling or OFF based on the state of the flashing bit.
Building and Running the Demo Application
Install the latest version of MPLAB X IDE.
Install the latest version of MPLAB XC32 Compiler.
Open MPLAB X IDE.
Go to File > Open Project.
Open the project located at uphy-stack-h3/apps/uphy_sampleapp/uphy-harmony-<devicename>.X.
Install the required dependencies by using the MPLAB Code Configurator (MCC) manifest file.
Open the Content Manager by clicking on the designated icon shown in the accompanying image.

Click on Select Versions From File.

Select the uphy-stack-h3/apps/uphy_sampleapp/uphy-harmony-<boardname>.X/mcc-manifest-generated-success.yml file.
Click Apply to install the required packages.
Go to the Projects view.

Right click on the project and select Properties.

In Conf: [xxx], select the latest Device Family Pack (DFP) and the latest MPLAB XC32 Compiler.

To create a BIN file, use post-build commands. Navigate to Project Properties and then select Building.
Enable the Execute this line after build option and enter the following command:
"${MP_CC_DIR}/xc32-objcopy -O binary ${DISTDIR}/${PROJECTNAME}.${IMAGE_TYPE}.elf ${DISTDIR}/harmony.bin"
Click Apply, then close the Property window:

Right click on the project and select Clean and Build to build the project.

At the end of the compilation process, you will see the BUILD SUCCESSFUL message.

You can now run the built application from the SD card by copying the required binaries, including the generated harmony.bin:
- Copy boot.bin from the device-specific folder located at uphy-stack-h3/bin/<devicename>/deps to the SD card.
- Copy harmony.bin from uphy-stack-h3/apps/uphy_sampleapp/uphy-harmony-<devicename>.X/dist/uphy_harmony_<devicename>/production to the SD card.
- Insert the SD card and press the RESET button.
Programming and Debugging the Demo Application
Connect an in-circuit debugger/programmer(s) to the JTAG DEBUG connector on one side and to the PC on the other.
Press the RESET button on the board to initiate a reset.
Click on the Refresh Debug Tool Status button.

If the debug probe has not been previously detected, you will be prompted to select it.

Click on the Debug
icon.
The project is programmed and running:

Programming Without Debugging the Demo Application
Connect an in-circuit debugger/programmer(s) to the JTAG DEBUG connector on one side and to the PC on the other.
Press the RESET button on the board to initiate a reset.
Click on the Make and Program device
icon.
The project is programmed and running:

Next Steps
For detailed instructions, please refer to the U-PHY User Manual located in the uphy-stack-h3/ folder.
Troubleshooting
There is no communication when running my CODESYS project. | If the connection fails with CODESYS, verify the following points:
|
The terminal only displays RomBOOT message. | Ensure that the SD card contains the correct files and is inserted properly. |
The image on the SD card is not booting. | Confirm that the jumpers for Quad Serial Peripheral Interface (QSPI) Flash and NAND Flash are open to prevent the system from booting a different image. |
The image on the SD card is not booting. | Confirm that the jumpers for Quad Serial Peripheral Interface (QSPI) Flash and NAND Flash are open to prevent the system from booting a different image. |


