{"id":104242,"date":"2026-09-12T07:41:38","date_gmt":"2026-09-11T23:41:38","guid":{"rendered":"https:\/\/www.wsisp.com\/helps\/104242.html"},"modified":"2026-09-12T07:41:38","modified_gmt":"2026-09-11T23:41:38","slug":"rtos-%e9%85%8d%e7%bd%ae%e4%bd%8e%e6%95%88%ef%bc%9atick-%e9%a2%91%e7%8e%87-%e6%a0%88%e9%bb%98%e8%ae%a4%e8%bf%87%e5%a4%a7%ef%bc%8c%e6%8c%89%e5%ae%9e%e6%b5%8b%e8%b0%83-config-%e5%8f%82%e6%95%b0","status":"publish","type":"post","link":"https:\/\/www.wsisp.com\/helps\/104242.html","title":{"rendered":"RTOS \u914d\u7f6e\u4f4e\u6548\uff1aTick \u9891\u7387\/\u6808\u9ed8\u8ba4\u8fc7\u5927\uff0c\u6309\u5b9e\u6d4b\u8c03 config \u53c2\u6570"},"content":{"rendered":"<h2>RTOS \u914d\u7f6e\u4f4e\u6548&#xff1a;Tick \u9891\u7387\/\u6808\u9ed8\u8ba4\u8fc7\u5927&#xff0c;\u6309\u5b9e\u6d4b\u8c03 config \u53c2\u6570<\/h2>\n<p>\u6458\u8981&#xff1a;RTOS \u914d\u7f6e\u53c2\u6570&#xff08;tick \u9891\u7387\u3001\u4efb\u52a1\u6808\u3001\u5806\u5927\u5c0f&#xff09;\u82e5\u76f4\u63a5\u6284\u9ed8\u8ba4\u503c&#xff0c;\u5f80\u5f80\u5bfc\u81f4\u8fc7\u5ea6\u914d\u7f6e\u6216\u914d\u7f6e\u4e0d\u8db3\u3002\u672c\u6587\u901a\u8fc7\u771f\u5b9e\u7ffb\u8f66\u6848\u4f8b&#xff0c;\u8bb2\u89e3\u5982\u4f55\u7528 uxTaskGetStackHighWaterMark \u6c34\u7ebf\u7edf\u8ba1\u548c xPortGetFreeHeapSize \u5806\u7edf\u8ba1\u5b9e\u6d4b\u8c03\u4f18&#xff1a;tick \u53d6\u4e1a\u52a1\u6700\u5c0f\u6240\u9700&#xff08;\u591a\u6570 100Hz \u591f&#xff09;\u3001\u6808\u6309\u5cf0\u503c\u6c34\u7ebf\u7559\u4f59\u91cf\u3001\u5806\u6309\u5cf0\u503c\u5360\u7528\u52a0 20% \u4f59\u91cf&#xff0c;\u505a\u5230&#034;\u521a\u597d\u591f\u7528\u4e0d\u6d6a\u8d39&#034;\u3002<\/p>\n<h3>\u4e00\u3001\u5f00\u7bc7&#xff1a;\u4e00\u4e2a\u771f\u5b9e\u7ffb\u8f66\u73b0\u573a<\/h3>\n<p>\u4e00\u4e2a FreeRTOS \u5de5\u7a0b\u76f4\u63a5\u5957\u4e86\u67d0\u6a21\u677f&#xff1a;configTICK_RATE_HZ&#061;1000&#xff08;1ms tick&#xff09;\u3001\u6bcf\u4e2a\u4efb\u52a1\u6808\u5f00 1024 \u5b57&#xff08;4KB&#xff09;\u3001configTOTAL_HEAP_SIZE&#061;64KB\u3002\u529f\u80fd\u80fd\u8dd1&#xff0c;\u4f46\u7cfb\u7edf\u5360\u7528\u9ad8\u3001tick \u4e2d\u65ad\u592a\u9891\u7e41\u5403\u6389 CPU\u3001\u5185\u5b58\u7d27\u5f20\u3002\u5728\u8d44\u6e90\u7d27\u5f20\u7684 MCU&#xff08;\u5982\u53ea\u6709 64KB RAM \u7684 F1&#xff09;\u4e0a&#xff0c;\u5149\u5806\u548c\u6808\u5c31\u628a RAM \u5403\u5149&#xff0c;\u522b\u7684\u529f\u80fd\u6ca1\u7a7a\u95f4\u3002<\/p>\n<p>\u6211\u9010\u9879\u8c03&#xff1a;tick \u964d\u5230 100Hz&#xff08;10ms \u591f\u7528&#xff09;\u3001\u6808\u6309\u6c34\u7ebf\u7f29\u5230\u5b9e\u9645\u5cf0\u503c&#043;\u4f59\u91cf\u3001\u5806\u6309\u5cf0\u503c\u5360\u7528\u5b9a\u3002\u7cfb\u7edf\u66f4\u8f7b\u3001\u5185\u5b58\u5145\u88d5\u3002<\/p>\n<p>\u6839\u56e0\u4e00\u53e5\u8bdd&#xff1a;RTOS \u914d\u7f6e\u53c2\u6570&#xff08;tick \u9891\u7387\u3001\u4efb\u52a1\u6808\u3001\u5806\u5927\u5c0f&#xff09;\u82e5\u76f4\u63a5\u6284\u9ed8\u8ba4\u503c\/\u62cd\u8111\u888b&#xff0c;\u5f80\u5f80\u8fc7\u5ea6\u914d\u7f6e&#xff08;tick \u592a\u5feb\u589e\u52a0\u4e2d\u65ad\u5f00\u9500\u3001\u6808\/\u5806\u8fc7\u5927\u6d6a\u8d39 RAM&#xff09;\u6216\u914d\u7f6e\u4e0d\u8db3&#xff08;\u6808\/\u5806\u592a\u5c0f\u5d29&#xff09;\u3002\u5e94\u6309\u5b9e\u6d4b\u8c03\u4f18&#xff1a;tick \u9891\u7387\u53d6\u4e1a\u52a1\u6240\u9700\u6700\u5c0f\u3001\u6808\u6309 uxTaskGetStackHighWaterMark \u5cf0\u503c\u7559\u4f59\u91cf\u3001\u5806\u6309 xPortGetFreeHeapSize \u5cf0\u503c\u5b9a\u3002<\/p>\n<p>\u9002\u7528\u8bfb\u8005&#xff1a;RTOS \u5de5\u7a0b RAM \u7d27\u5f20\/CPU \u5360\u7528\u9ad8\u3001\u53c2\u6570\u90fd\u662f\u6284\u9ed8\u8ba4\u503c\u7684\u540c\u5b66\u3002<br \/>\n\u8bfb\u5b8c\u4f60\u80fd\u505a&#xff1a;\u7528\u6c34\u7ebf\/\u5806\u7edf\u8ba1\u5b9e\u6d4b&#xff0c;\u8c03\u4f18 tick \u9891\u7387\u3001\u4efb\u52a1\u6808\u3001\u5806\u5927\u5c0f&#xff0c;\u505a\u5230&#034;\u521a\u597d\u591f\u7528\u4e0d\u6d6a\u8d39&#034;\u3002<\/p>\n<h3>\u4e8c\u3001\u5148\u641e\u61c2&#xff1a;\u54ea\u4e9b\u53c2\u6570\u6700\u8be5\u8c03&#xff08;\u8ba4\u77e5&#xff09;<\/h3>\n<h4>2.1 \u4e09\u4e2a\u5927\u5934<\/h4>\n<ul>\n<li>configTICK_RATE_HZ&#xff1a;tick \u4e2d\u65ad\u9891\u7387\u30021000Hz \u6bcf 1ms \u4e00\u6b21\u4e2d\u65ad&#xff0c;\u8c03\u5ea6\u5f00\u9500\u5927&#xff1b;\u591a\u6570\u4e1a\u52a1 100Hz&#xff08;10ms&#xff09;\u8db3\u591f\u3002<\/li>\n<li>\u4efb\u52a1\u6808 usStackDepth&#xff1a;\u5355\u4f4d\u5b57\u3002\u5f00\u592a\u5927\u6d6a\u8d39 RAM&#xff0c;\u592a\u5c0f\u6ea2\u51fa\u5d29\u3002\u6309\u6c34\u7ebf\u5b9a\u3002<\/li>\n<li>configTOTAL_HEAP_SIZE&#xff1a;RTOS \u5806\u603b\u91cf\u3002\u6309\u5cf0\u503c\u5360\u7528 &#043; \u4f59\u91cf\u3002<\/li>\n<\/ul>\n<h4>2.2 \u8fc7\u5ea6\u914d\u7f6e\u7684\u5371\u5bb3<\/h4>\n<ul>\n<li>tick \u592a\u5feb&#xff1a;\u4e2d\u65ad\u9891\u7e41&#xff0c;CPU \u5927\u91cf\u65f6\u95f4\u8fdb tick \u5904\u7406&#xff0c;\u4f4e\u529f\u8017\u5dee&#xff0c;\u4e14\u9ad8\u7cbe\u5ea6 tick \u53d7\u786c\u4ef6\u9650\u5236\u5e76\u975e\u771f\u51c6\u3002<\/li>\n<li>\u6808\/\u5806\u8fc7\u5927&#xff1a;\u5c0f RAM MCU \u76f4\u63a5\u4e0d\u591f\u7528&#xff0c;\u5176\u4ed6\u529f\u80fd\u6ca1\u7a7a\u95f4&#xff1b;\u4e14\u5927\u6808\u589e\u52a0\u73b0\u573a\u4fdd\u5b58\u5f00\u9500\u3002<\/li>\n<\/ul>\n<table>\n<tr>\u53c2\u6570\u8fc7\u5927\u5371\u5bb3\u8fc7\u5c0f\u5371\u5bb3<\/tr>\n<tbody>\n<tr>\n<td>tick Hz<\/td>\n<td>\u4e2d\u65ad\u5f00\u9500\u5927<\/td>\n<td>\u5468\u671f\u7cbe\u5ea6\u5dee<\/td>\n<\/tr>\n<tr>\n<td>\u6808<\/td>\n<td>\u6d6a\u8d39 RAM<\/td>\n<td>\u6ea2\u51fa\u5d29<\/td>\n<\/tr>\n<tr>\n<td>\u5806<\/td>\n<td>\u6d6a\u8d39 RAM<\/td>\n<td>\u5206\u914d\u5931\u8d25<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>#mermaid-svg-431pZkn2o6gn2pRy{font-family:\\&#8221;trebuchet ms\\&#8221;,verdana,arial,sans-serif;font-size:16px;fill:#333;}@keyframes edge-animation-frame{from{stroke-dashoffset:0;}}@keyframes dash{to{stroke-dashoffset:0;}}#mermaid-svg-431pZkn2o6gn2pRy .edge-animation-slow{stroke-dasharray:9,5!important;stroke-dashoffset:900;animation:dash 50s linear infinite;stroke-linecap:round;}#mermaid-svg-431pZkn2o6gn2pRy .edge-animation-fast{stroke-dasharray:9,5!important;stroke-dashoffset:900;animation:dash 20s linear infinite;stroke-linecap:round;}#mermaid-svg-431pZkn2o6gn2pRy .error-icon{fill:#552222;}#mermaid-svg-431pZkn2o6gn2pRy .error-text{fill:#552222;stroke:#552222;}#mermaid-svg-431pZkn2o6gn2pRy .edge-thickness-normal{stroke-width:1px;}#mermaid-svg-431pZkn2o6gn2pRy .edge-thickness-thick{stroke-width:3.5px;}#mermaid-svg-431pZkn2o6gn2pRy .edge-pattern-solid{stroke-dasharray:0;}#mermaid-svg-431pZkn2o6gn2pRy .edge-thickness-invisible{stroke-width:0;fill:none;}#mermaid-svg-431pZkn2o6gn2pRy .edge-pattern-dashed{stroke-dasharray:3;}#mermaid-svg-431pZkn2o6gn2pRy .edge-pattern-dotted{stroke-dasharray:2;}#mermaid-svg-431pZkn2o6gn2pRy .marker{fill:#333333;stroke:#333333;}#mermaid-svg-431pZkn2o6gn2pRy .marker.cross{stroke:#333333;}#mermaid-svg-431pZkn2o6gn2pRy svg{font-family:\\&#8221;trebuchet ms\\&#8221;,verdana,arial,sans-serif;font-size:16px;}#mermaid-svg-431pZkn2o6gn2pRy p{margin:0;}#mermaid-svg-431pZkn2o6gn2pRy .label{font-family:\\&#8221;trebuchet ms\\&#8221;,verdana,arial,sans-serif;color:#333;}#mermaid-svg-431pZkn2o6gn2pRy .cluster-label text{fill:#333;}#mermaid-svg-431pZkn2o6gn2pRy .cluster-label span{color:#333;}#mermaid-svg-431pZkn2o6gn2pRy .cluster-label span p{background-color:transparent;}#mermaid-svg-431pZkn2o6gn2pRy .label text,#mermaid-svg-431pZkn2o6gn2pRy span{fill:#333;color:#333;}#mermaid-svg-431pZkn2o6gn2pRy .node rect,#mermaid-svg-431pZkn2o6gn2pRy .node circle,#mermaid-svg-431pZkn2o6gn2pRy .node ellipse,#mermaid-svg-431pZkn2o6gn2pRy .node polygon,#mermaid-svg-431pZkn2o6gn2pRy .node path{fill:#ECECFF;stroke:#9370DB;stroke-width:1px;}#mermaid-svg-431pZkn2o6gn2pRy .rough-node .label text,#mermaid-svg-431pZkn2o6gn2pRy .node .label text,#mermaid-svg-431pZkn2o6gn2pRy .image-shape .label,#mermaid-svg-431pZkn2o6gn2pRy .icon-shape .label{text-anchor:middle;}#mermaid-svg-431pZkn2o6gn2pRy .node .katex path{fill:#000;stroke:#000;stroke-width:1px;}#mermaid-svg-431pZkn2o6gn2pRy .rough-node .label,#mermaid-svg-431pZkn2o6gn2pRy .node .label,#mermaid-svg-431pZkn2o6gn2pRy .image-shape .label,#mermaid-svg-431pZkn2o6gn2pRy .icon-shape .label{text-align:center;}#mermaid-svg-431pZkn2o6gn2pRy .node.clickable{cursor:pointer;}#mermaid-svg-431pZkn2o6gn2pRy .root .anchor path{fill:#333333!important;stroke-width:0;stroke:#333333;}#mermaid-svg-431pZkn2o6gn2pRy .arrowheadPath{fill:#333333;}#mermaid-svg-431pZkn2o6gn2pRy .edgePath .path{stroke:#333333;stroke-width:2.0px;}#mermaid-svg-431pZkn2o6gn2pRy .flowchart-link{stroke:#333333;fill:none;}#mermaid-svg-431pZkn2o6gn2pRy .edgeLabel{background-color:rgba(232,232,232, 0.8);text-align:center;}#mermaid-svg-431pZkn2o6gn2pRy .edgeLabel p{background-color:rgba(232,232,232, 0.8);}#mermaid-svg-431pZkn2o6gn2pRy .edgeLabel rect{opacity:0.5;background-color:rgba(232,232,232, 0.8);fill:rgba(232,232,232, 0.8);}#mermaid-svg-431pZkn2o6gn2pRy .labelBkg{background-color:rgba(232, 232, 232, 0.5);}#mermaid-svg-431pZkn2o6gn2pRy .cluster rect{fill:#ffffde;stroke:#aaaa33;stroke-width:1px;}#mermaid-svg-431pZkn2o6gn2pRy .cluster text{fill:#333;}#mermaid-svg-431pZkn2o6gn2pRy .cluster span{color:#333;}#mermaid-svg-431pZkn2o6gn2pRy div.mermaidTooltip{position:absolute;text-align:center;max-width:200px;padding:2px;font-family:\\&#8221;trebuchet ms\\&#8221;,verdana,arial,sans-serif;font-size:12px;background:hsl(80, 100%, 96.2745098039%);border:1px solid #aaaa33;border-radius:2px;pointer-events:none;z-index:100;}#mermaid-svg-431pZkn2o6gn2pRy .flowchartTitleText{text-anchor:middle;font-size:18px;fill:#333;}#mermaid-svg-431pZkn2o6gn2pRy rect.text{fill:none;stroke-width:0;}#mermaid-svg-431pZkn2o6gn2pRy .icon-shape,#mermaid-svg-431pZkn2o6gn2pRy .image-shape{background-color:rgba(232,232,232, 0.8);text-align:center;}#mermaid-svg-431pZkn2o6gn2pRy .icon-shape p,#mermaid-svg-431pZkn2o6gn2pRy .image-shape p{background-color:rgba(232,232,232, 0.8);padding:2px;}#mermaid-svg-431pZkn2o6gn2pRy .icon-shape rect,#mermaid-svg-431pZkn2o6gn2pRy .image-shape rect{opacity:0.5;background-color:rgba(232,232,232, 0.8);fill:rgba(232,232,232, 0.8);}#mermaid-svg-431pZkn2o6gn2pRy .label-icon{display:inline-block;height:1em;overflow:visible;vertical-align:-0.125em;}#mermaid-svg-431pZkn2o6gn2pRy .node .label-icon path{fill:currentColor;stroke:revert;stroke-width:revert;}#mermaid-svg-431pZkn2o6gn2pRy :root{&#8211;mermaid-font-family:\\&#8221;trebuchet ms\\&#8221;,verdana,arial,sans-serif;}<span class=\"edgeLabel\"><\/span><span class=\"edgeLabel\"><\/p>\n<p>\u6284\u9ed8\u8ba4<\/p>\n<p><\/span><span class=\"edgeLabel\"><\/p>\n<p>\u6c34\u7ebf\/\u5806\u7edf\u8ba1<\/p>\n<p><\/span><span class=\"nodeLabel\"><\/p>\n<p>RTOS\u53c2\u6570<\/p>\n<p><\/span><span class=\"nodeLabel\"><\/p>\n<p>\u5b9e\u6d4b\u8c03\u4f18?<\/p>\n<p><\/span><span class=\"nodeLabel\"><\/p>\n<p>\u8fc7\u5ea6\/\u4e0d\u8db3 \u6d6a\u8d39\u6216\u5d29<\/p>\n<p><\/span><span class=\"nodeLabel\"><\/p>\n<p>\u521a\u597d\u591f\u7528<\/p>\n<p><\/span><\/p>\n<p>\u56fe 1&#xff1a;RTOS \u53c2\u6570\u8c03\u4f18&#xff08;\u5982\u56fe 1 \u6240\u793a&#xff0c;\u5b9e\u6d4b\u5b9a\u800c\u975e\u62cd\u8111\u888b&#xff09;\u3002<\/p>\n<p>[\u6ce8\u610f] tick \u9891\u7387\u8fd8\u5f71\u54cd vTaskDelay \u5206\u8fa8\u7387&#xff08;\u89c1\u7b2c 28 \u8bb2&#xff09;&#xff1a;\u9700\u8981\u6beb\u79d2\u7ea7\u7cbe\u786e\u5b9a\u65f6\u7684\u786c\u5b9e\u65f6\u90e8\u5206\u5e94\u7528\u786c\u4ef6 TIM&#xff0c;\u800c\u975e\u76f2\u76ee\u62c9\u9ad8 tick\u3002<\/p>\n<h3>\u4e09\u3001\u4e3a\u4ec0\u4e48\u4f4e\u6548&#xff08;\u539f\u7406 &#043; \u771f\u5b9e\u9519\u8bef\u4ee3\u7801&#xff09;<\/h3>\n<h4>3.1 \u9519\u8bef\u7248<\/h4>\n<p><span class=\"token comment\">\/\/ \u274c \u9519&#xff1a;\u65e0\u8111\u6284\u9ed8\u8ba4&#xff0c;\u672a\u6d4b\u5b9e\u9645<\/span><br \/>\n<span class=\"token macro property\"><span class=\"token directive-hash\">#<\/span><span class=\"token directive keyword\">define<\/span> <span class=\"token macro-name\">configTICK_RATE_HZ<\/span>         <span class=\"token expression\"><span class=\"token number\">1000<\/span>      <\/span><span class=\"token comment\">\/\/ 1ms&#xff0c;\u591a\u6570\u573a\u666f\u6ca1\u5fc5\u8981<\/span><\/span><br \/>\n<span class=\"token macro property\"><span class=\"token directive-hash\">#<\/span><span class=\"token directive keyword\">define<\/span> <span class=\"token macro-name\">configTOTAL_HEAP_SIZE<\/span>      <span class=\"token expression\"><span class=\"token punctuation\">(<\/span><span class=\"token number\">64<\/span><span class=\"token operator\">*<\/span><span class=\"token number\">1024<\/span><span class=\"token punctuation\">)<\/span>  <\/span><span class=\"token comment\">\/\/ 64KB&#xff0c;\u5c0fRAM MCU\u7206<\/span><\/span><br \/>\n<span class=\"token comment\">\/\/ \u4efb\u52a1\u6808\u5168\u5f00 1024 \u5b57&#xff08;4KB&#xff09;&#xff0c;\u5b9e\u9645\u6c34\u7ebf\u5269 800&#043;<\/span><\/p>\n<p>\u9519&#xff1a;\u2460tick 1000Hz \u4e2d\u65ad\u5f00\u9500\u65e0\u8c13&#xff1b;\u2461\u5806 64KB \u5728\u5c0f MCU \u76f4\u63a5 OOM \u5176\u4ed6\u529f\u80fd&#xff1b;\u2462\u6808 4KB \u8fdc\u8d85\u5b9e\u9645&#xff08;\u6c34\u7ebf\u5269 800 \u5b57&#xff09;\u6d6a\u8d39\u3002<\/p>\n<p>[\u5751] \u94c1\u5f8b&#xff1a;RTOS \u53c2\u6570\u522b\u6284\u9ed8\u8ba4\u3002tick \u53d6\u4e1a\u52a1\u6700\u5c0f\u6240\u9700&#xff0c;\u6808\/\u5806\u6309\u6c34\u7ebf\/\u5806\u7edf\u8ba1\u5b9e\u6d4b\u5b9a\u3002<\/p>\n<h4>3.2 \u4e3a\u4ec0\u4e48&#034;\u80fd\u8dd1\u4f46\u4e0d\u597d&#034;<\/h4>\n<p>\u529f\u80fd\u80fd\u8dd1&#xff08;\u53c2\u6570\u591f&#xff09;&#xff0c;\u4f46\u8d44\u6e90\u6d6a\u8d39\/\u5f00\u9500\u5927&#xff0c;\u5728\u8d44\u6e90\u53d7\u9650 MCU \u4e0a\u66b4\u9732\u4e3a&#034;\u5185\u5b58\u4e0d\u591f\/CPU \u5360\u7528\u9ad8&#034;\u3002\u5c5e\u4e8e&#034;\u9690\u6027\u4f4e\u6548&#034;\u3002<\/p>\n<table>\n<tr>\u914d\u7f6e\u8868\u73b0<\/tr>\n<tbody>\n<tr>\n<td>\u6284\u9ed8\u8ba4\u8fc7\u5927<\/td>\n<td>\u80fd\u8dd1\u4f46\u6d6a\u8d39<\/td>\n<\/tr>\n<tr>\n<td>\u5b9e\u6d4b\u8c03\u4f18<\/td>\n<td>\u521a\u597d<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>\u4e0b\u9762\u662f&#034;\u80fd\u8dd1\u4f46\u4e0d\u597d&#034;\u7684\u6210\u56e0\u94fe\u8def\u56fe&#xff1a;<\/p>\n<p>#mermaid-svg-jvfciv9xwtdyUYHX{font-family:\\&#8221;trebuchet ms\\&#8221;,verdana,arial,sans-serif;font-size:16px;fill:#333;}@keyframes edge-animation-frame{from{stroke-dashoffset:0;}}@keyframes dash{to{stroke-dashoffset:0;}}#mermaid-svg-jvfciv9xwtdyUYHX .edge-animation-slow{stroke-dasharray:9,5!important;stroke-dashoffset:900;animation:dash 50s linear infinite;stroke-linecap:round;}#mermaid-svg-jvfciv9xwtdyUYHX .edge-animation-fast{stroke-dasharray:9,5!important;stroke-dashoffset:900;animation:dash 20s linear infinite;stroke-linecap:round;}#mermaid-svg-jvfciv9xwtdyUYHX .error-icon{fill:#552222;}#mermaid-svg-jvfciv9xwtdyUYHX .error-text{fill:#552222;stroke:#552222;}#mermaid-svg-jvfciv9xwtdyUYHX .edge-thickness-normal{stroke-width:1px;}#mermaid-svg-jvfciv9xwtdyUYHX .edge-thickness-thick{stroke-width:3.5px;}#mermaid-svg-jvfciv9xwtdyUYHX .edge-pattern-solid{stroke-dasharray:0;}#mermaid-svg-jvfciv9xwtdyUYHX .edge-thickness-invisible{stroke-width:0;fill:none;}#mermaid-svg-jvfciv9xwtdyUYHX .edge-pattern-dashed{stroke-dasharray:3;}#mermaid-svg-jvfciv9xwtdyUYHX .edge-pattern-dotted{stroke-dasharray:2;}#mermaid-svg-jvfciv9xwtdyUYHX .marker{fill:#333333;stroke:#333333;}#mermaid-svg-jvfciv9xwtdyUYHX .marker.cross{stroke:#333333;}#mermaid-svg-jvfciv9xwtdyUYHX svg{font-family:\\&#8221;trebuchet ms\\&#8221;,verdana,arial,sans-serif;font-size:16px;}#mermaid-svg-jvfciv9xwtdyUYHX p{margin:0;}#mermaid-svg-jvfciv9xwtdyUYHX .label{font-family:\\&#8221;trebuchet ms\\&#8221;,verdana,arial,sans-serif;color:#333;}#mermaid-svg-jvfciv9xwtdyUYHX .cluster-label text{fill:#333;}#mermaid-svg-jvfciv9xwtdyUYHX .cluster-label span{color:#333;}#mermaid-svg-jvfciv9xwtdyUYHX .cluster-label span p{background-color:transparent;}#mermaid-svg-jvfciv9xwtdyUYHX .label text,#mermaid-svg-jvfciv9xwtdyUYHX span{fill:#333;color:#333;}#mermaid-svg-jvfciv9xwtdyUYHX .node rect,#mermaid-svg-jvfciv9xwtdyUYHX .node circle,#mermaid-svg-jvfciv9xwtdyUYHX .node ellipse,#mermaid-svg-jvfciv9xwtdyUYHX .node polygon,#mermaid-svg-jvfciv9xwtdyUYHX .node path{fill:#ECECFF;stroke:#9370DB;stroke-width:1px;}#mermaid-svg-jvfciv9xwtdyUYHX .rough-node .label text,#mermaid-svg-jvfciv9xwtdyUYHX .node .label text,#mermaid-svg-jvfciv9xwtdyUYHX .image-shape .label,#mermaid-svg-jvfciv9xwtdyUYHX .icon-shape .label{text-anchor:middle;}#mermaid-svg-jvfciv9xwtdyUYHX .node .katex path{fill:#000;stroke:#000;stroke-width:1px;}#mermaid-svg-jvfciv9xwtdyUYHX .rough-node .label,#mermaid-svg-jvfciv9xwtdyUYHX .node .label,#mermaid-svg-jvfciv9xwtdyUYHX .image-shape .label,#mermaid-svg-jvfciv9xwtdyUYHX .icon-shape .label{text-align:center;}#mermaid-svg-jvfciv9xwtdyUYHX .node.clickable{cursor:pointer;}#mermaid-svg-jvfciv9xwtdyUYHX .root .anchor path{fill:#333333!important;stroke-width:0;stroke:#333333;}#mermaid-svg-jvfciv9xwtdyUYHX .arrowheadPath{fill:#333333;}#mermaid-svg-jvfciv9xwtdyUYHX .edgePath .path{stroke:#333333;stroke-width:2.0px;}#mermaid-svg-jvfciv9xwtdyUYHX .flowchart-link{stroke:#333333;fill:none;}#mermaid-svg-jvfciv9xwtdyUYHX .edgeLabel{background-color:rgba(232,232,232, 0.8);text-align:center;}#mermaid-svg-jvfciv9xwtdyUYHX .edgeLabel p{background-color:rgba(232,232,232, 0.8);}#mermaid-svg-jvfciv9xwtdyUYHX .edgeLabel rect{opacity:0.5;background-color:rgba(232,232,232, 0.8);fill:rgba(232,232,232, 0.8);}#mermaid-svg-jvfciv9xwtdyUYHX .labelBkg{background-color:rgba(232, 232, 232, 0.5);}#mermaid-svg-jvfciv9xwtdyUYHX .cluster rect{fill:#ffffde;stroke:#aaaa33;stroke-width:1px;}#mermaid-svg-jvfciv9xwtdyUYHX .cluster text{fill:#333;}#mermaid-svg-jvfciv9xwtdyUYHX .cluster span{color:#333;}#mermaid-svg-jvfciv9xwtdyUYHX div.mermaidTooltip{position:absolute;text-align:center;max-width:200px;padding:2px;font-family:\\&#8221;trebuchet ms\\&#8221;,verdana,arial,sans-serif;font-size:12px;background:hsl(80, 100%, 96.2745098039%);border:1px solid #aaaa33;border-radius:2px;pointer-events:none;z-index:100;}#mermaid-svg-jvfciv9xwtdyUYHX .flowchartTitleText{text-anchor:middle;font-size:18px;fill:#333;}#mermaid-svg-jvfciv9xwtdyUYHX rect.text{fill:none;stroke-width:0;}#mermaid-svg-jvfciv9xwtdyUYHX .icon-shape,#mermaid-svg-jvfciv9xwtdyUYHX .image-shape{background-color:rgba(232,232,232, 0.8);text-align:center;}#mermaid-svg-jvfciv9xwtdyUYHX .icon-shape p,#mermaid-svg-jvfciv9xwtdyUYHX .image-shape p{background-color:rgba(232,232,232, 0.8);padding:2px;}#mermaid-svg-jvfciv9xwtdyUYHX .icon-shape rect,#mermaid-svg-jvfciv9xwtdyUYHX .image-shape rect{opacity:0.5;background-color:rgba(232,232,232, 0.8);fill:rgba(232,232,232, 0.8);}#mermaid-svg-jvfciv9xwtdyUYHX .label-icon{display:inline-block;height:1em;overflow:visible;vertical-align:-0.125em;}#mermaid-svg-jvfciv9xwtdyUYHX .node .label-icon path{fill:currentColor;stroke:revert;stroke-width:revert;}#mermaid-svg-jvfciv9xwtdyUYHX :root{&#8211;mermaid-font-family:\\&#8221;trebuchet ms\\&#8221;,verdana,arial,sans-serif;}<span class=\"edgeLabel\"><\/span><span class=\"edgeLabel\"><\/span><span class=\"edgeLabel\"><\/span><span class=\"edgeLabel\"><\/span><span class=\"edgeLabel\"><\/span><span class=\"edgeLabel\"><\/span><span class=\"nodeLabel\"><\/p>\n<p>\u6284\u9ed8\u8ba4\/\u62cd\u8111\u888b\u914d\u7f6e<\/p>\n<p><\/span><span class=\"nodeLabel\"><\/p>\n<p>tick 1000Hz \u4e2d\u65ad\u9891\u7e41<\/p>\n<p><\/span><span class=\"nodeLabel\"><\/p>\n<p>\u6808\/\u5806\u5f00\u592a\u5927<\/p>\n<p><\/span><span class=\"nodeLabel\"><\/p>\n<p>CPU \u5360\u7528\u9ad8<\/p>\n<p><\/span><span class=\"nodeLabel\"><\/p>\n<p>RAM \u7d27\u5f20\/\u5176\u4ed6\u529f\u80fd\u6ca1\u7a7a\u95f4<\/p>\n<p><\/span><span class=\"nodeLabel\"><\/p>\n<p>\u9690\u6027\u4f4e\u6548&#xff1a;\u80fd\u8dd1\u4f46\u4e0d\u597d<\/p>\n<p><\/span><\/p>\n<p>\u56fe 2&#xff1a;\u8fc7\u5ea6\u914d\u7f6e\u5bfc\u81f4&#034;\u80fd\u8dd1\u4f46\u4e0d\u597d&#034;\u7684\u6210\u56e0\u94fe\u8def\u3002<\/p>\n<h3>\u56db\u3001\u6b63\u786e\u89e3\u6cd5&#xff1a;\u5b9e\u6d4b\u8c03\u4f18&#xff08;\u5b8c\u6574\u843d\u5730&#xff09;<\/h3>\n<h4>4.1 \u65b9\u6848\u5bf9\u6bd4<\/h4>\n<table>\n<tr>\u65b9\u6848\u8d44\u6e90\u8bf4\u660e<\/tr>\n<tbody>\n<tr>\n<td>\u6284\u9ed8\u8ba4<\/td>\n<td>\u6d6a\u8d39\/\u5d29<\/td>\n<td>\u9519<\/td>\n<\/tr>\n<tr>\n<td>\u6309\u6c34\u7ebf\/\u5806\u7edf\u8ba1\u5b9a<\/td>\n<td>\u521a\u597d<\/td>\n<td>\u6b63\u89e3<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<h4>4.2 \u914d\u7f6e&#xff08;\u7167\u7740\u70b9&#xff09;<\/h4>\n<p>FreeRTOSConfig.h&#xff1a;\u7528\u4ee5\u4e0b\u5b8f &#043; \u8fd0\u884c\u65f6\u7edf\u8ba1\u3002<\/p>\n<h4>4.3 \u5b8c\u6574\u4ee3\u7801&#xff08;\u8bca\u65ad &#043; \u914d\u7f6e&#xff09;<\/h4>\n<p><span class=\"token comment\">\/\/ \u8bca\u65ad&#xff1a;\u8fd0\u884c\u65f6\u8bfb\u6c34\u7ebf\/\u5806<\/span><br \/>\nUBaseType_t wm <span class=\"token operator\">&#061;<\/span> <span class=\"token function\">uxTaskGetStackHighWaterMark<\/span><span class=\"token punctuation\">(<\/span>task_h<span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">;<\/span>     <span class=\"token comment\">\/\/ \u5269\u4f59\u5b57\u6570&#xff0c;\u8d8a\u5c0f\u8d8a\u6ee1<\/span><br \/>\n<span class=\"token class-name\">size_t<\/span> free <span class=\"token operator\">&#061;<\/span> <span class=\"token function\">xPortGetFreeHeapSize<\/span><span class=\"token punctuation\">(<\/span><span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">;<\/span>                     <span class=\"token comment\">\/\/ \u7a7a\u95f2\u5806<\/span><\/p>\n<p><span class=\"token comment\">\/\/ \u8c03\u4f18\u540e\u914d\u7f6e&#xff08;\u4e3e\u4f8b&#xff0c;\u6309\u5b9e\u6d4b\u6539&#xff09;<\/span><br \/>\n<span class=\"token macro property\"><span class=\"token directive-hash\">#<\/span><span class=\"token directive keyword\">define<\/span> <span class=\"token macro-name\">configTICK_RATE_HZ<\/span>        <span class=\"token expression\"><span class=\"token number\">100<\/span>        <\/span><span class=\"token comment\">\/\/ 10ms \u591f\u591a\u6570\u4e1a\u52a1<\/span><\/span><br \/>\n<span class=\"token comment\">\/\/ \u4efb\u52a1\u6808&#xff1a;\u5b9e\u6d4b\u5cf0\u503c &#043; \u4f59\u91cf&#xff0c;\u5982\u5cf0\u503c 200\u5b57 \u2192 \u8bbe 256<\/span><br \/>\n<span class=\"token comment\">\/\/ configTOTAL_HEAP_SIZE&#xff1a;\u5cf0\u503c\u5360\u7528 &#043; 20% \u4f59\u91cf<\/span><\/p>\n<p>[\u5751] \u4e24\u4e2a\u7ffb\u8f66\u70b9\u6536\u597d&#xff1a;<\/p>\n<li>\u6808\u5355\u4f4d\u8bef\u7528&#xff08;\u5b57\u5f53\u5b57\u8282&#xff0c;\u8bbe\u5927 4 \u500d&#xff09;\u2014\u2014\u6d6a\u8d39\/\u5d29&#xff1b;\u660e\u786e\u5355\u4f4d\u3002<\/li>\n<li>\u53ea\u770b&#034;\u5f53\u524d&#034;\u6c34\u7ebf\u4e0d\u8dd1\u6ee1\u8f7d\u538b\u529b\u6d4b\u8bd5\u2014\u2014\u5cf0\u503c\u6ca1\u51fa\u73b0\u5c31\u5b9a\u5c0f\u4e86&#xff1b;\u9700\u6a21\u62df\u6700\u574f\u8d1f\u8f7d\u6d4b\u6c34\u7ebf\u3002<\/li>\n<h4>4.4 \u6539\u5b8c\u5bf9\u6bd4<\/h4>\n<table>\n<tr>\u6307\u6807\u6539\u524d\u6539\u540e<\/tr>\n<tbody>\n<tr>\n<td>tick \u4e2d\u65ad\u9891\u7387<\/td>\n<td>1000Hz<\/td>\n<td>100Hz<\/td>\n<\/tr>\n<tr>\n<td>\u603b RAM \u5360\u7528<\/td>\n<td>\u7206<\/td>\n<td>\u5145\u88d5<\/td>\n<\/tr>\n<tr>\n<td>\u8c03\u5ea6\u5f00\u9500<\/td>\n<td>\u9ad8<\/td>\n<td>\u4f4e<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>\u4e0b\u9762\u662f\u5b8c\u6574\u8c03\u4f18\u843d\u5730\u6d41\u7a0b&#xff1a;<\/p>\n<p>#mermaid-svg-sgGZD0t04aZDZoXr{font-family:\\&#8221;trebuchet ms\\&#8221;,verdana,arial,sans-serif;font-size:16px;fill:#333;}@keyframes edge-animation-frame{from{stroke-dashoffset:0;}}@keyframes dash{to{stroke-dashoffset:0;}}#mermaid-svg-sgGZD0t04aZDZoXr .edge-animation-slow{stroke-dasharray:9,5!important;stroke-dashoffset:900;animation:dash 50s linear infinite;stroke-linecap:round;}#mermaid-svg-sgGZD0t04aZDZoXr .edge-animation-fast{stroke-dasharray:9,5!important;stroke-dashoffset:900;animation:dash 20s linear infinite;stroke-linecap:round;}#mermaid-svg-sgGZD0t04aZDZoXr .error-icon{fill:#552222;}#mermaid-svg-sgGZD0t04aZDZoXr .error-text{fill:#552222;stroke:#552222;}#mermaid-svg-sgGZD0t04aZDZoXr .edge-thickness-normal{stroke-width:1px;}#mermaid-svg-sgGZD0t04aZDZoXr .edge-thickness-thick{stroke-width:3.5px;}#mermaid-svg-sgGZD0t04aZDZoXr .edge-pattern-solid{stroke-dasharray:0;}#mermaid-svg-sgGZD0t04aZDZoXr .edge-thickness-invisible{stroke-width:0;fill:none;}#mermaid-svg-sgGZD0t04aZDZoXr .edge-pattern-dashed{stroke-dasharray:3;}#mermaid-svg-sgGZD0t04aZDZoXr .edge-pattern-dotted{stroke-dasharray:2;}#mermaid-svg-sgGZD0t04aZDZoXr .marker{fill:#333333;stroke:#333333;}#mermaid-svg-sgGZD0t04aZDZoXr .marker.cross{stroke:#333333;}#mermaid-svg-sgGZD0t04aZDZoXr svg{font-family:\\&#8221;trebuchet ms\\&#8221;,verdana,arial,sans-serif;font-size:16px;}#mermaid-svg-sgGZD0t04aZDZoXr p{margin:0;}#mermaid-svg-sgGZD0t04aZDZoXr .label{font-family:\\&#8221;trebuchet ms\\&#8221;,verdana,arial,sans-serif;color:#333;}#mermaid-svg-sgGZD0t04aZDZoXr .cluster-label text{fill:#333;}#mermaid-svg-sgGZD0t04aZDZoXr .cluster-label span{color:#333;}#mermaid-svg-sgGZD0t04aZDZoXr .cluster-label span p{background-color:transparent;}#mermaid-svg-sgGZD0t04aZDZoXr .label text,#mermaid-svg-sgGZD0t04aZDZoXr span{fill:#333;color:#333;}#mermaid-svg-sgGZD0t04aZDZoXr .node rect,#mermaid-svg-sgGZD0t04aZDZoXr .node circle,#mermaid-svg-sgGZD0t04aZDZoXr .node ellipse,#mermaid-svg-sgGZD0t04aZDZoXr .node polygon,#mermaid-svg-sgGZD0t04aZDZoXr .node path{fill:#ECECFF;stroke:#9370DB;stroke-width:1px;}#mermaid-svg-sgGZD0t04aZDZoXr .rough-node .label text,#mermaid-svg-sgGZD0t04aZDZoXr .node .label text,#mermaid-svg-sgGZD0t04aZDZoXr .image-shape .label,#mermaid-svg-sgGZD0t04aZDZoXr .icon-shape .label{text-anchor:middle;}#mermaid-svg-sgGZD0t04aZDZoXr .node .katex path{fill:#000;stroke:#000;stroke-width:1px;}#mermaid-svg-sgGZD0t04aZDZoXr .rough-node .label,#mermaid-svg-sgGZD0t04aZDZoXr .node .label,#mermaid-svg-sgGZD0t04aZDZoXr .image-shape .label,#mermaid-svg-sgGZD0t04aZDZoXr .icon-shape .label{text-align:center;}#mermaid-svg-sgGZD0t04aZDZoXr .node.clickable{cursor:pointer;}#mermaid-svg-sgGZD0t04aZDZoXr .root .anchor path{fill:#333333!important;stroke-width:0;stroke:#333333;}#mermaid-svg-sgGZD0t04aZDZoXr .arrowheadPath{fill:#333333;}#mermaid-svg-sgGZD0t04aZDZoXr .edgePath .path{stroke:#333333;stroke-width:2.0px;}#mermaid-svg-sgGZD0t04aZDZoXr .flowchart-link{stroke:#333333;fill:none;}#mermaid-svg-sgGZD0t04aZDZoXr .edgeLabel{background-color:rgba(232,232,232, 0.8);text-align:center;}#mermaid-svg-sgGZD0t04aZDZoXr .edgeLabel p{background-color:rgba(232,232,232, 0.8);}#mermaid-svg-sgGZD0t04aZDZoXr .edgeLabel rect{opacity:0.5;background-color:rgba(232,232,232, 0.8);fill:rgba(232,232,232, 0.8);}#mermaid-svg-sgGZD0t04aZDZoXr .labelBkg{background-color:rgba(232, 232, 232, 0.5);}#mermaid-svg-sgGZD0t04aZDZoXr .cluster rect{fill:#ffffde;stroke:#aaaa33;stroke-width:1px;}#mermaid-svg-sgGZD0t04aZDZoXr .cluster text{fill:#333;}#mermaid-svg-sgGZD0t04aZDZoXr .cluster span{color:#333;}#mermaid-svg-sgGZD0t04aZDZoXr div.mermaidTooltip{position:absolute;text-align:center;max-width:200px;padding:2px;font-family:\\&#8221;trebuchet ms\\&#8221;,verdana,arial,sans-serif;font-size:12px;background:hsl(80, 100%, 96.2745098039%);border:1px solid #aaaa33;border-radius:2px;pointer-events:none;z-index:100;}#mermaid-svg-sgGZD0t04aZDZoXr .flowchartTitleText{text-anchor:middle;font-size:18px;fill:#333;}#mermaid-svg-sgGZD0t04aZDZoXr rect.text{fill:none;stroke-width:0;}#mermaid-svg-sgGZD0t04aZDZoXr .icon-shape,#mermaid-svg-sgGZD0t04aZDZoXr .image-shape{background-color:rgba(232,232,232, 0.8);text-align:center;}#mermaid-svg-sgGZD0t04aZDZoXr .icon-shape p,#mermaid-svg-sgGZD0t04aZDZoXr .image-shape p{background-color:rgba(232,232,232, 0.8);padding:2px;}#mermaid-svg-sgGZD0t04aZDZoXr .icon-shape rect,#mermaid-svg-sgGZD0t04aZDZoXr .image-shape rect{opacity:0.5;background-color:rgba(232,232,232, 0.8);fill:rgba(232,232,232, 0.8);}#mermaid-svg-sgGZD0t04aZDZoXr .label-icon{display:inline-block;height:1em;overflow:visible;vertical-align:-0.125em;}#mermaid-svg-sgGZD0t04aZDZoXr .node .label-icon path{fill:currentColor;stroke:revert;stroke-width:revert;}#mermaid-svg-sgGZD0t04aZDZoXr :root{&#8211;mermaid-font-family:\\&#8221;trebuchet ms\\&#8221;,verdana,arial,sans-serif;}<span class=\"edgeLabel\"><\/span><span class=\"edgeLabel\"><\/span><span class=\"edgeLabel\"><\/span><span class=\"edgeLabel\"><\/span><span class=\"edgeLabel\"><\/span><span class=\"edgeLabel\"><\/span><span class=\"edgeLabel\"><\/span><span class=\"edgeLabel\"><\/span><span class=\"nodeLabel\"><\/p>\n<p>\u8dd1\u6700\u574f\u8d1f\u8f7d\u538b\u529b\u6d4b\u8bd5<\/p>\n<p><\/span><span class=\"nodeLabel\"><\/p>\n<p>\u8bfb\u4efb\u52a1\u6808\u6c34\u7ebf uxTaskGetStackHighWaterMark<\/p>\n<p><\/span><span class=\"nodeLabel\"><\/p>\n<p>\u8bfb\u7a7a\u95f2\u5806 xPortGetFreeHeapSize<\/p>\n<p><\/span><span class=\"nodeLabel\"><\/p>\n<p>\u6808 &#061; \u5cf0\u503c\u6c34\u7ebf &#043; \u4f59\u91cf<\/p>\n<p><\/span><span class=\"nodeLabel\"><\/p>\n<p>\u5806 &#061; \u5cf0\u503c\u5360\u7528 &#043; 20% \u4f59\u91cf<\/p>\n<p><\/span><span class=\"nodeLabel\"><\/p>\n<p>tick \u53d6\u4e1a\u52a1\u6700\u5c0f\u6240\u9700<\/p>\n<p><\/span><span class=\"nodeLabel\"><\/p>\n<p>\u6539 FreeRTOSConfig.h<\/p>\n<p><\/span><span class=\"nodeLabel\"><\/p>\n<p>\u5f00 configCHECK_FOR_STACK_OVERFLOW \u9632\u6ea2\u51fa<\/p>\n<p><\/span><\/p>\n<p>\u56fe 3&#xff1a;\u5b9e\u6d4b\u8c03\u4f18\u5b8c\u6574\u843d\u5730\u6d41\u7a0b\u3002<\/p>\n<h3>\u4e94\u3001\u6536\u5c3e<\/h3>\n<p>\u8981\u70b9\u590d\u76d8<\/p>\n<li>RTOS \u53c2\u6570\u6284\u9ed8\u8ba4\u5e38\u8fc7\u5ea6\u914d\u7f6e&#xff08;tick \u592a\u5feb\u3001\u6808\/\u5806\u8fc7\u5927&#xff09;\u6216\u4e0d\u8db3\u3002<\/li>\n<li>tick \u53d6\u4e1a\u52a1\u6700\u5c0f\u6240\u9700&#xff1b;\u6808\u6309\u6c34\u7ebf\u5cf0\u503c&#043;\u4f59\u91cf&#xff1b;\u5806\u6309\u5806\u7edf\u8ba1\u5cf0\u503c\u5b9a\u3002<\/li>\n<li>\u5fc5\u987b\u8dd1\u6ee1\u8f7d\u538b\u529b\u6d4b\u8bd5\u6d4b\u5cf0\u503c&#xff0c;\u522b\u770b\u7a7a\u95f2\u6c34\u7ebf\u3002<\/li>\n<p>\u6700\u4f73\u5b9e\u8df5\u6e05\u5355<\/p>\n<ul>\n<li>configTICK_RATE_HZ \u53d6\u4e1a\u52a1\u6240\u9700\u6700\u5c0f&#xff08;\u591a\u6570 100Hz \u591f&#xff09;&#xff0c;\u786c\u5b9e\u65f6\u7528\u786c\u4ef6 TIM\u3002<\/li>\n<li>\u4efb\u52a1\u6808 &#061; \u5b9e\u6d4b\u5cf0\u503c\u6c34\u7ebf &#043; \u5b89\u5168\u4f59\u91cf&#xff0c;\u5355\u4f4d&#034;\u5b57&#034;\u522b\u641e\u9519\u3002<\/li>\n<li>configTOTAL_HEAP_SIZE &#061; \u5cf0\u503c\u5806\u5360\u7528 &#043; 20% \u4f59\u91cf\u3002<\/li>\n<li>\u8c03\u4f18\u524d\u8dd1\u6700\u574f\u8d1f\u8f7d\u6d4b\u6c34\u7ebf\/\u5806&#xff0c;\u907f\u514d\u6309\u7a7a\u95f2\u6001\u5b9a\u5c0f\u3002<\/li>\n<li>\u5f00 configCHECK_FOR_STACK_OVERFLOW \u9632\u6808\u6ea2\u51fa\u3002<\/li>\n<\/ul>\n<p>\u8fdb\u9636\u5ef6\u4f38&#xff1a;\u7528 uxTaskGetSystemState \u4e00\u6b21\u6027\u5bfc\u51fa\u6240\u6709\u4efb\u52a1\u6808\u6c34\u7ebf\u505a\u79bb\u7ebf\u5206\u6790&#xff1b;\u4f4e\u529f\u8017\u7528 tickless&#xff08;configUSE_TICKLESS_IDLE&#xff09;\u3002\u5b89\u5168\u5173\u952e\u7cfb\u7edf\u7528\u9759\u6001\u5206\u914d&#xff08;\u7b2c 33 \u8bb2&#xff09;\u3002<\/p>\n<p>\u4e92\u52a8&#xff1a;\u4f60 RTOS \u914d\u7f6e\u8fd8\u8e29\u8fc7\u5565&#xff1f;\u4e2d\u65ad\u4f18\u5148\u7ea7\u5206\u7ec4\u9519&#xff08;NVIC \u4e0e RTOS \u51b2\u7a81&#xff09;\u3001configMAX_PRIORITIES \u4e0d\u591f&#xff1f;\u8bc4\u8bba\u533a\u804a\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>RTOS \u914d\u7f6e\u4f4e\u6548&#xff1a;Tick \u9891\u7387\/\u6808\u9ed8\u8ba4\u8fc7\u5927&#xff0c;\u6309\u5b9e\u6d4b\u8c03 config \u53c2\u6570\u6458\u8981&#xff1a;RTOS \u914d\u7f6e\u53c2\u6570&#xff08;tick \u9891\u7387\u3001\u4efb\u52a1\u6808\u3001\u5806\u5927\u5c0f&#xff09;\u82e5\u76f4\u63a5\u6284\u9ed8\u8ba4\u503c&#xff0c;\u5f80\u5f80\u5bfc\u81f4\u8fc7\u5ea6\u914d\u7f6e\u6216\u914d\u7f6e\u4e0d\u8db3\u3002\u672c\u6587\u901a\u8fc7\u771f\u5b9e\u7ffb\u8f66\u6848\u4f8b&#xff0c;\u8bb2\u89e3\u5982\u4f55\u7528 uxTaskGetStackHighWaterMark \u6c34\u7ebf\u7edf\u8ba1\u548c xPortGetFreeHeapSize \u5806\u7edf\u8ba1\u5b9e\u6d4b\u8c03\u4f18&#xff1a;tick \u53d6\u4e1a\u52a1\u6700\u5c0f\u6240\u9700&amp;#x<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[7672,11865,5078,217,219],"topic":[],"class_list":["post-104242","post","type-post","status-publish","format-standard","hentry","category-server","tag-rtos","tag-11865","tag-freertos","tag-stm32","tag-219"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v20.3 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>RTOS \u914d\u7f6e\u4f4e\u6548\uff1aTick \u9891\u7387\/\u6808\u9ed8\u8ba4\u8fc7\u5927\uff0c\u6309\u5b9e\u6d4b\u8c03 config \u53c2\u6570 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.wsisp.com\/helps\/104242.html\" \/>\n<meta property=\"og:locale\" content=\"zh_CN\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"RTOS \u914d\u7f6e\u4f4e\u6548\uff1aTick \u9891\u7387\/\u6808\u9ed8\u8ba4\u8fc7\u5927\uff0c\u6309\u5b9e\u6d4b\u8c03 config \u53c2\u6570 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\" \/>\n<meta property=\"og:description\" content=\"RTOS \u914d\u7f6e\u4f4e\u6548&#xff1a;Tick \u9891\u7387\/\u6808\u9ed8\u8ba4\u8fc7\u5927&#xff0c;\u6309\u5b9e\u6d4b\u8c03 config \u53c2\u6570\u6458\u8981&#xff1a;RTOS \u914d\u7f6e\u53c2\u6570&#xff08;tick \u9891\u7387\u3001\u4efb\u52a1\u6808\u3001\u5806\u5927\u5c0f&#xff09;\u82e5\u76f4\u63a5\u6284\u9ed8\u8ba4\u503c&#xff0c;\u5f80\u5f80\u5bfc\u81f4\u8fc7\u5ea6\u914d\u7f6e\u6216\u914d\u7f6e\u4e0d\u8db3\u3002\u672c\u6587\u901a\u8fc7\u771f\u5b9e\u7ffb\u8f66\u6848\u4f8b&#xff0c;\u8bb2\u89e3\u5982\u4f55\u7528 uxTaskGetStackHighWaterMark \u6c34\u7ebf\u7edf\u8ba1\u548c xPortGetFreeHeapSize \u5806\u7edf\u8ba1\u5b9e\u6d4b\u8c03\u4f18&#xff1a;tick \u53d6\u4e1a\u52a1\u6700\u5c0f\u6240\u9700&amp;#x\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.wsisp.com\/helps\/104242.html\" \/>\n<meta property=\"og:site_name\" content=\"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\" \/>\n<meta property=\"article:published_time\" content=\"2026-09-11T23:41:38+00:00\" \/>\n<meta name=\"author\" content=\"admin\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"\u4f5c\u8005\" \/>\n\t<meta name=\"twitter:data1\" content=\"admin\" \/>\n\t<meta name=\"twitter:label2\" content=\"\u9884\u8ba1\u9605\u8bfb\u65f6\u95f4\" \/>\n\t<meta name=\"twitter:data2\" content=\"9 \u5206\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/104242.html\",\"url\":\"https:\/\/www.wsisp.com\/helps\/104242.html\",\"name\":\"RTOS \u914d\u7f6e\u4f4e\u6548\uff1aTick \u9891\u7387\/\u6808\u9ed8\u8ba4\u8fc7\u5927\uff0c\u6309\u5b9e\u6d4b\u8c03 config \u53c2\u6570 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\",\"isPartOf\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/#website\"},\"datePublished\":\"2026-09-11T23:41:38+00:00\",\"dateModified\":\"2026-09-11T23:41:38+00:00\",\"author\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41\"},\"breadcrumb\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/104242.html#breadcrumb\"},\"inLanguage\":\"zh-Hans\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.wsisp.com\/helps\/104242.html\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/104242.html#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"\u9996\u9875\",\"item\":\"https:\/\/www.wsisp.com\/helps\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"RTOS \u914d\u7f6e\u4f4e\u6548\uff1aTick \u9891\u7387\/\u6808\u9ed8\u8ba4\u8fc7\u5927\uff0c\u6309\u5b9e\u6d4b\u8c03 config \u53c2\u6570\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/#website\",\"url\":\"https:\/\/www.wsisp.com\/helps\/\",\"name\":\"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\",\"description\":\"\u9999\u6e2f\u670d\u52a1\u5668_\u9999\u6e2f\u4e91\u670d\u52a1\u5668\u8d44\u8baf_\u670d\u52a1\u5668\u5e2e\u52a9\u6587\u6863_\u670d\u52a1\u5668\u6559\u7a0b\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/www.wsisp.com\/helps\/?s={search_term_string}\"},\"query-input\":\"required name=search_term_string\"}],\"inLanguage\":\"zh-Hans\"},{\"@type\":\"Person\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41\",\"name\":\"admin\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"zh-Hans\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery\",\"contentUrl\":\"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery\",\"caption\":\"admin\"},\"sameAs\":[\"http:\/\/wp.wsisp.com\"],\"url\":\"https:\/\/www.wsisp.com\/helps\/author\/admin\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"RTOS \u914d\u7f6e\u4f4e\u6548\uff1aTick \u9891\u7387\/\u6808\u9ed8\u8ba4\u8fc7\u5927\uff0c\u6309\u5b9e\u6d4b\u8c03 config \u53c2\u6570 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.wsisp.com\/helps\/104242.html","og_locale":"zh_CN","og_type":"article","og_title":"RTOS \u914d\u7f6e\u4f4e\u6548\uff1aTick \u9891\u7387\/\u6808\u9ed8\u8ba4\u8fc7\u5927\uff0c\u6309\u5b9e\u6d4b\u8c03 config \u53c2\u6570 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","og_description":"RTOS \u914d\u7f6e\u4f4e\u6548&#xff1a;Tick \u9891\u7387\/\u6808\u9ed8\u8ba4\u8fc7\u5927&#xff0c;\u6309\u5b9e\u6d4b\u8c03 config \u53c2\u6570\u6458\u8981&#xff1a;RTOS \u914d\u7f6e\u53c2\u6570&#xff08;tick \u9891\u7387\u3001\u4efb\u52a1\u6808\u3001\u5806\u5927\u5c0f&#xff09;\u82e5\u76f4\u63a5\u6284\u9ed8\u8ba4\u503c&#xff0c;\u5f80\u5f80\u5bfc\u81f4\u8fc7\u5ea6\u914d\u7f6e\u6216\u914d\u7f6e\u4e0d\u8db3\u3002\u672c\u6587\u901a\u8fc7\u771f\u5b9e\u7ffb\u8f66\u6848\u4f8b&#xff0c;\u8bb2\u89e3\u5982\u4f55\u7528 uxTaskGetStackHighWaterMark \u6c34\u7ebf\u7edf\u8ba1\u548c xPortGetFreeHeapSize \u5806\u7edf\u8ba1\u5b9e\u6d4b\u8c03\u4f18&#xff1a;tick \u53d6\u4e1a\u52a1\u6700\u5c0f\u6240\u9700&amp;#x","og_url":"https:\/\/www.wsisp.com\/helps\/104242.html","og_site_name":"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","article_published_time":"2026-09-11T23:41:38+00:00","author":"admin","twitter_card":"summary_large_image","twitter_misc":{"\u4f5c\u8005":"admin","\u9884\u8ba1\u9605\u8bfb\u65f6\u95f4":"9 \u5206"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/www.wsisp.com\/helps\/104242.html","url":"https:\/\/www.wsisp.com\/helps\/104242.html","name":"RTOS \u914d\u7f6e\u4f4e\u6548\uff1aTick \u9891\u7387\/\u6808\u9ed8\u8ba4\u8fc7\u5927\uff0c\u6309\u5b9e\u6d4b\u8c03 config \u53c2\u6570 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","isPartOf":{"@id":"https:\/\/www.wsisp.com\/helps\/#website"},"datePublished":"2026-09-11T23:41:38+00:00","dateModified":"2026-09-11T23:41:38+00:00","author":{"@id":"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41"},"breadcrumb":{"@id":"https:\/\/www.wsisp.com\/helps\/104242.html#breadcrumb"},"inLanguage":"zh-Hans","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.wsisp.com\/helps\/104242.html"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.wsisp.com\/helps\/104242.html#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"\u9996\u9875","item":"https:\/\/www.wsisp.com\/helps"},{"@type":"ListItem","position":2,"name":"RTOS \u914d\u7f6e\u4f4e\u6548\uff1aTick \u9891\u7387\/\u6808\u9ed8\u8ba4\u8fc7\u5927\uff0c\u6309\u5b9e\u6d4b\u8c03 config \u53c2\u6570"}]},{"@type":"WebSite","@id":"https:\/\/www.wsisp.com\/helps\/#website","url":"https:\/\/www.wsisp.com\/helps\/","name":"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","description":"\u9999\u6e2f\u670d\u52a1\u5668_\u9999\u6e2f\u4e91\u670d\u52a1\u5668\u8d44\u8baf_\u670d\u52a1\u5668\u5e2e\u52a9\u6587\u6863_\u670d\u52a1\u5668\u6559\u7a0b","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.wsisp.com\/helps\/?s={search_term_string}"},"query-input":"required name=search_term_string"}],"inLanguage":"zh-Hans"},{"@type":"Person","@id":"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41","name":"admin","image":{"@type":"ImageObject","inLanguage":"zh-Hans","@id":"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/image\/","url":"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery","contentUrl":"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery","caption":"admin"},"sameAs":["http:\/\/wp.wsisp.com"],"url":"https:\/\/www.wsisp.com\/helps\/author\/admin"}]}},"_links":{"self":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/posts\/104242","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/comments?post=104242"}],"version-history":[{"count":0,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/posts\/104242\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/media?parent=104242"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/categories?post=104242"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/tags?post=104242"},{"taxonomy":"topic","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/topic?post=104242"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}