当前位置:网站首页>Dead loop in FreeRTOS task function
Dead loop in FreeRTOS task function
2022-07-06 11:59:00 【Weiyuan escort agency】
The task function is an infinite loop function with no return value .
The task must be an endless cycle , Otherwise, the task will pass LR return , If LR Pointing to illegal memory will generate HardFault_Handler, and FreeRTOS Point to a dead cycle , Then the task will be executed in the dead loop after it returns , Such a task is not safe .
This should be avoided when programming , Tasks are usually closed-loop and have no return value .
If it's a single task , Delete after one execution , It will not affect the operation of the system , therefore , Remember to delete tasks that are only executed once after execution . namely At the end of the mission , add vTaskDelete(NULL).
In the circular task The delay function must use FreeRTOS The delay function provided inside , We can't use the kind of delay in bare metal programming . The difference between these two delays is FreeRTOS The delay inside is blocking delay , That is to call vTaskDelay() Function , The current task will be suspended , The scheduler switches to other ready tasks , So as to realize multitasking . If you still use the delay in bare metal programming , Then the whole task becomes an endless cycle , If it happens, the priority of this task is the highest , Then the system will always run in this task , Tasks with lower priority cannot be run , There is no way to multitask .
When the task enters the delay , Because there is no other user task ready , Then the system will enter idle tasks , Idle tasks are FreeRTOS A task started by the system itself , The lowest priority . When the whole system has no ready task , The system must ensure that there is a task running , Idle tasks are designed for this . When the user task delay expires , It will switch back from idle task to user task .
边栏推荐
- 高通&MTK&麒麟 手機平臺USB3.0方案對比
- 【Flink】CDH/CDP Flink on Yarn 日志配置
- MySQL数据库面试题
- Raspberry pie tap switch button to use
- Kaggle竞赛-Two Sigma Connect: Rental Listing Inquiries(XGBoost)
- Correspondence between STM32 model and contex M
- 2019 Tencent summer intern formal written examination
- MySQL realizes read-write separation
- C语言回调函数【C语言】
- arduino JSON数据信息解析
猜你喜欢

FTP file upload file implementation, regularly scan folders to upload files in the specified format to the server, C language to realize FTP file upload details and code case implementation

物联网系统框架学习

機器學習--線性回歸(sklearn)

STM32型号与Contex m对应关系

Basic knowledge of lithium battery

共用体(union)详解【C语言】

Reno7 60W super flash charging architecture

荣耀Magic 3Pro 充电架构分析

arduino JSON数据信息解析
![[yarn] CDP cluster yarn configuration capacity scheduler batch allocation](/img/85/0121478f8fc427d1200c5f060d5255.png)
[yarn] CDP cluster yarn configuration capacity scheduler batch allocation
随机推荐
MySQL START SLAVE Syntax
Analysis of charging architecture of glory magic 3pro
[BSidesCF_2020]Had_ a_ bad_ day
[mrctf2020] dolls
Bubble sort [C language]
Stage 4 MySQL database
【Flink】CDH/CDP Flink on Yarn 日志配置
Password free login of distributed nodes
Détails du Protocole Internet
Raspberry pie tap switch button to use
mysql实现读写分离
STM32 如何定位导致发生 hard fault 的代码段
[yarn] CDP cluster yarn configuration capacity scheduler batch allocation
Kaggle竞赛-Two Sigma Connect: Rental Listing Inquiries(XGBoost)
Yarn installation and use
[Presto] Presto parameter configuration optimization
共用体(union)详解【C语言】
R & D thinking 01 ----- classic of embedded intelligent product development process
Linux yum安装MySQL
C language callback function [C language]