Home

RM-IAR18 Salvo Compiler Reference Manual – IAR

image

Contents

1. Salvo Pro users can reconfigure the way in which interrupts are disabled during critical sections by redefining OSPIC18_INTERRUPT_MASK in the project s salvocfg h For example if Salvo services e g OSTimer are called only from low priority interrupts then a value of 0x40 for OSPIC18_INTERRUPT_MASK ensures that only low priority interrupts are disabled during a Salvo critical section In this configuration high priority interrupts will therefore be unaffected by Salvo This is especially useful when high rate interrupts are present This is done automatically through the __ TAR_SYSTEMS_ICC__and__TID symbols defined by the compiler Via either in line assembly or a function call As of v2 10 the __monitor keyword was known to behave incorrectly Each event flag has RAM allocated to its own event flag control block Each message queue has RAM allocated to its own message queue control block i Salvo v3 2 1 with IAR PIC18 C v2 10A In bytes In bytes all banks udata Does not include stack default 0x130 bytes Salvo global objects are in access RAM near Salvo Pro build differs slightly from Salvo Lite build due to configuration see tutorial s salvocfg h Uk wD RM IAR18 Salvo Compiler Reference Manual IAR PIC 18 C
2. The global object codes are listed in Table 3 The RTOS that runs in tiny places Configuration Build Settings Reference Manual memory type code description Salvo objects are declared as type i OS s no_init bank and will be located in banked RAM Salvo objects are declared as type DO lipie banko and will be located in the first 128 bytes of internal RAM i e in access RAM Table 3 Memory Types for Salvo Libraries IAR s PIC18 C Compiler n OSN The code required to access Salvo s global objects e g the task control blocks or tcbs will vary in size and speed depending on where the objects are located __bankO type objects can be accessed the fastest but consume precious RAM in the Access Bank __bank type objects will be placed in banked RAM which will result in slower accesses Since there are only 128 bytes of access RAM in the PIC18 architecture in larger applications it may be necessary to place Salvo s global objects in banked RAM 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 Salvo s libraries for IAR s PIC18 C compiler are built using the default settings outlined in the Libraries chapter of the Salvo User Manual Target specific settings and overrides are listed in Table 4 RM IAR18 Salv
3. Reference Manual 750 Naples Street San Francisco CA 94112 415 584 6360 htto www pumpkininc com Salvo Compiler Reference Manual IAR PIC18 C J Salvo The RTOS that runs in tiny places Copyright 2003 Pumpkin Inc last updated on Jul 24 2003 All trademarks mentioned herein are properties of their respective companies Introduction This manual is intended for Salvo users who are targeting Microchip http www microchip com PIC18 PICmicro MCUs with IAR s http www iar com PIC18 C compiler Related Documents The following Salvo documents should be used in conjunction with this manual when building Salvo applications with IAR s PIC18 C compiler Salvo User Manual Application Note AN 14 Example Projects Example Salvo projects for use with IAR s PIC18 C compiler and the Microchip MPLAB v5 x IDE can be found in the salvo ex exl sysp salvo tut tul sysp salvo tut tu2 sysp salvo tut tu3 sysp salvo tut tu4 sysp salvo tut tu5 sysp salvo tut tu6 sysp directories of every Salvo for Microchip PICmicro MCUs distribution Features Table 1 illustrates important features of Salvo s port to IAR s PIC18 C compiler 2 RM IAR18 Salvo Compiler Reference Manual IAR PIC 18 C Sm dV 0 Reference Manual general Salvo Lite LE amp Pro available distributions for Microchip PICmicro MCUs supported targets PIC18 PlCmicro MCUs header file s portiarls h other ta
4. iler passes parameters on a software stack and uses the PIC18 s hardware stack for call return addresses While the compiler supports both stack reentrant and static overlay models Salvo supports only the stack model Locating Global Salvo Objects in Source Code Builds RM IAR18 Salvo Compiler Reference Manual IAR PIC18 C With IAR s PIC18 C compiler the initialization of Salvo s global objects can be controlled en masse _ through the OSIAR_PIC18_ATTR_ALL configuration option When set to __no_init Salvo s global objects will not be initialized This is useful in cases where you wish to maintain Salvo s state across wake from sleep resets etc When used thusly OSInit must be called to initialize Salvo s global objects at least once To selectively place certain Salvo global objects in access or banked RAM set Salvo s osLoc_xyz configuration parameters to __bank _ banko etc The RTOS that runs in tiny places Reference Manual Interrupt Control 10 The PIC18 architecture supports two distinct priority levels When enabled two separate global interrupt enable bits GIEH and GIEL are used to control high and low priority interrupts respectively Interrupts are automatically disabled within Salvo s critical sections By default both GIEH and GIEL are reset i e made 0 during critical sections This is controlled by Salvo s OSPIC18_INTERRUPT_MASK configuration option default value OxCO
5. left undefined the default values see Table 4 will be used Salvo Lite Library Build RM IAR18 Salvo Compiler Reference Manual IAR PIC18 C define OSUSE_LIBRARY TRUE The RTOS that runs in tiny places Reference Manual define define define OSLIBRARY_TYPE OSF OSLIBRARY_GLOBALS OSF OSLIBRARY_CONFIG OSA Listing 1 Example salvocfg h for Library Build Using Salvo LE amp Pro Library Build define define define define sfiar18 slfa lib OSUSE_LIBRARY TRUE OSLIBRARY_TYPE OSL OSLIBRARY_GLOBALS OSF OSLIBRARY_CONFIG OSA Listing 2 Example salvocfg h for Library Build Using Salvo Pro Source Code Build sliar18 slfa lib define OSENABLE IDLING _ HOOK TRUE define OSENABLE SEMAPHORES TRUE define OSEVENTS 1 define OSIAR_PIC18_ATTR ALL Ho init define OSLOC_ALL bank0 define OSTASKS 3 Listing 3 Example salvocfg h for Source Code Build RM IAR18 Salvo Compiler Reference Manual IAR PIC18 C The RTOS that runs in tiny places Performance Memory Usage Reference Manual tutorial memory usage total ROM total RAM tullite 494 11 cu2lite 858 24 tu3lite 942 26 cudite 1902 34 tu5lite 3042 53 tu6lite 3632 56 tu6pro 3338 52 Table 5 ROM and RAM requirements for Salvo Applications built with IAR s PIC18 C Compiler Special Considerations Stack Issues For architectural reasons IAR s PIC18 C comp
6. multitasking only I standard t multitasking with delays and events tasks can wait with timeouts IAR PIC18C memory type for global Salvo objects C Compiler f far objects are __no_init __bank qualified option n near objects are __no_init __bank0 qualified no option are gt memory model i library includes debugging I large lt 2MB address space information s small lt 64KB address space code model o static overlay s stack italicized items are not currently supported Figure 1 Salvo Library Nomenclature IAR s PIC18 C Compiler Salvo Lite distributions contain freeware libraries All other Salvo distributions contain standard libraries See the Libraries chapter of the Salvo User Manual for more information on library types No target specific identifiers are required 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 IAR s PIC18 C compiler C compiler s debug command line option This adds source level debugging information to the libraries making them ideal for source level debugging and stepping in the C SPY debugger To use these libraries simply select one that includes the debugging information e g sliarl8islna r49 RM IAR18 Salvo Compiler Reference Manual IAR PIC 18 C The RTOS that runs in tiny places Code Model Memory Model Reference Manual ins
7. o Compiler Reference Manual IAR PIC 18 C The RTOS that runs in tiny places Available Libraries Reference Manual compiled limits max number of tasks 3 max number of events 5 max number of event flags 1 max number of message 1 queues target specific settings delay sizes 8 bits idling hook enabled interrupt enable bits during critical sections GIEH GIEL 0 message pointers can point to ROM or RAM Salvo objects far system tick counter available 32 bits task priorities enabled watchdog timer cleared in OSSched Table 4 Build Settings and Overrides for Salvo Libraries for IAR s PIC18 C Compiler Note The compiled limits for tasks events etc in Salvo libraries can be overridden to be less all Salvo distributions or more all Salvo distributions except Salvo Lite than the library default See the Libraries chapter of the Salvo User Manual for more information There are 20 Salvo libraries for IAR s PIC18 C compiler Each Salvo for Microchip PICmicro MCUs distribution contains the Salvo libraries of the lesser distributions beneath it salvocfg h Examples Below are examples of salvocfg h project configuration files for different Salvo for PICmicro MCUs distributions targeting the PIC18C452 Note When overriding the default number of tasks events etc in a Salvo library build ostasKs and OSEVENTS respectively must also be defined in the project s salvocfg h If
8. rget specific file s portpicle e project subdirectory name s SYSP salvocfg h compiler auto detected yes libraries salvo lib subdirectory iarl18 context switching memod a _OSLabel required no size of auto variables and function parameters in tasks unrestricted memory memory models supported small and large interrupts GIEL and or GIEH bits Controlled controlled via via OSPIC18_INTERRUPT_MASK configuration option interrupt status preserved in re critical sections y external function to mimic operation method used of __ monitor keyword with flexibility to control GIEL and or GIEH nesting limit 8 levels alternate methods possible yes debugging source level debugging yes compiler bitfield packing support no printf p support yes yes va_arg support yes Table 1 Features of Salvo Port to IAR s PIC18 C Compiler Compiler Optimizations Incompatible Optimizations None of IAR s PIC18 C compiler s optimizations are known to be incompatible with Salvo RM IAR18 Salvo Compiler Reference Manual IAR PIC18 C 3 The RTOS that runs in tiny places Reference Manual Libraries Nomenclature Type Target Option The Salvo libraries for AR s PIC18 C compiler follow the naming convention shown in Figure 1 sfiar18 sIna r49 Salvo library configuration a multitasking with delays and events d multitasking with delays type e multitasking with events f freeware m
9. tead of one without e g sliarl8 slna r49 in your Embedded Workbench project Currently only the IAR PIC18 C compiler s stack code model is supported This allows for reentrancy etc Currently only the IAR PIC18 C compiler s Large memory model is supported In library builds the memory model applied to all of the source files must match that used in the library For source code builds the same memory model must be applied to all of the source files memory model code description Large memory model Program 1 OSL space is a maximum of 1M words 2MB Small memory model Program 3 099 space is a maximum of 32K words 64KB Table 2 Memory Models for Salvo Libraries IAR s PIC18 C Compiler Note Unlike the library configuration and variant options specified in the salvocfg h file for a library build none is specified for the selected memory model Therefore particular attention must be paid to the memory model settings used to build an application The memory model is usually specified on a node by node basis inside an IDE e g MPLAB Memory Type for Global Salvo Objects RM IAR18 Salvo Compiler Reference Manual IAR PIC18 C You can choose the memory type for Salvo s global objects in your application by choosing the appropriate library near type objects can be accessed the fastest but consume precious RAM in the Access Bank far type objects will be placed in banked RAM which will result in slower accesses

Download Pdf Manuals

image

Related Search

Related Contents

Limited Warranty for Boilers with Aluminum Heat Exchangers  e-grant User Guide - Large-Scale Projects  User`s Manual - Renesas Electronics  Polaris 330 Offroad Vehicle User Manual  Manuel d`utilisation et de sécurité  Liebert Network Router micro smart switch User's Manual    

Copyright © All rights reserved.
Failed to retrieve file