Target Bridge


In this bridge, three different compilers for ARM targets are supported:
In the files WSTTarget.h and WSTTarget.c, their respective sections are enclosed by the constants WST_COMPILER_KEILRV, WST_COMPILER_REALVIEW  and WST_COMPILER_IAR respectively.

Keil ARM RealView

In each µVision project which results in an application, there are some extra target dependant files which you use. These usually come with an evaluation board. The startup file can be generated / copied from a template by µVision when you create a new project. 
The example which is part of your product release is suitable for a MCB2130 Evaluation Board.
To interface with an ARM target, the files WSTTarget.h and WSTTarget.c have been implemented as follows:

Files Description
WSTTarget.h This file defines the following constant if the constant WST_RTOS_NONE is set, 
  • RIC_MS_PER_TICK
This constant defaults to 10.
Please refer to a section on Porting to a Target to see if this value is correct for your hardware or details on your Board Support Package, if any.


This file defines prototypes for the following functions:
  • WSTTarget_Init
Its prototype is:

void     WSTTarget_Init( void );
  • WSTTarget_Cleanup
Its prototype is:

void     WSTTarget_Cleanup( void );

This file defines prototypes for the following functions if the constant WST_RTOS_NONE is set:
  • WSTTarget_enterCriticalRegion
Its prototype is:

     void   WSTTarget_enterCriticalRegion( void );
  • WSTTarget_exitCriticalRegion
Its prototype is:

      void  WSTTarget_exitCriticalRegion( void );
  • WSTTarget_timerInterrupt
This function is added as wrapper to WSTRTOS_incrementRxfTicks()
Its prototype is:

void  WSTTarget_timerInterrupt( void ) __irq;

You can use the constant WST_TARGET_ARM_USE_SWI_FOR_CRITICAL_REGIONS when you want to use software interrupt handlers for your critical regions. By default, this constant is not set. If you want to use it, please refer to RXFDeployerGuide.pdf to learn how you can use your own instances of :
  • WSTProduct.h. You must define the constant WST_TARGET_ARM_USE_SWI_FOR_CRITICAL_REGIONS in WSTProduct.h so the RXF sources relying on the critical region handlers use the SWI handlers.
  • WSTTarget.h and WSTTarget.c - we have implemented the SWI handlers for Keil ARM RealView only, so the WSTTarget.h and WSTTarget.c which comes with your product serve as an example.
  • your own copy of a SWI table like for example SWI.s as part of the Keil ARM toolchain or a swi_handler.s which is part of the IAR ARM toolchain.
If the constant WST_TARGET_ARM_USE_SWI_FOR_CRITICAL_REGIONS is defined, the handlers are defined as:
  • WSTTarget_enterCriticalRegion
Its prototype is:

     void  __swi(0) WSTTarget_enterCriticalRegion( void );
  • WSTTarget_exitCriticalRegion
Its prototype is:

      void  __swi(1) WSTTarget_exitCriticalRegion( void );

Part of the Target installation is a directory CriticalRegionsAsSWI which may serve as an example.
WSTTarget.c This file implements the following functions:
  • WSTTarget_Init
If  WST_RTOS_NONE is set, this function initializes the timer and inserts WSTTarget_timerInterrupt as ISR.
  • WSTTarget_Cleanup
This function is left empty.


This file also implements the following functions if the constant WST_RTOS_NONE is set:
  • WSTTarget_enterCriticalRegion
It saves the SPSR and VIC and disables IRQ, FIQ and all interrupts in VIC.

If the constant WST_TARGET_ARM_USE_SWI_FOR_CRITICAL_REGIONS is defined, this function is implemented as ISR on a SWI( 0 ).
  • WSTTarget_exitCriticalRegion
It restores the SPSR and VIC.

If the constant WST_TARGET_ARM_USE_SWI_FOR_CRITICAL_REGIONS is defined, this function is implemented as ISR on a SWI( 1 ).
  • WSTTarget_timerInterrupt
