收藏 分享(赏)

汽车编程-Using the TASKING RTOS for TriCore.pdf

上传人:软件交流联系1171677800 文档编号:6257029 上传时间:2022-07-27 格式:PDF 页数:140 大小:1.62MB
下载 相关 举报
汽车编程-Using the TASKING RTOS for TriCore.pdf_第1页
第1页 / 共140页
汽车编程-Using the TASKING RTOS for TriCore.pdf_第2页
第2页 / 共140页
汽车编程-Using the TASKING RTOS for TriCore.pdf_第3页
第3页 / 共140页
汽车编程-Using the TASKING RTOS for TriCore.pdf_第4页
第4页 / 共140页
汽车编程-Using the TASKING RTOS for TriCore.pdf_第5页
第5页 / 共140页
亲,该文档总共140页,到这儿已超出免费预览范围,如果喜欢就下载吧!
资源描述

1、Using the TASKING RTOS forTriCoreMA160-700 (v1.0) November 13, 2017Copyright 2017 TASKING BV.All rights reserved.You are permitted to print this document provided that (1) the use of such is for personal use onlyand will not be copied or posted on any network computer or broadcast in any media, and

2、(2) no modifications of thedocument is made. Unauthorized duplication, in whole or part, of this document by any means, mechanical or electronic,including translation into another language, except for brief excerpts in published reviews, is prohibited without theexpress written permission of TASKING

3、 BV. Unauthorized duplication of this work may also be prohibited by localstatute.Violators may be subject to both criminal and civil penalties, including fines and/or imprisonment. Altium,TASKING, and their respective logos are registered trademarks of Altium Limited or its subsidiaries. All other

4、registeredor unregistered trademarks referenced herein are the property of their respective owners and no trademark rights tothe same are claimed.Table of ContentsManual Purpose and Structure . vii1. Introduction to the RTOS Kernel . 11.1. Real-time Systems . 11.2. Real-time Operating System . 11.3.

5、 ISO 17356 . 21.3.1. Operating Sytem (OS) . 21.3.2. Communication (COM) . 31.3.3. Implementation Language (OIL) . 31.3.4. Run Time Interface (ORTI) . 31.3.5.The ISO 17356 Documentation . 31.4. The TASKING RTOS . 31.4.1.Why Using the TASKING RTOS? . 42. Getting Started . 52.1.What is an RTOS Project?

6、 . 52.2. Creating an RTOS Project . 72.3. Configuring the RTOS Objects and Attributes . 82.4. Generate RTOS Code . 102.5.TASKING RTOS Configurator Preferences . 112.6. Edit the Application Files . 112.7. Set the Project Options . 122.8. How to Build an RTOS Application . 132.9. How to Debug an RTOS

7、Application . 133. RTOS Objects and Attributes . 153.1.What are the OIL System Objects? . 153.1.1. Standard and Non-Standard Attributes . 153.1.2. Overview of System Objects and Attributes . 153.1.3. Non-Standard Attributes for the TriCore . 174. Startup Process . 194.1. Introduction . 194.2. System

8、 Boot . 194.3.The main() Module . 204.3.1. What are Application Modes? . 204.4. RTOS Initialization . 204.5. Shut-down Process . 214.6. API Service Restrictions . 235. Task Management . 255.1. What is a Task? . 255.2. Defining a Task in the C Source . 255.3.The States of a Task . 265.4.The Priority

9、of a Task . 265.4.1.Virtual versus Physical Priorities . 275.4.2. Fast Scheduling . 295.5. Activating and Terminating a Task . 295.6. Scheduling a Task . 325.6.1. Full-preemptive Tasks . 325.6.2. Nonpreemptive Tasks . 335.6.3. Scheduling Policy . 335.7.The Stack of a Task . 36iii5.8. C Interface for

10、 Tasks . 376. Events . 396.1. Introduction . 396.2. Adding Events . 396.3. Using Events . 406.4. The C Interface for Events . 447. Resource Management . 477.1. Key Concepts . 477.2. What is a Resource? . 487.3.The Ceiling Priority Protocol . 557.3.1. Priority Inversion . 557.3.2. Deadlocks . 567.3.3

11、. Description of The Priority Ceiling Protocol . 567.4. Grouping Tasks . 587.5.The Scheduler as a Special Resource . 617.6.The C Interface for Resources . 628. Alarms . 638.1. Introduction . 638.2. Counters . 638.2.1.What is a Counter? . 638.2.2.The RTOS System Counter . 648.3. What is an Alarm? . 6

12、68.4.The C Interface for Alarms . 719. Interrupts . 739.1. Introduction . 739.2. The ISR Object . 739.2.1.The ISR Non-Standard Attribute LEVEL . 749.3. Defining an Interrupt in the C Source . 749.4.The Category of an ISR Object . 749.5. Nested ISRs . 759.6. ISRs and Resources . 769.7. ISRs and Messa

13、ges . 789.8. Interrupt Disable/Enable Services . 799.8.1. Disable/Enable All Interrupts . 799.8.2. Suspend/Resume All Interrupts . 819.8.3. Suspend/Resume OS Interrupts . 829.9.The C Interface for Interrupts . 8310. Communication . 8510.1. Introduction . 8510.2. Basic Concepts . 8610.3. Configuring

