{"id":721,"date":"2026-04-01T12:40:37","date_gmt":"2026-04-01T04:40:37","guid":{"rendered":"https:\/\/monykate.com\/index.php\/2026\/04\/01\/freertos-%e5%ae%9e%e6%97%b6%e6%93%8d%e4%bd%9c%e7%b3%bb%e7%bb%9f%e8%af%a6%e8%a7%a3\/"},"modified":"2026-04-01T12:40:37","modified_gmt":"2026-04-01T04:40:37","slug":"freertos-%e5%ae%9e%e6%97%b6%e6%93%8d%e4%bd%9c%e7%b3%bb%e7%bb%9f%e8%af%a6%e8%a7%a3","status":"publish","type":"post","link":"https:\/\/monykate.com\/index.php\/2026\/04\/01\/freertos-%e5%ae%9e%e6%97%b6%e6%93%8d%e4%bd%9c%e7%b3%bb%e7%bb%9f%e8%af%a6%e8%a7%a3\/","title":{"rendered":"FreeRTOS \u5b9e\u65f6\u64cd\u4f5c\u7cfb\u7edf\u8be6\u89e3"},"content":{"rendered":"<p># FreeRTOS \u5b9e\u65f6\u64cd\u4f5c\u7cfb\u7edf\u8be6\u89e3<\/p>\n<p>## \u4ec0\u4e48\u662f FreeRTOS\uff1f<\/p>\n<p>FreeRTOS\uff08Free Real-Time Operating System\uff09\u662f\u4e00\u4e2a\u5f00\u6e90\u7684\u5b9e\u65f6\u64cd\u4f5c\u7cfb\u7edf\u5185\u6838\uff0c\u4e13\u4e3a\u5d4c\u5165\u5f0f\u8bbe\u5907\u8bbe\u8ba1\u3002\u5b83\u8f7b\u91cf\u7ea7\u3001\u53ef\u79fb\u690d\u3001\u6613\u4e8e\u4f7f\u7528\uff0c\u662f\u76ee\u524d\u5168\u7403\u6700\u6d41\u884c\u7684\u5d4c\u5165\u5f0f RTOS \u4e4b\u4e00\u3002<\/p>\n<p>FreeRTOS \u7531 Richard Barry \u4e8e 2003 \u5e74\u521b\u5efa\uff0c\u91c7\u7528 MIT \u8bb8\u53ef\u8bc1\uff0c\u5141\u8bb8\u5728\u4efb\u4f55\u5546\u4e1a\u6216\u5f00\u6e90\u9879\u76ee\u4e2d\u514d\u8d39\u4f7f\u7528\uff0c\u65e0\u9700\u652f\u4ed8\u4efb\u4f55\u7248\u7a0e\u3002<\/p>\n<p>&#8212;<\/p>\n<p>## \u6838\u5fc3\u7279\u6027<\/p>\n<p>### 1. \u62a2\u5360\u5f0f\u4efb\u52a1\u8c03\u5ea6<br \/>\nFreeRTOS \u652f\u6301\u57fa\u4e8e\u4f18\u5148\u7ea7\u7684\u62a2\u5360\u5f0f\u8c03\u5ea6\uff0c\u786e\u4fdd\u9ad8\u4f18\u5148\u7ea7\u4efb\u52a1\u80fd\u591f\u53ca\u65f6\u54cd\u5e94\u5173\u952e\u4e8b\u4ef6\u3002<\/p>\n<p>### 2. \u8f7b\u91cf\u7ea7\u5185\u6838<br \/>\n&#8211; \u6700\u5c0f\u4ee3\u7801 footprint \u53ef\u4f4e\u81f3 6KB<br \/>\n&#8211; \u6781\u4f4e\u7684 RAM \u5360\u7528<br \/>\n&#8211; \u9002\u5408\u8d44\u6e90\u53d7\u9650\u7684\u5fae\u63a7\u5236\u5668<\/p>\n<p>### 3. \u4e30\u5bcc\u7684\u7ec4\u4ef6<br \/>\n&#8211; **\u4efb\u52a1\u7ba1\u7406**\uff1a\u521b\u5efa\u3001\u5220\u9664\u3001\u6302\u8d77\u3001\u6062\u590d\u4efb\u52a1<br \/>\n&#8211; **\u4fe1\u53f7\u91cf**\uff1a\u4e8c\u8fdb\u5236\u4fe1\u53f7\u91cf\u3001\u8ba1\u6570\u4fe1\u53f7\u91cf\u3001\u4e92\u65a5\u91cf<br \/>\n&#8211; **\u6d88\u606f\u961f\u5217**\uff1a\u4efb\u52a1\u95f4\u901a\u4fe1<br \/>\n&#8211; **\u8f6f\u4ef6\u5b9a\u65f6\u5668**\uff1a\u4e00\u6b21\u6027\u6216\u5468\u671f\u6027\u5b9a\u65f6\u5668<br \/>\n&#8211; **\u4e8b\u4ef6\u7ec4**\uff1a\u591a\u4e8b\u4ef6\u540c\u6b65<br \/>\n&#8211; **\u5185\u5b58\u7ba1\u7406**\uff1a5 \u79cd\u5806\u5185\u5b58\u7ba1\u7406\u65b9\u6848<\/p>\n<p>### 4. \u5e7f\u6cdb\u7684\u786c\u4ef6\u652f\u6301<br \/>\n\u652f\u6301\u8d85\u8fc7 40 \u79cd\u5904\u7406\u5668\u67b6\u6784\uff0c\u5305\u62ec\uff1a<br \/>\n&#8211; ARM Cortex-M\/R\/A \u7cfb\u5217<br \/>\n&#8211; RISC-V<br \/>\n&#8211; ESP32<br \/>\n&#8211; PIC<br \/>\n&#8211; AVR<br \/>\n&#8211; 8051<\/p>\n<p>&#8212;<\/p>\n<p>## \u57fa\u672c\u67b6\u6784<\/p>\n<p>&#8220;`<br \/>\n\u250c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2510<br \/>\n\u2502           \u5e94\u7528\u7a0b\u5e8f\u4efb\u52a1               \u2502<br \/>\n\u251c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2524<br \/>\n\u2502     FreeRTOS \u5185\u6838 API (C \u8bed\u8a00)       \u2502<br \/>\n\u251c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2524<br \/>\n\u2502  \u4efb\u52a1\u8c03\u5ea6\u5668 | \u961f\u5217 | \u4fe1\u53f7\u91cf | \u5b9a\u65f6\u5668  \u2502<br \/>\n\u251c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2524<br \/>\n\u2502          \u786c\u4ef6\u62bd\u8c61\u5c42 (Port)           \u2502<br \/>\n\u251c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2524<br \/>\n\u2502           \u5fae\u63a7\u5236\u5668\u786c\u4ef6               \u2502<br \/>\n\u2514\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2518<br \/>\n&#8220;`<\/p>\n<p>&#8212;<\/p>\n<p>## \u5feb\u901f\u5165\u95e8\u793a\u4f8b<\/p>\n<p>### \u521b\u5efa\u4efb\u52a1<\/p>\n<p>&#8220;`c<br \/>\n#include &#8220;FreeRTOS.h&#8221;<br \/>\n#include &#8220;task.h&#8221;<\/p>\n<p>void vTaskFunction(void *pvParameters)<br \/>\n{<br \/>\n    for(;;)<br \/>\n    {<br \/>\n        \/\/ \u4efb\u52a1\u4ee3\u7801<br \/>\n        vTaskDelay(pdMS_TO_TICKS(1000)); \/\/ \u5ef6\u65f6 1 \u79d2<br \/>\n    }<br \/>\n}<\/p>\n<p>\/\/ \u521b\u5efa\u4efb\u52a1<br \/>\nxTaskCreate(<br \/>\n    vTaskFunction,      \/\/ \u4efb\u52a1\u51fd\u6570<br \/>\n    &#8220;Task1&#8221;,            \/\/ \u4efb\u52a1\u540d\u79f0<br \/>\n    1024,               \/\/ \u5806\u6808\u5927\u5c0f (\u5b57)<br \/>\n    NULL,               \/\/ \u53c2\u6570<br \/>\n    1,                  \/\/ \u4f18\u5148\u7ea7<br \/>\n    NULL                \/\/ \u4efb\u52a1\u53e5\u67c4<br \/>\n);<\/p>\n<p>\/\/ \u542f\u52a8\u8c03\u5ea6\u5668<br \/>\nvTaskStartScheduler();<br \/>\n&#8220;`<\/p>\n<p>### \u4f7f\u7528\u961f\u5217\u8fdb\u884c\u4efb\u52a1\u95f4\u901a\u4fe1<\/p>\n<p>&#8220;`c<br \/>\nQueueHandle_t xQueue;<\/p>\n<p>\/\/ \u521b\u5efa\u961f\u5217<br \/>\nxQueue = xQueueCreate(10, sizeof(int));<\/p>\n<p>\/\/ \u53d1\u9001\u6570\u636e<br \/>\nint data = 42;<br \/>\nxQueueSend(xQueue, &#038;data, portMAX_DELAY);<\/p>\n<p>\/\/ \u63a5\u6536\u6570\u636e<br \/>\nint received;<br \/>\nxQueueReceive(xQueue, &#038;received, portMAX_DELAY);<br \/>\n&#8220;`<\/p>\n<p>&#8212;<\/p>\n<p>## \u5178\u578b\u5e94\u7528\u573a\u666f<\/p>\n<p>| \u9886\u57df | \u5e94\u7528 |<br \/>\n|&#8212;&#8212;|&#8212;&#8212;|<br \/>\n| \u5de5\u4e1a\u63a7\u5236 | PLC\u3001\u7535\u673a\u63a7\u5236\u3001\u4f20\u611f\u5668\u7f51\u7edc |<br \/>\n| \u6d88\u8d39\u7535\u5b50 | \u667a\u80fd\u5bb6\u5c45\u3001\u53ef\u7a7f\u6234\u8bbe\u5907 |<br \/>\n| \u6c7d\u8f66\u7535\u5b50 | ECU\u3001\u8f66\u8f7d\u4fe1\u606f\u5a31\u4e50\u7cfb\u7edf |<br \/>\n| \u533b\u7597\u8bbe\u5907 | \u76d1\u62a4\u4eea\u3001\u8f93\u6db2\u6cf5 |<br \/>\n| \u7269\u8054\u7f51 | \u7f51\u5173\u3001\u8fb9\u7f18\u8ba1\u7b97\u8282\u70b9 |<\/p>\n<p>&#8212;<\/p>\n<p>## \u4f18\u52bf\u4e0e\u5c40\u9650<\/p>\n<p>### \u2705 \u4f18\u52bf<br \/>\n&#8211; **\u514d\u8d39\u5f00\u6e90**\uff1aMIT \u8bb8\u53ef\u8bc1\uff0c\u65e0\u5546\u4e1a\u9650\u5236<br \/>\n&#8211; **\u6210\u719f\u7a33\u5b9a**\uff1a20 \u591a\u5e74\u5386\u53f2\uff0c\u5e7f\u6cdb\u5e94\u7528\u4e8e\u5de5\u4e1a\u9886\u57df<br \/>\n&#8211; **\u6587\u6863\u5b8c\u5584**\uff1a\u5b98\u65b9\u6587\u6863\u8be6\u5c3d\uff0c\u793e\u533a\u6d3b\u8dc3<br \/>\n&#8211; **AWS \u652f\u6301**\uff1a\u4e0e AWS IoT \u6df1\u5ea6\u96c6\u6210<br \/>\n&#8211; **\u4f4e\u8d44\u6e90\u5360\u7528**\uff1a\u9002\u5408\u4f4e\u7aef MCU<\/p>\n<p>### \u26a0\ufe0f \u5c40\u9650<br \/>\n&#8211; **\u529f\u80fd\u76f8\u5bf9\u57fa\u7840**\uff1a\u76f8\u6bd4\u5546\u4e1a RTOS\uff08\u5982 VxWorks\u3001QNX\uff09\u529f\u80fd\u8f83\u5c11<br \/>\n&#8211; **\u65e0\u5185\u5b58\u4fdd\u62a4**\uff1a\u5927\u591a\u6570\u7aef\u53e3\u4e0d\u652f\u6301 MPU\/MMU<br \/>\n&#8211; **\u786c\u5b9e\u65f6\u80fd\u529b\u6709\u9650**\uff1a\u4e2d\u65ad\u5ef6\u8fdf\u53d6\u51b3\u4e8e\u5177\u4f53\u7aef\u53e3<\/p>\n<p>&#8212;<\/p>\n<p>## \u5f00\u53d1\u5de5\u5177\u63a8\u8350<\/p>\n<p>1. **IDE**\uff1aSTM32CubeIDE\u3001IAR EWARM\u3001Keil MDK<br \/>\n2. **\u8c03\u8bd5\u5de5\u5177**\uff1aFreeRTOS+Trace\u3001SystemView<br \/>\n3. **\u6a21\u62df\u5668**\uff1aFreeRTOS Simulator\u3001QEMU<br \/>\n4. **\u4ee3\u7801\u751f\u6210**\uff1aSTM32CubeMX\u3001ESP-IDF<\/p>\n<p>&#8212;<\/p>\n<p>## \u5b66\u4e60\u8d44\u6e90<\/p>\n<p>&#8211; **\u5b98\u7f51**\uff1ahttps:\/\/www.freertos.org<br \/>\n&#8211; **GitHub**\uff1ahttps:\/\/github.com\/FreeRTOS\/FreeRTOS<br \/>\n&#8211; **\u5b98\u65b9\u6587\u6863**\uff1ahttps:\/\/www.freertos.org\/Documentation\/01-FreeRTOS-quick-start<br \/>\n&#8211; **\u4e66\u7c4d**\uff1a\u300aMastering the FreeRTOS Real Time Kernel\u300b<\/p>\n<p>&#8212;<\/p>\n<p>## \u7ed3\u8bed<\/p>\n<p>FreeRTOS \u51ed\u501f\u5176\u7b80\u6d01\u3001\u9ad8\u6548\u3001\u514d\u8d39\u7684\u7279\u70b9\uff0c\u5df2\u6210\u4e3a\u5d4c\u5165\u5f0f\u5f00\u53d1\u7684\u4e8b\u5b9e\u6807\u51c6\u4e4b\u4e00\u3002\u65e0\u8bba\u662f\u521d\u5b66\u8005\u8fd8\u662f\u7ecf\u9a8c\u4e30\u5bcc\u7684\u5de5\u7a0b\u5e08\uff0cFreeRTOS \u90fd\u662f\u5b66\u4e60\u5b9e\u65f6\u64cd\u4f5c\u7cfb\u7edf\u539f\u7406\u548c\u5b9e\u8df5\u7684\u4f18\u79c0\u9009\u62e9\u3002<\/p>\n<p>\u968f\u7740\u7269\u8054\u7f51\u548c\u8fb9\u7f18\u8ba1\u7b97\u7684\u5feb\u901f\u53d1\u5c55\uff0cFreeRTOS \u7684\u5e94\u7528\u524d\u666f\u5c06\u66f4\u52a0\u5e7f\u9614\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p># FreeRTOS \u5b9e\u65f6\u64cd\u4f5c\u7cfb\u7edf\u8be6\u89e3 ## \u4ec0\u4e48\u662f FreeRTOS\uff1f FreeRTOS\uff08Free Real [&hellip;]<\/p>\n","protected":false},"author":0,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_gspb_post_css":"","footnotes":""},"categories":[30],"tags":[],"class_list":["post-721","post","type-post","status-publish","format-standard","hentry","category-30"],"blocksy_meta":[],"_links":{"self":[{"href":"https:\/\/monykate.com\/index.php\/wp-json\/wp\/v2\/posts\/721","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/monykate.com\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/monykate.com\/index.php\/wp-json\/wp\/v2\/types\/post"}],"replies":[{"embeddable":true,"href":"https:\/\/monykate.com\/index.php\/wp-json\/wp\/v2\/comments?post=721"}],"version-history":[{"count":1,"href":"https:\/\/monykate.com\/index.php\/wp-json\/wp\/v2\/posts\/721\/revisions"}],"predecessor-version":[{"id":722,"href":"https:\/\/monykate.com\/index.php\/wp-json\/wp\/v2\/posts\/721\/revisions\/722"}],"wp:attachment":[{"href":"https:\/\/monykate.com\/index.php\/wp-json\/wp\/v2\/media?parent=721"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/monykate.com\/index.php\/wp-json\/wp\/v2\/categories?post=721"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/monykate.com\/index.php\/wp-json\/wp\/v2\/tags?post=721"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}