PROFINET® Quick Start Guide on MPLAB® Harmony v3

Last modified by Microchip on 2025/12/05 15:39

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
  • Build and debug the demo application
Information

Pre-Requisites:

  • Hardware
    • One of the following Microchip development boards:
    • 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

Board Setup

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.

sam9x75

  • 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 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.

sam9x60

  • 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.

sama7d65

Back to Top


Serial Terminal Setup

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

Open Windows Device Manager to identify the correct COM port.

Information

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 serial

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

putty configuration

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

putty session

Success

 Congratulations!

The setup is complete.

Back to Top

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 SW44H19Aand 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

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.

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


​​​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.

If the PROFINET device already has a valid IP address, both devices will be connected by a line:

device connection diagram

If this is not the case, please follow these instructions:

  • Right-click on the device and select Set Network Parameters to modify the device’s name and IP address.

set network parameters

  • To ensure these changes are retained after a reboot, select Apply settings permanently.

set network parameters

  • Both devices are now connected:

device connection diagram

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.

device connection diagram

Warning

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

Building, Programming, and Debugging the Demo Application

Information

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

Building

Install latest MPLAB X IDE.

Back to Top


Install latest 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

Back to Top


Go to Projects view.

Projects

Back to Top


Right-click on the project and select Properties.

properties

In Conf: [xxx], select the latest Device Family Pack (DFP) and the latest 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 on 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 message BUILD SUCCESSFUL.

BUILD SUCCESSFUL message

 

Warning

Please note that, depending on the debugger used, you may encounter booting issues if the SD card 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.

Back to Top

Programming and Debugging

Click on the Refresh Debug Tool Status.

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


Right-click on the project and select Debug to begin debugging the project.

debug

Back to Top

Programming Without Debugging

Click on the Make and program device icon.

Make and program device icon


Information

Alternatively, you can run the 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.

 

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 on Generate.

project graph

Success

Congratulations!

You have successfully built, programmed and debugged the PROFINET device demo application using MPLAB Ecosystem.

Back to Top

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