14、Messages . 8710.4. Message Transmission . 9010.4.1. Sending a Message . 9010.4.2. How to Define the Data Type of a Message . 9010.4.3. Receiving a Message . 9110.4.4. Initializing Unqueued Messages . 9410.4.5. Long versus Short Messages . 9710.5. Message Notification . 9710.5.1. Notification Example

15、: Activate Task . 9810.5.2. Notification Example: Set Event . 100ivUsing the TASKING RTOS for TriCore10.5.3. Notification Example: Flag . 10010.5.4. Notification Example: Callback . 10310.6. Starting and Ending the COM . 10410.6.1. Starting the COM . 10410.6.2. Starting the COM Extension . 10510.6.3

16、. Stopping the COM . 10510.7. The C Interface for Messages . 10611. Error Handling . 10711.1. Introduction . 10711.2. Error Handling . 10711.2.1. Standard Versus Extended Status . 10711.2.2. Fatal Errors . 10811.2.3. The ErrorHook Routine . 10811.2.4. The COMErrorHook Routine . 11211.3. Debug Routin

17、es . 11411.4. RTOS Configuration Examples . 11512. Debugging an RTOS Application . 11712.1. Introduction . 11712.2. How to Debug the System Status . 11712.3. How to Debug Tasks . 11912.4. How to Debug Resources . 12012.5. How to Debug Alarms . 12112.6. How to Debug ISRs . 12112.7. How to Debug Messa

18、ges . 12212.8. How to Debug Contexts . 12212.9. How to Debug Stacks . 12313. Implementation Parameters . 12513.1. Introduction . 12513.2. Functionality Implementation Parameters . 12513.3. Performance Implementation Parameters . 12713.3.1. ISR Latency . 12713.3.2. Context Switch Latency . 12813.3.3.

19、 System Timer Latency . 129vUsing the TASKING RTOS for TriCore软件下载:https:/ 提取码:uo1z viUsing the TASKING RTOS for TriCoreManual Purpose and StructureManual PurposeThis manual aims to provide you with the necessary information to build real-time applications using theRTOS (Real Time Operating System)

20、micro kernel delivered with the toolset.This kernel implementsdesignated parts of the ISO 17356 standard.After reading the document, you should: know how the RTOS is implemented by Altium, understand the benefits of using the RTOS, know how to build real-time RTOS applications, be able to customize

21、RTOS settings in the Eclipse IDE to your project needs, be familiar with the most relevant RTOS concepts, know how to debug RTOS applications.This manual assumes that you have already read the Users Manual of the toolset documentation. The manual leads you through the hottest topics of configuring a

22、nd building RTOS applications, overview of the functionality, design hints, debugging facilities and performance.This manual expects you to have gone through the main topics of the online ISO 17356 standard documents. These documents should be, in fact, a constant reference during the reading of thi

23、s manual. Please refer to Manual StructureChapter 1, Introduction to the RTOS KernelProvides an introduction to the RTOS real-time multitasking kernel and provides a high-level introduction to real-time concepts.Chapter 2, Getting StartedContains an overview of the files (and their interrelations) i

24、nvolved in every RTOS application and includes a self explanatory diagram of the development process as a whole. Describes also how you can build your very first RTOS application guiding you step by step through the process.Chapter 3, RTOS Objects and AttributesDescribes the available RTOS objects a

25、nd attributes you can configure in the TASKING RTOS Configurator.viiChapter 4, Startup ProcessOpens the black-box of what happens in the system since application reset until the first application taskis scheduled and describes how you can interact with the start-up process by customizing certain Hoo

26、kRoutines.Chapter 5, Task ManagementExplains how the RTOS manages tasks ( scheduling policies, tasks states, .) and describes how youcan declare TASK objects in the TASKING RTOS Configurator in order to optimize your task configuration.Chapter 6, EventsExplains how the RTOS may synchronize tasks via

27、 events and describes how you can declare EVENTobjects in the TASKING RTOS Configurator in order to optimize your event configuration.Chapter 7, Resource ManagementExplains how the RTOS performs resource management (resource occupation, ceiling priority protocol,internal resources,. ) and describes

28、how you can declare RESOURCE objects in the TASKING RTOSConfigurator in order to optimize your resource configuration.Chapter 8, AlarmsDescribes how the RTOS offers alarm mechanisms based on counting specific recurring events anddescribes how you can declare these objects in the TASKING RTOS Configu

29、rator in order to optimizeyour alarm configuration.Chapter 9, InterruptsDescribes how you can declare ISR objects in the TASKING RTOS Configurator in order to optimize theinterrupt configuration.Chapter 10, CommunicationDescribes the communication services to offer you a robust and reliable way of d

30、ata exchange betweentasks and/or interrupt service routines and how you can declare MESSAGE and COM objects in theTASKING RTOS Configurator.Chapter 11, Error HandlingHelps you to understand the available debug facilities and error checking possibilities. Describes whichservices and mechanisms are av

