Troubleshooting
Problem
This technote describes one procedure to build a bootable VxWorks application which contains a Rose RealTime application. (Method 2)
Resolving The Problem
This technote assumes you are using the platform TORNADO2T.ppc-cygnus-2.7.2-960126. The process should be similar for other platforms.
For another method to accomplish the same, please see the Related URL below.
1) Make a copy of %ROSERT_HOME%\C++\TargetRTS\target\TORNADO2T called %ROSERT_HOME%\C++\TargetRTS\target\TORNADO2BootT
2) Make a copy of %ROSERT_HOME%\C++\TargetRTS\config\TORNADO2T.ppc-cygnus-2.7.2-960126 called %ROSERT_HOME%\C++\TargetRTS\config\TORNADO2BootT.ppc-cygnus-2.7.2-960126
3) Build the TargetRTS libraries for your new platform.
cd to %ROSERT_HOME%\C++\TargetRTS\src and type
make CONFIG=TORNADO2BootT.ppc-cygnus-2.7.2-960126
4) Edit %ROSERT_HOME%\C++\TargetRTS\target\TORNADO2BootT\link.pl and comment out the lines below. The last line will ensure the RTmunch.o file, used in step 6, is not deleted after a Rose RealTime build.
#$cc_cmd = "cc$arch";
#$munch = "wtxtcl \"$WIND_BASE/host/$WIND_HOST_TYPE/bin/munch.tcl\""
# . " -asm $arch";
#$nm_cmd = "nm$arch --extern-only --no-sort";
# munch the big object file
#$status = &mySystem( "$nm_cmd $prelink | $munch > $ctor_c" )
# if $status == 0;
# compile the constructor/destructor tables
#$status = &mySystem( $cc_cmd, '-traditional', '-o', $ctor_o, '-c', $ctor_c )
# if $status == 0;
# final link of the application
#$status = &mySystem( $ld_cmd, '-r', '-o', $output, $ctor_o, $prelink )
# if $status == 0;
# remove our temporary files
#unlink( @tmpfiles );
5) Create a new component in RoseRT and build the application. The new component should use the target created in step 1). It should show up in the list of targets available. Rebuild the new component.
6) Create a new project within Tornado to build a VxWorks bootable image. This method is easiest to implement because Tornado has existing projects to start from, that build bootable images. We simply add the RTmunch.o file built in step 5) as an extra module. Some notes :
- create a new build specification for RoseRT.
- in the properties dialog for the RoseRT build spec - press the Macros tab.
- edit the EXTRA_MODULES macro to include the full path to the Rose RealTime RTmunch.o file built in step 5)
- edit the file usrAppInit.c : add a call to
rtsMain( "-URTS_DEBUG=quit", (const char *)0 );
this is the hook to start your RoseRT application.
- start build. End result will be a file vxWorks. The output directory will be where the vxWorks project is stored (not in the RoseRT component build directory.) This file will become the boot file for the target board.
NOTE: When using a simulator target, the following error may be encountered when booting with the new vxWorks image.
CPU: VxSim for Windows
VxWorks: 5.4
BSP version: 1.1/1
Creation date: May 18 2001
WDB: Ready.
Rational Rose RealTime C++ Target Run Time System
Release 6.30.C.00 (+c)
Copyright (c) 1993-2000 Rational Software
Exception !
Vector 13 : General Protection Fault
Program Counter : 0x0042d266
Status Register : 0x00010217
To correct this you must specify all 20 arguments in the rtsMain function.
rtsMain( "-URTS_DEBUG=quit", "", "", "", "", "", "",
"", "", "", "", "", "", "", "", "", "", "", "", "");
7) To enable target observability on the bootable version and to provide arguments add command line arguments to usrAppInit.c as described in 6). A typical invocation of this would like :
usrAppInit.c :
rtsMain( "-obslisten=35555");
The port to use for Target Observability in the component instance specification must match the port number assigned to the obslisten parameter..
8) Create a processor in the Rose RealTime deployment view. Be sure to set the correct IP address. Create component instance. Set port number as described in 7). Disable the "Attach Target at Startup" option. You must boot the target first and then "Attach Target" (right click on component instance).
NOTE: The instructions above describe how to run a RoseRT application inside a vxWorks task. To run it in it's own task, it will have to be spawned using taskSpawn(). To do so, modify the userAppInit.c in the following way.
* usrAppInit - initialize the users application
*/
extern int rtsMain( char * a01, char * a02, char * a03, char * a04,
char * a05, char * a06, char * a07, char * a08,
char * a09, char * a10, char * a11, char * a12,
char * a13, char * a14, char * a15, char * a16,
char * a17, char * a18, char * a19, char * a20 );
void usrAppInit (void)
{
#ifdef USER_APPL_INIT
USER_APPL_INIT; /* for backwards compatibility */
#endif
/* add application specific code here */
taskSpawn("tRosertTask", 75, 0, 20000, rtsMain, "-URTS_DEBUG=quit",
0, 0, 0, 0, 0, 0, 0, 0, 0);
}
Related Information
Historical Number
17115
Was this topic helpful?
Document Information
Modified date:
16 June 2018
UID
swg21124548