Home
using safertos from rom on stellaris microcontrollers
Contents
1. 5 2 14 ACCESSING SAFERTOS FROM 1 2 2 0000000000000000000000 rne rine rines ns 6 21 4 SAFERTOS API Fi isi tete ada e d a d A x er Ra det SNR 6 2 2 PROJECT 0 00 000000000000 iini isis is sisse aes EEN sss sss nana 6 2 2 1 elis 6 2 2 2 Linker 2 1 2 212120000 0 10000000000 00000009999 6 22 3 ae e et eie eet 6 CHAPTER INTERRUPT SERVICE 8 00200000000000000 0 nennen 8 3 1 DEFINING AN INTERRUPT SERVICE ROUTINE 5 9 3 2 INTERRUPT PRIORITIES AND 9 CHAPTER 4 DEMO APPLICATIONS 2 000 0 1202020000 01010 10 4 1 GETTING 5 11 42 TROUBLESHOOTING ette eux heec ense eee aad er epe ana dic vied 11 REFERENCED DOCUMENTS Ref Document Description 1 34 172 MAN 1 SAFERTOS User Manual 2 34 172 MAN 2 SAFERTOS Safety Manual available as part of the optional Design Assurance Pack 3 IEC 61508 Functional Safety of Electrical Electronic Programmable Electronic Safety Related Systems
2. ham WITTENSTEIN SAFERTOS APPLICATION NOTE 34 172 AN 009 USING SAFERTOS FROM ROM ON STELLARIS MICROCONTROLLERS WITTENSTEIN high integrity systems is a trading name of WITTENSTEIN aerospace amp simulation Itd Proprietary to WITTENSTEIN aerospace amp simulation Itd THE INFORMATION CONTAINED IN THIS DOCUMENT IS PROPRIETARY INFORMATION AND ALL INFORMATION TECHNICAL DATA DESIGNS INCLUDING BUT NOT LIMITED DATA DISCLOSED AND OR PROVIDED HEREIN IS AND REMAINS THE EXCLUSIVE PROPERTY OF WITTENSTEIN aerospace amp simulation Itd IT IS STRICTLY PROHIBITED TO DISCLOSE ANY INFORMATION TO THIRD PARTIES WITHOUT THE PRIOR WRITTEN CONSENT OF WITTENSTEIN aerospace amp simulation Itd THE RECIPIENT OF THIS DOCUMENT BY IT S RETENTION AND USE AGREES TO HOLD IN CONFIDENCE ALL PROPRIETARY INFORMATION PROVIDED WITHIN THIS DOCUMENT Copyright WITTENSTEIN aerospace amp simulation date as document all rights reserved 4 law WITTENSTEIN CONTENTS CONTENT O iine ERLEBEN 2 REFERENCED DOCUMENTS RA Rua daa 2 CHAPTER 1 SAFERTOS AND 186 2 2 2 0000000 0 0 00 nennen 3 1 1 INTRODUCTION peni EMI MG HAMM am PME 4 1 1 1 Use in Safety Related 4 1 1 2 File Systems USB Drivers and TCP IP Protocol 4 CHAPTER 2 INSTIABEATION
3. Using SAFERTOS from ROM on Issue 1 0 Page 2 Stellaris Microcontrollers THE INFORMATION CONTAINED IN THIS DOCUMENT IS PROPRIETARY AND SUBJECT TO THE RESTRICTIONS ON THE COVER PAGE Copyright date as document date 5 1 SAFERTOS AND STELLARIS Using SAFERTOS from ROM on Issue 1 0 Page 3 Stellaris Microcontrollers THE INFORMATION CONTAINED IN THIS DOCUMENT IS PROPRIETARY AND SUBJECT TO THE RESTRICTIONS ON THE COVER PAGE Copyright date as document date A Ae WITTENSTEIN CHAPTER 2 INSTALLATION WITTENSTEIN high integrity systems 1 1 INTRODUCTION The LM3S9B96 is a Cortex M3 microcontroller from Texas Instruments that comes with a pre built version of SAFERTOS embedded in ROM Applications running on the LM3S9B96 can link to and use the ROMed copy of SAFERTOS in commercial applications without paying any license fees The SAFERTOS User Manual Reference 1 and Safety Manual Reference 2 provide detailed but generic information on the use of SAFERTOS This application note provides additional usage and configuration information that is specific only to using a Stellaris microcontroller that already has SAFERTOS pre programmed in ROM information in this application note supersedes that found in the generic manuals when using this platform The recommended way to get running with SAFERTOS is to start with one of the pre configured demo applications This application note d
4. e How to configure the include paths 4 2 TROUBLE SHOOTING Finally following a debug session the LM3S9B96 flash memory might be left in a locked state depending on how the debug session was terminated This will prevent the flash from being erased or re programmed unlock the flash use the Texas Instruments Stellaris Flash Programming Utility that comes on the DK LM3S9B9 CD and is also available for download from the Texas Instruments WEB site Using SAFERTOS from ROM on Issue 1 0 Page 11 Stellaris Microcontrollers THE INFORMATION CONTAINED IN THIS DOCUMENT IS PROPRIETARY AND SUBJECT TO THE RESTRICTIONS ON THE COVER PAGE Copyright date as document date A WITTENSTEIN CONTACT INFORMATION User feedback is essential to the continued maintenance and development of SAFERTOS Please provide all software and documentation comments and suggestions to the most convenient contact point listed below Address Phone Fax Email Website All Trademarks acknowledged WITTENSTEIN high integrity systems Brown s Court Long Ashton Business Park Yanley Lane Long Ashton Bristol BS41 9LB England 44 0 1275 395 600 44 0 1275 393 630 support HighintegritySystems com www HighIntegritySystems com Using SAFERTOS from ROM on Stellaris Microcontrollers Issue 1 0 Page 12 THE INFORMATION CONTAINED IN THIS DOCUMENT IS PROPRIETARY AND SUBJECT TO THE RESTRICTIONS ON THE COVER PAGE Copyright date as docum
5. IntDefaultHandler The usage fault handler 0 Reserved 0 Reserved 0 Reserved 0 Reserved void WSafeRTOS SVC Handler Address Svcall handler IntDefaultHandler Debug monitor handler 0 Reserved void The PendSV handler void The SysTick handler IntDefaultHandler GPIO Port A IntDefaultHandler GPIO Port B IntDefaultHandler GPIO Port C Rest of vector table definition goes below here Listing 1 An example vector table definition Using SAFERTOS from ROM on Issue 1 0 Stellaris Microcontrollers Page 7 THE INFORMATION CONTAINED IN THIS DOCUMENT IS PROPRIETARY AND SUBJECT TO THE RESTRICTIONS ON THE COVER PAGE Copyright date as document date V A CHAPTER 3 INTERRUPT SERVICE ROUTINES Using SAFERTOS from ROM on Issue 1 0 Page 8 Stellaris Microcontrollers THE INFORMATION CONTAINED IN THIS DOCUMENT IS PROPRIETARY AND SUBJECT TO THE RESTRICTIONS ON THE COVER PAGE Copyright date as document date 5 3 1 DEFINING AN INTERRUPT SERVICE ROUTINE ISR Interrupt service routines do not require any special syntax and can be written as described in the compiler documentation An application defined interrupt handler can request a context switch by calling taskYIELD FROM ISR as described in the SAFERTOS User Manual Reference 1 and demonstrated by Listing 2 An interrupt should do this if it unblocks a task and the task that was unbloc
6. can be called from an interrupt service routine Refer to the SAFERTOS User Manual Reference 1 for details of which API functions can be safely called from within interrupt service routines Using SAFERTOS from ROM on Issue 1 0 Page 9 Stellaris Microcontrollers THE INFORMATION CONTAINED IN THIS DOCUMENT IS PROPRIETARY AND SUBJECT TO THE RESTRICTIONS ON THE COVER PAGE Copyright date as document date 5 4 DEMO APPLICATIONS Using SAFERTOS from ROM on Issue 1 0 Page 10 Stellaris Microcontrollers THE INFORMATION CONTAINED IN THIS DOCUMENT IS PROPRIETARY AND SUBJECT TO THE RESTRICTIONS ON THE COVER PAGE Copyright date as document date A WITTENSTEIN 4 1 GETTING STARTED One of the easiest ways to get running with SAFERTOS in ROM is to start with a demo application that already has the compiler options linker script start up files and vector tables correctly configured These are available from both Texas Instruments and WITTENSTEIN and are intended to not only get you up and running with the minimum of fuss but also serve as a training aid and as a start point for your own application Amongst other things the demo applications provide examples of e How to initialize the scheduler e How to use compiler extensions to ensure buffers used by tasks and queues are correctly aligned e How to create tasks e How to dimension and create queues e How to start the scheduler
7. date ham WITTENSTEIN 2 1 ACCESSING SAFERTOS FROM ROM 2 1 1 SAFERTOS_API h The SAFERTOS functionality for the LM3S9B96 is pre built and resident in ROM so the SAFERTOS source files do not need to be included in the application build Instead a jump table is used to link the application code to the ROMed kernel code at run time The jump table is contained in a header file called SafeRTOS_API h This header file must be included from any source file that wishes to call SAFERTOS API function Including SafeRTOS API h allows the SAFERTOS to be used in the normal way 2 2 PROJECT CONFIGURATION 2 2 4 Include Path SafeRTOS_API h is included within the StellarisWare directory structure same directory location contains several other dependent SAFERTOS related header files and must be included in the compilers pre processor include path the compiler must be configured so it can find the SAFERTOS header files 2 2 2 Linker Configuration The linker script used by the application must reserve the first Ox20C bytes of RAM for use by SAFERTOS See the provided demo applications for example linker scripts that can be used as a reference or simply copied 2 2 3 Vector Table The interrupt vector table must be populated with the addresses of the SAFERTOS interrupt handlers located ROM The addresses are defined in SaFERTOS_API h Table 2 1 contains the vectors that require populating with SAFERTOS addresses and the c
8. ent date
9. ked has a priority above the currently executing task Requesting a context switch within the interrupt will ensure the interrupt returns directly and immediately to the higher priority task void vXYZ ISR void portBASE xYieldRequired pdFALSE Clear the interrupt Perform ISR work here A yield is required xYieldRequired pdTRUE Perform the yield taskYIELD FROM ISR xYieldRequired Listing 2 The template for an ISR 3 2 INTERRUPT PRIORITIES AND NESTING SAFERTOS is pre loaded into ROM and its configuration cannot be modified In the ROMed version portSYSCALL INTERRUPT PRIORITY is set to 191 Therefore interrupts that use the SAFERTOS API must be assigned a priority equal to or below 191 or 5 depending on which notation is used E Important The Cortex M3 core uses numerically low priority numbers to represent HIGH priority interrupts which can seem counter intuitive and is easy to forget If you wish to assign an interrupt a low priority do NOT assign it a priority of O or other low numeric value as this can result in the interrupt actually having the highest priority and potentially make your system crash if this priority is above portSYSCALL INTERRUPT PRIORITY Interrupts that use the SAFERTOS API must be assigned a numeric priority of 191 or a numerically higher value to give them an interrupt priority equal to or lower than 191 Only API functions that end in FromISR or FROM ISR
10. ocuments and explains how the demo applications are configured so the configuration can be copied or replicated for real applications 1 1 1 Use in Safety Related Systems Its small size and simplicity makes SAFERTOS ideal for use in a wide range of embedded application areas including those that require safety certification SAFERTOS has been independently certified to ease application certification especially in industrial and medical applications Users can buy a separate Design Assurance Pack which contains complete certification evidence for IEC61508 Reference 3 SIL3 and FDA510 k Refer to the SAFERTOS User Manual and http www SafeRTOS com for more information on using SAFERTOS in safety related systems 1 1 22 File Systems USB Drivers and TCP IP Protocol Suites http www SafeRTOS com also provides information on the range of tightly integrated file systems USB drivers and TCP IP stacks that can be purchased separately for use with SAFERTOS Using SAFERTOS from ROM on Issue 1 0 Page 4 Stellaris Microcontrollers THE INFORMATION CONTAINED IN THIS DOCUMENT IS PROPRIETARY AND SUBJECT TO THE RESTRICTIONS ON THE COVER PAGE Copyright date as document date 5 2 INSTALLATION Using SAFERTOS from ROM on Issue 1 0 Page 5 Stellaris Microcontrollers THE INFORMATION CONTAINED IN THIS DOCUMENT IS PROPRIETARY AND SUBJECT TO THE RESTRICTIONS ON THE COVER PAGE Copyright date as document
11. onstants to be used for each address Listing 1 demonstrates how the constants can be used Again see the provided demo applications for example vector table definitions that can be used as a reference or simply copied Table 2 1 Vector Table Definitions Required to Use SAFERTOS From ROM Vector Required Definition SVCall vSafeRTOS_SVC_Handler_Address PendSV vSafeRTOS PendSV Handler Address SysTick vSafeRTOS SysTick Handler Address Using SAFERTOS from ROM on Issue 1 0 Page 6 Stellaris Microcontrollers THE INFORMATION CONTAINED IN THIS DOCUMENT IS PROPRIETARY AND SUBJECT TO THE RESTRICTIONS ON THE COVER PAGE Copyright date as document date 4 7 1 WITTENSTEIN Include the header file that contains the addresses of the SafeRTOS interrupt handlers include SafeRTOS API h JKR KK k k kk k k k k k k k k k k k k k k k k k k k k k k k k k k k k k k k k k k k AA k k k k k k k k k k k k ko kk k k k A k ke The vector table 77 S EE KK K k k kk kk kk kk KC Kk Ck kk kk Ck k ee ee k k k kk k k k k kk attribute section isr vector GCC syntax for demonstration only void const g pfnVectors void t void amp vStackTop The initial stack pointer ResetISR The reset handler NmiSR The NMI handler FaultISR The hard fault handler IntDefaultHandler The MPU fault handler IntDefaultHandler The bus fault handler
Download Pdf Manuals
Related Search
Related Contents
Manual del usuario SOYO SY-K7VTA User's Manual BALANÇA COMPUTADORA DIGITAL MODELO Russound Advantage Hi-Fi SP-H8TT Speaker - 2-way Speaker P10~11 Samsung HT-D550W User Manual velvet - Mac para FHG Operation Manual TP-Link TD-W8960N V5 Quick Installation Guide Copyright © All rights reserved.
Failed to retrieve file