This function serves as wrapper to WSTRTOS_incrementRxfTicks()  and clears the interrupt flag and acknowledges the interrupt afterwards.




ARM RealView

In each Eclipse project which results in an application, there are some extra target dependant files which you use. These usually come with an evaluation board.
 
To interface with an ARM target, the files WSTTarget.h and WSTTarget.c have been implemented as follows:

Files Description
WSTTarget.h This file defines the following constant if the constant WST_RTOS_NONE is set, 
  • RIC_MS_PER_TICK
This constant defaults to 10.
Please refer to a section on Porting to a Target to see if this value is correct for your hardware or details on your Board Support Package, if any.


This file defines prototypes for the following functions:
  • WSTTarget_Init
Its prototype is:

void     WSTTarget_Init( void );
  • WSTTarget_Cleanup
Its prototype is:

void     WSTTarget_Cleanup( void );

This file defines prototypes for the following functions if the constant WST_RTOS_NONE is set:
  • WSTTarget_enterCriticalRegion
Its prototype is:

void   WSTTarget_enterCriticalRegion( void );
  • WSTTarget_exitCriticalRegion
Its prototype is:

void   WSTTarget_exitCriticalRegion( void );
  • WSTTarget_timerInterrupt
This function is added as wrapper to WSTRTOS_incrementRxfTicks()
Its prototype is:

void  WSTTarget_timerInterrupt( void ) __irq;
WSTTarget.c This file implements the following functions:
  • WSTTarget_Init
If  WST_RTOS_NONE is set, this function initializes the timer and inserts WSTTarget_timerInterrupt as ISR.
  • WSTTarget_Cleanup
This function is left empty.


This file also implements the following functions if the constant WST_RTOS_NONE is set:
  • WSTTarget_enterCriticalRegion

  • WSTTarget_exitCriticalRegion



IAR ARM Embedded Workbench

In each Embedded Workbench project which results in an application, there are some extra target dependant files which you use. These usually come with an evaluation board. The startup file can be copied from an example by IAR or your board manufactorer when you create a new project. 
 
To interface with an ARM target, the files WSTTarget.h and WSTTarget.c have been implemented as follows:

Files Description
WSTTarget.h This file defines the following constants if the constant WST_RTOS_NONE is set, 
  • RIC_MS_PER_TICK
This constant defaults to 10.
Please refer to a section on Porting to a Target to see if this value is correct for your hardware or details on your Board Support Package, if any.
This constant is set to be able to use the isrmask_t type in save and restore operations for the critical regions.


This file defines prototypes for the following functions:
  • WSTTarget_Init
Its prototype is:

void     WSTTarget_Init( void );
  • WSTTarget_Cleanup
Its prototype is:

void     WSTTarget_Cleanup( void );

This file defines prototypes for the following functions if the constant WST_RTOS_NONE is set:
  • WSTTarget_enterCriticalRegion
Its prototype is:

isrmask_t  WSTTarget_enterCriticalRegion( void );
  • WSTTarget_exitCriticalRegion
Its prototype is:

void  WSTTarget_exitCriticalRegion( isrmask_t mask);
  • WSTTarget_timerInterrupt
This function is added as wrapper to WSTRTOS_incrementRxfTicks()
Its prototype is:

void  WSTTarget_timerInterrupt( void );
WSTTarget.c This file implements the following functions:
  • WSTTarget_Init
If  WST_RTOS_NONE is set, this function initializes the timer and inserts WSTTarget_timerInterrupt as ISR using a API library on a Luminary Stellaris board.
  • WSTTarget_Cleanup
This function is left empty.


This file also implements the following functions if the constant WST_RTOS_NONE is set:
  • WSTTarget_enterCriticalRegion
This function is implemented as disabling interrupts using the API library on a  Luminary Stellaris board.
  • WSTTarget_exitCriticalRegion
This function is implemented as enabling interrupts using the API library on a  Luminary Stellaris board.
  • WSTTarget_timerInterrupt
This function serves as wrapper to WSTRTOS_incrementRxfTicks() .



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