ChibiOS简介1/5

ChibiOS简介1/5

  • 1. 源由
  • 2. ChibiOS基础知识1/5
    • 2.1 Chapter 1 - Introduction
      • 2.1.1 Priciple(设计原则)
      • 2.1.2 Fundamental requirements(基本需求)
    • 2.2 Chapter 2 - Real Time Systems Concepts
      • 2.2.1 System(系统)
      • 2.2.2 Classification(分类)
      • 2.2.3 Jitter(抖动)
    • 2.3 Chapter 3 - Embedded RTOSes
      • 2.3.1 Priorities(优先级)
      • 2.3.2 Scheduling(调度)
      • 2.3.3 Interrupts(中断)
      • 2.3.4 Tasks and Threads(任务和线程)
      • 2.3.5 Task Types(任务类型)
      • 2.3.6 Synchronization(同步)
      • 2.3.7 Atomic Operations(原子操作)
      • 2.3.8 Critical Sections(临界区域)
  • 3. 参考资料

1. 源由

作为后续研读Ardupilot的ChibiOS的垫脚石,先了解下ChibiOS系统。


Ardupilot ChibiOS项目: https://github.com/ArduPilot/ChibiOS

Artery(AT32) porting项目: //Artery官网没有相关porting动作,不过开源github有相关项目。

  • https://github.com/dron0gus/artery
  • https://github.com/dron0gus/ChibiOS

2. ChibiOS基础知识1/5

2.1 Chapter 1 - Introduction

2.1.1 Priciple(设计原则)

  • Elegant
  • Fast
  • Small
  • Static

2.1.2 Fundamental requirements(基本需求)

  • Focus for code elegance and consistency, it must be a pleasure to work with the code.
  • Fully, unambiguously static.
  • Short code paths for all operations, it has to be really fast.
  • Compact.
  • Feature complete.
  • Strong abstraction.

2.2 Chapter 2 - Real Time Systems Concepts

2.2.1 System(系统)

A complex systems can always be decomposed in a set of elementary processes connected in a network, the system has a set of input and output signals, we can still consider them events and reactions but on a system level. A system can also have a global state, information that can optionally be accessed by the various processes in the system.

在这里插入图片描述

2.2.2 Classification(分类)

  • Non Real Time(非实时). A non real time system is a system where there are no deadlines involved. Non realtime systems could be described as follow:

“A non real time system is a system where the programmed reaction to an event will certainly happen sometime in the future”.

  • Soft Real Time(软实时). A Soft Real Time (SRT) system is a system where not meeting a deadline can have undesirable but not catastrophic effects, a performance degradation for example. Such systems could be described as follow:

“A soft real time system is a system where the programmed reaction to an event is almost always completed within a known finite time”.

  • Hard Real Time(硬实时). An Hard Real Time (HRT) system is a system where not meeting a deadline can have catastrophic effects. Hard realtime systems require a much more strict definition and could be described as follow:

“An hard real time system is a system where the programmed reaction to an event is guaranteed to be completed within a known finite time”.

2.2.3 Jitter(抖动)

Processes never react in a constant time, at a sufficiently small time scale any physical process is bound to have jitter. Unbounded or not assessed jitter is not compatible with an hard realtime system.

在这里插入图片描述

2.3 Chapter 3 - Embedded RTOSes

2.3.1 Priorities(优先级)

  • Static Priorities are usually assigned statically and cannot be changed at runtime.

  • Modifiable Priorities allow for priority to change at runtime in order to implement particular scheduling strategies.
    在这里插入图片描述

2.3.2 Scheduling(调度)

The scheduling rule is very simple: in any instant, the task being executed is the ready task with the highest priority level. This is true for both tasks and ISRs in the proposed model.

2.3.3 Interrupts(中断)

Interrupts trigger directly ISRs which in turn can wakeup tasks.

在这里插入图片描述在这里插入图片描述Note: If interrupts processing is an important requirement for your system then you should look for an RTOS/core combination able to efficiently handle nested interrupts on a dedicated interrupts stack.

2.3.4 Tasks and Threads(任务和线程)

Tasks are the fundamental entities in an RTOS environment. A task can be seen as a virtual CPU inside the system with its own registers bank and stack area. Tasks are scheduled by the RTOS based on their priority as described before. Some RTOSes, like ChibiOS for example, use the term threads for their tasks.

在这里插入图片描述

2.3.5 Task Types(任务类型)

  • Periodic Tasks, a periodic task is a task triggered periodically with a fixed time interval. The task is mostly waiting and becomes ready for execution when its internal timer triggers it. The task then performs a brief action and returns to the waiting state.

  • Non-periodic Tasks, this kind of tasks are triggered by an external event, for example an ISR, and are thus not periodic. After performing its programmed action the task returns to the waiting state.

  • Continuous Tasks, tasks should never take the CPU indefinitely, a task running an empty loop would not allow the execution of tasks at lower priority level. The rule is that tasks should wait for events, do their programmed action and then go back to waiting for events. If there are tasks that never release the CPU resource then those must be placed at lowest priority level in the system.