31、ailable to handle errors in the system and how you can interact withthem by means of customizing certain Hook Routines.Chapter 12, Debugging an RTOS ApplicationExplains how you can debug RTOS information and describes in detail all the information that you canobtain.viiiUsing the TASKING RTOS for Tr

32、iCoreChapter 13, Implementation ParametersThe implementation parameters provide detailed information concerning the functionality, performanceand memory demand. From the implementation parameters you can obtain information about the impactof the RTOS on your application.ixManual Purpose and Structur

33、exUsing the TASKING RTOS for TriCoreChapter 1. Introduction to the RTOS KernelThis chapter provides an introduction to the RTOS real-time multitasking kernel and provides a high-levelintroduction to real-time concepts.1.1. Real-time SystemsA real-time system is used when there are rigid timing requi

34、rements on the operations of a processor toperform certain tasks. Real-time applications perform an action or give an answer to an external eventin a timely and predictable manner.They cover a wide range of tasks with different time dependencies.The timing requirements of actions usually differ betw

35、een real-time applications; what may be fast forone application may be slow or late for another. In all cases, there should be well-defined time requirements.The concept of predictability for real-time applications generally means that a task or set of tasks mustalways be completed within a predeter

36、mined amount of time. Depending on the situation, an unpredictablereal-time application can result in loss of data or loss of deadlines.There are two flavors of real-time systems: A hard real-time system must guarantee that critical tasks complete on time. Processing must be donewithin the defined c

37、onstraints or the system will fail. A soft real-time system is less restrictive. In a soft real-time system, failure to produce the correctresponse at the correct time is also undesirable but not fatal.Many real-time applications require high I/O throughput while still guaranteeing a fast response t

38、ime toasynchronous external events.The ability to schedule tasks rapidly and implement secure communicationmechanisms among multiple tasks becomes crucial.Real-time applications are usually characterized by a blend of requirements. Some parts of the applicationmay consist of hard, critical tasks whi

39、ch must meet their deadlines. In reality, most applications consistof tasks with both hard and soft real-time constraints.The key to a successful real-time application is yourability to accurately define application requirements at every point in the program.1.2. Real-time Operating SystemAs explain

40、ed, most applications consist of tasks with both hard and soft real-time constraints. If thesetasks are single purposed, you could implement them as semi-independent program segments. Still youwould need to embed the processor allocation logic inside the application tasks. Implementations of thiskin

41、d typically take the form of a control loop that continually checks for tasks to execute. Such techniquessuffer from numerous problems and do not represent a solution for regular real-time applications. Besides,they complicate the maintenance and reusability of the software.A Real Time Operating Sys

42、tem (RTOS) is a dedicated operating system fully designed to overcome thetime constraints of a real-time system. An RTOS, like any other operating system, provides an environmentin which you can execute programs in a convenient and structured manner, but without the risk of failingthe real-time cons

43、traints.1In general, the benefits of using an RTOS are: An RTOS eliminates the need for processor allocation in the application software. Modifications, or additions of completely new tasks can be made in the application software withoutaffecting critical system response requirements. Besides managi

44、ng task execution, most real-time operating systems also provide facilities that includetask communication, task synchronization, timers, memory management etc. An RTOS hides the underlying hardware specific concerns to the user offering a run-time environmentthat is completely independent of the ta

45、rget processor. Easy migration to other targets (provided that the RTOS vendor offers support for these other processorfamilies).1.3. ISO 17356ISO 17356 is the open interface for embedded automotive applications. Although the ISO 17356 standardswere originally developed for the automotive industry,

46、the resulting specifications describe a small real-timeOS ideal for most embedded systems that are statically defined, i.e. with no dynamic (run-time) allocationof memory.The ISO 17356 specification consists of several documents:- operating systemOS- communicationCOM- network monitoring (not discuss

47、ed in this manual)NM- implementation languageOILAn ISO 17356 implementation refers to a particular implementation of one or more of the standards.These standards tend to define the minimum requirements for a compliant system but individualimplementations can vary because of different processor requi

48、rements and/or capabilities.1.3.1. Operating Sytem (OS)The specification of the OS covers a pool of services and processing mechanisms.The operating systemcontrols the real-time execution in concurrent executing applications and provides you with a dedicatedprogramming environment.The architecture o

49、f the OS distinguishes three processing levels: an interruptlevel, a logical level for operating system activities and a task level.The interrupt level is assigned higherpriorities than the task level.In addition to the management of the processing levels, the operating system offers also system ser

50、vicesto manage tasks, events, resources, counters, alarms, and to handle errors.You can consider systemservices as library functions in C.2Using the TASKING RTOS for TriCore1.3.2. Communication (COM)The communication specification provides interfaces for the transfer of data within vehicle networks

展开阅读全文
相关资源
相关搜索

当前位置:首页 > 生活休闲 > 服装首饰

本站链接:文库   一言   我酷   合作


客服QQ:2549714901微博号:文库网官方知乎号:文库网

经营许可证编号: 粤ICP备2021046453号世界地图

文库网官网©版权所有2025营业执照举报