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, in particular the function WSTTarget_Init(). The function WSTTarget_incrementRxfTicks() must be called peridically, so either during board initialization within startup code, or within WSTTarget_Init() you must use a Interrupt Service Routine like WSTTarget_timerInterrupt().

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




TargetComponent is using the stereotypes StaticComponent to prevent dynamic allocated memory, and RXFComponent for its Tags. These Tags are used by the Deployer so it will use relative paths inside your IAR Embedded Workbench project.

ExamplePkg has two objects:

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 IAR 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 Chadwick 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. Chadwick.sbs is installed in <Rhapsody>\Share\WST_RXF_V5\<product>\Config\Profiles\Chadwick_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 EW 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 Embedded Workbench

Now open the GettingStarted project in EW, which is installed in the directory <your Rhapsody>\Share\WST_RXF_V5\<your  product>\Samples\Model\Code\GettingStarted:



Now we can build the application and test it.

Running GettingStarted on Hardware


The GettingStarted project is prepared to run on the Microchip dsPICDEM 1.1 Plus development board. Before connecting the target board, make sure all necessary drivers are installed and a sample project delivered with your Board (without using Rhapsody and the RXF) could already successfully be flashed and executed.


In IAR EW check the project settings. The degugger must be set to MPLAB REAL ICE and the description file must match your target CPU:


Start debugging by pressing the Debug button:


You should see a successfull download of the HEX file:


You can now start debugging as usual, for exaple by setting breakpoints in LED_on() and LED_off() of LED.c and running the program:



Caveats

If you are not using default installation paths or MPLAB is not integrated correctly with IAR EW, you might get an error message like a missing RealICEAPI.dll file:




To solve this, you need to navigate to your MPLAB folder and copy the RealICE libraries into IAR's dspic\bin directory:




Directly using the MPLAB IDE:

If you are familiar with the MPLAB IDE, you can also switch the linkers output format to another format which supports debug symbols the MPLAB IDE can interpretate, e.g. coff:


After linking go to the MPLAB IDE and select Import from the File menu. Open the .cof file created under Samples\Code\GettingStarted\Debug\Exe and program the file. You can now also debug as usual.
Note 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.