{"id":796,"date":"2025-07-04T08:00:37","date_gmt":"2025-07-04T00:00:37","guid":{"rendered":"https:\/\/www.zhoubin.asia\/?p=796"},"modified":"2025-07-03T20:16:35","modified_gmt":"2025-07-03T12:16:35","slug":"h15-sbc-yocto","status":"publish","type":"post","link":"https:\/\/www.zhoubin.asia\/index.php\/2025\/07\/04\/h15-sbc-yocto\/","title":{"rendered":"H15 SBC Yocto \u5b9a\u5236\u5316\u6307\u5357"},"content":{"rendered":"<h2>Yocto \u4ecb\u7ecd<\/h2>\n<p>Yocto \u662f\u4e00\u4e2a\u5f00\u6e90\u9879\u76ee\uff0c\u65e8\u5728\u5e2e\u52a9\u5f00\u53d1\u8005\u5feb\u901f\u521b\u5efa\u9002\u7528\u4e8e\u4e0d\u540c\u786c\u4ef6\u5e73\u53f0\u7684 Linux \u7cfb\u7edf\u3002\u5176\u4e3b\u8981\u7279\u70b9\uff1a<\/p>\n<ul>\n<li>\u652f\u6301\u591a\u786c\u4ef6\u67b6\u6784\uff0c\u7075\u6d3b\u53ef\u6269\u5c55<\/li>\n<li>\u4f7f\u7528 Poky \u4f5c\u4e3a\u53c2\u8003\u53d1\u884c\u7248\u548c\u6784\u5efa\u7cfb\u7edf<\/li>\n<li>\u6838\u5fc3\u6784\u5efa\u7cfb\u7edf\u662f <strong>OpenEmbedded<\/strong><\/li>\n<li>\u6838\u5fc3\u6784\u5efa\u5de5\u5177\u662f <strong>bitbake<\/strong><\/li>\n<li>\u652f\u6301\u9ad8\u5ea6\u6a21\u5757\u5316\u7684 <strong>layer<\/strong> \u751f\u6001\u7cfb\u7edf<\/li>\n<\/ul>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-797\" src=\"https:\/\/www.zhoubin.asia\/wp-content\/uploads\/2025\/07\/yocto1.png\" alt=\"\" width=\"677\" height=\"342\" \/><br \/>\n\u66f4\u591a\u53c2\u8003\uff1a<a href=\"https:\/\/docs.yoctoproject.org\/\">Yocto \u5b98\u65b9\u6587\u6863<\/a> | Hailo-15 Yocto \u4ed3\u5e93\uff1a<a href=\"https:\/\/github.com\/hailo-ai\/meta-hailo-soc\">meta-hailo-soc<\/a><\/p>\n<h2>OpenEmbedded \u4ecb\u7ecd<\/h2>\n<p>OpenEmbedded \u662f Yocto \u9879\u76ee\u7684\u6838\u5fc3\uff0c\u5b83\u652f\u6301\u4f7f\u7528 <strong>layer<\/strong> \u5c06\u5143\u6570\u636e\uff08meta-xxx\uff09\u6a21\u5757\u5316\u7ba1\u7406\uff0c\u5178\u578b\u5c42\u5305\u62ec\uff1a<\/p>\n<ul>\n<li>meta-hailo-bsp<\/li>\n<li>meta-hailo-dsp<\/li>\n<li>meta-hailo-imaging<\/li>\n<li>meta-openembedded\uff08\u7b2c\u4e09\u65b9\u901a\u7528\u5c42\uff09<\/li>\n<\/ul>\n<p>\u6784\u5efa\u5de5\u5177\uff1a<strong>bitbake<\/strong><br \/>\n<img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-798\" src=\"https:\/\/www.zhoubin.asia\/wp-content\/uploads\/2025\/07\/yocto2.png\" alt=\"\" width=\"755\" height=\"540\" \/><\/p>\n<h2>Hailo-15 Yocto \u955c\u50cf\u7f16\u8bd1\u6d41\u7a0b<\/h2>\n<ol>\n<li>\u5b89\u88c5\u4f9d\u8d56\uff1a\n<pre>sudo apt install python3-pip chrpath diffstat gawk zstd lz4 kas<\/pre>\n<\/li>\n<li>\u514b\u9686 Hailo Yocto \u4ed3\u5e93\uff1a\n<pre>git clone https:\/\/github.com\/hailo-ai\/meta-hailo-soc.git\r\ncd meta-hailo-soc<\/pre>\n<\/li>\n<li>\u521d\u59cb\u5316\u9ed8\u8ba4\u73af\u5883\uff1a\n<pre>kas build kas\/hailo15-sbc.yml<\/pre>\n<\/li>\n<li>\u8f7d\u5165\u6784\u5efa\u73af\u5883\uff1a\n<pre>source poky\/oe-init-build-env<\/pre>\n<\/li>\n<li>\u6784\u5efa\u955c\u50cf\uff1a\n<pre>bitbake core-image-hailo<\/pre>\n<p>\u6784\u5efa\u5185\u6838\uff1a<\/p>\n<pre>bitbake linux-yocto-hailo<\/pre>\n<\/li>\n<li>\u53c2\u8003 hailo15_sbc_quick_start_guide.pdf \u5b8c\u6210\u5237\u673a<\/li>\n<\/ol>\n<h2>Yocto BSP \u5b9a\u5236\u5316<\/h2>\n<p>\u5b9a\u5236 BSP \u6b65\u9aa4\uff1a<\/p>\n<ol>\n<li>\u521b\u5efa Vendor Layer\uff1a\n<pre>mkdir -p customer\r\nbitbake-layers create-layer --priority 7 customer\/meta-vendor<\/pre>\n<\/li>\n<li>\u6dfb\u52a0 Vendor Layer\uff1a\n<pre>bitbake-layers add-layer customer\/meta-vendor<\/pre>\n<\/li>\n<li>\u65b0\u589e machine \u914d\u7f6e\uff1a\u5728 <code>meta-vendor\/conf\/machine\/<\/code> \u65b0\u5efa <code>new_board.conf<\/code><\/li>\n<li>\u4fee\u6539 build\/conf\/local.conf\uff1a\n<pre>MACHINE ??= \"new_board\"<\/pre>\n<\/li>\n<\/ol>\n<p>MACHINE \u662f Yocto \u4e2d\u786c\u4ef6\u62bd\u8c61\u4e0e\u914d\u7f6e\u590d\u7528\u7684\u5173\u952e\u673a\u5236\u3002<\/p>\n<h2>U-boot \u5b9a\u5236\u5316<\/h2>\n<ul>\n<li>\u9ed8\u8ba4 U-Boot \u914d\u7f6e\u7531 machine.conf \u4e2d\u7684 <code>UBOOT_MACHINE<\/code> \u6307\u5b9a<\/li>\n<li>\u81ea\u5b9a\u4e49\u6b65\u9aa4\uff1a\n<ul>\n<li>\u65b0\u589e <code>new_board_defconfig<\/code> \u548c <code>new_board.dts<\/code><\/li>\n<li>\u5728 meta-vendor\/recipes-bsp\/u-boot\/ \u4e0b\u521b\u5efa bbappend<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<p>\u9ed8\u8ba4 repo \u53ef\u53c2\u8003\uff1a<code>meta-hailo-bsp\/recipes-bsp\/u-boot\/u-boot-hailo.inc<\/code><\/p>\n<h2>\u8bbe\u5907\u6811\u5b9a\u5236<\/h2>\n<ul>\n<li>\u53c2\u8003 arch\/arm\/dts\/hailo15-sbc.dts<\/li>\n<li>\u521b\u5efa arch\/arm\/dts\/new_board.dts\uff0c\u5e76\u5728 defconfig \u4e2d\u6307\u5b9a<\/li>\n<\/ul>\n<h2>Kernel \u5b9a\u5236\u5316<\/h2>\n<ol>\n<li>\u786e\u8ba4 Kernel Provider\uff1a\n<pre>PREFERRED_PROVIDER_virtual\/kernel = \"linux-yocto-hailo\"<\/pre>\n<\/li>\n<li>\u521b\u5efa bbappend\uff1a\n<pre>meta-vendor\/recipes-kernel\/linux-yocto-hailo\/linux-yocto-hailo_%.bbappend<\/pre>\n<\/li>\n<li>\u589e\u52a0\u914d\u7f6e\uff1a\n<pre>SRC_URI += \"file:\/\/fragment.cfg\"\r\nKERNEL_FEATURES:append = \" cfg\/fragment.scc \"<\/pre>\n<\/li>\n<li>\u91cd\u65b0\u7f16\u8bd1\uff1a\n<pre>bitbake linux-yocto-hailo -c cleansstate\r\nbitbake linux-yocto-hailo<\/pre>\n<\/li>\n<\/ol>\n<h2>\u8f6f\u4ef6\u5305\u5b9a\u5236<\/h2>\n<ol>\n<li>\u521b\u5efa packagegroup\uff1a\n<pre>meta-vendor\/recipes-core\/packagegroups\/packagegroup-custom.bb<\/pre>\n<\/li>\n<li>\u5b9a\u4e49\u5185\u5bb9\uff1a\n<pre>inherit packagegroup\r\nRDEPENDS:${PN} = \" \\\r\n    package_recipe1 \\\r\n    package_recipe2 \\\r\n\"<\/pre>\n<\/li>\n<li>\u5c06 packagegroup \u52a0\u5165 core-image\uff1a\n<pre>meta-vendor\/recipes-core\/images\/core-image-minimal.bbappend<\/pre>\n<p>\u5e76 include \u4e00\u4e2a core-image-append.inc \u6587\u4ef6\uff1a<\/p>\n<pre>IMAGE_INSTALL:append = \" packagegroup-custom \"<\/pre>\n<\/li>\n<\/ol>\n<h2>Hailo \u5b89\u5168\u542f\u52a8 (Secure Boot)<\/h2>\n<p>\u5b89\u5168\u542f\u52a8\u9632\u6b62\u8bbe\u5907\u52a0\u8f7d\u672a\u7ecf\u6388\u6743\u7684\u56fa\u4ef6\uff0c\u4fdd\u62a4\u7cfb\u7edf\u5b89\u5168\u3002<\/p>\n<ol>\n<li>\u751f\u6210\u5bc6\u94a5\uff1a\n<pre>openssl genrsa -out customer_keypair.pem 3072\r\nopenssl rsa -in customer_keypair.pem -out customer_pubkey.pem -pubout<\/pre>\n<\/li>\n<li>\u5c06\u516c\u94a5 customer_pubkey.pem \u63d0\u4f9b\u7ed9 Hailo\uff0c\u83b7\u5f97 customer_certificate_chain.bin<\/li>\n<li>\u5c06 Yocto \u5f00\u53d1 key \u66ff\u6362\u4e3a\u4e0a\u8ff0\u4e13\u7528\u5bc6\u94a5<\/li>\n<li>\u65b0\u589e secureboot \u7684 bbappend<br \/>\n<img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-799\" src=\"https:\/\/www.zhoubin.asia\/wp-content\/uploads\/2025\/07\/yocto3.png\" alt=\"\" width=\"463\" height=\"453\" \/><\/li>\n<\/ol>\n<p>\u8be6\u7ec6\u6d41\u7a0b\u53c2\u8003\uff1ahailo_os_secure_boot_user_guide.pdf<\/p>\n<h2>USB WiFi \u8bbe\u5907\u96c6\u6210\u793a\u4f8b<\/h2>\n<p>\u4ee5 AIC8800 \u4e3a\u4f8b\uff1a<\/p>\n<ul>\n<li>GitHub \u5730\u5740\uff1a<a href=\"https:\/\/github.com\/alex2014git\/meta-aic-wifi\">meta-aic-wifi<\/a><\/li>\n<li>\u5728 <code>core-image-append.inc<\/code> \u4e2d\u6dfb\u52a0 packagegroup-aic8800<\/li>\n<li>Yocto \u7f16\u8bd1\u65f6\u81ea\u52a8\u6253\u5305\u8fdb rootfs<\/li>\n<\/ul>\n<hr \/>\n<p>\u672c\u6587\u5185\u5bb9\u57fa\u4e8e Hailo-15 SBC Yocto \u5b9a\u5236\u5316\u5b98\u65b9\u8d44\u6599\u548c\u5b9e\u8df5\u603b\u7ed3\uff0c\u63a8\u8350\u7ed3\u5408\u5b98\u65b9\u6587\u6863\u6df1\u5165\u7406\u89e3\u3002<\/p>\n<p>&nbsp;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Yocto \u4ecb\u7ecd Yocto \u662f\u4e00\u4e2a\u5f00\u6e90\u9879\u76ee\uff0c\u65e8\u5728\u5e2e\u52a9\u5f00\u53d1\u8005\u5feb\u901f\u521b\u5efa\u9002\u7528\u4e8e\u4e0d\u540c\u786c\u4ef6\u5e73\u53f0\u7684 Linux \u7cfb\u7edf\u3002\u5176 [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_bbp_topic_count":0,"_bbp_reply_count":0,"_bbp_total_topic_count":0,"_bbp_total_reply_count":0,"_bbp_voice_count":0,"_bbp_anonymous_reply_count":0,"_bbp_topic_count_hidden":0,"_bbp_reply_count_hidden":0,"_bbp_forum_subforum_count":0,"footnotes":""},"categories":[1],"tags":[],"class_list":["post-796","post","type-post","status-publish","format-standard","hentry","category-tech"],"_links":{"self":[{"href":"https:\/\/www.zhoubin.asia\/index.php\/wp-json\/wp\/v2\/posts\/796","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.zhoubin.asia\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.zhoubin.asia\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.zhoubin.asia\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.zhoubin.asia\/index.php\/wp-json\/wp\/v2\/comments?post=796"}],"version-history":[{"count":1,"href":"https:\/\/www.zhoubin.asia\/index.php\/wp-json\/wp\/v2\/posts\/796\/revisions"}],"predecessor-version":[{"id":800,"href":"https:\/\/www.zhoubin.asia\/index.php\/wp-json\/wp\/v2\/posts\/796\/revisions\/800"}],"wp:attachment":[{"href":"https:\/\/www.zhoubin.asia\/index.php\/wp-json\/wp\/v2\/media?parent=796"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.zhoubin.asia\/index.php\/wp-json\/wp\/v2\/categories?post=796"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.zhoubin.asia\/index.php\/wp-json\/wp\/v2\/tags?post=796"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}