Interfaces RTOS


Each product has a number of interfaces, see the image below:


We focus on the interface to the RTOS - please refer to the description on all interfaces on details for non-RTOS interfaces. All RXF source files always include WSTRTOS.h

Example:

#include "RxfConstants.h"
#include "WSTProduct.h"
#include "WSTProlog.h"
#include "WSTCompiler.h"
#include "WSTTarget.h"
#include "WSTRTOS.h"
#include "WSTPMF.h"
#include "RxfDimensions.h"

..  (include files for ANSI-C like stddef.h, include files for RXF)

#include "WSTEpilog.h"


Interface RTOS implementation VDK


Files Description
WSTRTOS.h This file defines the following functions:
  • WSTRTOS_Init
This function is called as second call in RiCOXFInit(), which is the first call generated by Rhapsody in WST_RXF_Main(). So this is the place to hook code into when your RTOS is not already initialized by your startup code, prior to calling main().

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 );
         
This file defines the following macros:
  • RIC_MS_PER_TICK
10
  • RiCOSDefaultThreadPriority
(long) RTOS_PRIORITY_NORMAL
  • RiCOSDefaultStackSize
(long) RTOS_DEFAULT_STACK
  • RiCOSDefaultMessageQueueSize
(long) RTOS_MQ_DEFAULT_SIZE
  • RTOS_PRIORITY_NUMBER2SYMBOL(N)
translate the number n into a symbol VDK_kPriorityN so you can use numbers in the Rhapsody model
  • RTOS_PRIORITY_NORMAL
VDK_kPriority15 - it must match the kernel configuration in the VDKConfig project.
  • RTOS_PRIORITY_ABOVE_NORMAL
VDK_kPriority12
  • RTOS_PRIORITY_HIGH
VDK_kPriority1 - it must match the kernel configuration in the VDKConfig project.
  • RTOS_PRIORITY_LOW
VDK_kPriority30
  • RTOS_DEFAULT_STACK
512 - it must match the kernel configuration in the VDKConfig project.
  • RTOS_MQ_DEFAULT_SIZE
60 - it must match the kernel configuration in the VDKConfig project.
  • RTOS_BRIDGE_STK_SIZE
255 - it must match the kernel configuration in the VDKConfig project.
  • RTOS_MSGCHANNEL_ID
VDK_kMsgChannel12 - this is an arbitrary value between VDK_kMsgChannel1 and VDK_kMsgChannel15. You may freely use a different one but it must match the kernel configuration in theVDKConfig project.
  • RTOS_MAX_THREADS
10 - it must match the kernel configuration in the VDKConfig project.
  • RTOS_MSGPAYLOAD_TYPE
1 - this is an arbitrary positive number. You may freely use a different one but it must match the kernel configuration in the VDKConfig project.
  • RiC_RAW_MEMORY_ALIGNMENT
16
  • RiCOSMemoryAllocation_malloc
malloc is mapped to this function
  • RiCOSMemoryAllocation_calloc
calloc is mapped to this function
  • RiCOSMemoryAllocation_realloc
realloc is mapped to this function
  • RiCOSMemoryAllocation_free
free is mapped to this function

The constant RIC_OS_MUTEX_LOCK_AS_OPERATION is defined.
WSTRTOS.c This file is used in the GettingStarted example. It implements the following functions:
  • WSTRTOS_Init
Is implemented as calls to RiCOSMutex_InitSysVars() and RiCOSMemoryAllocation_Init()
  • WSTRTOS_Cleanup
This function is left empty.






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