Home

RM-ICCAVR Salvo Compiler Reference Manual

image

Contents

1. Manual Table 4 Target specific context switcher files for ImageCraft s ICCAVR C compiler salvocfg h Examples Below are examples of salvocfg h project configuration files for different Salvo for Atmel AVR and MegaAVR distributions targeting a variety of AVR targets Salvo Lite Library Build define OSUSE_ LIBRARY TRUE define OSLIBRARY_TYPE OSF define OSLIBRARY_ CONFIG OST define OSTASKS 2 define OSEVENTS 4 define OSEVENT_FLAGS 0 define OSMESSAGE QUEUES 1 Listing 1 Example salvocfg h for library build using libsalvoficcavr t a Salvo LE amp Pro Library Build define OSUSE_ LIBRARY TRUE define OSLIBRARY_TYPE OSL define OSLIBRARY CONFIG OST define OSTASKS 7 define OSEVENTS 1 3 define OSEVENT_FLAGS 3 define OSMESSAGE QUEUES 2 Listing 2 Example salvocfg h for library build using libsalvoliccatmega t a or libsalvoliccatm256 a Salvo Pro Source Code Build define OSENABLE_IDLING_HOOK RUE define OSENABLE_SEMAPHORES RUE define OSTASKS 9 define OSEVENTS 17 define OSEVENT_FLAGS 2 define OSMESSAGE QUEUES 4 Listing 3 Example salvocfg h for source code build RM ICCAVR Salvo Compiler Reference Manual ImageCraft ICCAVR 7 The RTOS that runs in tiny places Interrupt Latencies Memory Usage User Hooks Reference Manual Since Salvo s cont
2. 1 and similar megaAVRs Salvo uses 4 10 RM ICCAVR Salvo Compiler Reference Manual ImageCraft ICCAVR The RTOS that runs in tiny places Stack Issues External SRAM Reference Manual bytes per function pointer instead of two This allows Salvo tasks to be located anywhere in program memory Salvo for AVR and megaAVR automatically detects whether you are building for the ATmega2560 or ATmega2561 and configures Salvo s function pointer type accordingly If you are using a chip other than the ATmega2560 or ATmega2561 define the symbol OSAVR_256K for every Salvo source module including salvomem c in Salvo library builds This can be done by passing DOSAVR_256K to the compiler e g in the AVR Studio IDE or by including define OAVR_256K 1 in the project s salvocfg h ImageCraft s ICCAVR C compiler uses two separate stacks one for return addresses the hardware stack which uses sP and one for parameter passing and local storage the software stack which uses Y Compared to a non Salvo non multitasking application with similar call trees the corresponding Salvo application will require an additional two return addresses i e 4 bytes for typical AVRs and megaAVRs in the hardware stack A The size of the hardware stack can be set in the ICCAVR IDE via Project Options Target Advanced Return Stack Size or on the iccavr linker command line e g iccavr dhwstk_size 20 Appl
3. Reference Manual 750 Naples Street San Francisco CA 94112 415 584 6360 http www pumpkininc com Salvo Compiler Reference Manual ImageCraft ICCAVR J Salvo The RTOS that runs in tiny places Copyright 2003 Pumpkin Inc last updated on Jun 5 2008 All trademarks mentioned herein are properties of their respective companies The RTOS that runs in tiny places Introduction Reference Manual This manual is intended for Salvo 4 users who are targeting Atmel http www atmel com AVR and MegaAVR microcontrollers with ImageCraft s http www imagecraft com ICCAVR C compiler v7 14 or later Note Users of ICCAVR v6 and earlier should use Salvo v3 x which is now deprecated Related Documents Example Projects Features The following Salvo documents should be used in conjunction with this manual when building Salvo applications with ImageCraft s ICCAVR C compiler e Salvo User Manual Example Salvo projects for use with ImageCraft s ICCAVR C compiler and the ImageCraft IDE can be found in the Pumpkin Salvo Example AVR directories of every Salvo for Atmel AVR and MegaAVR distribution Tip These example projects can be easily modified for any AVR or MegaAVR device Table 1 illustrates important features of Salvo s port to ImageCraft s ICCAVR C compiler RM ICCAVR Salvo Compiler Reference Manual ImageCraft ICCAVR Sm dV 0 Reference Manual General Abbr
4. brary o configuration a multitasking with delays and events d multitasking with delays type e multitasking with events f freeware m multitasking only standard s Salvo SE library ImageCraft t multitasking with delays and events tasks can wait with timeo C Compiler y Salvo tiny library target option avr AVR no option atmega MegaAVR i library includes debugging information Figure 1 Salvo Library Nomenclature ImageCraft s ICCAVR C Compiler Salvo Lite distributions contain freeware libraries All other Salvo distributions contain standard libraries See the Libraries chapter of the Sa vo User Manual for more information on library types Each library is intended for one or more specific processors Table 2 lists the correct library for each AVR and MegaAVR processor RM ICCAVR Salvo Compiler Reference Manual ImageCraft ICCAVR The RTOS that runs in tiny places Option Configuration RM ICCAVR Salvo Compiler Reference Manual ImageCraft ICCAVR Reference Manual Target Code Processor s AVR and megaAVR devices with 8KB or less program memory e g AT90S8515 These libraries use the basic AVR instruction set AVR and megaAVR devices with more than 8KB and less than 256KB atmega of program memory e g ATmega 16 These libraries use the megaAVR instruction set AVR and megaAVR devices with more than 8KB and less than 256KB atm128 of program memory e g ATmega1280 These libraries use th
5. cific settings and overrides are listed in Table 3 Target specific Settings Delay sizes 8 bits dummy can be overridden disables then restores GIE bit can be overridden Watchdog hook clears WDT without other changes can be overridden System tick counter available 32 bits Task priorities enabled Idling hook Interrupt hook Table 3 Build settings and overrides for Salvo libraries for ImageCraft s ICCAVR C compiler Note Salvo Lite libraries have precompiled limits for the number of supported tasks events etc Salvo LE and Pro libraries have no such limits See the Libraries chapter of the Salvo User Manual for more information There are a total of 44 Salvo libraries for ImageCraft s ICCAVR C compiler Each Salvo for Atmel AVR and MegaAVR distribution contains the Salvo libraries of the lesser distributions beneath it Target Specific Salvo Source Files Depending on the target AVR one of three different context switcher files is required for Salvo Pro source code builds as shown in Table 4 Context switcher Filename Application AVRs with 8KB or less program salvoporticcavr s memory Uses IJMP and RJMP instructions AVRs with more than 8KB and up to salvoporticcatmega s 128KB program memory Uses IJMP and JMP instructions AVRs with 256KB and more program salvoporticcatm256 s memory Uses EIJMP JMP and LPM instructions RM ICCAVR Salvo Compiler Reference Manual ImageCraft ICCAVR Sm dV 0 Reference
6. dummy function as shown below RM ICCAVR Salvo Compiler Reference Manual ImageCraft ICCAVR The RTOS that runs in tiny places Interrupt RM ICCAVR Salvo Compiler Reference Manual ImageCraft ICCAVR Reference Manual void OSIdlingHook void Listing 4 Default Salvo idling hook for ImageCraft s ICCAVR C compiler Users can replace it e g with a directive to put the AVR to sleep by building their own version with their application The default interrupt hooks in salvohook_interrupt c are shown below static unsigned char sreg void OSDisableHook void unsigned char sreg_local sreg_local SREG CLI sreg sreg_local void OSEnableHook void SREG sreg Listing 5 Default Salvo interrupt hooks for ImageCraft s ICCAVR C compiler These functions clear the GIE bit i e disable global interrupts across Salvo s critical section and restore the bit to its previous value thereafter These hooks are suitable for all applications These hooks work very well within Salvo services called from interrupts as the GIE bit is automatically cleared upon entry to an interrupt Therefore interrupts are not re enabled at the end of a Salvo service that is called in an ISR This avoids unnecessary interrupt nesting The use of the auto variable sreg_local avoids issues that would affect the shared global sreg when a Salvo service is called from within an ISR Note Not disabli
7. e enhanced AVR instruction set megaAVR devices with 256KB or more of program memory atm256 e g ATmega2561 These libraries use the extended AVR instruction set a Table 2 Processors for Salvo libraries ImageCraft s ICCAVR C compiler Note The target code for an unlisted processor will match that used by ImageCraft s ICCAVR C compiler for standard libraries etc Salvo Pro users can select between two sets of libraries standard libraries and standard libraries incorporating source level debugging information The latter have been built with ImageCraft s ICCAVR C compiler s g command line option This adds source level debugging information to the libraries making them ideal for source level debugging and stepping in the ICCAVR debugger To use these libraries simply select one that includes the debugging information e g libsalvoliccavrit a instead of one without e g libsalvoliccavr t a in your ICCAVR project Different library configurations are provided for different Salvo distributions and to enable the user to minimize the Salvo kernel s footprint See the Libraries chapter of the Sa vo User Manual for more information on library configurations The RTOS that runs in tiny places Build Settings Available Libraries Reference Manual Salvo s libraries for ImageCraft s ICCAVR C compiler are built using the default settings outlined in the Libraries chapter of the Salvo User Manual Target spe
8. eviated as ICCAVR Salvo Lite LE amp Pro Available distributions for Atmel AVR and MegaAVR Supported targets entire AVR and MegaAVR family Header file s salvoporticcavr h salvoporticcavr s Other target specific file s salvoporticcatmega s salvoporticcatm256 s salvocfg h Compiler auto detected yes Include target specific header file in salvocfg h ye libraries errs Lib ICCAVR v7 for v7 x compilers Context Switching function based via Memod OSDispatch amp OSCtxSw Labels required no Size of auto variables and total size must not exceed 254 8 bit function parameters in tasks bytes Memory amp Registers Internal and external RAM yes via supported bsalvoram 0xstart 0xend R20 R23 used no Interrupts Interrupt latency in context 0 cycles switcher Interrupts in critical sections user hooks controlled via Default behavior in critical see example user hooks sections Debugging Source level debugging with Pro library builds YES Compiler Bitfield packing support no printf p support yes yes va_arg support yes Table 1 Features of Salvo port to ImageCraft s ICCAVR C compiler Libraries Nomenclature The Salvo libraries for ImageCraft s ICCAVR C compiler follow the naming convention shown in Figure 1 RM ICCAVR Salvo Compiler Reference Manual ImageCraft ICCAVR 3 The RTOS that runs in tiny places Reference Manual Type Target libsalvoficcavr a a Salvo li
9. ext switcher for ImageCraft s ICCAVR C compiler does not need to control interrupts Salvo applications can easily be created with zero total interrupt latency for interrupts of interest In a properly configured application only those interrupts that call Salvo services will by necessity experience interrupt latency from Salvo s operations Users must ensure that these interrupt sources are disabled and re enabled via the user interrupt hooks Disabling and re enabling interrupts globally in the user interrupt hooks i e the default user interrupt hook behavior is of course permitted but will result in non zero interrupt latencies for all interrupt sources even those that do not call Salvo services See the target specific source files of this distribution for examples set Program Data Memory Example Application Memory Usage Usage AVR AT90S8515 tut5lite 3206 57 AVR AT90S8515 tut5le 3148 57 AVR AT90S8515 tut5pro 2962 56 Table 5 ROM and RAM requirements for Salvo applications built with ImageCraft s ICCAVR C compiler Overriding Default Hooks Idling In library builds users can define new hook functions in their projects and the linker will choose the user function s over the default function s contained in the Salvo library In source code builds users can remove the default hook file s from the project and substitute their own hook functions The default idling hook in salvohook_idle c is a
10. ications using nested interrupts floating points or longs will require a hardware stack larger than the default size see ICCAVR Help for more information Salvo s global objects can be placed in internal or external RAM In ImageCraft s ICCAVR IDE the placement of objects e g variables in the data program area is controlled via Project Options Target Device Configuration Internal SRAM RM ICCAVR Salvo Compiler Reference Manual ImageCraft ICCAVR 11 The RTOS that runs in tiny places Data Segments Code Compressor Reference Manual etc On the iccavr linker command line placement of these objects is specified via bdata start end e g iccavr bdata 0x260 0xffff specifies that the data program area start at 0x260 the end of internal SRAM and extend to 0xFFFF the 64K boundary Salvo s global objects can be placed as a group anywhere in RAM internal or external by specifying the start and end addresses of the salvoram program area This applies to source code and library builds For example to place all of Salvo s global objects in a 256 byte block of external RAM just beneath the 32K boundary use iccavr bsalvoram 0x7F0O0 Ox7FFF when linking your application Note If you do not use the p linker command line argument the salvoram program area will be located immediately after the bss program area in the data program area Therefore it is only required if you w
11. ish to locate Salvo s global objects separately from your program s variables etc You can override the order of the program areas by using the area assembler directive The RAMPD register is normally used to access the entire data space on processors with more than 64K bytes data space There are no provisions for accessing Salvo s global objects outside of the current data segment of 64K bytes Salvo is compatible with ImageCraft s ICCAVR Code Compressor in both library and source code builds Indirect Function Calls 12 Salvo handles indirect function calls directly through tump and EIJMP instructions and not through Code Compressor s xicall This is transparent to the user RM ICCAVR Salvo Compiler Reference Manual ImageCraft ICCAVR The RTOS that runs in tiny places Reference Manual Registers R20 R23 ICCAVR can be instructed to not use registers R20 R23 In practice this has little effect on the Salvo code it may result in a small speedup and smaller ROM size The Salvo libraries are built without using R20 R23 so that control of these registers is left to the programmer 14 Salvo Pro users can control the use of these registers in a source code build N tiny AVR devices are not supported because of their lack of RAM This is done automatically through the __TMAGECRAFT__ and _AVR symbols defined by the compiler ICCAVR v7 places 3 byte address of function pointers into a literal tab
12. le located within the first 64K of program memory Therefore LPM is used ELPM is not required Salvo 4 1 2 rcO with v7 15 compiler In bytes Entire application including func_lit text and vector areas In bytes Entire application including bss area Does not include RAM reserved for the return address hardware SP stack nor for the parameter passing and local storage software Y stack This hook is valid for all AVR and MegaAVR targets because the register and GIE bit locations are the same for all targets This hook is valid for all AVR and MegaAVR targets because the watchdog control register is the same for all targets Bits 16 through 21 are defined for the AVR architecture on these parts Salvo does not use the uppermost most significant byte it remains 0 Salvo Pro application can reduce this by one return address by inlining OSSched E g task control blocks queue pointers counters etc Failure to allocate enough RAM for the salvoram program area will result in an area salvoram not large enough linker error Code Compressor is included in ICCAVR Professional The ICCAVR libraries that do not use R20 R23 have the gr global register suffix RM ICCAVR Salvo Compiler Reference Manual ImageCraft ICCAVR 13
13. ng all source of interrupts that call Salvo services during critical sections will cause the Salvo application to fail Tan aav Reference Manual Watchdog The default watchdog hook in salvohook_wadt c is shown below void OSCl1rWDTHook void _WDR Listing 6 Default Salvo watchdog hook for ImageCraft s ICCAVR C compiler Users can replace it e g with a dummy function this would stop Salvo from clearing the watchdog timer and allow the user to clear it elsewhere by building their own version with their application Compiler Issues Runtime Models and Compatible Libraries The runtime models used by ImageCraft s ICCAVR C compiler have evolved over the years When building an application with Salvo libraries it s necessary to link to the libraries compatible with the version of ImageCraft s ICCAVR C compiler that you are using Table 6 lists the locations of Salvo libraries as a function of the ImageCraft s ICCAVR C compiler version ICCAVR Version Salvo Library Location T ods Lib ICCAVR v7 Table 6 Compiler versions runtime models and Salvo library locations for ImageCraft s ICCAVR C compiler Incompatible Optimizations There are no known incompatibilities between ImageCraft s ICCAVR C compiler s optimizations e g 08 016 024 and Salvo Special Considerations ATmega2560 2561 256KB and greater program memory In order to support the larger than 16 bit program memory space of the ATmega2560 256

Download Pdf Manuals

image

Related Search

Related Contents

    Manuel de l`utilisateur  EAT : trombi_2013_Simone_Beauvoir (1707.3ko application  D - Keb  平成 17 年度 ファイル基準総括表  Mitel IP8820 User's Manual  KG-PS125X User`s Manual  Wireless 54Mbps ADSL Router    

Copyright © All rights reserved.
Failed to retrieve file