{"id":91026,"date":"2026-08-06T16:24:35","date_gmt":"2026-08-06T08:24:35","guid":{"rendered":"https:\/\/www.wsisp.com\/helps\/91026.html"},"modified":"2026-08-06T16:24:35","modified_gmt":"2026-08-06T08:24:35","slug":"stm32-%e4%b8%ad%e6%96%ad","status":"publish","type":"post","link":"https:\/\/www.wsisp.com\/helps\/91026.html","title":{"rendered":"stm32 -- \u4e2d\u65ad"},"content":{"rendered":"<hr \/>\n<p>tags:<\/p>\n<ul>\n<li>\u201c#\u4e2d\u65ad\u201d<\/li>\n<li>\u201c#stm32\u201d<\/li>\n<li>\u201c#\u4e2d\u65ad\u4f18\u5148\u7ea7\u201d<\/li>\n<li>\u201c#\u5916\u90e8\u4e2d\u65ad\u201d<\/li>\n<li>\u201c#NVIC\u201d<\/li>\n<li>\u201c#\u4e32\u53e3\u201d<\/li>\n<li>\u201c#\u8235\u673a\u201d<\/li>\n<li>\u201c#\u6309\u952e\u201d<br \/>\ndate: 2026-08-04<\/li>\n<\/ul>\n<hr \/>\n<h5>\u4e2d\u65ad\u7684\u57fa\u7840\u6982\u5ff5<\/h5>\n<p>1&#xff09;\u5355\u7247\u673a\u4e2d\u65ad\u7f16\u7a0b&#xff1a;<br \/>\n\u5e38\u89c4\u7a0b\u5e8f \u2013 \u7a81\u53d1\u4e8b\u4ef6 \u2013 \u5904\u7406\u7a81\u53d1\u4e8b\u4ef6 \u2013 \u7ee7\u7eed\u5e38\u89c4\u7a0b\u5e8f<br \/>\n\u5176\u4e2d&#xff1a;\u7a81\u53d1\u4e8b\u4ef6\u79f0\u4e3a\u4e2d\u65ad\u6e90<br \/>\n\u5904\u7406\u7a81\u53d1\u4e8b\u4ef6\u7684\u4ee3\u7801\u53eb\u505a\u4e2d\u65ad\u54cd\u5e94\u51fd\u6570&#xff1b;<br \/>\n2&#xff09;\u7a81\u7834\u4e86\u6309\u90e8\u5c31\u73ed\u7684\u505a\u4e8b\u513f\u65b9\u5f0f&#xff0c;\u80fd\u591f\u66f4\u5feb\u7684\u54cd\u5e94\u7a81\u53d1\u4e8b\u4ef6<br \/>\n3&#xff09;\u56de\u987e\u4e4b\u524d\u7684\u95ea\u706f\u5b9e\u9a8c\u548c\u4e32\u53e3\u63a5\u6536\u5b9e\u9a8c[[LED\u95ea\u706f\u5b9e\u9a8c]] [[\u7b80\u5355\u6570\u636e\u63a5\u6536\u5b9e\u9a8c]]<br \/>\n4&#xff09;\u4e32\u53e3\u63a5\u6536\u6570\u636e\u7684\u65f6\u5019&#xff0c;\u5b58\u5728\u4e24\u7ea7\u7f13\u51b2\u533a&#xff0c;\u4e00\u7ea7\u7f13\u51b2\u548c\u4e8c\u7ea7\u7f13\u51b2&#xff0c;\u5982\u679c\u53d1\u9001\u8fc7\u6765\u7684\u6570\u636e&#xff0c;\u4e0d\u53ca\u65f6\u5904\u7406\u5c31\u4f1a\u4e22\u5931<br \/>\n5&#xff09;\u601d\u8def&#xff1a;<\/p>\n<p>   <span class=\"token function\">main<\/span><span class=\"token punctuation\">(<\/span><span class=\"token punctuation\">)<\/span><br \/>\n   <span class=\"token punctuation\">{<\/span><br \/>\n   <span class=\"token keyword\">while<\/span><span class=\"token punctuation\">(<\/span><span class=\"token number\">1<\/span><span class=\"token punctuation\">)<\/span><br \/>\n   <span class=\"token punctuation\">{<\/span><br \/>\n   <span class=\"token comment\">\/\/\u4eae<\/span><br \/>\n   <span class=\"token comment\">\/\/\u5ef6\u8fdf<\/span><br \/>\n   <span class=\"token comment\">\/\/\u706d<\/span><br \/>\n   <span class=\"token comment\">\/\/\u5ef6\u8fdf<\/span><br \/>\n   <span class=\"token punctuation\">}<\/span><br \/>\n   <span class=\"token punctuation\">}<\/span><br \/>\n   <span class=\"token keyword\">void<\/span> \u4e2d\u65ad\u54cd\u5e94\u51fd\u6570<br \/>\n   <span class=\"token punctuation\">{<\/span><br \/>\n   <span class=\"token comment\">\/\/ \u8bfb\u53d6\u6570\u636e<\/span><br \/>\n   <span class=\"token comment\">\/\/\u5904\u7406\u6570\u636e<\/span><br \/>\n   <span class=\"token punctuation\">}<\/span><\/p>\n<ul>\n<li>\u95ea\u706f\u7a0b\u5e8f\u6b63\u5e38\u8fdb\u884c&#xff0c;\u5f53\u63a5\u6536\u5230\u4e32\u53e3\u7684\u6570\u636e\u65f6&#xff0c;\u8c03\u7528\u4e2d\u65ad\u54cd\u5e94\u51fd\u6570\u5bf9\u6570\u636e\u8fdb\u884c\u5904\u7406&#xff0c;\u5904\u7406\u8fc7\u540e\u7ee7\u7eed\u95ea\u706f\u7a0b\u5e8f\u3002<\/li>\n<li>\u5f53\u4e2d\u65ad\u53d1\u751f\u65f6&#xff0c;\u786c\u4ef6\u4f1a\u81ea\u52a8\u8c03\u7528\u4e2d\u65ad\u54cd\u5e94\u51fd\u6570<\/li>\n<\/ul>\n<hr \/>\n<h5>\u4e2d\u65ad\u4f18\u5148\u7ea7<\/h5>\n<ul>\n<li>\u4e2d\u65ad\u4f18\u5148\u7ea7\u5206\u7ec4&#xff1a;\n<ul>\n<li>0~15&#xff0c;\u4ece\u9ad8\u5230\u4f4e<\/li>\n<li>\u62a2\u5360\u4f18\u5148\u7ea7&#xff0c;\u5b50\u4f18\u5148\u7ea7\u3002![[5077253bbfe0ed20cc27d9cf3d991807.jpg]]<\/li>\n<li>\u4e2d\u65ad\u4f18\u5148\u7ea7\u5c31\u662f\u4e2d\u65ad\u7684\u7d27\u6025\u7a0b\u5ea6&#xff0c;\u6839\u636e\u7a0b\u5e8f\u8bbe\u8ba1\u7684\u9700\u6c42&#xff0c;\u81ea\u5df1\u8bbe\u7f6e\u7684<\/li>\n<li>\u62a2\u5360\u4f18\u5148\u7ea7\u9ad8\u7684\u53ef\u4ee5\u4e2d\u65ad\u5d4c\u5957&#xff0c;\u54cd\u5e94\u4f18\u5148\u7ea7\u9ad8\u7684\u53ef\u4ee5\u4f18\u5148\u6392\u961f<\/li>\n<\/ul>\n<\/li>\n<li>\u4e2d\u65ad\u6392\u961f&#xff1a;\n<ul>\n<li>\u89c4\u5219&#xff1a;\n<ul>\n<li>\u4f18\u5148\u7ea7\u8d8a\u9ad8&#xff0c;\u6392\u961f\u8d8a\u9760\u524d<\/li>\n<li>\u4f18\u5148\u7ea7\u76f8\u540c\u65f6&#xff0c;\u6309\u7167\u4e2d\u65ad\u53f7\u6392\u961f\u3002<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<\/li>\n<li>\u4e2d\u65ad\u5d4c\u5957\n<ul>\n<li>\u5728\u7a0b\u5e8f\u6267\u884c\u8fc7\u7a0b\u4e2d&#xff0c;\u5982\u679c\u53d1\u751f\u4e2d\u65ad&#xff0c;\u5355\u7247\u673a\u4f1a\u8c03\u7528\u5bf9\u5e94\u7684\u4e2d\u65ad\u670d\u52a1\u51fd\u6570\u3002\u82e5\u5728\u8be5\u51fd\u6570\u6267\u884c\u671f\u95f4\u53c8\u4ea7\u751f\u4e86\u65b0\u7684\u7d27\u6025\u4e2d\u65ad&#xff0c;\u4e14\u8be5\u4e2d\u65ad\u65e0\u6cd5\u7b49\u5f85\u6392\u961f&#xff0c;\u7cfb\u7edf\u4fbf\u4f1a\u6253\u65ad\u5f53\u524d\u4e2d\u65ad\u670d\u52a1\u51fd\u6570\u7684\u6267\u884c&#xff0c;\u8f6c\u800c\u5904\u7406\u65b0\u7684\u4e2d\u65ad\u3002\u8fd9\u79cd\u5728\u4e00\u4e2a\u4e2d\u65ad\u5185\u90e8\u5d4c\u5957\u53e6\u4e00\u4e2a\u4e2d\u65ad\u7684\u73b0\u8c61&#xff0c;\u79f0\u4e3a\u4e2d\u65ad\u5d4c\u5957\u3002<\/li>\n<li>\u53d1\u751f\u4e2d\u65ad\u5d4c\u5957\u7684\u6761\u4ef6&#xff1a;\u65b0\u4e2d\u65ad\u7684\u62a2\u5360\u4f18\u5148\u7ea7\u66f4\u9ad8\u3002<\/li>\n<li>\u5f53\u4e2d\u65ad\u53d1\u751f\u7684\u65f6\u5019&#xff0c;\u5982\u679c\u6765\u4e86\u53e6\u5916\u7684\u4e2d\u65ad\u4fe1\u53f7&#xff0c;\u5f53\u65b0\u6765\u7684\u4e2d\u65ad\u7684\u62a2\u5360\u4f18\u5148\u7ea7\u66f4\u9ad8&#xff08;\u6570\u5b57\u66f4\u5c0f&#xff09;\u7684\u65f6\u5019&#xff0c;\u5c31\u53d1\u751f\u4e2d\u65ad\u5d4c\u5957&#xff0c;\u5982\u679c\u65b0\u6765\u7684\u4e2d\u65ad\u62a2\u5360\u4f18\u5148\u7ea7\u66f4\u4f4e&#xff0c;\u90a3\u5c31\u8981\u6392\u961f<\/li>\n<\/ul>\n<\/li>\n<li>\u5206\u7ec4\u65b9\u5f0f\n<ul>\n<li>NVIC \u901a\u8fc7 AIRCR \u5bc4\u5b58\u5668\u7684 PRIGROUP \u4f4d&#xff0c;\u628a 4 \u4f4d\u4f18\u5148\u7ea7\u62c6\u5206\u4e3a\u62a2\u5360\u4f18\u5148\u7ea7 &#043; \u5b50\u4f18\u5148\u7ea7<\/li>\n<li>\u5e38\u7528\u5206\u7ec4\u4e3a \u5206\u7ec4 2&#xff08;2 \u4f4d\u62a2\u5360 &#043; 2 \u4f4d\u5b50&#xff09;&#xff0c;\u5982 CubeMX \u9ed8\u8ba4\u914d\u7f6e<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<table>\n<tr>\u5206\u7ec4\u7f16\u53f7PRIGROUP \u503c\u62a2\u5360\u4f18\u5148\u7ea7\u4f4d\u6570\u5b50\u4f18\u5148\u7ea7\u4f4d\u6570\u62a2\u5360\u4f18\u5148\u7ea7\u8303\u56f4\u5b50\u4f18\u5148\u7ea7\u8303\u56f4<\/tr>\n<tbody>\n<tr>\n<td align=\"center\">0<\/td>\n<td align=\"center\">011<\/td>\n<td align=\"center\">0<\/td>\n<td align=\"center\">4<\/td>\n<td align=\"center\">0<\/td>\n<td align=\"center\">0~15<\/td>\n<\/tr>\n<tr>\n<td align=\"center\">1<\/td>\n<td align=\"center\">100<\/td>\n<td align=\"center\">1<\/td>\n<td align=\"center\">3<\/td>\n<td align=\"center\">0~1<\/td>\n<td align=\"center\">0~7<\/td>\n<\/tr>\n<tr>\n<td align=\"center\">2<\/td>\n<td align=\"center\">101<\/td>\n<td align=\"center\">2<\/td>\n<td align=\"center\">2<\/td>\n<td align=\"center\">0~3<\/td>\n<td align=\"center\">0~3<\/td>\n<\/tr>\n<tr>\n<td align=\"center\">3<\/td>\n<td align=\"center\">110<\/td>\n<td align=\"center\">3<\/td>\n<td align=\"center\">1<\/td>\n<td align=\"center\">0~7<\/td>\n<td align=\"center\">0~1<\/td>\n<\/tr>\n<tr>\n<td align=\"center\">4<\/td>\n<td align=\"center\">111<\/td>\n<td align=\"center\">4<\/td>\n<td align=\"center\">0<\/td>\n<td align=\"center\">0~15<\/td>\n<td align=\"center\">0<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>\u8bf4\u660e&#xff1a;<\/p>\n<ul>\n<li>\u62a2\u5360\u4f18\u5148\u7ea7 &#061; \u6570\u5b57\u8d8a\u5c0f\u4f18\u5148\u7ea7\u8d8a\u9ad8&#xff0c;\u53ef\u53d1\u751f\u4e2d\u65ad\u5d4c\u5957<\/li>\n<li>\u5b50\u4f18\u5148\u7ea7 &#061; \u540c\u62a2\u5360\u4f18\u5148\u7ea7\u4e0b\u6392\u961f\u987a\u5e8f&#xff0c;\u4e0d\u80fd\u6253\u65ad\u5d4c\u5957<\/li>\n<li>\u5206\u7ec4 4 \u65f6\u6ca1\u6709\u5b50\u4f18\u5148\u7ea7&#xff0c;\u54cd\u5e94\u4f18\u5148\u7ea7\u5168\u4e3a 0&#xff0c;\u4f9d\u9760\u4e2d\u65ad\u53f7\u6392\u961f<\/li>\n<\/ul>\n<hr \/>\n<h5>EXTI\u5916\u90e8\u4e2d\u65ad<\/h5>\n<p>1&#xff09;Extern Interrupt<\/p>\n<ul>\n<li>\u76d1\u6d4b\u6307\u5b9aGPIO\u53e3\u7684\u7535\u5e73\u4fe1\u53f7&#xff0c;\u5f53\u5176\u6307\u5b9a\u7684GPIO\u53e3\u4ea7\u751f\u7535\u5e73\u53d8\u5316\u65f6&#xff0c;EXTI\u5c06\u7acb\u523b\u5411NVIC\u53d1\u9001\u4e2d\u65ad\u7533\u8bf7&#xff0c;\u7ecf\u8fc7NVIC\u88c1\u51b3\u540e&#xff0c;\u5373\u53ef\u4e2d\u65adCPU\u4e3b\u7a0b\u5e8f&#xff0c;\u4f7fCPU\u6267\u884cEXTI\u5bf9\u5e94\u7684\u4e2d\u65ad\u7a0b\u5e8f<\/li>\n<li>\u652f\u6301\u7684\u89e6\u53d1\u65b9\u5f0f&#xff1a;\n<ul>\n<li>\u4e0a\u5347\u6cbf<\/li>\n<li>\u4e0b\u964d\u6cbf<\/li>\n<li>\u53cc\u8fb9\u6cbf<\/li>\n<li>\u8f6f\u4ef6\u89e6\u53d1<\/li>\n<\/ul>\n<\/li>\n<li>\u652f\u6301\u6240\u6709IO\u53e3,\u4f46\u662f\u76f8\u540c\u7684Pin\u4e0d\u80fd\u540c\u65f6\u89e6\u53d1\u4e2d\u65ad<\/li>\n<li>\u901a\u9053\u6570&#xff1a;16\u4e2aGPIO_Pin&#xff0c;\u5916\u52a0PVD\u8f93\u51fa&#xff0c;RTC\u95f9\u949f&#xff0c;USB\u5524\u9192&#xff0c;\u4ee5\u592a\u7f51\u5524\u9192<\/li>\n<li>\u89e6\u53d1\u54cd\u5e94\u65b9\u5f0f&#xff1a;\u4e2d\u65ad\u54cd\u5e94\/\u4e8b\u4ef6\u54cd\u5e94\n<ul>\n<li>\u4e8b\u4ef6\u54cd\u5e94&#xff1a;\u5f53\u5916\u90e8\u4e2d\u65ad\u68c0\u6d4b\u5230\u5f15\u811a\u7535\u5e73\u53d8\u5316\u7684\u65f6\u5019&#xff0c;\u89e6\u53d1\u4e8b\u4ef6&#xff0c;\u5916\u90e8\u4e2d\u65ad\u7684\u4fe1\u53f7\u5c31\u4e0d\u4f1a\u901a\u5411CPU&#xff0c;\u800c\u662f\u901a\u5411\u5176\u4ed6\u5916\u8bbe&#xff0c;\u7528\u6765\u89e6\u53d1\u5176\u4ed6\u5916\u8bbe\u7684\u64cd\u4f5c&#xff0c;\u6bd4\u5982\u89e6\u53d1ADC\u8f6c\u6362&#xff0c;\u89e6\u53d1DMA\u7b49\u3002<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<p>2&#xff09;AFIO\u590d\u7528IO\u53e3<\/p>\n<ul>\n<li>AFIO\u4e3b\u8981\u7528\u4e8e\u5f15\u811a\u590d\u7528\u529f\u80fd\u7684\u9009\u62e9\u548c\u91cd\u5b9a\u4e49<\/li>\n<li>\u5728stm32\u4e2d&#xff0c;AFIO\u4e3b\u8981\u5b8c\u6210\u4e24\u4e2a\u4efb\u52a1&#xff1a;\u590d\u7528\u529f\u80fd\u5f15\u811a\u91cd\u6620\u5c04&#xff0c;\u4e2d\u65ad\u5f15\u811a\u9009\u62e9<\/li>\n<\/ul>\n<hr \/>\n<h5>NVIC\u6a21\u5757<\/h5>\n<p>1&#xff09;NVIC&#xff0c;\u662f\u5355\u7247\u673a\u5185\u90e8\u7684\u4e00\u4e2a\u6a21\u5757&#xff0c;\u5168\u79f0\u662f&#xff1a;Nested Vectored Interrupt Controller &#8211;\u5d4c\u5957\u5411\u91cf\u4e2d\u65ad\u63a7\u5236\u5668&#xff0c;\u8d1f\u8d23\u7ba1\u7406\u5355\u7247\u673a\u7684\u4e2d\u65ad\u3002<br \/>\n2&#xff09;![[00f9637b298ed228563fb94994b80f6e.jpg]]<\/p>\n<ul>\n<li>\n<p>\u4e2d\u65ad\u4f7f\u80fd&#xff0c;\u5bf9\u5e94\u4e2d\u65ad\u540e\u9762\u6253\u4e0a\u52fe\u5c31\u76f8\u5f53\u4e8e\u4f7f\u80fd\u4e86\u8fd9\u4e2a\u4e2d\u65ad\u30022&#xff09;\u56fe\u4e2d\u7684\u56db\u4e2a\u65b9\u6846\u8868\u793a\u4e2d\u65ad\u4f18\u5148\u7ea7\u3002\u84dd\u8272\u7ebf\u53ef\u4ee5\u79fb\u52a8&#xff0c;\u63a7\u5236\u62a2\u5360\u4f18\u5148\u7ea7\u548c\u5b50\u4f18\u5148\u7ea7\u3002<\/p>\n<\/li>\n<li>\n<p>![[Pasted image 20260724152848.png]]<\/p>\n<\/li>\n<li>\n<p>\u4f18\u5148\u7ea7\u5206\u7ec4<br \/>\n![[Pasted image 20260724153433.png]]<\/p>\n<\/li>\n<li>\n<p>\u4ef2\u88c1\u7535\u8def\u7528\u6765\u7ba1\u7406\u4e2d\u65ad\u5d4c\u5957\u548c\u4e2d\u65ad\u6392\u961f\u7684\u903b\u8f91\u3002<\/p>\n<\/li>\n<li>\n<p>\u4e2d\u65ad\u54cd\u5e94\u51fd\u6570\u5b58\u50a8\u5728\u5355\u7247\u673a\u7684flash\u91cc\u9762<\/p>\n<\/li>\n<\/ul>\n<hr \/>\n<h5>\u4e32\u53e3\u4e2d\u65ad\u5b9e\u9a8c<\/h5>\n<p>1&#xff09;\u5b9e\u9a8c\u76ee\u7684&#xff1a;<br \/>\n\u901a\u8fc7\u4e32\u53e3\u8c03\u8bd5\u52a9\u624b\u63a7\u5236\u677f\u8f7dLED\u7684\u95ea\u70c1\u901f\u5ea6&#xff0c;\u53d1\u90011\u662f\u6162\u95ea&#xff0c;2\u662f\u6b63\u5e38&#xff0c;3\u662f\u5feb\u95ea<br \/>\n2&#xff09;\u590d\u4e60\u4e00\u4e0b\u95ea\u706f\u5b9e\u9a8c\u548cUART\u4e32\u53e3\u5b9e\u9a8c&#xff1a;<br \/>\n[[LED\u95ea\u706f\u5b9e\u9a8c]] [[\u7b80\u5355\u6570\u636e\u63a5\u6536\u5b9e\u9a8c]][[\u7b80\u5355\u6570\u636e\u53d1\u9001\u5b9e\u9a8c]]<\/p>\n<p>1.\u677f\u8f7dLED\u662f\u4e0ePC13\u5f15\u811a\u8fde\u63a5&#xff0c;\u91c7\u7528\u5f00\u6f0f\u63a5\u6cd5\u3002\u5411pc13\u5f15\u811a\u51991\u662f\u7184\u706d&#xff0c;0\u662f\u70b9\u4eae<br \/>\n2.UART\u5206\u522b\u6709\u4e00\u4e2a\u53d1\u9001\u5f15\u811aTX&#xff0c;\u4e00\u4e2a\u63a5\u6536\u5f15\u811aRX&#xff0c;\u5bf9\u4e8eUART1&#xff0c;PA9\u5f15\u811a\u662fTX\u5f15\u811a&#xff0c;PA10\u5f15\u811a\u662fRX\u5f15\u811a&#xff0c;\u8fde\u63a5\u7684\u65f6\u5019&#xff0c;USBtoTTL\u6a21\u5757\u7684RX\u548cPA9\u76f8\u8fde&#xff0c;TX\u548cPA10\u76f8\u8fde&#xff0c;GND\u5f15\u811a\u63a5\u5730\u3002<br \/>\n3.\u5728\u53d1\u9001\u5b9e\u9a8c\u4e2d&#xff0c;\u7528\u5230\u4e86HAL_UART_Transmit\u7684\u7f16\u7a0b\u63a5\u53e3\u3002<\/p>\n<p>3&#xff09;\u7b2c\u4e00\u6b65\u5148\u5b9e\u73b0LED\u7684\u95ea\u70c1<br \/>\n1.\u901a\u8fc7\u95ea\u706f\u5b9e\u9a8c\u6211\u4eec\u77e5\u9053&#xff0c;\u6211\u4eec\u901a\u8fc7HAL_GPIO_WritePin&#xff0c;\u5411PC13\u5f15\u811a\u51991\u6216\u80050&#xff0c;\u540c\u65f6\u901a\u8fc7HAL_Delay&#xff0c;\u5ef6\u8fdf\u51fd\u6570\u6765\u63a7\u5236LED\u7684\u95ea\u706f\u9891\u7387\u3002<br \/>\n2&#xff0c;<br \/>\n![[Pasted image 20260725112319.png]]<br \/>\n\u4e00\u822c\u628a\u5168\u5c40\u53d8\u91cf\u7684\u58f0\u660e\u5199\u5728Private variables\u4e0b\u9762&#xff0c;\u4e00\u5bf9begin\u548cend\u4e2d\u95f4\u3002<br \/>\n3.\u5728Private variables\u4f4d\u7f6e\u58f0\u660e\u4e00\u4e2a\u53d8\u91cf&#xff1a;blinkinterval&#xff0c;\u6211\u4eec\u53ef\u4ee5\u901a\u8fc7\u6539\u53d8\u8fd9\u4e2a\u503c&#xff0c;\u6765\u6539\u53d8\u5ef6\u8fdf\u7684\u5927\u5c0f\u4ece\u800c\u63a7\u5236\u95ea\u706f\u7684\u9891\u7387\u3002<\/p>\n<p><span class=\"token comment\">\/* USER CODE BEGIN PV *\/<\/span><br \/>\n<span class=\"token keyword\">static<\/span> <span class=\"token class-name\">uint32_t<\/span> blinkinterval <span class=\"token operator\">&#061;<\/span> <span class=\"token number\">1000<\/span><span class=\"token punctuation\">;<\/span><br \/>\n<span class=\"token comment\">\/* USER CODE END PV *\/<\/span><br \/>\n<span class=\"token keyword\">int<\/span> <span class=\"token function\">main<\/span><span class=\"token punctuation\">(<\/span><span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">{<\/span><br \/>\n<span class=\"token keyword\">while<\/span> <span class=\"token punctuation\">(<\/span><span class=\"token number\">1<\/span><span class=\"token punctuation\">)<\/span><br \/>\n  <span class=\"token punctuation\">{<\/span><br \/>\n<span class=\"token function\">HAL_GPIO_WritePin<\/span><span class=\"token punctuation\">(<\/span>GPIOC<span class=\"token punctuation\">,<\/span>GPIO_PIN_13<span class=\"token punctuation\">,<\/span><br \/>\nGPIO_PIN_RESET<span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">;<\/span><br \/>\n<span class=\"token function\">HAL_Delay<\/span><span class=\"token punctuation\">(<\/span>blinkinterval<span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">;<\/span><\/p>\n<p><span class=\"token function\">HAL_GPIO_WritePin<\/span><span class=\"token punctuation\">(<\/span>GPIOC<span class=\"token punctuation\">,<\/span>GPIO_PIN_13<span class=\"token punctuation\">,<\/span><br \/>\nGPIO_PIN_SET<span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">;<\/span><br \/>\n<span class=\"token function\">HAL_Delay<\/span><span class=\"token punctuation\">(<\/span>blinkinterval<span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">;<\/span><br \/>\n    <span class=\"token comment\">\/* USER CODE END WHILE *\/<\/span><\/p>\n<p>    <span class=\"token comment\">\/* USER CODE BEGIN 3 *\/<\/span><br \/>\n  <span class=\"token punctuation\">}<\/span><\/p>\n<p><span class=\"token punctuation\">}<\/span><\/p>\n<p>\u9996\u5148\u6211\u4eec\u70b9\u51fb\u9b54\u672f\u68d2\u9009\u9879&#xff0c;\u9009\u62e9c\/c&#043;&#043;&#xff0c;\u628a\u4ee3\u7801\u4f18\u5316\u5173\u6389&#xff0c;\u7b49\u4f1a\u8981\u8c03\u8bd5\u3002<br \/>\n\u7136\u540e\u70b9\u51fb\u8c03\u8bd5\u6309\u94ae\u3002<br \/>\n\u5728view\u7684watch windows\u9009\u9879&#xff0c;\u9009\u62e9watch1&#xff0c;\u5728\u4e0b\u65b9\u7a97\u53e3\u8f93\u5165\u6211\u4eec\u60f3\u76d1\u63a7\u7684\u53d8\u91cf&#xff0c;\u8fd9\u91cc\u662fblinkinterval&#xff0c;\u7136\u540e\u53f3\u952e\u5c06\u5341\u516d\u8fdb\u5236\u5173\u6389\u3002<br \/>\n![[Pasted image 20260725114309.png]]<br \/>\n\u7b2c\u4e00\u4e2a\u5c31\u662f\u5341\u516d\u8fdb\u5236\u7684\u9009\u9879<br \/>\n![[Pasted image 20260725114327.png]]<br \/>\n\u901a\u8fc7\u6539\u53d8value\u7684\u503c&#xff0c;\u53ef\u4ee5\u770b\u5230LED\u95ea\u70c1\u7684\u9891\u7387\u7684\u53d8\u5316\u3002<\/p>\n<p>4)\u8bbe\u7f6eUART\u3002<\/p>\n<ul>\n<li>\u9009\u62e9\u5f02\u6b65\u6a21\u5f0f&#xff0c;\u5176\u4ed6\u53c2\u6570\u4fdd\u6301\u9ed8\u8ba4&#xff0c;\u6bd4\u5982\u6ce2\u7279\u7387\u3002<\/li>\n<li>\u91cd\u70b9\u5728\u4e8eNVIC SETTING&#xff0c;\u662f\u548c\u8fc7\u53bb\u7684\u5b9e\u9a8c\u4e0d\u540c\u7684\u5730\u65b9\u3002<\/li>\n<li>![[Pasted image 20260725115300.png]]<\/li>\n<li>\u4e32\u53e31\u5168\u5c40\u4e2d\u65ad&#xff0c;\u6253\u52feenable<br \/>\n5&#xff09;\u4e2d\u65ad\u7684\u4f7f\u7528\u65b9\u6cd5 \u2013 \u65b0\u7684\u7f16\u7a0b\u63a5\u53e3\u3002<\/li>\n<\/ul>\n<p>HAL_StatusTypeDef <span class=\"token function\">HAL_UART_Receive_IT<\/span><span class=\"token punctuation\">(<\/span>UART_HandleTypeDef <span class=\"token operator\">*<\/span>huart<span class=\"token punctuation\">,<\/span><br \/>\n                                               <span class=\"token class-name\">uint8_t<\/span> <span class=\"token operator\">*<\/span>pData<span class=\"token punctuation\">,<\/span><br \/>\n                                               <span class=\"token class-name\">uint16_t<\/span> Size<span class=\"token punctuation\">)<\/span><\/p>\n<p>\u4f5c\u7528&#xff1a;\u901a\u8fc7\u4e32\u53e3\u4ee5\u4e2d\u65ad\u65b9\u5f0f\u63a5\u6536\u6307\u5b9a\u6570\u91cf\u7684\u6570\u636e&#xff08;\u975e\u963b\u585e&#xff09;&#xff1b;<br \/>\n\u53c2\u6570 huart&#xff1a;\u586b\u5199\u4e32\u53e3\u53e5\u67c4\u7684\u6307\u9488&#xff1b;<br \/>\n\u53c2\u6570 pData&#xff1a;\u6307\u5411\u63a5\u6536\u7f13\u51b2\u533a\u7684\u6307\u9488&#xff1b;<br \/>\n\u53c2\u6570 Size &#xff1a;\u586b\u5199\u8981\u63a5\u6536\u6570\u636e\u7684\u6570\u91cf&#xff0c;\u4ee5\u5b57\u8282\u4e3a\u5355\u4f4d&#xff1b;<br \/>\n\u8fd4\u56de\u503c&#xff1a;\u8fd4\u56de\u64cd\u4f5c\u7ed3\u679c&#xff08;HAL_OK \u8868\u793a\u542f\u52a8\u6210\u529f&#xff0c;\u5176\u4ed6\u8fd4\u56de\u503c\u8868\u793a\u5931\u8d25&#xff09;\u3002<\/p>\n<ul>\n<li>\u4e0e HAL_UART_Receive&#xff08;\u963b\u585e\u5f0f&#xff09;\u4e0d\u540c&#xff0c;HAL_UART_Receive_IT \u4e0d\u4f1a\u7b49\u5f85\u6570\u636e\u63a5\u6536\u5b8c\u6210&#xff0c;\u800c\u662f\u6ce8\u518c\u4e2d\u65ad\u540e\u7acb\u5373\u8fd4\u56de&#xff0c;CPU \u53ef\u4ee5\u7ee7\u7eed\u6267\u884c\u5176\u4ed6\u4ee3\u7801\u3002<\/li>\n<li>\u5f53\u6570\u636e\u63a5\u6536\u5b8c\u6210\u540e&#xff0c;\u786c\u4ef6\u89e6\u53d1\u4e2d\u65ad&#xff0c;HAL \u5e93\u4f1a\u81ea\u52a8\u8c03\u7528\u56de\u8c03\u51fd\u6570 HAL_UART_RxCpltCallback&#xff0c;\u9700\u8981\u5728\u7528\u6237\u4ee3\u7801\u4e2d\u5b9e\u73b0\u8be5\u56de\u8c03\u51fd\u6570&#xff0c;\u5728\u91cc\u9762\u5904\u7406\u63a5\u6536\u5b8c\u6210\u540e\u7684\u903b\u8f91\u3002<\/li>\n<\/ul>\n<p><span class=\"token comment\">\/* \u5728 while \u5faa\u73af\u524d\u8c03\u7528&#xff0c;\u542f\u52a8\u4e2d\u65ad\u63a5\u6536 *\/<\/span><br \/>\n<span class=\"token function\">HAL_UART_Receive_IT<\/span><span class=\"token punctuation\">(<\/span><span class=\"token operator\">&amp;<\/span>huart1<span class=\"token punctuation\">,<\/span> <span class=\"token operator\">&amp;<\/span>datarcvd<span class=\"token punctuation\">,<\/span> <span class=\"token number\">1<\/span><span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">;<\/span><\/p>\n<p><span class=\"token comment\">\/* \u5728\u7528\u6237\u4ee3\u7801\u533a\u91cd\u5199\u56de\u8c03\u51fd\u6570 *\/<\/span><br \/>\n<span class=\"token keyword\">void<\/span> <span class=\"token function\">HAL_UART_RxCpltCallback<\/span><span class=\"token punctuation\">(<\/span>UART_HandleTypeDef <span class=\"token operator\">*<\/span>huart<span class=\"token punctuation\">)<\/span><br \/>\n<span class=\"token punctuation\">{<\/span><br \/>\n    <span class=\"token comment\">\/* \u5224\u65ad\u662f\u54ea\u4e2a\u4e32\u53e3\u89e6\u53d1\u7684\u4e2d\u65ad *\/<\/span><br \/>\n    <span class=\"token keyword\">if<\/span> <span class=\"token punctuation\">(<\/span>huart <span class=\"token operator\">&#061;&#061;<\/span> <span class=\"token operator\">&amp;<\/span>huart1<span class=\"token punctuation\">)<\/span><br \/>\n    <span class=\"token punctuation\">{<\/span><br \/>\n        <span class=\"token comment\">\/* \u5728\u8fd9\u91cc\u5904\u7406\u63a5\u6536\u5230\u7684\u6570\u636e *\/<\/span><br \/>\n        <span class=\"token keyword\">if<\/span> <span class=\"token punctuation\">(<\/span>datarcvd <span class=\"token operator\">&#061;&#061;<\/span> <span class=\"token number\">0<\/span><span class=\"token punctuation\">)<\/span><br \/>\n        <span class=\"token punctuation\">{<\/span><br \/>\n            <span class=\"token function\">HAL_GPIO_WritePin<\/span><span class=\"token punctuation\">(<\/span>GPIOC<span class=\"token punctuation\">,<\/span> GPIO_PIN_13<span class=\"token punctuation\">,<\/span> GPIO_PIN_SET<span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">;<\/span><br \/>\n        <span class=\"token punctuation\">}<\/span><br \/>\n        <span class=\"token keyword\">else<\/span> <span class=\"token keyword\">if<\/span> <span class=\"token punctuation\">(<\/span>datarcvd <span class=\"token operator\">&#061;&#061;<\/span> <span class=\"token number\">1<\/span><span class=\"token punctuation\">)<\/span><br \/>\n        <span class=\"token punctuation\">{<\/span><br \/>\n            <span class=\"token function\">HAL_GPIO_WritePin<\/span><span class=\"token punctuation\">(<\/span>GPIOC<span class=\"token punctuation\">,<\/span> GPIO_PIN_13<span class=\"token punctuation\">,<\/span> GPIO_PIN_RESET<span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">;<\/span><br \/>\n        <span class=\"token punctuation\">}<\/span><br \/>\n        <span class=\"token comment\">\/* \u91cd\u65b0\u5f00\u542f\u4e2d\u65ad\u63a5\u6536&#xff0c;\u51c6\u5907\u63a5\u6536\u4e0b\u4e00\u4e2a\u6570\u636e *\/<\/span><br \/>\n        <span class=\"token function\">HAL_UART_Receive_IT<\/span><span class=\"token punctuation\">(<\/span><span class=\"token operator\">&amp;<\/span>huart1<span class=\"token punctuation\">,<\/span> <span class=\"token operator\">&amp;<\/span>datarcvd<span class=\"token punctuation\">,<\/span> <span class=\"token number\">1<\/span><span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">;<\/span><br \/>\n    <span class=\"token punctuation\">}<\/span><br \/>\n<span class=\"token punctuation\">}<\/span><\/p>\n<ul>\n<li>\n<p>\u5173\u952e\u70b9&#xff1a;\u4e2d\u65ad\u63a5\u6536\u53ea\u751f\u6548\u4e00\u6b21&#xff0c;\u6bcf\u5b8c\u6210\u4e00\u6b21\u63a5\u6536\u540e&#xff0c;\u5982\u679c\u60f3\u7ee7\u7eed\u63a5\u6536\u540e\u7eed\u6570\u636e&#xff0c;\u5fc5\u987b\u5728\u56de\u8c03\u51fd\u6570\u4e2d\u518d\u6b21\u8c03\u7528 HAL_UART_Receive_IT \u91cd\u65b0\u5f00\u542f\u4e2d\u65ad\u3002<\/p>\n<\/li>\n<li>\n<p>\u53f3\u8fb9\u6587\u4ef6\u5939\u5904&#xff0c;\u6709\u4e2a&#xff0c;drivers\/stm32&#xff0c;\u6253\u5f00\u4e4b\u540e\u70b9\u51fbuart.c\u6587\u4ef6&#xff0c;\u5728\u6587\u4ef6\u76842622\u884c<\/p>\n<\/li>\n<li>\n<p>![[Pasted image 20260725121145.png]]<\/p>\n<\/li>\n<li>\n<p>ctrl&#043;G\u53ef\u4ee5\u68c0\u7d22\u5230\u8fd9\u4e2a\u4f4d\u7f6e\u3002<\/p>\n<ul>\n<li>weak\u5f31\u65b9\u6cd5\u53ef\u4ee5\u8986\u76d6&#xff0c;\u8fd9\u662f\u6211\u4eec\u8981\u5199\u7684\u56de\u8c03\u51fd\u6570\u7684\u51fd\u6570\u539f\u578b&#xff0c;\u6211\u4eec\u5199\u7684\u51fd\u6570\u540d\u5e94\u548c\u8fd9\u4e2a\u51fd\u6570\u540d\u5b8c\u5168\u4e00\u81f4\u3002<\/li>\n<li>\u56de\u8c03\u51fd\u6570\u7a0b\u5e8f\u3002<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<p><span class=\"token keyword\">void<\/span> <span class=\"token function\">HAL_UART_RxCpltCallback<\/span><span class=\"token punctuation\">(<\/span>UART_HandleTypeDef <span class=\"token operator\">*<\/span>huart<span class=\"token punctuation\">)<\/span><br \/>\n<span class=\"token punctuation\">{<\/span><br \/>\n    <span class=\"token keyword\">if<\/span> <span class=\"token punctuation\">(<\/span>huart <span class=\"token operator\">&#061;&#061;<\/span> <span class=\"token operator\">&amp;<\/span>huart1<span class=\"token punctuation\">)<\/span> <span class=\"token comment\">\/\/ \u56fa\u5b9a\u7684\u5199\u6cd5&#xff0c;\u5224\u65ad\u4f20\u8fdb\u6765\u7684\u53e5\u67c4\u662f\u4e0d\u662f\u4e32\u53e31<\/span><br \/>\n    <span class=\"token punctuation\">{<\/span><br \/>\n        <span class=\"token keyword\">if<\/span> <span class=\"token punctuation\">(<\/span>datarcvd <span class=\"token operator\">&#061;&#061;<\/span> <span class=\"token char\">&#039;1&#039;<\/span><span class=\"token punctuation\">)<\/span><br \/>\n        <span class=\"token punctuation\">{<\/span><br \/>\n            blinkinterval <span class=\"token operator\">&#061;<\/span> <span class=\"token number\">1000<\/span><span class=\"token punctuation\">;<\/span><br \/>\n        <span class=\"token punctuation\">}<\/span><br \/>\n        <span class=\"token keyword\">else<\/span> <span class=\"token keyword\">if<\/span> <span class=\"token punctuation\">(<\/span>datarcvd <span class=\"token operator\">&#061;&#061;<\/span> <span class=\"token char\">&#039;2&#039;<\/span><span class=\"token punctuation\">)<\/span><br \/>\n        <span class=\"token punctuation\">{<\/span><br \/>\n            blinkinterval <span class=\"token operator\">&#061;<\/span> <span class=\"token number\">300<\/span><span class=\"token punctuation\">;<\/span><br \/>\n        <span class=\"token punctuation\">}<\/span><br \/>\n        <span class=\"token keyword\">else<\/span> <span class=\"token keyword\">if<\/span> <span class=\"token punctuation\">(<\/span>datarcvd <span class=\"token operator\">&#061;&#061;<\/span> <span class=\"token char\">&#039;3&#039;<\/span><span class=\"token punctuation\">)<\/span><br \/>\n        <span class=\"token punctuation\">{<\/span><br \/>\n            blinkinterval <span class=\"token operator\">&#061;<\/span> <span class=\"token number\">50<\/span><span class=\"token punctuation\">;<\/span><br \/>\n        <span class=\"token punctuation\">}<\/span><br \/>\n        <span class=\"token function\">HAL_UART_Receive_IT<\/span><span class=\"token punctuation\">(<\/span><span class=\"token operator\">&amp;<\/span>huart1<span class=\"token punctuation\">,<\/span> <span class=\"token operator\">&amp;<\/span>datarcvd<span class=\"token punctuation\">,<\/span> <span class=\"token number\">1<\/span><span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">;<\/span><br \/>\n    <span class=\"token punctuation\">}<\/span><br \/>\n<span class=\"token punctuation\">}<\/span><\/p>\n<p>\u603b\u7ed3&#xff1a;<br \/>\n1&#xff09;\u4e2d\u65ad&#xff0c;\u5c31\u662f\u8ba9cpu\u505c\u6b62\u5f53\u524d\u7a0b\u5e8f&#xff0c;\u5148\u53bb\u5904\u7406\u4e2d\u65ad\u54cd\u5e94\u51fd\u6570&#xff0c;\u5904\u7406\u5b8c\u54cd\u5e94\u51fd\u6570\u4e4b\u540e&#xff0c;\u7ee7\u7eed\u5148\u524d\u7684\u7a0b\u5e8f\u3002<br \/>\n2&#xff09;HAL_UART_Receive_IT&#xff0c;\u8fd9\u4e2a\u7f16\u7a0b\u63a5\u53e3\u7684\u4f5c\u7528&#xff1a;\u901a\u8fc7\u4e32\u53e3\u63a5\u6536\u4e00\u4e2a\u6570\u636e\u7684\u540c\u65f6&#xff0c;\u89e6\u53d1\u4e2d\u65ad&#xff0c;\u8c03\u7528\u56de\u8c03\u51fd\u6570\u3002\u4e2d\u65ad\u63a5\u6536\u89e6\u53d1\u4e4b\u540e&#xff0c;\u76f8\u5f53\u4e8e\u6d3e\u4e00\u4e2a\u5458\u5de5\u5b88\u5728\u95e8\u53e3\u7b49\u7740&#xff0c;\u5f53\u6709\u6570\u636e\u6765\u7684\u65f6\u5019&#xff0c;\u4ed6\u5c31\u63a5\u6536\u6570\u636e&#xff0c;\u89e6\u53d1\u4e2d\u65ad&#xff0c;\u8c03\u7528\u56de\u8c03\u51fd\u6570&#xff0c; \u4ed6\u5728\u7b49\u5f85\u7684\u65f6\u5019&#xff0c;\u4e0d\u5f71\u54cdcpu\u4e3b\u7a0b\u5e8f\u7684\u6b63\u5e38\u6267\u884c\u3002<br \/>\n3&#xff09;\u4e2d\u65ad\u63a5\u6536\u51fd\u6570\u53ea\u751f\u6548\u4e00\u6b21&#xff0c;\u82e5\u60f3\u5b8c\u6210\u63a5\u6536\u540e\u7ee7\u7eed\u63a5\u6536&#xff0c;\u5c31\u9700\u8981\u5728\u56de\u8c03\u51fd\u6570\u5185&#xff0c;\u518d\u8c03\u7528\u4e00\u6b21\u4e2d\u65ad\u63a5\u6536\u51fd\u6570&#xff0c;\u518d\u6d3e\u4e00\u4e2a\u5458\u5de5\u8e72\u5b88\u3002<\/p>\n<ul>\n<li>\u5f53GPIO\u5f15\u811a\u68c0\u6d4b\u5230\u7535\u5e73\u53d8\u5316\u65f6&#xff0c;\u4f1a\u81ea\u52a8\u8c03\u7528\u4e2d\u65ad\u54cd\u5e94\u51fd\u6570<\/li>\n<li>\u6cbf\u7684\u65b9\u5411\u7531\u5f15\u811a\u7535\u5e73\u7684\u8df3\u53d8\u65b9\u5411\u51b3\u5b9a&#xff0c;\u4e0e\u6309\u4e0b\/\u62ac\u8d77\u65e0\u5173&#xff1a;\n<ul>\n<li>\u4e0a\u5347\u6cbf Rising&#xff1a;\u7535\u5e73\u4ece\u4f4e\u2192\u9ad8&#xff08;\u6309\u952e\u63a5GND&#043;\u4e0a\u62c9\u65f6&#xff0c;\u677e\u5f00&#061;\u4f4e\u2192\u9ad8&#061;\u4e0a\u5347\u6cbf&#xff09;<\/li>\n<li>\u4e0b\u964d\u6cbf Falling&#xff1a;\u7535\u5e73\u4ece\u9ad8\u2192\u4f4e&#xff08;\u6309\u952e\u63a5GND&#043;\u4e0a\u62c9\u65f6&#xff0c;\u6309\u4e0b&#061;\u9ad8\u2192\u4f4e&#061;\u4e0b\u964d\u6cbf&#xff09;<\/li>\n<li>\u53cc\u8fb9\u6cbf&#xff1a;\u4e0a\u5347\u6cbf\u548c\u4e0b\u964d\u6cbf\u90fd\u4f1a\u89e6\u53d1<\/li>\n<\/ul>\n<\/li>\n<li>\u672c\u9879\u76ee\u6309\u952e\u63a5 GND &#043; \u4e0a\u62c9&#xff0c;\u6309\u4e0b\u4e3a\u4f4e\u7535\u5e73&#xff0c;\u6545\u914d\u7f6e Falling edge&#xff08;\u4e0b\u964d\u6cbf&#xff09;\u89e6\u53d1<\/li>\n<\/ul>\n","protected":false},"excerpt":{"rendered":"<p>tags:<br \/>\n\u201c#\u4e2d\u65ad\u201d\u201c#stm32\u201d\u201c#\u4e2d\u65ad\u4f18\u5148\u7ea7\u201d\u201c#\u5916\u90e8\u4e2d\u65ad\u201d\u201c#NVIC\u201d\u201c#\u4e32\u53e3\u201d\u201c#\u8235\u673a\u201d\u201c#\u6309\u952e\u201d<br \/>\ndate: 2026-08-04\u4e2d\u65ad\u7684\u57fa\u7840\u6982\u5ff5<br \/>\n1&#xff09;\u5355\u7247\u673a\u4e2d\u65ad\u7f16\u7a0b&#xff1a;<br \/>\n\u5e38\u89c4\u7a0b\u5e8f \u2013 \u7a81\u53d1\u4e8b\u4ef6 \u2013 \u5904\u7406\u7a81\u53d1\u4e8b\u4ef6 \u2013 \u7ee7\u7eed\u5e38\u89c4\u7a0b\u5e8f<br \/>\n\u5176\u4e2d&#xff1a;\u7a81\u53d1\u4e8b\u4ef6\u79f0\u4e3a\u4e2d\u65ad\u6e90<br \/>\n\u5904\u7406\u7a81\u53d1\u4e8b\u4ef6\u7684\u4ee3\u7801\u53eb\u505a\u4e2d\u65ad\u54cd\u5e94\u51fd\u6570&#xff1b;<br \/>\n2&#xff09;\u7a81\u7834\u4e86\u6309\u90e8\u5c31\u73ed\u7684\u505a\u4e8b\u513f\u65b9\u5f0f&#xff0c;\u80fd\u591f\u66f4\u5feb\u7684\u54cd\u5e94\u7a81\u53d1\u4e8b\u4ef6<br \/>\n3&#xff09;\u56de\u987e\u4e4b\u524d\u7684\u95ea\u706f<\/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":[217,270,269],"topic":[],"class_list":["post-91026","post","type-post","status-publish","format-standard","hentry","category-server","tag-stm32","tag-270","tag-269"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v20.3 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>stm32 - \u4e2d\u65ad - \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\/91026.html\" \/>\n<meta property=\"og:locale\" content=\"zh_CN\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"stm32 - \u4e2d\u65ad - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\" \/>\n<meta property=\"og:description\" content=\"tags: \u201c#\u4e2d\u65ad\u201d\u201c#stm32\u201d\u201c#\u4e2d\u65ad\u4f18\u5148\u7ea7\u201d\u201c#\u5916\u90e8\u4e2d\u65ad\u201d\u201c#NVIC\u201d\u201c#\u4e32\u53e3\u201d\u201c#\u8235\u673a\u201d\u201c#\u6309\u952e\u201d date: 2026-08-04\u4e2d\u65ad\u7684\u57fa\u7840\u6982\u5ff5 1&#xff09;\u5355\u7247\u673a\u4e2d\u65ad\u7f16\u7a0b&#xff1a; \u5e38\u89c4\u7a0b\u5e8f \u2013 \u7a81\u53d1\u4e8b\u4ef6 \u2013 \u5904\u7406\u7a81\u53d1\u4e8b\u4ef6 \u2013 \u7ee7\u7eed\u5e38\u89c4\u7a0b\u5e8f \u5176\u4e2d&#xff1a;\u7a81\u53d1\u4e8b\u4ef6\u79f0\u4e3a\u4e2d\u65ad\u6e90 \u5904\u7406\u7a81\u53d1\u4e8b\u4ef6\u7684\u4ee3\u7801\u53eb\u505a\u4e2d\u65ad\u54cd\u5e94\u51fd\u6570&#xff1b; 2&#xff09;\u7a81\u7834\u4e86\u6309\u90e8\u5c31\u73ed\u7684\u505a\u4e8b\u513f\u65b9\u5f0f&#xff0c;\u80fd\u591f\u66f4\u5feb\u7684\u54cd\u5e94\u7a81\u53d1\u4e8b\u4ef6 3&#xff09;\u56de\u987e\u4e4b\u524d\u7684\u95ea\u706f\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.wsisp.com\/helps\/91026.html\" \/>\n<meta property=\"og:site_name\" content=\"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\" \/>\n<meta property=\"article:published_time\" content=\"2026-08-06T08:24:35+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=\"3 \u5206\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/91026.html\",\"url\":\"https:\/\/www.wsisp.com\/helps\/91026.html\",\"name\":\"stm32 - \u4e2d\u65ad - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\",\"isPartOf\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/#website\"},\"datePublished\":\"2026-08-06T08:24:35+00:00\",\"dateModified\":\"2026-08-06T08:24:35+00:00\",\"author\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41\"},\"breadcrumb\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/91026.html#breadcrumb\"},\"inLanguage\":\"zh-Hans\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.wsisp.com\/helps\/91026.html\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/91026.html#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"\u9996\u9875\",\"item\":\"https:\/\/www.wsisp.com\/helps\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"stm32 -- \u4e2d\u65ad\"}]},{\"@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":"stm32 - \u4e2d\u65ad - \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\/91026.html","og_locale":"zh_CN","og_type":"article","og_title":"stm32 - \u4e2d\u65ad - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","og_description":"tags: \u201c#\u4e2d\u65ad\u201d\u201c#stm32\u201d\u201c#\u4e2d\u65ad\u4f18\u5148\u7ea7\u201d\u201c#\u5916\u90e8\u4e2d\u65ad\u201d\u201c#NVIC\u201d\u201c#\u4e32\u53e3\u201d\u201c#\u8235\u673a\u201d\u201c#\u6309\u952e\u201d date: 2026-08-04\u4e2d\u65ad\u7684\u57fa\u7840\u6982\u5ff5 1&#xff09;\u5355\u7247\u673a\u4e2d\u65ad\u7f16\u7a0b&#xff1a; \u5e38\u89c4\u7a0b\u5e8f \u2013 \u7a81\u53d1\u4e8b\u4ef6 \u2013 \u5904\u7406\u7a81\u53d1\u4e8b\u4ef6 \u2013 \u7ee7\u7eed\u5e38\u89c4\u7a0b\u5e8f \u5176\u4e2d&#xff1a;\u7a81\u53d1\u4e8b\u4ef6\u79f0\u4e3a\u4e2d\u65ad\u6e90 \u5904\u7406\u7a81\u53d1\u4e8b\u4ef6\u7684\u4ee3\u7801\u53eb\u505a\u4e2d\u65ad\u54cd\u5e94\u51fd\u6570&#xff1b; 2&#xff09;\u7a81\u7834\u4e86\u6309\u90e8\u5c31\u73ed\u7684\u505a\u4e8b\u513f\u65b9\u5f0f&#xff0c;\u80fd\u591f\u66f4\u5feb\u7684\u54cd\u5e94\u7a81\u53d1\u4e8b\u4ef6 3&#xff09;\u56de\u987e\u4e4b\u524d\u7684\u95ea\u706f","og_url":"https:\/\/www.wsisp.com\/helps\/91026.html","og_site_name":"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","article_published_time":"2026-08-06T08:24:35+00:00","author":"admin","twitter_card":"summary_large_image","twitter_misc":{"\u4f5c\u8005":"admin","\u9884\u8ba1\u9605\u8bfb\u65f6\u95f4":"3 \u5206"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/www.wsisp.com\/helps\/91026.html","url":"https:\/\/www.wsisp.com\/helps\/91026.html","name":"stm32 - \u4e2d\u65ad - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","isPartOf":{"@id":"https:\/\/www.wsisp.com\/helps\/#website"},"datePublished":"2026-08-06T08:24:35+00:00","dateModified":"2026-08-06T08:24:35+00:00","author":{"@id":"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41"},"breadcrumb":{"@id":"https:\/\/www.wsisp.com\/helps\/91026.html#breadcrumb"},"inLanguage":"zh-Hans","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.wsisp.com\/helps\/91026.html"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.wsisp.com\/helps\/91026.html#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"\u9996\u9875","item":"https:\/\/www.wsisp.com\/helps"},{"@type":"ListItem","position":2,"name":"stm32 -- \u4e2d\u65ad"}]},{"@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\/91026","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=91026"}],"version-history":[{"count":0,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/posts\/91026\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/media?parent=91026"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/categories?post=91026"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/tags?post=91026"},{"taxonomy":"topic","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/topic?post=91026"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}