Getting Started Example

If you have not created the Framework libraries already, please do so.

Rhapsody in C

Please verify the implementation of your compiler bridge and target bridge.

Open the Rhapsody project Blinky at the directory <your Rhapsody>\Share\WST_RXF_V5\<your product>\Samples\Model\Blinky:




TargetComponent is using the stereotype RXFComponent which is defined in the profile Handel. Each RXF by Willert Software Tools comes with its own profile with the stereotype RXFComponent. RXFComponent sets the proper environment, some properies for the RXF and defines some Tags. These Tags are used by the Deployer so it will use relative paths inside your Embedded Workbench project. The other profile referenced, WSTProfile, is used to set Rhapsody GUI details which makes it easier for you to view and maintain your models.

ExamplePkg, show the classes: SequentialController, ActiveController and LED:
The Rhapsody generated code from the ActiveController object results in a timer event, which is sent to the LED every 400 msec. The SequentialController object uses the LED_on() and LED_off() operations to switch another LED on and off, every 300 msec.

Select the proper environment via the Features and do this for both Configurations Debug and Release:



The Deployer which will deploy Rhapsody generated source files and some generated configuration files, needs information from your model on relative paths inside an Embedded Workbench  project:



It uses Tags from the stereotype RXFComponent which you must specify for your Component:

Note Each Rhapsody model must have a reference to the Händel profile and use the stereotype RXFComponent.
This will allow you to use the Tags. You can set them via the Features dialog for your component. Handel.sbs is installed in <Rhapsody>\Share\WST_RXF_V5\<product>\Config\Profiles\Handel_Profile_rpy

Use Code | Generate Debug to generate C code from this model, and accept the question to have the directory created for the Debug Configuration:




Use Code | Build TargetComponent.dat to generate




Now you can deploy the generated files. The model does not contain the location of your GettingStarted Embedded Workbench project on your PC; the Deployer will maintain that information instead. This enables one to have the same project used by different persons at different locations; the installation of the IAR toolchain on various PCs may differ.


Deployer

The very first time that the Deployer must deploy a project, it will automatically launch in configuration mode and ask for path(s). Select Code | Run TargetComponent.dat to start the Deployer:




The Deployer will prompt for the path to your GettingStarted workspace or project, so you must specify Rhapsody\Share\WST_RXF_V5\<your product>\Samples\Code\GettingStarted:





The Deployer knows from your model that it must search for a Embedded Workbench project file in that directory, which it will update with the names of the files it deploys:




After you saved the path to GettingStarted, the files are deployed to the Embedded Workbench project:





IAR M16C Specific const Keyword Workaround

When using the C keyword "const", IAR for M16C is assuming it refers to ROM area, which is not the expected behavior of the C toolchain. We implemented a workaround using the AWK script RemoveConstKeyword.awk. This script is used during installation of the product to process RXF sources, in the example projects and in each and every Rhapsody project before deploying your sources. The result of the script is always captured in a subdirectory "Workaround". Please use the Samples/Code/Workaround IAR projects and keep in mind that sources from Source/Workaround, libraries from Source/LIB/Workaround and Rhapsody generated code from the Workaround subdirectory shall be used. If you want to deactivate the workaround, we offer a property WSTUseWorkaround, which can be overridden in Rhapsody to the value "false" on component or project level. (We reference this known issue as ticket #1356.)

IAR Embedded Workbench

We created the example for the IAR Embedded Workbench. The IAR C libraries, the embOS libraries and the CreateRXFLibrary examples can not be interchanged between different versions of the IAR toolchain and embOS: you must verify you are using embOS libraries which are buil with the same IAR toolchain version!

Open the GettingStarted project in IAR Embedded Workbench, which is installed in the directory <your Rhapsody>\Share\WST_RXF_V5\<your  product>\Samples\Model\Code\Workaround\GettingStated:





Now we can build the application and test it. When you test it in the simulator, you must set the interrupt simulation correctly as soon as you launched the simulator. Open the menu Simulator | Interrupt Setup...:




Select the entry for the timer interrupt and press Edit:




Set the Hold time is set to 0 - verify this setting on each run of the simulator:





If you receive a message when debugging in IAR simulator like below, disable the Stack plugin on the Debugger tab of your project settings:






Set a breakpoint in LED.c in the functions LED_off() and LED_on() to verify the application is running:





Notes If you specify that constant data is located in far memory, then you must use the keyword __far when accessing such data.
You must add an entry in the Rhapsody Tools menu, which launces the Deployer in Configuration Mode.
This allows you to change the path used by the Deployer for your EW project in case you want to use a different EW project for your Rhapsody project, or in case you moved the EW project. 

Copyright (c) Willert Software Tools GmbH. All rights reserved.