I worked a bit on using Papyrus-RT for generating code for single-board computers. First of all, keep in mind that Papyrus-RT allows you to generate code for Linux systems. So, it will work out-of-the-box on your Raspberry PI. You just have to compile the Papyrus-RT RunTime Service (RTS) library first on your RPI.

About using the GPIOs of the RPI, you can use WiringPI. All you have to do is to include the corresponding header files and to modify the global configuration of your Papyrus-RT Makefile. More info here:

As for non-Linux microcontrollers (e.g., Arduino), unless I am mistaken, there is for now no support for them since the RTS of Payrus-RT was designed for being executed on Linux, or under Cygwin, and Vagrant. Two options:

Your Arduino plays the role of "slave" in a "master-slave" communication where the master is a Linux-powered board (e.g., Raspberry PI). In that case, you can use Papyrus-RT to generate code on the master, and write Arduino code for your Arduino. Include WiringPI or other libraries in your model in order to communicate through I2C, SPI or other protocols;

You want to generate code for your Arduino directly. In that case, you have to build a minimalist RTS for your Arduino, and to generate code from Papyrus-RT using your preferred M2T technology. I used not long ago Acceleo to generate code on bare metal, I can give you pointers to do it if necessary.

No, you can add it using the CapsuleProperties stereotype from the Cpp profile in Papyrus-RT. After adding the stereotype, you can include WiringPI in the "implementation preface" field.

About the Makefile, you would have to add -lwiringPi each time you recompile your application. A better idea (since your Papyrus-RT RTS installation on the Rpi will most likely be used for executing UML-RT systems that access the GPIOs most exclusively) is to add this flag in: $UMLRTS_ROOT/build/buildtools/x86-gcc-4.6.3/buildtools.mk so you would not have to change your generated Makefile every time you recompile.

In your previous post, you wrote that you send the generated code via SCP to the pi and if I understand it correctly build it on the py. I expect the teacher wants us to cross compile but he said compiling the code on the py is very time consuming and kills the SD card due to the large amount of write actions. Is that your experience too?

Never experienced something like that. It's not like compiling UML-RT applications is so time consuming that it will destroy your SD card instantaneously :) Otherwise, we should not even use an OS since it will perform many more read and write operations on the SD card than compiling UML-RT applications.. Nonetheless, cross-compiling should be a better and faster approach since you will be able to compile on a more powerful computer and then just deploy your binary file.