{"id":372,"date":"2025-12-10T06:10:03","date_gmt":"2025-12-09T22:10:03","guid":{"rendered":"https:\/\/qkd.koudaipc.com\/?p=372"},"modified":"2025-12-10T06:10:03","modified_gmt":"2025-12-09T22:10:03","slug":"at32f415-openharmony%e8%bd%bb%e9%87%8f%e7%b3%bb%e7%bb%9f%e7%a7%bb%e6%a4%8d","status":"publish","type":"post","link":"https:\/\/ns1.koudaipc.com\/en\/2025\/12\/10\/at32f415-openharmony%e8%bd%bb%e9%87%8f%e7%b3%bb%e7%bb%9f%e7%a7%bb%e6%a4%8d\/","title":{"rendered":"AT32F415 OpenHarmony\u8f7b\u91cf\u7cfb\u7edf\u79fb\u690d"},"content":{"rendered":"<p>\u5c06 OpenHarmony LiteOS-M \u79fb\u690d\u5230 AT32F415 \u82af\u7247\u662f\u53ef\u884c\u7684\uff0c\u56e0\u4e3a\u5176 <strong>Cortex\u2011M4 \u5185\u6838\u5df2\u53d7\u652f\u6301<\/strong>\uff0c\u79fb\u690d\u5de5\u4f5c\u5c06\u4e3b\u8981\u56f4\u7ed5\u201c\u5355\u677f\u9002\u914d\u201d\u5c55\u5f00\u3002<\/p>\n<h3>\ud83d\udcdd \u79fb\u690d\u53ef\u884c\u6027\u4e0e\u524d\u7f6e\u6761\u4ef6<\/h3>\n<table>\n<thead>\n<tr>\n<th style=\"text-align: left;\">\u9879\u76ee<\/th>\n<th style=\"text-align: left;\">\u8bf4\u660e<\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<td style=\"text-align: left;\"><strong>\u82af\u7247\u67b6\u6784<\/strong><\/td>\n<td style=\"text-align: left;\">AT32F415 \u91c7\u7528 <strong>ARM Cortex\u2011M4<\/strong>\uff0cOpenHarmony LiteOS\u2011M \u5df2\u5728 <code>kernel\/arch\/arm\/cortex\u2011m4<\/code> \u4e2d\u63d0\u4f9b\u652f\u6301[reference:0]\u3002<\/td>\n<\/tr>\n<tr>\n<td style=\"text-align: left;\"><strong>\u79fb\u690d\u7c7b\u578b<\/strong><\/td>\n<td style=\"text-align: left;\">\u5c5e\u4e8e <strong>\u5355\u677f\u9002\u914d<\/strong>\uff08Board Porting\uff09\uff0c\u65e0\u9700\u4ece\u96f6\u5f00\u59cb\u9002\u914d\u82af\u7247\u67b6\u6784\u3002<\/td>\n<\/tr>\n<tr>\n<td style=\"text-align: left;\"><strong>\u4e3b\u8981\u5de5\u4f5c<\/strong><\/td>\n<td style=\"text-align: left;\">\u521b\u5efa\u677f\u7ea7\u76ee\u5f55\u3001\u7f16\u5199\u542f\u52a8\u6587\u4ef6\u3001\u914d\u7f6e\u7cfb\u7edf\u65f6\u949f\u3001\u79fb\u690d\u5fc5\u8981\u9a71\u52a8\uff08UART\u3001GPIO\u3001Timer\u7b49\uff09\u3001\u8c03\u6574\u94fe\u63a5\u811a\u672c\u3002<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<h3>\ud83d\udd27 \u79fb\u690d\u6b65\u9aa4\u6982\u89c8<\/h3>\n<p>\u6574\u4e2a\u79fb\u690d\u5de5\u4f5c\u53ef\u5206\u4e3a\u4ee5\u4e0b\u51e0\u4e2a\u5173\u952e\u73af\u8282\uff1a<\/p>\n<table>\n<thead>\n<tr>\n<th style=\"text-align: left;\">\u6b65\u9aa4<\/th>\n<th style=\"text-align: left;\">\u5173\u952e\u4efb\u52a1<\/th>\n<th style=\"text-align: left;\">\u8bf4\u660e\u4e0e\u53c2\u8003<\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<td style=\"text-align: left;\"><strong>1. \u79fb\u690d\u51c6\u5907<\/strong><\/td>\n<td style=\"text-align: left;\">\u83b7\u53d6 OpenHarmony \u6e90\u7801\u3001\u642d\u5efa\u7f16\u8bd1\u73af\u5883\uff08hb\u3001arm\u2011none\u2011eabi\u2011gcc\uff09\u3002<\/td>\n<td style=\"text-align: left;\">\u5efa\u8bae\u4f7f\u7528 OpenHarmony 3.0.1 LTS \u6216\u66f4\u9ad8\u7248\u672c\u3002<\/td>\n<\/tr>\n<tr>\n<td style=\"text-align: left;\"><strong>2. \u5355\u677f\u9002\u914d<\/strong><\/td>\n<td style=\"text-align: left;\">\u5728 <code>device\/board\/<\/code> \u4e0b\u521b\u5efa <code>at32f415<\/code> \u76ee\u5f55\uff0c\u7f16\u5199 <code>BUILD.gn<\/code>\u3001<code>config.gni<\/code> \u7b49\u3002<\/td>\n<td style=\"text-align: left;\">\u53ef\u53c2\u8003\u5df2\u6709 Cortex\u2011M4 \u677f\u7ea7\u914d\u7f6e\uff08\u5982 <code>gd32f303<\/code>\uff09\u3002<\/td>\n<\/tr>\n<tr>\n<td style=\"text-align: left;\"><strong>3. \u5185\u6838\u9002\u914d<\/strong><\/td>\n<td style=\"text-align: left;\">\u786e\u8ba4 <code>liteos_m\/kernel\/arch\/arm\/cortex\u2011m4<\/code> \u5df2\u652f\u6301\uff0c\u65e0\u9700\u4fee\u6539 arch \u4ee3\u7801\u3002<\/td>\n<td style=\"text-align: left;\">\u91cd\u70b9\u5728\u542f\u52a8\u6587\u4ef6 <code>startup.S<\/code>\u3001\u94fe\u63a5\u811a\u672c <code>linker.ld<\/code> \u7684\u9002\u914d\u3002<\/td>\n<\/tr>\n<tr>\n<td style=\"text-align: left;\"><strong>4. \u5b50\u7cfb\u7edf\u4e0e\u9a71\u52a8\u79fb\u690d<\/strong><\/td>\n<td style=\"text-align: left;\">\u79fb\u690d <strong>HDF<\/strong> \u9a71\u52a8\u6846\u67b6\u6216\u76f4\u63a5\u88f8\u673a\u9a71\u52a8\uff08UART \u7528\u4e8e\u8c03\u8bd5\u3001GPIO\u3001Timer\u3001Flash \u7b49\uff09\u3002<\/td>\n<td style=\"text-align: left;\">\u4f7f\u7528 HDF \u53ef\u66f4\u597d\u517c\u5bb9 OpenHarmony \u9a71\u52a8\u6a21\u578b\u3002<\/td>\n<\/tr>\n<tr>\n<td style=\"text-align: left;\"><strong>5. \u7f16\u8bd1\u4e0e\u9a8c\u8bc1<\/strong><\/td>\n<td style=\"text-align: left;\">\u901a\u8fc7 <code>hb set<\/code> \u9009\u62e9\u4f60\u7684\u677f\u5b50\uff0c<code>hb build<\/code> \u7f16\u8bd1\uff0c\u6700\u540e\u70e7\u5f55\u5e76\u89c2\u5bdf\u4e32\u53e3\u8f93\u51fa\u3002<\/td>\n<td style=\"text-align: left;\">\u9996\u6b21\u5efa\u8bae\u5148\u5b9e\u73b0\u4e32\u53e3\u6253\u5370 \u201cHello OpenHarmony!\u201d \u9a8c\u8bc1\u6700\u5c0f\u7cfb\u7edf\u3002<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<h3>\ud83d\udca1 \u5173\u952e\u63d0\u793a\u4e0e\u6ce8\u610f\u4e8b\u9879<\/h3>\n<ul>\n<li><strong>\u65f6\u949f\u914d\u7f6e<\/strong>\uff1aAT32F415 \u7684\u65f6\u949f\u6811\u9700\u5728 <code>board.c<\/code> \u4e2d\u6b63\u786e\u521d\u59cb\u5316\uff0c\u786e\u4fdd\u5185\u6838\u5b9a\u65f6\u5668\uff08SysTick\uff09\u9891\u7387\u8bbe\u7f6e\u6b63\u786e\u3002<\/li>\n<li><strong>\u4e32\u53e3\u8c03\u8bd5<\/strong>\uff1a\u5c3d\u65e9\u5b9e\u73b0 UART \u9a71\u52a8\uff0c\u65b9\u4fbf\u6253\u5370\u8c03\u8bd5\u4fe1\u606f\u3002<\/li>\n<li><strong>\u5b58\u50a8\u5e03\u5c40<\/strong>\uff1a\u94fe\u63a5\u811a\u672c\u9700\u5339\u914d AT32F415 \u7684 Flash \u548c RAM \u5730\u5740\u4e0e\u5927\u5c0f\u3002<\/li>\n<li><strong>\u4e2d\u65ad\u5411\u91cf\u8868<\/strong>\uff1a\u542f\u52a8\u6587\u4ef6\u4e2d\u9700\u6b63\u786e\u8bbe\u7f6e\u4e2d\u65ad\u5411\u91cf\u8868\u5730\u5740\uff0c\u5e76\u786e\u4fdd <code>Reset_Handler<\/code> \u8df3\u8f6c\u5230 OpenHarmony \u5165\u53e3\u3002<\/li>\n<li><strong>\u53c2\u8003\u73b0\u6709\u79fb\u690d<\/strong>\uff1a\u867d\u7136\u6ca1\u6709\u76f4\u63a5\u7684 AT32F415 \u79fb\u690d\uff0c\u4f46 [\u300a\u4ece\u96f6\u5f00\u59cb\u79fb\u690dOpenHarmony\u8f7b\u91cf\u7cfb\u7edf\u300b] \u7cfb\u5217\u6587\u7ae0\u8be6\u7ec6\u4ecb\u7ecd\u4e86\u5728 GD32F303\uff08\u540c\u4e3a Cortex\u2011M4\uff09\u4e0a\u7684\u79fb\u690d\u8fc7\u7a0b\uff0c\u5176\u6b65\u9aa4\u3001\u4ee3\u7801\u7ed3\u6784\u53ef\u4f9b\u76f4\u63a5\u53c2\u8003[reference:1]\u3002<\/li>\n<li><strong>\u5b98\u65b9\u6587\u6863<\/strong>\uff1aOpenHarmony \u63d0\u4f9b\u7684 [\u8f7b\u91cf\u7cfb\u7edf\u82af\u7247\u79fb\u690d\u6982\u8ff0] \u63d0\u4f9b\u4e86\u5b8c\u6574\u7684\u9002\u914d\u6d41\u7a0b\u548c\u5173\u952e\u6982\u5ff5\u8bf4\u660e[reference:2]\u3002<\/li>\n<\/ul>\n<h3>\ud83d\udcda \u76f8\u5173\u8d44\u6e90<\/h3>\n<table>\n<thead>\n<tr>\n<th style=\"text-align: left;\">\u8d44\u6e90<\/th>\n<th style=\"text-align: left;\">\u94fe\u63a5<\/th>\n<th style=\"text-align: left;\">\u8bf4\u660e<\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<td style=\"text-align: left;\"><strong>\u8f7b\u91cf\u7cfb\u7edf\u82af\u7247\u79fb\u690d\u6982\u8ff0<\/strong><\/td>\n<td style=\"text-align: left;\">[<a href=\"http:\/\/open.weharmonyos.com\/zh-cn\/device-dev\/porting\/porting-minichip-overview.html\">http:\/\/open.weharmonyos.com\/zh-cn\/device-dev\/porting\/porting-minichip-overview.html<\/a>]<\/td>\n<td style=\"text-align: left;\">\u5b98\u65b9\u9002\u914d\u6d41\u7a0b\u3001\u57fa\u672c\u6982\u5ff5[reference:3]<\/td>\n<\/tr>\n<tr>\n<td style=\"text-align: left;\"><strong>\u79fb\u690d\u6982\u8ff0\uff08\u82af\u7247\u67b6\u6784\u9002\u914d\uff09<\/strong><\/td>\n<td style=\"text-align: left;\">[<a href=\"https:\/\/openi.pcl.ac.cn\/openihu\/openharmony-docs\/src\/commit\/f0c211a24a813dbf1fe45a89f599a0003e5760f4\/zh-cn\/device-dev\/porting\/\u79fb\u690d\u6982\u8ff0.md\">https:\/\/openi.pcl.ac.cn\/openihu\/openharmony-docs\/src\/commit\/f0c211a24a813dbf1fe45a89f599a0003e5760f4\/zh-cn\/device-dev\/porting\/\u79fb\u690d\u6982\u8ff0.md<\/a>]<\/td>\n<td style=\"text-align: left;\">\u8bf4\u660e\u4f55\u65f6\u9700\u505a arch \u9002\u914d\u3001\u76ee\u5f55\u7ed3\u6784[reference:4]<\/td>\n<\/tr>\n<tr>\n<td style=\"text-align: left;\"><strong>\u4ece\u96f6\u5f00\u59cb\u79fb\u690dOpenHarmony\u8f7b\u91cf\u7cfb\u7edf<\/strong>\uff08GD32F303\uff09<\/td>\n<td style=\"text-align: left;\">[<a href=\"https:\/\/bbs.elecfans.com\/jishu_2249266_1_1.html\">https:\/\/bbs.elecfans.com\/jishu_2249266_1_1.html<\/a>]<\/td>\n<td style=\"text-align: left;\">7\u7bc7\u8be6\u7ec6\u79fb\u690d\u6587\u7ae0\uff0c\u4ee3\u7801\u5f00\u6e90[reference:5]<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>\u603b\u7684\u6765\u8bf4\uff0c\u79fb\u690d AT32F415 \u7684\u5173\u952e\u662f\u5b8c\u6210\u5355\u677f\u9002\u914d\u548c\u9a71\u52a8\u79fb\u690d\u3002\u5982\u679c\u4f60\u6709\u66f4\u5177\u4f53\u7684\u5f00\u53d1\u677f\u578b\u53f7\uff08\u5982\u67d0\u6b3e AT32F415 \u5f00\u53d1\u677f\uff09\uff0c\u6216\u9047\u5230\u67d0\u4e2a\u5177\u4f53\u6b65\u9aa4\uff08\u5982\u542f\u52a8\u6587\u4ef6\u4fee\u6539\u3001\u94fe\u63a5\u811a\u672c\u7f16\u5199\uff09\u7684\u95ee\u9898\uff0c\u53ef\u4ee5\u8fdb\u4e00\u6b65\u63d0\u95ee\uff0c\u6211\u80fd\u63d0\u4f9b\u66f4\u8be6\u7ec6\u7684\u6307\u5bfc\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u5c06 OpenHarmony LiteOS-M \u79fb\u690d\u5230 AT32F415 \u82af\u7247\u662f\u53ef\u884c\u7684\uff0c\u56e0\u4e3a\u5176 Cortex\u2011M [&hellip;]<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"pmpro_default_level":"","footnotes":""},"categories":[23],"tags":[],"class_list":["post-372","post","type-post","status-publish","format-standard","hentry","category-kpcos","pmpro-has-access"],"_links":{"self":[{"href":"https:\/\/ns1.koudaipc.com\/en\/wp-json\/wp\/v2\/posts\/372","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/ns1.koudaipc.com\/en\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/ns1.koudaipc.com\/en\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/ns1.koudaipc.com\/en\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/ns1.koudaipc.com\/en\/wp-json\/wp\/v2\/comments?post=372"}],"version-history":[{"count":1,"href":"https:\/\/ns1.koudaipc.com\/en\/wp-json\/wp\/v2\/posts\/372\/revisions"}],"predecessor-version":[{"id":373,"href":"https:\/\/ns1.koudaipc.com\/en\/wp-json\/wp\/v2\/posts\/372\/revisions\/373"}],"wp:attachment":[{"href":"https:\/\/ns1.koudaipc.com\/en\/wp-json\/wp\/v2\/media?parent=372"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/ns1.koudaipc.com\/en\/wp-json\/wp\/v2\/categories?post=372"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/ns1.koudaipc.com\/en\/wp-json\/wp\/v2\/tags?post=372"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}