{"id":1468,"date":"2024-08-18T10:46:35","date_gmt":"2024-08-18T02:46:35","guid":{"rendered":"https:\/\/xujiwei.com\/blog\/?p=1468"},"modified":"2024-08-18T10:46:35","modified_gmt":"2024-08-18T02:46:35","slug":"run-linux-on-ch32v003","status":"publish","type":"post","link":"https:\/\/xujiwei.com\/blog\/2024\/08\/run-linux-on-ch32v003\/","title":{"rendered":"\u7528 7 \u6bdb\u94b1\u7684 CH32V003 \u5355\u7247\u673a\u8dd1 Linux\uff0c\u542f\u52a8\u9700\u8981 5 \u5206\u949f"},"content":{"rendered":"<div id=\"ez-toc-container\" class=\"ez-toc-v2_0_65 ez-toc-wrap-right counter-hierarchy ez-toc-counter ez-toc-light-blue ez-toc-container-direction\">\n<p class=\"ez-toc-title\">\u6587\u7ae0\u76ee\u5f55<\/p>\n<label for=\"ez-toc-cssicon-toggle-item-69e35c5d14c7e\" class=\"ez-toc-cssicon-toggle-label\"><span class=\"\"><span class=\"eztoc-hide\" style=\"display:none;\">Toggle<\/span><span class=\"ez-toc-icon-toggle-span\"><svg style=\"fill: #999;color:#999\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" class=\"list-377408\" width=\"20px\" height=\"20px\" viewBox=\"0 0 24 24\" fill=\"none\"><path d=\"M6 6H4v2h2V6zm14 0H8v2h12V6zM4 11h2v2H4v-2zm16 0H8v2h12v-2zM4 16h2v2H4v-2zm16 0H8v2h12v-2z\" fill=\"currentColor\"><\/path><\/svg><svg style=\"fill: #999;color:#999\" class=\"arrow-unsorted-368013\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" width=\"10px\" height=\"10px\" viewBox=\"0 0 24 24\" version=\"1.2\" baseProfile=\"tiny\"><path d=\"M18.2 9.3l-6.2-6.3-6.2 6.3c-.2.2-.3.4-.3.7s.1.5.3.7c.2.2.4.3.7.3h11c.3 0 .5-.1.7-.3.2-.2.3-.5.3-.7s-.1-.5-.3-.7zM5.8 14.7l6.2 6.3 6.2-6.3c.2-.2.3-.5.3-.7s-.1-.5-.3-.7c-.2-.2-.4-.3-.7-.3h-11c-.3 0-.5.1-.7.3-.2.2-.3.5-.3.7s.1.5.3.7z\"\/><\/svg><\/span><\/span><\/label><input type=\"checkbox\"  id=\"ez-toc-cssicon-toggle-item-69e35c5d14c7e\"  aria-label=\"Toggle\" \/><nav><ul class='ez-toc-list ez-toc-list-level-1 ' ><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-1\" href=\"https:\/\/xujiwei.com\/blog\/2024\/08\/run-linux-on-ch32v003\/#linux-ch32v003\" title=\"linux-ch32v003\">linux-ch32v003<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-2\" href=\"https:\/\/xujiwei.com\/blog\/2024\/08\/run-linux-on-ch32v003\/#mini-rv32ima\" title=\"mini-rv32ima\">mini-rv32ima<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-3\" href=\"https:\/\/xujiwei.com\/blog\/2024\/08\/run-linux-on-ch32v003\/#%E5%A4%8D%E5%88%BB\" title=\"\u590d\u523b\">\u590d\u523b<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-4\" href=\"https:\/\/xujiwei.com\/blog\/2024\/08\/run-linux-on-ch32v003\/#%E5%8F%82%E8%80%83%E8%B5%84%E6%96%99\" title=\"\u53c2\u8003\u8d44\u6599\">\u53c2\u8003\u8d44\u6599<\/a><\/li><\/ul><\/nav><\/div>\n<p>\u5728\u63a5\u89e6\u5230\u53ea\u9700\u8981 7 \u6bdb\u94b1\u7684\u5355\u7247\u673a CH32V003 \u4e4b\u540e\uff0c\u62ff\u5b83\u505a\u4e86\u597d\u51e0\u4e2a DIY \u9879\u76ee\uff0c\u50cf\u94a5\u5319\u6263\u6e38\u620f\u673a\u4ec0\u4e48\u7684\uff0c\u611f\u89c9\u8fd8\u662f\u6bd4\u8f83\u6709\u610f\u601d\u7684\uff0c\u867d\u7136\u8d44\u6e90\u76f8\u6bd4 STM32F103 \u5c11\u5f88\u591a\uff0c\u4f46\u662f\u4ef7\u683c\u5b9e\u5728\u592a\u4fbf\u5b9c\u4e86\u3002<\/p>\n<p>\u5728\u4f7f\u7528 CH32V003 \u7684\u8fc7\u7a0b\u4e2d\uff0c\u4e5f\u4e0a\u7f51\u641c\u4e86\u4e00\u5708\u4f7f\u7528\u5b83\u7684\u9879\u76ee\uff0c\u5176\u4e2d\u6709\u4e00\u4e2a linux-ch32v003 \u5c31\u5f88\u6709\u610f\u601d\uff0c\u4f5c\u8005\u7684\u4ecb\u7ecd\u5c31\u662f\u201c\u5728\u4e00\u4e2a 0.15 \u7f8e\u5143\u7684\u5355\u7247\u673a\u4e0a\u8fd0\u884c Linux\u201d\uff0c\u6211\u4e5f\u514b\u9686\u4e86\u8fd9\u4e2a\u9879\u76ee\u5b66\u4e60\u4e86\u4e00\u4e0b\u3002<\/p>\n<h2><span class=\"ez-toc-section\" id=\"linux-ch32v003\"><\/span>linux-ch32v003<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<blockquote>\n<p>Linux on a $0.15 RISC-V microcontroller<\/p>\n<\/blockquote>\n<p>\u9879\u76ee\u5730\u5740\uff1a <a href=\"https:\/\/github.com\/tvlad1234\/linux-ch32v003\">https:\/\/github.com\/tvlad1234\/linux-ch32v003<\/a><\/p>\n<p>\u8fd9\u4e2a\u9879\u76ee\u4e3b\u8981\u89e3\u51b3\u7684\u95ee\u9898\u5c31\u662f CH32V003 \u53ef\u7528\u5185\u5b58\u592a\u5c11\u7684\u95ee\u9898\uff0c\u4f5c\u8005\u4f7f\u7528\u4e86\u4e00\u4e2a\u5916\u56f4\u7684 PSRAM \u6765\u6269\u5c55\u5185\u5b58\uff0c\u5b9e\u73b0\u4e86\u786c\u4ef6 SPI \u64cd\u4f5c\u76f8\u5173\u7684\u5e93\u3002<\/p>\n<p>\u6a21\u62df\u5668\u672c\u8eab\uff0c\u5176\u5b9e\u662f\u53e6\u5916\u4e00\u4e2a\u5f00\u6e90\u9879\u76ee mini-rv32ima\uff0c\u4e00\u4e2a RISC-V \u7684\u6a21\u62df\u5668\u3002<\/p>\n<p>linux-ch32v003 \u4e3b\u8981\u7684\u76ee\u5f55\u7ed3\u6784\u5982\u4e0b\uff1a<\/p>\n<p><img src=\"https:\/\/xujiwei.com\/blog\/wp-content\/uploads\/2024\/08\/linux-ch32v003-01.png\" alt=\"linux-ch32v003-01\" style=\"zoom:50%;\" \/><\/p>\n<p>\u9879\u76ee\u76ee\u5f55\u4e2d\u4e3b\u8981\u7684\u5185\u5bb9\uff1a<\/p>\n<ul>\n<li>emulator\uff1a\u6a21\u62df\u5668\u76f8\u5173\u4ee3\u7801\uff0c\u6765\u81ea mini-rv32ima \u9879\u76ee<\/li>\n<li>hardware\uff1a\u6d4b\u8bd5\u7528\u7684\u786c\u4ef6\u5de5\u7a0b\uff0c\u4f7f\u7528 KiCAD \u5f00\u53d1<\/li>\n<li>hw_spi\uff1a\u786c\u4ef6 SPI \u5e93<\/li>\n<li>linux\uff1a\u7f16\u8bd1 Linux \u955c\u50cf\u6240\u9700\u8981\u7684\u914d\u7f6e\uff0c\u6709\u4e00\u4e2a Makefile \u53ef\u4ee5\u4e00\u952e\u6253\u5305\uff0c\u53e6\u5916\u8fd8\u5305\u542b\u4e86 buildroot \u76f8\u5173\u7684\u914d\u7f6e<\/li>\n<li>pff\uff1aFatFS \u6587\u4ef6\u7cfb\u7edf\u8bfb\u5199\u5e93<\/li>\n<li>psram\uff1a\u5916\u7f6e\u9759\u6001\u5b58\u50a8 PSRAM \u64cd\u4f5c\u5e93<\/li>\n<\/ul>\n<p>\u53ea\u80fd\u8bf4\uff0c\u4e3a\u4e86\u5728 CH32V003 \u4e0a\u628a Linux \u8dd1\u8d77\u6765\uff0c\u6709\u592a\u591a\u989d\u5916\u5de5\u4f5c\u8981\u505a\u4e86\u3002<\/p>\n<h2><span class=\"ez-toc-section\" id=\"mini-rv32ima\"><\/span>mini-rv32ima<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p><img src=\"https:\/\/xujiwei.com\/blog\/wp-content\/uploads\/2024\/08\/linux-ch32v003-2.png\" alt=\"linux-ch32v003-2\" style=\"width:100%;\" \/><\/p>\n<p>mini-rv32ima \u662f\u4e00\u4e2a\u8d85\u7cbe\u7b80\u7684 RISC-V \u6a21\u62df\u5668\uff0c\u6ca1\u6709\u5916\u90e8\u4f9d\u8d56\uff0c\u53ea\u6709\u4e00\u4e2a\u5934\u6587\u4ef6\u3002<\/p>\n<blockquote>\n<p>A tiny C header-only risc-v emulator.<\/p>\n<\/blockquote>\n<p>\u5728\u4e86\u89e3\u4e86\u8fd9\u4e2a\u9879\u76ee\u4e4b\u540e\u624d\u53d1\u73b0\uff0c\u5b83\u7684\u4f5c\u8005\u540c\u65f6\u4e5f\u662f CH32V003 \u7cbe\u7b80\u5f00\u53d1 SDK ch32v003fun \u7684\u4f5c\u8005\uff0c\u5927\u4f6c\u679c\u7136\u8fd8\u662f\u5927\u4f6c\u3002<\/p>\n<p>\u7ed3\u5408 linux-ch32v003 \u9879\u76ee\uff0c\u5927\u6982\u7814\u7a76\u4e86\u4e00\u4e0b mini-rv32ima\uff0c\u8981\u63a5\u5165\u7684\u65b9\u6cd5\u4e5f\u4e0d\u7b97\u591a\uff0c\u4e3b\u8981\u662f\u5904\u7406\u5185\u5b58\u8bbf\u95ee\u3001\u952e\u76d8\u8f93\u5165\u4ee5\u53ca\u7ec8\u7aef\u8f93\u51fa\u3002<\/p>\n<p>\u5728 <code>mini-rv32ima.c<\/code> \u4e2d\u5df2\u7ecf\u5b9a\u4e49\u4e86\u9700\u8981\u5b9e\u73b0\u7684\u51fd\u6570\u3002<\/p>\n<p><img src=\"https:\/\/xujiwei.com\/blog\/wp-content\/uploads\/2024\/08\/linux-ch32v003-3.png\" alt=\"linux-ch32v003-3\" style=\"widht:100%;\" \/><\/p>\n<p>\u4e3b\u8981\u662f\u7ec8\u7aef\u7684\u63a5\u5165\uff0c\u53ea\u6709\u63a5\u5165\u4e86\u7ec8\u7aef\uff0c\u8fd9\u4e2a\u6a21\u62df\u5668\u624d\u80fd\u771f\u6b63\u548c\u7528\u6237\u4ea4\u4e92\uff0c\u770b\u4e86\u4e0b linux-ch32v003 \u7684\u5b9e\u73b0\uff0c\u8fd8\u662f\u6bd4\u8f83\u7b80\u5355\u7684\u3002<\/p>\n<p><img src=\"https:\/\/xujiwei.com\/blog\/wp-content\/uploads\/2024\/08\/linux-ch32v003-4.png\" alt=\"linux-ch32v003-4\" style=\"width:100%;\" \/><\/p>\n<h2><span class=\"ez-toc-section\" id=\"%E5%A4%8D%E5%88%BB\"><\/span>\u590d\u523b<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p>\u770b\u5230\u8fd9\u4e2a\u9879\u76ee\u4e4b\u540e\u5c31\u51c6\u5907\u590d\u523b\u4e00\u4e2a\u4e86\uff0c\u4e0d\u8fc7\u6309\u4f5c\u8005\u7684\u8bf4\u6cd5\uff0cLinux \u5728 CH32V003 \u4e0a\u542f\u52a8\u8981\u82b1 5 \u5206\u949f\uff0c\u8fd9\u5b9e\u5728\u96be\u4ee5\u63a5\u53d7\uff0c\u5e76\u4e14\u610f\u4e49\u4e5f\u4e0d\u5927\u2026\u2026<\/p>\n<p>\u521a\u597d\u8fd9\u4e2a\u9879\u76ee\u7528\u7684 PSRAM \u662f 8M \u7684\uff0c\u800c\u6211\u7ecf\u5e38\u7528\u7684 ESP32-S3 \u5c31\u6709 8M PSRAM \u7684\u7248\u672c\uff0c\u5b8c\u7f8e\u5339\u914d\u4e86\u539f\u9879\u76ee\u7684\u9700\u6c42\uff0c\u5e76\u4e14\u76f4\u63a5\u8d2d\u4e70 ESP32-S3-N16R8 \u6a21\u7ec4\u7684\u8bdd\uff0c\u8fde\u710a\u63a5\u5de5\u4f5c\u90fd\u7701\u6389\u4e86\uff0c\u76f4\u63a5\u81ea\u5e26\u4e86 8M PSRAM\u3002<\/p>\n<p>\u5e76\u4e14 ESP32-S3 \u7684 CPU \u8981\u6bd4 CH32V003 \u5f3a\u52b2\u592a\u591a\u4e86\uff0c\u542f\u52a8\u65f6\u95f4\u5e94\u8be5\u4e0d\u9700\u8981 5 \u5206\u949f\u90a3\u4e48\u591a\u3002<\/p>\n<p>\u53e6\u5916\u56e0\u4e3a ESP32-S3-N16R8 \u7684 Flash \u6709 16MB\uff0c\u90a3\u4e48 Linux \u955c\u50cf\u4e5f\u53ef\u4ee5\u76f4\u63a5\u6253\u5305\u5728\u56fa\u4ef6\u91cc\u4e86\uff0c\u7701\u53bb\u4e86\u989d\u5916\u641e TF \u5361\u9a71\u52a8\u7684\u9ebb\u70e6\u3002<\/p>\n<p>\u7b49\u641e\u5b8c\u4e86\u518d\u5206\u4eab\u7ed9\u5927\u5bb6\u5427\uff5e<\/p>\n<h2><span class=\"ez-toc-section\" id=\"%E5%8F%82%E8%80%83%E8%B5%84%E6%96%99\"><\/span>\u53c2\u8003\u8d44\u6599<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<ul>\n<li><a href=\"https:\/\/github.com\/tvlad1234\/linux-ch32v003\">https:\/\/github.com\/tvlad1234\/linux-ch32v003<\/a><\/li>\n<li><a href=\"https:\/\/github.com\/cnlohr\/mini-rv32ima\">https:\/\/github.com\/cnlohr\/mini-rv32ima<\/a><\/li>\n<li><a href=\"https:\/\/github.com\/wagiminator\/CH32V003-GameConsole\">https:\/\/github.com\/wagiminator\/CH32V003-GameConsole<\/a><\/li>\n<li><a href=\"https:\/\/github.com\/cnlohr\/ch32v003fun\">https:\/\/github.com\/cnlohr\/ch32v003fun<\/a><\/li>\n<\/ul>\n","protected":false},"excerpt":{"rendered":"<p>\u5728\u63a5\u89e6\u5230\u53ea\u9700\u8981 7 \u6bdb\u94b1\u7684\u5355\u7247\u673a CH32V003 \u4e4b\u540e\uff0c\u62ff\u5b83\u505a\u4e86\u597d\u51e0\u4e2a DIY &hellip;<\/p>\n<p class=\"read-more\"><a href=\"https:\/\/xujiwei.com\/blog\/2024\/08\/run-linux-on-ch32v003\/\">\u7ee7\u7eed\u9605\u8bfb &raquo;<\/a><\/p>\n","protected":false},"author":2,"featured_media":1464,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[402],"tags":[359,422,191,423,401],"_links":{"self":[{"href":"https:\/\/xujiwei.com\/blog\/wp-json\/wp\/v2\/posts\/1468"}],"collection":[{"href":"https:\/\/xujiwei.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/xujiwei.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/xujiwei.com\/blog\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/xujiwei.com\/blog\/wp-json\/wp\/v2\/comments?post=1468"}],"version-history":[{"count":0,"href":"https:\/\/xujiwei.com\/blog\/wp-json\/wp\/v2\/posts\/1468\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/xujiwei.com\/blog\/wp-json\/wp\/v2\/media\/1464"}],"wp:attachment":[{"href":"https:\/\/xujiwei.com\/blog\/wp-json\/wp\/v2\/media?parent=1468"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/xujiwei.com\/blog\/wp-json\/wp\/v2\/categories?post=1468"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/xujiwei.com\/blog\/wp-json\/wp\/v2\/tags?post=1468"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}