Raspberry Pi Dev

From Axel Public Wiki
Revision as of 15:02, 21 November 2017 by Axelpwiki (talk | contribs)
Jump to navigation Jump to search

Summary

The purpose of this page is to allow expert Raspberry PI developers to extend the PLC runtime.
It shows up how the interface to PiFace I/O board can be implemented from scratch.
You can clone the example to implements inteface with your own I/O module.

Prerequisites

To follow this guide you need:

  • A Raspberry PI with a running and licensed PLC runtime (LLExec >= 2.6.2 is suggested).
You can install the runtime following the guide in http://www.axelsw.it/pwiki/index.php?title=Raspberry_Pi
  • A Raspbian cross-compile toolchain
You can download it from https://github.com/raspberrypi/tools

Setup your Linux machine

Please uncompress the toolchain and find the path of the compiler tools: for example suppose they are under the folder

/home/axel/toolchain_RPI_orig/tools-master/arm-bcm2708/gcc-linaro-arm-linux-gnueabihf-raspbian/bin

In this case you have to edit your .profile file and add the row

export PATH=/home/axel/toolchain_RPI_orig/tools-master/arm-bcm2708/gcc-linaro-arm-linux-gnueabihf-raspbian/bin:$PATH

in order to make the compiler available to the system.
At this point make folder and uncompress PluginHeaders_2.6.2.zip in it. You can download the file from our site, in the Dowload section.
Plugin headers expose the LLExec API to interface with the runtime, they require that some defines are set in order to compile correctly. As you will see after, these defines will be already defined in the Makefile.
Now please download and uncompress the file LLXPlugin_PIFACE.zip in the previous foldere where you have already uncompressed the plugin headers.
Please note that every release of LLExec has its own plugin header, so be shure that the release number of the headers matches with the release of LLExec installed. No backward compatibility is guaranted:please compile your plugin for a specific release of LLExec.

Compile the plugin

In order to compile the plugin please go to the directory you have previously uncompressed, ie

/home/axel/plugin_headers_root/LLXPlugin_PIFACE

type

make

If you have done correctly all the previous steps, this will generate the file LLXPlugin_PIFACE.so Please copy this file on the RaspberryPI in the same directory where the runtime is installed.

Plugin concepts

LLExec is a modular runtime designed to run on top of (realtime) operating systems;we have another type of runtime that can be embedded in the firmware of the target board, but it is not the case.
Every thing in the runtime is a plugin, the runtime itself is a plugin, while the core module (LLExec) io only responsible to load and link the modules together, implements communication with LogicLab and schedules all the tasks involved.

Plugin details

Edit pll library

Configure runtime

Access from LogicLab

Further readings