|
Re: Generating code for specific hardware [message #1798903 is a reply to message #1798813] |
Tue, 27 November 2018 09:12 |
Nicolas Hili Messages: 40 Registered: March 2017 |
Member |
|
|
Hi,
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:
The first link also includes models I've created and presented.
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.
Cheers,
Nicolas Hili
|
|
|
|
|
|
|
Re: Generating code for specific hardware [message #1799351 is a reply to message #1799343] |
Wed, 05 December 2018 13:17 |
Nicolas Hili Messages: 40 Registered: March 2017 |
Member |
|
|
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.
Nicolas
[Updated on: Wed, 05 December 2018 13:18] Report message to a moderator
|
|
|
Re: Generating code for specific hardware [message #1799670 is a reply to message #1799351] |
Wed, 12 December 2018 08:10 |
Twan Dieltjes Messages: 22 Registered: September 2018 |
Junior Member |
|
|
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?
[Updated on: Thu, 13 December 2018 07:26] Report message to a moderator
|
|
|
|
Powered by
FUDForum. Page generated in 0.05722 seconds