PROFINET® Quick Start Guide on Linux®

Last modified by Microchip on 2025/12/04 13:19

Introduction

Thank you for taking the time to evaluate our PROFINET® solution on Linux®.

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 the demo application
Information

Pre-Requisites:

  • Hardware
    • One of the following Microchip development boards:
    • Serial to USB adapter
    • Ethernet® cable
  • Software and Tools
    • A Windows® PC or Linux PC with Ubuntu or Debian distribution
    • RT-Labs® PROFINET Device Stack library and demo application (P/N: SW70F56A)
    • TeraTerm or PuTTY serial terminal
    • balenaEtcher SD™ card flasher
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 QSPI Flash.
    • Use a USB Type-A to Micro-USB cable to connect the J2 Micro-USB port for power.

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

SAMA7D65 Curiosity kit (EV63J76A)

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

To set up the serial terminal on a Linux PC with picocom:

  • Identify the serial USB connection by monitoring the last lines of the dmesg command (may need sudo rights).
  • The /dev/ttyUSBx number will be used to configure the terminal emulator.

dmesg output

  • Assuming the serial USB interface is /dev/ttyUSB0, run the following command:
sudo picocom -b 115200 /dev/ttyUSB0  (sudo rights may be needed)

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

  • Got 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!

Setup is completed.

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 SW70F56A and extract its content.

Back to Top


Flash the extracted image onto the SD card.

Open balenaEtcher.

balenaEtcher window

Click on Flash from file and select a pre-built image from the SW70F56A/bin/ folder.

  • Files with the *.wic extension are Yocto Project® images.
  • Files with the *.img extension are Buildroot™ images.

Click on Select target and choose the mounted SD card. Then, click Flash to begin the installation process.

After the flashing process is complete, insert the SD card into the on-board SD card slot.

Back to Top


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

The Linux image will boot, and a login prompt will appear in the serial terminal.

If you are not automatically logged in, enter "root" as the username.

Information

No password is required.

login prompt

Back to Top


The PROFINET demo application operates as a systemd service.

You can check the status of the application by running the following command:

systemctl status pnet-demo

systemctl status pnet-demo

Back to Top


You can view the console log by executing the following command:

journalctl -u pnet-demo.service

journalctl -u pnet-demo.service

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


In the Network Adapter menu, 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.

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

devices will be connected by a line

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 option

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

Set Network Parameters window

  • Both devices are now connected:

Devices connected

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.

stop Flashing LED

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 the Demo Application

Information

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

The demo application includes:

  1. A pnet meta layer, which can be integrated into a Yocto Project build
  2. A pnet Buildroot package that can be incorporated into a Buildroot build

Yocto Project Build

Install the following packages on your Linux PC:

sudo apt-get install gawk wget git-core git-lfs diffstat unzip texinfo gcc-multilib \
     build-essential chrpath socat cpio python3 python3-pip python3-pexpect \
     xz-utils debianutils iputils-ping python3-git python3-jinja2 liblz4-tool xterm repo

Clone the required repositories.

  • Create an empty directory to serve as your workspace:
mkdir yocto-dev
cd yocto-dev
  • Set the language settings environment variable:
export LC_ALL=C
  • Set git email and user:
git config --global user.email "Your email"
git config --global user.name "Your Name"
  • Use the repo tool to download all the required repositories:
repo init -u https://github.com/linux4microchip/meta-mchp-manifest.git -b refs/tags/linux4microchip-2025.04 -m mpu/default.xml

repo sync

Copy the SW70F56A/meta-pnet directory to the yocto-dev directory.

Modify the EXTERNALSRC path in yocto-dev/meta-pnet/recipes-pnet/pnet-demo/pnet-demo_1.0.bbappend to reference the absolute path of SW70F56A/src.

Initialize the build environment.

The meta-mchp repository includes sample configuration templates to help set up BitBake layers and key configuration files in the Yocto Project build directory.

  • Set the TEMPLATECONF environment variable to the appropriate configuration template before initializing the build environment:
export TEMPLATECONF=${TEMPLATECONF:-../meta-mchp/meta-mchp-mpu/conf/templates/default}
  • Navigate to the yocto-dev directory and initialize the Yocto Project build environment:
source openembedded-core/oe-init-build-env
  • To enable the meta-pnet layer during the build, edit yocto-dev/build/conf/bblayers.conf and add the meta-pnet layer:
BBLAYERS ?= " \
/<path-to-yocto-dev>/yocto-dev/openembedded-core/meta \
...
/<path-to-yocto-dev>/yocto-dev/openembedded-core/../meta-pnet \
"
  • To include the PROFINET demo application and SNMP server in the image, add the following line at the bottom of yocto-dev/build/conf/local.conf:
CORE_IMAGE_EXTRA_INSTALL += "pnet-demo net-snmp-server-snmpd"

Specify the target machine and initiate the image build process.

  • Depending on your target machine, execute one of the following commands:
export MACHINE=sam9x75-curiosity-sd
export MACHINE=sam9x60-curiosity-sd
export MACHINE=sama7d65-curiosity-sd
  • Navigate to the yocto-dev directory and build the project:
bitbake mchp-headless-image
Information

The SD card image with the .wic extension is located in the yocto-dev/build/tmp-glibc/deploy/images/"MACHINE" folder.

 

Success

Congratulations!

You have successfully built the PROFINET device demo application using Yocto Project build system.

Back to Top


Buildroot Build

Install the following packages on your Linux PC:

sudo apt-get install subversion build-essential bison flex gettext \
libncurses5-dev texinfo autoconf automake libtool mercurial git-core \
gperf gawk expat curl cvs libexpat-dev bzr unzip bc python3-dev \
wget cpio rsync xxd bmap-tools

Clone the required repositories.

  • Create an empty directory to serve as your workspace:
mkdir buildroot-dev
cd buildroot-dev
  • Clone the required repositories:
git clone https://github.com/linux4microchip/buildroot-mchp.git
git clone https://github.com/linux4microchip/buildroot-external-microchip.git
  • Check out the following release branch:
cd buildroot-external-microchip/
git checkout linux4microchip-2025.04 -b linux4microchip-2025.04
cd ../buildroot-mchp/
git checkout linux4microchip-2025.04 -b linux4microchip-2025.04

Copy SW70F56A/pnet-br folder to buildroot-external-microchip/package folder.

Add the following line to buildroot-external-microchip/Config.in:

source "$BR2_EXTERNAL_MCHP_PATH/package/pnet-br/Config.in"

Initialize the build environment:

  • Navigate to the buildroot-mchp directory and set up BR2_EXTERNAL:
export BR2_EXTERNAL=../buildroot-external-microchip/
  • Run the defconfig for your board by executing one of the following commands:
make sam9x75_curiosity_headless_defconfig
make sam9x60_curiosity_headless_defconfig
make sama7d65_curiosity_headless_defconfig
  • Open the Buildroot configuration menu:
make menuconfig
  • Enable the following packages:
    • p-net:
      • Go to External Options > pnet and press y. This will display the pnet repo path or URL option.
      • Enter the full path to the SW70F56A/ folder:
    • SW70F56A/ folder path
    • snmp:
      • Go to Target packages > Networking applications > netsnmp and press y.
  • Save and exit the configuration.

Build the project:

$ make
Information

The SD card image is located in buildroot-mchp/output/images/sdcard.img folder.

Success

Congratulations!

You have successfully built the PROFINET device demo application using Buildroot lightweigth build system.

Back to Top

Next Steps

The PROFINET device demo application can be connected to a PLC to establish PROFINET communication. For detailed instructions, please refer to the PROFINET User Manual located in the SW70F56A/ 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