{"id":17285,"date":"2024-09-17T00:08:55","date_gmt":"2024-09-16T16:08:55","guid":{"rendered":"https:\/\/blog.iyatt.com\/?p=17285"},"modified":"2024-09-17T00:35:58","modified_gmt":"2024-09-16T16:35:58","slug":"%e6%a0%91%e8%8e%93%e6%b4%be%e4%bd%bf%e7%94%a8-wiringpi-%e6%8a%a5%e9%94%99-unable-to-determine-board-revision-from-proc-cpuinfo","status":"publish","type":"post","link":"https:\/\/blog.iyatt.com\/?p=17285","title":{"rendered":"\u6811\u8393\u6d3e\u4f7f\u7528 WiringPi \u62a5\u9519 Unable to determine board revision from \/proc\/cpuinfo"},"content":{"rendered":"<p>\u786c\u4ef6\uff1a\u6811\u8393\u6d3e CM4<br \/>\n\u7cfb\u7edf\uff1araspios 20240704 Debian 12 arm64\uff08Linux Kernal 6.6.31+rpt-rpi-v8\uff09<br \/>\nWiringPi\uff1a3.10<\/p>\n<p>\u6b63\u786e\u5730\u5b89\u88c5\u6b65\u9aa4\u53c2\u8003\uff1a<\/p>\n<p>1.\u5b89\u88c5\u6784\u5efa\u5de5\u5177<\/p>\n<pre><code class=\"language-bash\">sudo apt update\nsudo apt install -y build-essential git<\/code><\/pre>\n<p>2.\u514b\u9686\u6e90\u7801<\/p>\n<pre><code class=\"language-bash\">git clone https:\/\/github.com\/WiringPi\/WiringPi.git --depth=1 --branch=3.10\ncd WiringPi<\/code><\/pre>\n<p>3.\u4fee\u6539\u6e90\u7801<br \/>\n\u8fd9\u90e8\u5206\u662f\u589e\u52a0\u7684\u5185\u5bb9\uff0c\u4e5f\u662f\u89e3\u51b3\u6807\u9898\u62a5\u9519\u7684\u5173\u952e\uff08\u6765\u6e90\u53c2\u8003\uff1a<a href=\"https:\/\/raspberrypi.stackexchange.com\/questions\/145031\/wiringpi-giving-unable-to-determine-board-revision-from-proc-cpuinfo-error-af\">https:\/\/raspberrypi.stackexchange.com\/questions\/145031\/wiringpi-giving-unable-to-determine-board-revision-from-proc-cpuinfo-error-af<\/a> \uff09<br \/>\n\u6574\u4f53\u590d\u5236\u7c98\u7c98\u6267\u884c<\/p>\n<pre><code class=\"language-bash\">cat &lt;&lt;&#039;PATCH&#039; | patch --ignore-whitespace -p1 wiringPi\/wiringPi.c\n@@ -747,6 +747,7 @@ int piGpioLayout (void)\n   if ((cpuFd = fopen (&quot;\/proc\/cpuinfo&quot;, &quot;r&quot;)) == NULL)\n     piGpioLayoutOops (&quot;Unable to open \/proc\/cpuinfo&quot;) ;\n\n+#ifdef DONT_CARE_ANYMORE\n \/\/ Start by looking for the Architecture to make sure we&#039;re really running\n \/\/ on a Pi. I&#039;m getting fed-up with people whinging at me because\n \/\/ they can&#039;t get it to work on weirdFruitPi boards...\n@@ -769,7 +770,6 @@ int piGpioLayout (void)\n \/\/ I do not support so don&#039;t email me your bleating whinges about anything\n \/\/ other than a genuine Raspberry Pi.\n\n-#ifdef DONT_CARE_ANYMORE\n   if (! (strstr (line, &quot;BCM2708&quot;) || strstr (line, &quot;BCM2709&quot;) || strstr (line, &quot;BCM2835&quot;)))\n   {\n     fprintf (stderr, &quot;Unable to determine hardware version. I see: %s,\\n&quot;, line) ;\nPATCH<\/code><\/pre>\n<p>4.\u6784\u5efa\u5b89\u88c5<\/p>\n<pre><code class=\"language-bash\">bash INSTALL<\/code><\/pre>\n<p>5.\u6d4b\u8bd5<\/p>\n<p>\u7248\u672c\u67e5\u770b <\/p>\n<pre><code class=\"language-bash\">gpio -v<\/code><\/pre>\n<p><img decoding=\"async\" data-src=\"https:\/\/blog.iyatt.com\/wp-content\/uploads\/2024\/09\/image-1726502890026.png\" alt=\"file\" src=\"data:image\/svg+xml;base64,PHN2ZyB3aWR0aD0iMSIgaGVpZ2h0PSIxIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPjwvc3ZnPg==\" class=\"lazyload\" style=\"--smush-placeholder-width: 484px; --smush-placeholder-aspect-ratio: 484\/231;\" \/><\/p>\n<p>\u63a5\u53e3\u67e5\u770b<\/p>\n<pre><code class=\"language-bash\">gpio readall<\/code><\/pre>\n<p><img decoding=\"async\" data-src=\"https:\/\/blog.iyatt.com\/wp-content\/uploads\/2024\/09\/image-1726502916473.png\" alt=\"file\" src=\"data:image\/svg+xml;base64,PHN2ZyB3aWR0aD0iMSIgaGVpZ2h0PSIxIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPjwvc3ZnPg==\" class=\"lazyload\" style=\"--smush-placeholder-width: 570px; --smush-placeholder-aspect-ratio: 570\/410;\" \/><\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u786c\u4ef6\uff1a\u6811\u8393\u6d3e CM4 \u7cfb\u7edf\uff1araspios 20240704 Debian 12 arm64\uff08Linux Ke [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"zakra_page_container_layout":"customizer","zakra_page_sidebar_layout":"customizer","zakra_remove_content_margin":false,"zakra_sidebar":"customizer","zakra_transparent_header":"customizer","zakra_logo":0,"zakra_main_header_style":"default","zakra_menu_item_color":"","zakra_menu_item_hover_color":"","zakra_menu_item_active_color":"","zakra_menu_active_style":"","zakra_page_header":true,"_lmt_disableupdate":"no","_lmt_disable":"no","footnotes":""},"categories":[1,580,600],"tags":[],"class_list":["post-17285","post","type-post","status-publish","format-standard","hentry","category-all","category-580","category-600"],"modified_by":"IYATT-yx","_links":{"self":[{"href":"https:\/\/blog.iyatt.com\/index.php?rest_route=\/wp\/v2\/posts\/17285","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/blog.iyatt.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blog.iyatt.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blog.iyatt.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/blog.iyatt.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=17285"}],"version-history":[{"count":0,"href":"https:\/\/blog.iyatt.com\/index.php?rest_route=\/wp\/v2\/posts\/17285\/revisions"}],"wp:attachment":[{"href":"https:\/\/blog.iyatt.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=17285"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blog.iyatt.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=17285"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blog.iyatt.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=17285"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}