PROFINET® Quick Start Guide on MPLAB® Harmony v3

Last modified by Microchip on 2026/03/30 11:46

Introduction

Thank you for taking the time to evaluate our PROFINET® solution on MPLAB® Harmony v3.

This guide provides instructions on how to:

  • Run a pre-built PROFINET device demo application
  • Use a diagnostic tool to view the PROFINET device
  • Establish an IO connection between CODESYS SoftPLC and the PROFINET device
  • Build and debug the demo application
Information

Pre-Requisites:

  • Hardware
    • One of the following Microchip development boards:
      • SAM9X75 Curiosity LAN Kit (P/N: EV31H43A)
      • SAM9X60 Curiosity Kit (P/N: EV40E67A)
      • SAMA7D65 Curiosity kit (P/N: EV63J76A)
      • SAMA7G54 Evaluation kit (P/N: EV2118A)
    • Microchip or Segger J-Link™ In-Circuit Debugger/Programmer(s)
    • Serial to USB adapter
    • Ethernet® cable
  • Software and Tools
Warning

Please refer to the "Troubleshooting" section of this page for assistance.

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.

SAM9X75 Curiosity LAN Kit

 

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.

SAM9X60 Curiosity kit

 

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.

SAMA7D65 Curiosity kit (EV63J76A)

 

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 USB Type-C® cable to connect the J7 USB Type-C port for power.
  • Press the START pushbutton.

SAMA7G54 Evaluation kit

 

Back to Top


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.

PuTTY Configuration window

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

PuTTY Configuration window

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

PuTTY Configuration window

​​​​​​

Success

 Congratulations! The setup is complete.

Running the Pre-Built Demo Application

Information

This section provides instructions on how to program and execute the pre-built PROFINET device demo application.

Download the ZIP release package file from SW44H19A and extract its content.

Back to Top


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.

Back to Top


Program the binaries to the SD card.

Copy boot.bin from the board-specific folder located at SW44H19A/bin/<devicename>/deps to the SD card.

Copy harmony.bin from the board-specific folder located at SW44H19A/bin/<devicename> to the SD card.

Back to Top


Insert the SD card into the board.

Back to Top


Press the RESET button on the board to initiate a reset.

Back to Top


The sample application will display a startup message on the serial terminal, as illustrated in the accompanying image.

serial terminal

Success

Congratulations! The PROFINET device demo application is now running successfully.

Back to Top

Using a Diagnostic Tool to View the PROFINET Device

Information

Note: This section explains how to view and configure the PROFINET device demo application using the PRONETA® diagnostic tool.

PRONETA is a Siemens® diagnostic tool designed for analyzing and configuring PROFINET networks.

In PROFINET terminology, PRONETA acts as a PROFINET IO Supervisor. It's neither a PROFINET IO Controller, nor an IO Device.

Therefore, PRONETA works without the need of a PLC (PROFINET Controller) and allows to access PROFINET Devices during commissioning.

Warning

Since PRONETA is compatible exclusively with Windows OS, this section can only be completed on a Windows-based PC.

Download PRONETA BASIC 3.8 (or higher) from Siemens by logging in with a free account. Locate the ZIP file in the downloads section, download it, and extract its contents.

Back to Top


Run PRONETA.exe. If prompted to install the Npcap driver, click Yes to proceed.

Once the PRONETA window opens, navigate to the Settings menu.

PRONETA window

Back to Top


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

PRONETA - Siemens window

Back to Top


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.

PC running PRONETA and the device running the PROFINET demo application

Back to Top


 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.

Start Flashing LED option

Back to Top

Warning

The Set/Reset Network Parameters options are functional: they allow setting/resetting the IP address, which is used to uniquely identify devices within the Ethernet network, allowing controllers (such as PLCs) to communicate with specific devices. This step is not required.

The Open Web Browser option is not supported by the demo application.

Success

Congratulations! You are now able to view and configure a PROFINET device demo application using the PRONETA diagnostic tool.

Back to Top

Establishing a PROFINET IO Connection

Information

This section outlines the procedure for establishing a PROFINET IO connection between a CODESYS Soft PLC and the PROFINET device demonstration application.

A Soft PLC is a software‑based PROFINET IO Controller that acts as a hardware-based PLC.

Warning

This section is performed on a Windows-based PC as a continuation of the previous section.

As shown in the CODESYS documentation, configure a static IP address for the Windows PC Ethernet interface connected to the PROFINET device.

CODESYS documentation screenshot

CODESYS documentation screenshot

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.

Edit IP Settings window


Download CODESYS Development System V3 and install it on the Windows machine.

Information

This guide is based on CODESYS V3.5 SP21 Patch 5. Please note that menu names and layouts may vary if you are using a different version. We recommend using the latest version of all software components whenever possible.


In the Windows taskbar system tray, right-click the CODESYS Control Win SysTray icon and select Start PLC.

CODESYS Control Win SysTray bar

Click OK if the following window appears.

CODESYS Control Win SysTray window


Launch CODESYS from the Start menu.

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

CODESYS Installer window


Navigate to Tools > Device Repository.

Click Install and select the GSD file located in SW70F56A/src/p-net/share to load it.

Device Repository dialog

Information

The PROFINET General Station Description (GSD) file is a description of a PROFINET device provided by the device manufacturer in XML.

The GSD file is now successfully installed.

GSD file installed


Navigate to File > Open Project and select SW70F56A/codesys/pn_demo_controller_win.project to load the project.

pn_demo_controller_win.project window


Double-click on Device (CODESYS Control Win…).

In the Communication Settings section, click Scan network and select your PC from the list.

