The open source software is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
Find the table of supported devices at the end of the document Link to table
This HowTo describes steps to install the Software-Development-Kit (SDK) for PFC's on Ubuntu16.04
The start into the embedded linux world requires substantial technical know-how to have success. Therefore WAGO recommends familiarity with the following topics for the future embedded linux developer:
- Linux-OS
- working on command line interface(CLI)
- writing Makefile, C or C++ code, shell-scripts.
- Cross-Platform-Development.
Helpful when heard about:
- Realtime operating systems
- PTXdist,
- ARM architecture
- Bootloader
We will provide ’ready to use’ toolchains in a binary manner, which saves a lot of time and headaches. This document describes the installation and usage of the binary toolchain.
The advantages of the ready to use toolchain have to be paid with some dependencies, which make a uniquely defined host environment mandatory. Ubuntu 16.04 (64bit) fits these requirements, others may or may not.
You can download the Ubuntu-Iso directly form their website: http://releases.ubuntu.com/16.04/
Is Ubuntu 16.04 LTS still supported?
Yes, Ubuntu 16.04 LTS is supported until 2024 through
Canonical’s Extended Security Maintenance (ESM) product.
Xenial enters the ESM period in April 2021, with security
patches provided for an additional three years beyond the
traditional five-year standard support.
https://ubuntu.com/16-04
Make sure if you like to use the precompiled toolchain that you use the Ubuntu-64bit variant.
A minimal disk space of 25GB is required. We recommend 50GB.
For virtual machines on windows x64 hosts: You may enable virtualization support(Intel VT-x or AMD-V), typical turned on in BIOS or UEFI.
Due to the fact that the repository contains files over 50MB you need the GIT large file support extension for GIT before you clone the repository.
Make sure that you install GIT version >= 1.8.2
The recommended Ubuntu version will meet the requirement!
>sudo apt install git
Please refer to this link to get detailed information about the installation on other systems: https://github.com/git-lfs/git-lfs/wiki/Installation
These steps will only concentrate on the recommented Ubuntu version:
>sudo apt install software-properties-common curl
>sudo add-apt-repository ppa:git-core/ppa
>curl -s https://packagecloud.io/install/repositories/github/git-lfs/script.deb.sh | sudo bash
Detected operating system as Ubuntu/xenial.
Checking for curl...
Detected curl...
Checking for gpg...
Detected gpg...
Running apt update... done.
Installing apt-transport-https... done.
Installing /etc/apt/sources.list.d/github_git-lfs.list...done.
Importing packagecloud gpg key... done.
Running apt update... done.
The repository is setup! You can now install packages.
>sudo apt install git-lfs
>git lfs install
>cd ~
>mkdir -p wago/ptxproj/
>cd wago/ptxproj/
>git clone https://github.com/WAGO/pfc-firmware-sdk.git .
We will provide a ’ready to use’ toolchain in a binary manner. To install the binary toolchain act as follows:
We need to clone the pre-compiled toolchain archive to the storage directory. We expect /opt
>sudo mkdir -p /opt/gcc-Toolchain-2019.12/
>sudo git clone https://github.com/WAGO/gcc-toolchain-2019.12-precompiled.git /opt/gcc-Toolchain-2019.12/
After that the cross toolchain is located into folder: /opt/gcc-Toolchain-2019.12/arm-linux-gnueabihf/bin/
If you are interested in the sources of the toolchain take a look at:
http://www.github.com/wago/gcc-toolchain-2019.12
>sudo apt install libncurses5-dev
>sudo apt install gawk
>sudo apt install flex
>sudo apt install bison
>sudo apt install texinfo
>sudo apt install python-dev
>sudo apt install g++
>sudo apt install dialog
>sudo apt install libc6-dev
>sudo apt install lzop #used to build kernel image, ./configure did not check if installed
>sudo apt install autoconf #used to build kernel image, ./configure did not check if installed
>sudo apt install libtool #used to build kernel image, ./configure did not check if installed
>sudo apt install xmlstarlet #used to build led_server package, ./configure did not check if installed
>sudo apt install xsltproc #used to build led_server package, ./configure did not check if installed
>sudo apt install doxygen #used to build modular-config-tools package, ./configure did not check if installed
>sudo apt install autopoint #used to build libmodbus_tglx package
>sudo apt install python3-setuptools #used to build host-system-python3
or in one-shot:
>sudo apt install libncurses5-dev gawk flex bison texinfo python-dev g++ dialog libc6-dev lzop autoconf libtool xmlstarlet xsltproc doxygen autopoint python3-setuptools
>git clone http://github.com/wago/ptxdist.git ~/ptxdist
>cd ~/ptxdist
>./configure
The output looks like this:
checking build system type... x86_64-unknown-linux-gnu
checking host system type... x86_64-unknown-linux-gnu
checking for ptxdist patches... yes
checking for gcc... gcc
checking whether the C compiler works... yes
checking for C compiler default output file name... a.out
checking for suffix of executables...
checking whether we are cross compiling... no
....
checking for gunzip... /bin/gunzip
checking for mktemp... /bin/mktemp
checking for wget... /usr/bin/wget
checking find version... 4.4.2
checking for gmake... no
checking for gnumake... no
checking for make... /usr/bin/make
checking for file... /usr/bin/file
checking for msgfmt... /usr/bin/msgfmt
checking for gcc... /usr/bin/gcc
checking for python2.7... /usr/bin/python2.7
checking whether /usr/bin/python2.7 finds distutils... yes
checking whether python development files are present... yes
checking for patch... /usr/bin/patch
checking whether /usr/bin/patch will work... yes
configure: creating ./config.status
config.status: creating Makefile
ptxdist version 2017.11.1 configured.
Using '/usr/local' for installation prefix.
Report bugs to ptxdist@pengutronix.de
If "configure" fails, install missing packages and run configure again.
>cd ~/ptxdist
>make
The output looks like this:
building conf and mconf ...
make[1]: Betrete Verzeichnis '/home/wago/Downloads/ptxdist-2013.03.0/scripts/kconfig'
...
gcc -g -O2 -DCURSES_LOC="<curses.h>" -DKBUILD_NO_NLS -DPACKAGE='"ptxdist"' -DCONFIG_='"PTXCONF_"' -c nconf.gui.c -o nconf.gui.o
gcc nconf.o zconf.tab.o nconf.gui.o -o nconf -lncurses -lmenu -lpanel
make[1]: Verlasse Verzeichnis '/home/wago/Downloads/ptxdist-2013.03.0/scripts/kconfig'
done.
preparing PTXdist environment ... done
>cd ~/ptxdist
>sudo make install
Default setup installs build environment to folder: /usr/local/lib/ptxdist-2017.11.1/bin/ptxdist
Default setup also creates a sym-link to it in: /usr/local/bin/ptxdist
>cd ~/wago/ptxproj
>ptxdist select configs/wago-pfcXXX/ptxconfig_generic
info: selected ptxconfig:
'configs/wago-pfcXXX/ptxconfig_generic'
>cd ~/wago/ptxproj
>ptxdist platform configs/wago-pfcXXX/platformconfig
info: selected platformconfig:
'configs/wago-pfcXXX/platformconfig'
info: insufficient information in your platformconfig file
please use 'ptxdist toolchain </path/to/toolchain>' to select your toolchain
>cd ~/wago/ptxproj
>ptxdist toolchain /opt/gcc-Toolchain-2019.12/arm-linux-gnueabihf/bin/
found and using toolchain:
'ptxdist toolchain /opt/gcc-Toolchain-2019.12/arm-linux-gnueabihf/bin/'
>cd ~/wago/ptxproj
>ptxdist menu
Leave dialog with [Exit]
>cd ~/wago/ptxproj
>ptxdist menuconfig
Leave dialog with [Exit]
>cd ~/wago/ptxproj
>ptxdist go -q
started : ethtool.get
finished: ethtool.get
started : ethtool.extract
finished: ethtool.extract
started : base.get
finished: base.get
started : base.extract
finished: base.extract
started : kernel-header.get
finished: kernel-header.get
started : kernel-header.extract
...
Now it's probably time to go home for the day. Even on reasonably fast machines the time to build the PFC firmware takes from 30 minutes up to a few hours. Another possibility is to read "How to become a PTXdist Guru" http://public.pengutronix.de/software/ptxdist/appnotes/ in the meantime.
>cd ~/wago/ptxproj
>ptxdist images
Afterwards you should find the firmware image "sd.hdimg" in folder ~/wago/ptxproj/platform-wago-pfcXXX/images/ .
ATTENTION: Size of generated 'sd.hdimg' has been changed to 204MB.
When working in a virtual machine on a windows host and you don't feel familar or save using dd on the virtual machine. Just follow the follwing steps:
- Copy firmware image "sd.hdimg" to your windows host
- Download, install and use "Win32 Disk imager.exe"...
- Disable desktops "automount-open" feature
>gsettings set org.gnome.desktop.media-handling automount true
>gsettings set org.gnome.desktop.media-handling automount-open false
- Identify SD-Card
In this example we will identify /dev/sde as out sd card device.
>mount
/dev/sda1 on / type ext4 (rw,errors=remount-ro)
proc on /proc type proc (rw,noexec,nosuid,nodev)
sysfs on /sys type sysfs (rw,noexec,nosuid,nodev)
....
/dev/sde1 on /media/BOOT type vfat (rw,nosuid,nodev,uid=1000,gid=1000,shortname=mixed,dmask=0077,utf8=1,showexec,flush,uhelper=udisks)
/dev/sde2 on /media/disk type ext3 (rw,nosuid,nodev,uhelper=udisks)
>umount /dev/sde1
>umount /dev/sde2
- Copy "sd.hdimg" to SD-Card
>cd <workspace>/ptxproj/platform-wago-pfcXXX/images
Identify your sd card device, this will be needed as parameter for dd. 'of=[/dev/[sd card device].`
We will use /dev/sde for example.
>sudo dd if=sd.hdimg of=/dev/sde
[sudo] password for <user>:
399360+0 Datasets in
399360+0 Datasets out
204427320 Bytes (204 MB) copied, 73.5553 s, 2.8 MB/s
PFC boot device order checks SD-Card slot before internal NAND.
By default, PFC tries to find a DHCP-Server to retrieve an IP-Address.
- PowerOff PFC
- Insert SD-Card with custom-image
- PowerOn PFC
User | Password |
---|---|
root | wago |
admin | wago |
user | user |
"PFCx00-uvwxyz"
Where 'uvwxyz' is the last part of eth0's MAC-ID in capital letters.
- Operate in "switched-mode"
- DHCP-Client request dynamic Ip-Address from DHCP Server.
- SSH-Daemon is enabled.
- https-Server is enabled.
Prepared to dial with:
- "WAGO IO-Check.exe" version 5.3.1.17 or higher
- "WAGO EthernetSettings.exe" version 5.4.1.3 or higher REQUIRE: WAGO-Service-Cable 750-920 or 750-923
Is no more owned by operating system Linux, so it has to be configured to be the console output.
This can be easily be done via the web-confuguration.
-
Variant A: Use tool WAGO-IO-Check to set ip address or obtain actual
A.1) Connect PFC-Service-Interface and PC with Service-Cable 750-920 or 750-923.
A.2) Start windows tool "WAGO-IO-Check.exe".
A.3) Configure local serial interface to use
A.4) Press button [Identify]
A.5) Move to register card "Network"\ -
Variant B: Web-Based-Management(WBM) via https
B.0) Obtain actual IP address
B.1) Open WBM in browser(https://)
B.2) Ignore x509 certificate warning and proceed.
B.3) Now you should be able to view and change settings.\ -
Variant C: Command-Line-Interface(CLI) via ssh
C.0) Obtain actual IP address
C.1) Start ssh-client, such as putty
C.2) Open ssh session to PFC )
C.3) Ignore 'PuTTY Security Alert' and proceed.
C.4) Login as user/password (Default: "root"/"wago")
C.5) Start WAGO config tool "/usr/sbin/cbm"\
Read "How to become a PTXdist Guru" and other ressources at http://public.pengutronix.de/software/ptxdist/appnotes/
Building a complete firmware image is necessary exactly one time, to extract and build the whole system. For your daily work, you usually will work on package level. As usual, you can:
- Rebuild a package
>cd <workspace>/ptxproj/
>ptxdist clean <pkg-name> && ptxdist targetinstall <pkg-name>
- Copy "binaries" somehow by hand into PFC's file system, and make them executable.
- Transfer install-package ".ipk" somehow into PFC file system and call
>opkg install <pkg-name>.ipk
- Utilize Web-Based-Management(WBM) feature "Software-Upload" to upload and apply ".ipk".
CAUTION:
Every binary or installation package(.ipk) is generated for a specific firmware version,
do not mix up different versions.
Open 4 shell sessions on your development host(Ubuntu16.04).
- First shell used to open source code files within an editor like vim or gedit
>cd /wago/ptxproj/src/kbusdemo
>gedit kbusdemo1.c
- Second shell used for “clean” and “build” the ptxdist package
>cd /wago/ptxproj/
>ptxdist clean kbusdemo
>ptxdist targetinstall kbusdemo
- Third shell used to transfer executable to PFC.
>scp kbusdemo1 root@<ip or hostname>:/usr/bin/kbusdemo1
- Fourth shell used to manage and control the PFC via ssh
>ssh root@<ip or hostname>
>cd /usr/bin
>chmod +x kbusdemo1
>./kbusdemo1
For the next round trip: 1. Switch to the first shell and use the cursor-up-key to call the last command… 2. Modify source code and save changes 3. Switch to the second shell and use the cursor-up-key to call the last command… 4. Rebuild executables 5. Switch to the third shell and use the cursor-up-key to call the last command… 6. Transfer executables to PFC 7. Switch to the fourth shell and use the cursor-up-key to call the last command… 8. Start executable on PFC
10.2) Using Web-Based-Management(WBM) feature "Software-Upload" for upload and applying IPK packages
Tool "ptxdist" automatically generates an ".ipk" file for each package during build process.
https://ip.address.assigned.by.dhcp
Ignore Cert-Warning ...
10.2.2) Select "Software-Upload" in left hand "Navigation" pane, You will be requested to authenticate!
Login as "admin" with password "wago" (default)
Browse to folder "~/wago/ptxproj/platform-wago-pfcXXX/packages/"
Select package to install or update, here "kbusdemo_0.3_arm.ipk".
Transfers selected file into PFC file system and show button [Activate].
Internally WBM just calls:
>cd /home/
>opkg install kbusdemo_0.3_arm.ipk
Depending on type of package a restart of PFC may required.
It may a good idea to setup a build server for a nightly build to check dependencies and consistency and do some unit testing in an automated way.
Article Number | Designation |
---|---|
750-8100 | PFC100 2ETH ECO |
750-8101 | PFC100 2ETH |
750-8101/025-000 | PFC100 2ETH T |
750-8102 | PFC100 2ETH RS |
750-8102/025-000 | PFC100 2ETH RS T |
750-8101/000-010 | PFC100 FG0 2ETH |
750-8202 | PFC200 2ETH RS |
750-8203 | PFC200 2ETH CAN |
750-8204 | PFC200 2ETH RS CAN |
750-8206 | PFC200 2ETH RS CAN DPS |
750-8207 | PFC200 2ETH RS 3G |
750-8208 | PFC200 2ETH RS CAN |
750-8202/025-000 | PFC200 2ETH RS T |
750-8202/025-001 | PFC200 2ETH RS Tele T |
750-8202/025-002 | PFC200 2ETH RS ECO Tele T |
750-8203/025-000 | PFC200 2ETH CAN T |
750-8204/025-000 | PFC200 2ETH RS CAN T |
750-8206/025-000 | PFC200 2ETH RS CAN DPS T |
750-8206/025-001 | PFC200 2ETH RS CAN DPS Tele T |
750-8207/025-000 | PFC200 2ETH RS 3G T |
750-8207/025-001 | PFC200 2ETH RS 3G Tele T |
750-8208/025-000 | PFC200 2ETH RS CAN DPM T |
750-8208/025-001 | PFC200 2ETH RS CAN DPM Tele T |
750-8202/040-000 | PFC200 2ETH RS XTR |
750-8202/040-001 | PFC200 2ETH RS Tele XTR |
750-8206/040-000 | PFC200 2ETH RS CAN DPS XTR |
750-8206/040-001 | PFC200 2ETH RS CAN DPS Tele XTR |
750-8202/000-011 | PFC200 FG1 2ETH RS |
750-8202/000-012 | PFC200 FG2 2ETH RS |
750-8202/000-022 | PFC200 FGE 2ETH RS |
750-8207/000-022 | PFC200 FGE 2ETH RS |