2.3.6 Synchronization(同步)

Usually tasks can use areas of memory as shared data, usually also called Shared Resources, the concurrent access to resources can lead to corruption of said data because the operations performed by tasks may be not atomic.

2.3.7 Atomic Operations(原子操作)

The safest approach is to consider everything not atomic. Failure to understand atomicity and implement proper mutual exclusion is the recipe for disaster, errors are usually random in nature and very hard to detect and debug. Ideally the problem must be resolved in the analysis and design phases by carefully defining the shared resources and defining correct protocols for concurrent access.

Most RTOSes have a specific API for handling of critical sections, the right approach is to use the RTOS-provided API and not make assumptions about how critical sections are or should be implemented. A good RTOS should take care about the best implementation on any given architecture.

2.3.8 Critical Sections(临界区域)

Critical Sections (or critical zones) are probably the most simple and common way to make a non-atomic sequence of code behave atomically.

3. 参考资料

【1】ArduPilot开源飞控系统之简单介绍
【2】 ChibiOS官方文档

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.mzph.cn/news/208193.shtml

如若内容造成侵权/违法违规/事实不符,请联系多彩编程网进行投诉反馈email:809451989@qq.com,一经查实,立即删除!

相关文章

flutter TextPainter 的用法

本文章基于 Flutter 3.16.2 Dart SDK 3.2.2。 TextPainter 是 Flutter 中用于在 Canvas 上绘制文本的类。它允许您在自定义的 CustomPainter 中使用 drawText 方法来绘制文本,并可以控制文本的位置、颜色、字体等属性。 import package:flutter/material.dart;cla…

【NEON】学习资料汇总

一、资料链接 Guide : http://www.heenes.de/ro/material/arm/DEN0018A_neon_programmers_guide_en.pdf csdn博文1,基础案例: https://blog.csdn.net/kakasxin/article/details/103912832? csdn博文2,内部函数: ht…

css 输入框动态特效