Communication settings

This will display the following result:

Scan results

 


Double-click on Ethernet.

In the General tab, click Browse and select the network adapter connected to the PROFINET device.

Ethernet tab

Warning

When performing this step for the first time, you may be prompted to create a username and password.

CODESYS dialog

Click Yes and record the username and password for future reference.

If you are asked to log in, enter the username and password you just created:

Device User Logon dialog

Configure the IP address and subnet mask to match the values originally defined in the Windows Network & Internet settings.

 Network & Internet settings


Double-click on PN_Controller.

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

PN_Controller tab

This configuration should result in the following:

Default slave IP parameter


Double-click on P_Net_multi_module_sample_app.

In the General tab, set an IP address for the PROFINET device. In this guide, we use 192.168.0.50.

P_Net_multi_module_sample_app tab


Go to the Online menu and select Login.

If prompted by a confirmation window, click Yes.

CODESYS dialog


Go to the Debug menu and select Start.

Debug menu

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

RUN mode


Double-click on P_Net_multi_module_sample_app.

In the General tab, the Status will be OK if a PROFINET connection is established to the PROFINET device.

P_Net_multi_module_sample_app tab


Double-click on PLC_PRG to look at the project code.

Information

The out_pin_LED variable is a PLC output that controls the LED on the PROFINET device, while in_pin_button_LED is a PLC input that provides the status of the USER button on the PROFINET device.

The flashing bit will toggle when the on-board USER push button is pressed.

If the flashing bit is set to TRUE, out_pin_LED will toggle continuously, causing the LED on the PROFINET device to blink.

PLC_PRG tab


The User LED should toggle continuously based on the state of the flashing bit controlled by the USER pushbutton.

Press the USER pushbutton to stop or restart the LED toggling.

 


You can check under PRONETA that the right IP Address is now assigned to your PROFINET device:

IP Address

 

Success

Congratulations! You have successfully established a PROFINET IO connection.

Back to Top

Building and Running the Demo Application

Information

This section provides instructions on how to build the PROFINET device demo application from source and run it.

Install the latest version of MPLAB X IDE.

Back to Top


Install the latest version of MPLAB XC32 Compiler.

Back to Top


Open MPLAB X IDE.

Go to File > Open Project.

Open the project located at SW44H19A/apps/pnet_sampleapp/pnet-harmony-<devicename>.X.

Back to Top


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.

content manager icon

Click on Select Versions From File.

Select Versions from File

Select the SW44H19A/apps/pnet_sampleapp/pnet-harmony-<boardname>.X/mcc-manifest-generated-success.yml file. 

Click Apply to install the required packages.

Apply button

Back to Top


Go to the Projects view.

Projects tab

Back to Top


Right-click on the project and select Properties.

Properties tab

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

device family pack

Back to Top


Information

MPLAB X IDE does not generate a BIN file by default.

To create a BIN file, use post-build commands by navigating to Project Properties and then selecting 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:

property window

Back to Top


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

clean and build

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

BUILD SUCCESSFUL message

 


You can now run the built application from the SD card by copying the required binaries, including the generated harmony.bin:

  1. Copy boot.bin from the device-specific folder located at SW44H19A/bin/<devicename>/deps to the SD card. 
  2. Copy harmony.bin from SW44H19A/apps/pnet_sampleapp/pnet-harmony-<devicename>.X/dist/pnet_harmony_<devicename>/production to the SD card.
  3. Insert the SD card and press the RESET button.

Success

Congratulations! You have successfully built and run the PROFINET device demo application.

Information

The next two sections provide instructions on how to program with or without debugging the PROFINET device demo application. Choose the option you want to follow.

Back to Top

Programming and Debugging the Demo Application

Warning

Please note that, depending on the debugger used, you may encounter booting issues if the SD card already contains a bootable image, so:

  • Delete the boot.bin file from the SD card to prevent it from being bootable.
  • Then, reinsert the SD card into the board, as the application uses it as a persistent storage medium.

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.

Refresh Debug Tool Status

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

select debug probe

Back to Top


Click on the Debug Debug project icon icon.

The project is programmed and running:

programmed and running message


Check on PRONETA that both devices are now connected:

both devices connected

 

Success

Congratulations! You have successfully built, programmed, and debugged the PROFINET device demo application using the MPLAB development ecosystem.

Back to Top

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 Make and Program device icon icon.

The project is programmed and running:

programmed and running message


Check on PRONETA that both devices are now connected:

both devices connected

 

Success

Congratulations! You are now able to view your PROFINET device using the PRONETA diagnostic tool.

Information

MCC:

If you need to modify any MPLAB Harmony module configuration parameters, close Content Manager and open the MPLAB Code Configurator by clicking on MCC.

Once you have made the required changes, generate the updated code by clicking Generate.

project graph

Next Steps

The PPOFINET device demo application can be connected to a Programmable Logic Controller (PLC) to establish PROFINET communication.

For detailed instructions, please refer to the PPOFINET user manual located in the SW44H19A/ folder.

The user manual provides guidance on setting up a CODESYS® soft PLC on a Raspberry Pi or a Siemens PLC to communicate with the PROFINET device demo application, utilizing the board’s button and LED as input/output devices.

Back to Top

Troubleshooting

The serial terminal is not displaying any output.

If the terminal does not display any output, consider the following possible causes:

  • Ensure that the RX and TX signals of the serial cable are correctly connected to the corresponding RX and TX signals on the board.
  • Confirm that the ground signal is properly connected.
  • Verify that the SD card contains the correct files.

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 QSPI Flash and NAND Flash are open to prevent the system from booting a different image.

Back to Top