Question & Answer
Question
How do you use IBM Rhapsody C/C++ with the Raspberry Pi?
Note, this profile creates executable and static libraries for the Raspberry Pi OS environment. For Linux/Darwin and shared library support, please refer to Using Rhapsody with GNU/LLVM toolchains on Linux/Darwin targets.
Cause
Creating and building a project for the Raspberry Pi target using Rhapsody is quick and simple. This profile demonstrates that using IBM Rational Rhapsody enables a faster workflow than the existing cross-platform configuration. This means a radically reduced setup time; Allowing you to spend more time building IBM Rational Rhapsody solutions with your Raspberry Pi!
Typically a micro controller has limited resources with no operating system. In this situation you must compile the project on the local windows host using a cross-compiler configuration and then upload the executable to the target device. However, setting up a cross-compiler configuration is time-consuming and complex. This is a block to productivity.
However, the Raspberry Pi has more memory and a more powerful CPU than most micro controllers. It even has it's own built-in Linux based operating system. So why not capitalize on this by leveraging it with the powerful modeling capabilities of IBM Rational Rhapsody?
Traditionally you would build the Rhapsody project locally and upload the binary file to the target device:
Typically a micro controller has limited resources with no operating system. In this situation you must compile the project on the local windows host using a cross-compiler configuration and then upload the executable to the target device. However, setting up a cross-compiler configuration is time-consuming and complex. This is a block to productivity.
However, the Raspberry Pi has more memory and a more powerful CPU than most micro controllers. It even has it's own built-in Linux based operating system. So why not capitalize on this by leveraging it with the powerful modeling capabilities of IBM Rational Rhapsody?
Traditionally you would build the Rhapsody project locally and upload the binary file to the target device:
Answer
Now you can upload the Rhapsody generated source code to the remote target and build it remotely on the Raspberry Pi from IBM Rational Rhapsody:
So how does it work? The process of building, running and animating IBM Rational Rhapsody models has been automated so that it is now possible to do so using remote Secure Shell (SSH) scripting. All from the comfort of the out-of-box IBM Rational Rhapsody user interface:
- Automated upload and build of Rhapsody model code on the remote target.
- Automated execution of Rhapsody model application on remote target.
- Automated animation of Rhapsody model application on remote target.
- Automated rebuild of Rhapsody framework on the remote target.
Prerequisites
- This profile makes extensive use of Putty as an SSH client. You must have plink.exe and pscp.exe copied to the c:\ folder (you can reconfigure this default location at a later point by editing BuildOxfRedirect.bat/ExeRedirect.bat/MakeRedirect.bat).
You may also want to download the main SSH client, putty.exe (see step 2).
Please visit the Putty site to download all three SSH client tools.
Disclaimer IBM is not providing program services of any kind for this program. Making use of the Information provided in this technote is done at the user's own risk.
- Ensure you have successfully connected to the remote target and given permission to the remote target's SSH key. This is a one time operation per local host. For simplicity, it is recommend you do this separately using the main putty.exe client user interface.
- You must have OMROOT defined as a local environment variable. For example, C:/IBM/Rational/Rhapsody/Share or C:/Users/<user name>/IBM/Rational/Rhapsody/Share
- Ensure the correct Rhapsody API is registered for the above OMROOT installation. See http://www-01.ibm.com/support/docview.wss?uid=swg21638221
- Copy the NativeLinux.zip to the Rhapsody OMROOT\share\profiles folder and unzip
- Ensure path is correct i.e. Share\Profiles\NativeLinuxAdaptor\NativeLinux_rpy\NativeLinuxProfile.sbs
- Create a new Rhapsody project and add the NativeLinuxProfile (NativeLinuxProfile.sbs)
- Add a new linux configuration and set the NativeLinuxConfiguration stereotype to the configuration
- Open the features of the configuration and set the following properties:
- C_CG::Linux::RemoteTarget - Set this to the remote target, the linux/raspberry pi workstation/device
- C_CG::Linux::RemoteTargetUsername - Set this to the username of the account you want to use on the remote target
- C_CG::Linux::RemoteTargetPassword - Set the to the password of the account you want to use on the remote target
- Run the Code menu > BuildFramework command. You should see the linuxshare.tar uploaded to the remote target, extract and then build remotely on the target. The output is typical for a framework build n.b. the paths will mention linux-style paths instead of windows-style paths
- All done. You are ready to start modelling!!
- Create your model and test it using a Windows compatible configuration.
- Add a new NativeLinuxConfiguration and make it the active configuration.
- Use GMR (or separate commands) to build and run your model on the Raspberry Pi
- Console output may be shown on the local host in "chunks", animation however will run in real-time.
If you need to modify or extend the capabilities of this profile you can find the SSH command chain details of each workflow in this section.
- Building the Rhapsody OXF framework
- Building your Project
- Executing your Project
[{"Product":{"code":"SSB2MU","label":"IBM Engineering Systems Design Rhapsody"},"Business Unit":{"code":"BU059","label":"IBM Software w\/o TPS"},"Component":"Integrations - 3rd Party","Platform":[{"code":"PF016","label":"Linux"},{"code":"PF033","label":"Windows"}],"Version":"8.1.3;8.1.4;8.1.5;8.2","Edition":"","Line of Business":{"code":"LOB59","label":"Sustainability Software"}}]
Product Synonym
Rational Rhapsody;Rational Rhapsody
Was this topic helpful?
Document Information
Modified date:
27 May 2022
UID
swg21973531