ARM7/STR71x Release

IAR Embedded Workbench


General

Release consists of the RTOS sources and three sample projects - see Release description for details. Each sample located in separate folder. Structure of test project folder (folders are in brackets '[]'):

[Config]          - linker scripts and other utilities
[Exe]             - executable product[s]
[List]            - listings and other temporary text files
[Obj]             - objects and other intermediate files
[settings]        - IAR IDE auxiliary files
[Src]             - test project sources
slon.ewd          - IAR IDE auxiliary file
slon.ewp          - IAR IDE project
slon.eww          - IAR IDE workspace

slon is test project name.

Structure of the RTOS folder:

scmRTOS
  Common            - common RTOS sources
  ARM7              - portable part

See Distribution section and below about release using manners.


Interrupts

STR71x family has very peculiar interrupt controller (EIC). To achieve some flexibility between user application and RTOS interrupt handling mechanism, the address EIC method is used. All ISR handlers are placed into specially defined segment INT_HANDLERS by qualifing them OS_INTERRUPT, and linker script ensures that INT_HANDLERS segment resided in single properly located 64K area.

Context switching interrupt

TIM0 used as system timer in samples and it's OCMPA interrupt used for context switching. This int flag never to be cleared, enable bit in EIC->IER cleared instead to make this channel always ready to assert interrupt. Software interrupts in XTI not used because:

  1. context switching interrupt handler must be so fast as possible
  2. it's difficult to share one handler between OS core and user application if required.

Context switching interrupt selected in project-depended include file scmRTOS_TARGET_CFG.h, so user can select differnt interrupt for context switching if required


Building

There is only one way provided to build any sample - IAR IDE.

Just launch IDE, open appropriate workspace (*.eww file), choose project target (RAM/Flash), and build the project. Default chip type, the sample project is targeted for is STR711. To alter chip type, three settings has to be changed:

  1. Project->Options->General Options->Target->Device
  2. Project->Options->C/C++ Compiler->Preprocessor->Defined symbols (consult device.h for appropriate value)
  3. Project->Options->Assembler->Preprocessor->Defined symbols (consult device.h for appropriate value)

If user want to use his own build system [1] he has to specify the following command-line options for various tools:

Assembler:

-DSTR711  (or another suitable STR71x chip type, consult device.h)
--cpu ARM7TDMI
--fpu None
-r
-OObj
-LList
-ISrc
-I..\scmRTOS\Common
-I..\scmRTOS\ARM7
-I$TOOLKIT_PATH$\arm\INC

Compiler:

-e
--eec++
-s9
-DSTR711  (or another suitable STR71x chip type, consult device.h)
-lCN List
-o Obj
--debug
--cpu_mode thumb
--endian little
--cpu ARM7TDMI-S
--stack_align 4
--interwork
--fpu None
--dlib_config $TOOLKIT_PATH$\arm\LIB\dl4tptinl8n.h
-ISrc
-I$TOOLKIT_PATH$\arm\INC\
-I../scmRTOS/Common
-I../scmRTOS/ARM7

Linker:

-s __program_start
-r
-xmseo
dl4tptinl8n.r79
-o Exe\slon.d79
-l List\slon.map
-I $TOOLKIT_PATH$\arm\LIB
-f Config\STR71x_FLASH.xcl (or -f Config\STR71x_RAM.xcl)
-Osimple-code=Exe\slon.sim

Note

where $TOOLKIT_PATH$ - path to folder with toolkit installed.


Addind support of new device

This release supports only STR710, STR711, STR712, STR715 devices. If user wants to use other STR71x family device supported by compiler, two files has to be changed: device.h in Src folder and OS_Target_core.h in scmRTOS/ARM7 folder. Contence of those files is simple enought.


[1]For example, make utility or simple bat file.