ARM7/ADuC70xx Release
IAR Embedded Workbench
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.
Since noone interrupt can be raised and masked by software, the only available context switch scheme
is direct program control flow transfer.
Besause of absence of interrupt controller in ADuC family, IRQ exception handler is implemented as
call to project-level function IRQ_Switch(). Function must have "C" linkage and can be qualified
as __arm or __thumb. Function must analyze interrupt flags and masks and call appropriate
interrupt handlers. All interrupt handlers, which is uses OS services must be called from this function.
Function must call OS::SystemTimer_ISR() handler in case it detects system timer interrupt. Function example:
extern "C" __arm void IRQ_Switch()
{
dword irq = IRQSIG;
irq &= IRQSTA;
if(irq & GP_TIMER_BIT)
{
Timer_ISR();
}
if(irq & RTOS_TIMER_BIT)
{
OS::SystemTimer_ISR();
}
}
Interrupt handlers, which is not uses OS services can also be qualified in the same way as handlers with OS
services calls and, sequently, be called from IRQ_Switch() or can be programmed as FIQ and handled in ordinary way.
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 ADuC7020. To alter chip type, three
settings has to be changed:
- Project->Options->General Options->Target->Device
- Project->Options->C/C++ Compiler->Preprocessor->Defined symbols (consult device.h for appropriate value)
- Project->Options->Assembler->Preprocessor->Defined symbols (consult device.h for appropriate value)
If user want to use his own build system he has to specify the following
command-line options for various tools:
-DADuC7020 (or another suitable ADuC chip type, consult device.h)
--cpu ARM7TDMI
--fpu None
-r
-OObj
-LList
-ISrc
-I..\scmRTOS\Common
-I..\scmRTOS\ARM7
-I$TOOLKIT_PATH$\arm\INC
-e
--eec++
-s9
-DADuC7020 (or another suitable ADuC 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
-s __program_start
-r
-xmseo
dl4tptinl8n.r79
-o Exe\slon.d79
-l List\slon.map
-I $TOOLKIT_PATH$\arm\LIB
-f Config\ADuC70xx_FLASH.xcl (or -f Config\ADuC70xx_RAM.xcl)
-Osimple-code=Exe\slon.sim
Note
where $TOOLKIT_PATH$ - path to folder with toolkit installed.
This release supports all ADuC70xx devices, supported by version 4.30 of IAR EWARM. If user
has modern version of compiler and wants to use other ADuC70xx family device, 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.