先上图 代码 <!DOCTYPE html> <html lang"en"> <head><meta charset"UTF-8"><title>css 输入框动效</title><style>.inputBox {position: relative;width: 250px;}.inputBox input {width: 100%;padding: 10px…

使用git push太慢怎么办

使用git push太慢怎么办 修改host文件&#xff1a; windows 的路径应该在 C:\Windows\System32\drivers\etc\hosts 在host文件的最后一行加上 151.101.72.249 github.global.ssl.fastly.nethost不允许修改就复制一份&#xff0c;修改好了再替换掉&#xff0c;可能会让你输入…

028:简单的foreach

028:简单的foreach 总时间限制: 1000ms 内存限制: 65536kB 描述 编写MyForeach模板&#xff0c;使程序按要求输出 不得编写 MyForeach函数 #include <iostream> #include <string> using namespace std; // 在此处补充你的代码 void Print(string s) {cout <…

【面试经典150 | 二叉树】对称二叉树

文章目录 写在前面Tag题目来源解题思路方法一&#xff1a;递归方法二&#xff1a;迭代 写在最后 写在前面 本专栏专注于分析与讲解【面试经典150】算法&#xff0c;两到三天更新一篇文章&#xff0c;欢迎催更…… 专栏内容以分析题目为主&#xff0c;并附带一些对于本题涉及到的…

第6讲、Hyper-V体系结构和相关管理程序文件及服务:

1、Hyper-V的体系结构 1、CPU能力在服务器虚拟化实现中扮演着一个重要角色&#xff0c;Intel/AMD型号的CPU定义了一些权限 级别&#xff0c;称为ring。在传统模型中&#xff0c;ring0级别最高权限最大。Windows内核和设备驱动程序 使用这个级别…

【优选算法系列】【专题一双指针】第三节.611. 有效三角形的个数和LCR 179. 查找总价格为目标值的两个商品

文章目录 前言一、有效三角形的个数 1.1 题目描述 1.2 题目解析 1.2.1 算法原理 1.2.2 代码编写 1.2.3 题目总结二、查找总价格为目标值的两个商品 2.1 题目描述 2.2 题目解析 2.2.1 算法原理 …

0008-【PID学习笔记 8 】控制系统的分析方法

写在前面 前面已经完成了控制系统的性能指标学习&#xff0c;从这节开始继续学习控制系统的分析方法&#xff0c;本文重点介绍分析方法概述和时域分析法。 一、控制系统的基本分析方法 控制系统的基本分析方法包括&#xff1a; 古典方法&#xff08;经典控制理论&#xff09;…

独孤思维:赚钱需要独一无二的支点,而不是技多不压身的堆料

赚钱需要找到属于自己独一无二&#xff0c;且超乎常人的支点&#xff0c;而不应该一味追求大而全&#xff0c;技多不压身的堆料。 凡是考了一堆证书&#xff0c;以为掌握多项技能&#xff0c;就能赚到钱的都是学生思维。 尤其是很多刚入职场的年轻人&#xff0c;为了职场晋升…

2024山东健博会,济南健康展,5月中国大健康展,健康管理展

China-DJK山东健博会&#xff1a;5月黄金招商季&#xff0c;携千家参展商、万余款产品精彩亮相&#xff1b; DJK 2024第6届中国&#xff08;济南&#xff09;国际大健康产业博览会 The 2024 sixth China (Jinan) International Big Health Industry Expo 时间&#xff1a;2024…

LLaMA-Factory微调ChatGLM3报错: Segmentation fault (core dumped)

SFT训练模型的命令 CUDA_VISIBLE_DEVICES0 python src/train_bash.py \--stage sft \--model_name_or_path models/chatglm3-6b \--do_train \--dataset self_cognition \--template chatglm3 \--finetuning_type lora \--lora_target query_key_value \--output_dir output/c…

Docker网络原理

Docker网络概述 1.桥接模式介绍 bridge模式是docker的默认网络模式。 桥接模式是一种用于连接两个不同网络段的设备&#xff0c;使它们能够共享通信的一种方式。 桥接设备工作在OSI模型的第二层&#xff0c;即数据链路层&#xff0c;通常基于MAC地址进行帧转发。 物理层连接…

一个简单的 postman设置接口关联让我措施了大厂的机会

postman设置接口关联 在实际的接口测试中&#xff0c;后一个接口经常需要用到前一个接口返回的结果&#xff0c; 从而让后一个接口能正常执行&#xff0c;这个过程的实现称为关联。 在postman中实现关联操作的步骤如下&#xff1a; 1、利用postman获取上一个接口指定的返回值…

YOLOv8 YoLov8l 模型输出及水果识别

&#x1f368; 本文为[&#x1f517;365天深度学习训练营学习记录博客 &#x1f366; 参考文章&#xff1a;365天深度学习训练营 &#x1f356; 原作者&#xff1a;[K同学啊 | 接辅导、项目定制] &#x1f680; 文章来源&#xff1a;[K同学的学习圈子](https://www.yuque.com/m…

LeetCode双指针:有序数组中的单一元素

LeetCode双指针&#xff1a;有序数组中的单一元素 题目描述 给你一个仅由整数组成的有序数组&#xff0c;其中每个元素都会出现两次&#xff0c;唯有一个数只会出现一次。 请你找出并返回只出现一次的那个数。 你设计的解决方案必须满足 O(log n) 时间复杂度和 O(1) 空间复…

关于什么是 JVM

关于什么是 JVM&#xff0c;看看普通⼈和⾼⼿的回答。 普通人 JVM 就是 Java 虚拟机&#xff0c;是⽤来运⾏我们平时所写的 Java 代码的。优点是它会 ⾃动进⾏内存管理和垃圾回收&#xff0c;缺点是⼀旦发⽣问题&#xff0c;要是不了解 JVM 的运⾏ 机制&#xff0c; 就很难…

是谁还没玩AI扩图?快跟上节奏啦

最近&#xff0c;抖音上的AI扩图突然火了&#xff0c;看完真的让人笑掉大牙&#xff5e;&#xff5e;&#xff5e; 这一热议的话题#AI扩图#在短视频平台抖音上的播放量已经突破7.8亿次&#xff0c;而相关的讨论也如同星火燎原&#xff0c;迅速点燃了公众的好奇心。从“用AI扩图…

中伟视界:皮带跑偏、异物检测AI算法除了矿山行业应用,还能在钢铁、火电、港口等行业中使用吗?

随着工业化的发展&#xff0c;皮带输送机已经成为各行业中不可或缺的重要设备&#xff0c;但是在使用过程中&#xff0c;由于各种原因&#xff0c;皮带常常出现跑偏问题&#xff0c;给生产运营带来了诸多困扰。不仅仅是矿山行业&#xff0c;钢铁、火电、港口等行业也都面临着皮…

C语言 扫雷游戏

代码在一个项目里完成&#xff0c;分成三个.c.h文件(game.c,game.h,main.c) 在Clion软件中通过运行调试。 /大概想法/ 主函数main.c里是大框架(菜单,扫雷棋盘初始化&#xff0c;随机函数生成雷&#xff0c;玩家扫雷) game.h函数声明(除main函数和游戏函数外的一些函数声明) ga…