Profinet® Quick Start Guide on Linux®

Last modified by Microchip on 2025/10/31 09:11

Introduction

Thank you for taking time to evaluate our Profinet solution on Linux®. This guide demonstrates how to perform the following activities:

  • Run a pre-built Profinet® device demo application
  • Use a diagnostic tool to view the Profinet device
  • Build the demo application
Information

Pre-Requisites:

  • Any one of the following Microchip development boards:
    • SAM9X75 Curiosity LAN Kit (P/N: EV31H43A)
    • SAM9X60 Curiosity Kit (P/N: EV40E67A)
  • A Windows® PC
  • A Linux PC with Ubuntu™ or Debian™ distribution
  • Serial to USB adapter
  • Ethernet® cable
  • RT-Labs® Profinet Device Stack library, demo application and user manual (P/N: SW70F56A)
  • Install the following applications on the Windows PC:

See the "Troubleshooting" section at the bottom of this page for help.

Setup

Go to the board-specific section below and connect the components as described in the following steps:

SAM9X75 Curiosity LAN Kit

  • LAN8840 EDS2 Daughter Card to Gigabit Ethernet J17 connector
  • Ethernet cable to RJ45 connector on the LAN8840 EDS2 Daughter Card
  • The other side of the Ethernet cable needs to be plugged into the Windows PC
  • SD card programmed and inserted into the SD Boot J14 slot
    • The procedure for programming an SD card is provided in a later part of this guide
  • Serial to USB dongle to UART DEBUG J35 header on one side and to the PC on the other side
  • USB Type-A to Micro-USB cable to J2 Micro-USB port for power
  • Jumpers J9 and J10 opened to avoid booting from NAND and QSPI Flash

SAM9X75 Curiosity LAN Kit

SAM9X60 Curiosity Kit

  • Ethernet cable to RJ45 connector J6
  • The other side of the Ethernet cable needs to be plugged into the Windows PC
  • SD card programmed and inserted into the SDMMC0 J3 slot
    • The procedure for programming an SD card is provided later in this guide
  • Serial to USB dongle to UART DEBUG J11 header on one side and to the PC on the other side
  • USB Type-A to Micro-USB cable to J1 Micro-USB port for power
  • Jumper J4 opened to avoid booting from NAND Flash

SAM9X60 Curiosity kit

Back to Top


On the PC, open a serial terminal with the following settings:

  • Baud Rate: 115200
  • Data: 8-bit
  • Parity: None
  • Stop: 1-bit
  • Flow Control: None

Open PuTTY.

                                          PuTTY icon

Open Windows Device Manager to find out which COM port to use. Plug and unplug the serial-USB dongle and check which COMxx port appears and disappears (COM10 will be used in this example).

Open PuTTY > Category > Connection > Serial and configure the parameters as shown in the accompanying image. (Adapt the COM port to your local setup.)

PuTTY Configuration window

Come back to PuTTY > Category > Session and choose Serial for Connection type. Then press Open.

PuTTY Configuration window

Back to Top

Run the Pre-Built Demo Application

This section will demonstrate how to install and run the pre-built Profinet device demo application.

Download the ZIP file from SW70F56A and unzip it.

Back to Top


Install the image on the SD card.

Open balenaEtcher.

balenaEtcher window

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

  • *.wic files are the Yocto Project® images
  • *.img files are the Buildroot™ images 

Click on Select target and select the mounted SD card. Then click on Flash.

Insert the SD card into the board once flashing is done.

Back to Top


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

Back to Top


The Linux image will be booted and a login prompt will be shown in the serial terminal. If not automatically logged in, enter "root" as the login with no password.

Back to Top


The Profinet demo application runs as a systemd service. The status of the application can be checked with the following command:

systemctl status pnet-demo

systemctl status pnet-demo

Back to Top


The console log can be checked with the following command:

journalctl -u pnet-demo.service

journalctl -u pnet-demo.service

Congratulations! Your Profinet device demo application is now running.

Back to Top

Diagnostic Tool to View the Profinet Device

This section demonstrates how to view and configure the Profinet device demo application using the PRONETA™ diagnostic tool.

PRONETA is a diagnostic tool for analyzing and configuring Profinet networks from Siemens. It can run on a Windows PC.

Download PRONETA BASIC 3.8 (or higher) from Siemens™ after logging in with a free account. Download the zip file under the downloads section and extract it.

Back to Top


Run PRONETA.exe. If a pop-up asks you to install the Npcap™ driver, click yes. Once the PRONETA window is opened, click on Settings.

PRONETA window

Back to Top


Go to the Network Adapter window and select the adapter to which the Profinet device is connected.

