Use a Different Target


If you want to use a different target, you must deal with three levels of dependancies:
Please refer to RXFDeployerGuide.pdf to learn how you can use your own instances of these files.
The compiler options  are specific for the RXF being used, and their values are translated into #define's in the file  RxfDimensions.h which is normally generated in Rhapsody. In the CreateRXFLibrary you may need to modify the static RxfDimensions.h

When you modify existing files, you must enclose sections between #ifdef WST_TARGET_xx and #endif constructions, using existing constants or defining a new one. After you have implemented the following interface,

Files Description
WSTTarget.h This file must define the following functions:
  • WSTTarget_Init
This function is called in main(), prior to calling the Rhapsody generated WST_RXF_Main(). So this is the place to hook code into when your target is not already initialized by your startup code, prior to calling WST_RXF_Main().

Its prototype is:

void     WSTTarget_Init( void );
  • WSTTarget_Cleanup
This function is not called by the RXF.
You must implement it and call it in your <Rhapsody component>__Cleanup() if you need it.

Its prototype is:

void     WSTTarget_Cleanup( void );
         
WSTTarget.c This file must implement the following functions:
  • WSTTarget_Init
See its description for WSTTarget.h.
  • WSTTarget_Cleanup
Optional, see its description for WSTTarget.h.

WSTRTOS.h This file must define the following functions:
  • WSTRTOS_Init
This function is called as last call in main(), which initializes the RTOS and starts the main task which calls the Rhapsody generated WST_RXF_Main(). So this is the place to hook code into when your RTOS is not already initialized by your startup code.

Its prototype is:

void     WSTRTOS_Init( void );
  • WSTRTOS_Cleanup
This function is not called by the RXF.
You must implement it and call it in your <Rhapsody component>__Cleanup() if you need it.

Its prototype is:

void     WSTRTOS_Cleanup( void );
         
The file WSTRTOS.h must define the following macros:
  • RIC_MS_PER_TICK
The number of ticks per milisecond.
Usually this constant can be derived from your RTOS configuration.
  • RiCOSDefaultThreadPriority
This constant, type long, is part of the RiCOSOXFInitEpilog and RiCOSEndApplocation interface by IBM Rational, but needed in an RTX based on an RTOS only.
You can define it as RTOS_PRIORITY_NORMAL
  • RiCOSDefaultStackSize
This constant, type long, is part of the RiCOSOXFInitEpilog and RiCOSEndApplocation interface by IBM Rational, but needed in an RTX based on an RTOS only.
You can define it as RTOS_DEFAULT_STACK
  • RiCOSDefaultMessageQueueSize
This constant, type long, is part of the RiCOSOXFInitEpilog and RiCOSEndApplocation interface by IBM Rational, but needed in an RTX based on an RTOS only.
You can define it as RTOS_MQ_DEFAULT_SIZE
  • RTOS_PRIORITY_NORMAL
The default priority of any task. This priority is used when the real time model is used.
  • RTOS_PRIORITY_HIGH
The priority of the Bridge task
  • RTOS_PRIORITY_LOW
The lowest priority of any task. This priority is used when the simulated time model is used.
  • RTOS_DEFAULT_STACK
This macro defines the default size of any task in bytes.
  • RTOS_MQ_DEFAULT_SIZE
This macro defines the maximum number of messages in a queue
  • RTOS_MAIN_STK_SIZE
This macro defines the alignment in bytes of the main task rhpMainTask
  • RTOS_SMALL_STACK
This macro defines the alignment in bytes of the main task BridgeTask
  • RiC_RAW_MEMORY_ALIGNMENT

  • RiCOSMemoryAllocation_malloc
malloc must be mapped to this function
  • RiCOSMemoryAllocation_calloc
calloc must be mapped to this function
  • RiCOSMemoryAllocation_realloc
realloc must be mapped to this function
  • RiCOSMemoryAllocation_free
free must be mapped to this function

The constant RIC_OS_MUTEX_LOCK_AS_OPERATION may be used when the RTOS is capable of locking a mutex in a single operation.

WSTRTOS.c This file must implement the following functions:
  • WSTRTOS_Init
See its description for WSTRTOS.h.
  • WSTRTOS_Cleanup
Optional, see its description for WSTRTOS.h.




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