Introduction
The Raspberry Pi is a Single Board Computer with an fully functional Operating System on Top. It is capable as an application controller for the iRJ45/SoM module.
Software
The uGOAL software package provides several examples for the device. The examples can be compiled either at a host system or the target. For a host based build a cross compiler toolchain is required.
It is recommended to build the binaries at the target.
For compiling some requirements are needed. These can be installed using this command:
sudo apt-get install build-essential
In addition the SPI interface needs to be enabled using raspi-config. Under “Interface options” it os possible to enable the SPI interface.
sudo raspi-config
The uGOAL software package (download) needs to be transferred to the target. This can be done using scp:
scp 2015013_ugoal_release_2.2.3.zip pi@raspberrypi:/home/pi/.
On the raspberry pi the archive needs to be extracted:
unzip 2015013_ugoal_release_2.2.3.zip
Getting Started
Using delivered build system
Within a example folder “ugoal/projects/ugoal/<example name>/gcc” of the uGOAL software package, build the firmware with following commands:
pi@raspberrypi:~/ugoal/projects/ugoal/02_profinet/gcc $ make PLATFORM=linux
The build system will then start to build the software. The resulting file is stored in the subfolder “build/raspberry_pi_raspi_shield” named goal_raspberry_pi_raspi_shield.bin.
pi@raspberrypi:~/ugoal/projects/ugoal/02_profinet/gcc $ ./build/linux/02_profinet_linux.bin [AC_I|plat_spiInit:169] spi opened successfully [AC_I|goal_rpcSetStackMax:819] rpc transfer size set to 1024 [AC_I|goal_miMctcDmCbRead:747] peer requested Sync Init [AC_I|goal_miMctcDmCbRead:747] peer requested Sync Init [AC_I|goal_miMctcDmCbRead:747] peer requested Sync Init [AC_I|goal_miMctcDmCbRead:747] peer requested Sync Init [AC_I|goal_miMctcRpcSyncLoop:471] RPC state synchronized, running appl_setup [AC_I|goal_miMctcRpcSyncLoop:474] configuring timeout values for peer [AC_I|goal_pnioNewAc:341] PROFINET Application Core successfully started [AC_I|appl_setup:245] Initializing device structure [AC_I|goal_pnioDmDpAddAc:4132] generic data provider mapped to position 0 [AC_I|appl_setup:302] PROFINET ready [AC_I|goal_miMctcRpcSyncLoop:506] local setup done
If the message “local setup done” is missing, a reset issue may affect your hardware. Please perform a reset of the SoM module setting a defined output level for the reset signal using the shown shell script
#/usr/bin/env bash echo "13" > /sys/class/gpio/export || true sleep 1 echo "out" > /sys/class/gpio/gpio13/direction sleep 1 echo "0" > /sys/class/gpio/gpio13/value sleep 1 echo "1" > /sys/class/gpio/gpio13/value
This script will set the GPIO, where the reset signal of the SoM module is connected to a defined value. Beside that a reset is performed. After this, the application should start properly.
The Application has been started the Profinet Stack at the SoM successfully.
Generate Projects for an IDE
The uGOAL software package contains a project generator for IDEs like Eclipse.
From any project folder a project generator can be run to create an Eclipse project for the application. The project generator requires a python3 installation. Required dependencies are installed automatically.
If you want to create an Eclipse project, run the following command:
pi@raspberrypi:~/ugoal/projects/ugoal/02_profinet/gcc $ make PLATFORM=linux gen_project Please select a template - OR - press <CTRL+c> and set the GEN_PROJECT_TPL environment variable. Choose IDE: [ 1] e2studio [ 2] eclipse [ 3] stmcubeide Choice [1-3]:
For the Raspberry Pi platform the template number 1 needs to be chosen.
Selected template: [1] eclipse/port/generic gen_project ----------- Project: 02_profinet_linux Templates: /home/pi/ugoal/tools/gen_project/templates/eclipse/port/generic Generating: .cproject .project language.settings.xml Output dir: /home/pi/ugoal/projects/ugoal/02_profinet/gcc/../ide/eclipse/port/linux/
The generated project can be imported into Eclipse
Known Issues
Following you’ll find current limitations regarding the Raspberry Pi.
EtherCAT Distributed Clocks is not fully supported due to missing assignment to external GPIOs at the platform driver “ugoal/plat/drv/linux/plat.c”.