PRONETA window Settings

Back to Top


Go to the Network Analysis window and select the Online tab. The PC running PRONETA and the device running Profinet demo application will be visible. Both will be connected by a line if the Profinet device already has a valid IP address. The procedure to set an IP address for the Profinet device is explained below. Click on the device to view the Device Details.

Network Analysis window

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. It will continue to do so with a short break each cycle until you right click on the device and select Stop Flashing LED.

stop Flashing LED

Back to Top


Right-click on the device and select Set Network Parameters to change the device’s name and IP address.  To persist the change across reboot, select Apply settings permanently.

Set Network Parameters window

Congratulations! You are now able to view and configure the Profinet device demo application.

Back to Top

Build the Demo Application

This section demonstrates how to build the Profinet device demo application from source and run it. The demo application has a pnet meta layer, which can be integrated into the Yocto Project build and a pnet buildroot package, which can be integrated into the Buildroot build.

Yocto Project Build

Install the following packages on the 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

Back to Top


Clone the necessary repositories.

Create an empty directory to hold the workspace:

mkdir yocto-dev
cd yocto-dev

Use the repo tool to fetch 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

Back to Top


Edit the EXTERNALSRC path in SW70F56A/meta-pnet/recipes-pnet/pnet-demo/pnet-demo_1.0.bbappend to point to the absolute path of SW70F56A/src.

Back to Top


Copy SW70F56A/meta-pnet to yocto-dev.

Back to Top


Initialize the build environment.

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

Set the TEMPLATECONF environment variable to point to the appropriate configuration template before initializing the build environment:

export TEMPLATECONF=${TEMPLATECONF:-../meta-mchp/meta-mchp-mpu/conf/templates/default}

 Go 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 to 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 add the Profinet demo application and SNMP server to the image, add the following line at the bottom of the file yocto-dev/build/conf/local.conf.

CORE_IMAGE_EXTRA_INSTALL += "pnet-demo net-snmp-server-snmpd"

Back to Top


Set the target machine and build the image.

Depending on the target machine, execute any one of the following commands:

export MACHINE=sam9x75-curiosity-sd
export MACHINE=sam9x60-curiosity-sd

Go to the yocto-dev directory. Build the project:

bitbake mchp-headless-image

The SD card image with the wic extension can be found in yocto-dev/build/tmp-glibc/deploy/images/ folder.

Back to Top

Buildroot™ Build

Install the following packages on the 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

Back to Top


Clone the necessary repositories:

mkdir buildroot-dev
cd buildroot-dev

Fetch the required repositories:

git clone https://github.com/linux4microchip/buildroot-mchp.git
git clone https://github.com/linux4microchip/buildroot-external-microchip.git

Checkout the latest 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

Back to Top


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

Back to Top


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

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

Back to Top


Initialize the build environment:

Go to the buildroot-mchp directory. Setup BR2_EXTERNAL.

export BR2_EXTERNAL=../buildroot-external-microchip/

 Run the defconfig for your board by executing any one of the following commands:

make sam9x75_curiosity_headless_defconfig
make sam9x60_curiosity_headless_defconfig

Now, open the Buildroot configuration menu:

make menuconfig

Enable the following packages:

  • p-net: Navigate to External Options > pnet and press y. This will expose the "pnet repo path or URL" option. Add the full path to the SW70F56A/ folder.
  • snmp: Navigate to Target packages > Networking applications > netsnmp and press y.

Save and exit the configuration.

Back to Top


Build the project:

$ make

The SD card image can be found in folder buildroot-mchp/output/images/sdcard.img

Congratulations! You are now able to build the Profinet device demo application.

Back to Top

Troubleshooting

The serial terminal is not showing anything.

There are multiple possible reasons why the terminal does not show anything:

  • Double-check that the RX-TX signals of the serial cable are properly connected to the RX-TX signals of the board.
  • Double-check that the ground signal is properly connected.
  • Verify that the SD card contains the right files.
The terminal shows a RomBOOT message.
  • Verify that the SD card contains the right files.
  • Verify that the SD card is inserted properly.
The image loaded on the SD card is not booted
  • Verify that the jumper of QSPI Flash and NAND Flash are open to ensure a different image is not booted

Back to Top

Going Further

The Profinet device demo application can be connected to a PLC to establish Profinet communication. More information on how to achieve this can be found in our Profinet User Manual located in the SW70F56A/doc folder. The user manual explains how to set up a CODESYS™ soft PLC running on a Raspberry Pi™ or a Siemens PLC to communicate with the Profinet device demo application, using the button and LED on the board as input/output devices.

Back to Top