Generating code for specific hardware [message #1798813] |
Mon, 26 November 2018 02:50  |
Eclipse User |
|
|
|
Till now, I only used Papyrus RT to generate code which used log.log to write to the console. Suppose I want to generate code for a Raspberry Pi, Arduino or other microcontrollers like a stm32.
Is there a best-practice guide available about how to generate code for this kind of hardware and control buttons, motors etc?
Where and how should I insert the code to control the hardware?
|
|
|
Re: Generating code for specific hardware [message #1798903 is a reply to message #1798813] |
Tue, 27 November 2018 04:12   |
Eclipse User |
|
|
|
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 #1799915 is a reply to message #1799670] |
Mon, 17 December 2018 07:16  |
Eclipse User |
|
|
|
Hi Twan,
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.
|
|
|
Powered by
FUDForum. Page generated in 0.04341 seconds