<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>python sbc_gpio Archives - Learning to Pi</title>
	<atom:link href="https://www.learningtopi.com/tag/python-sbc_gpio/feed/" rel="self" type="application/rss+xml" />
	<link>https://www.learningtopi.com/tag/python-sbc_gpio/</link>
	<description>Programming Python on SBC&#039;s and Microcontrollers</description>
	<lastBuildDate>Wed, 30 Aug 2023 05:30:36 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=6.9.1</generator>

<image>
	<url>https://www.learningtopi.com/wp-content/uploads/2022/04/cropped-circuit-150x150.png</url>
	<title>python sbc_gpio Archives - Learning to Pi</title>
	<link>https://www.learningtopi.com/tag/python-sbc_gpio/</link>
	<width>32</width>
	<height>32</height>
</image> 
	<item>
		<title>OrangePi 5 &#8211; Testing with sbc_gpio</title>
		<link>https://www.learningtopi.com/templates/orangepi-5-testing-with-sbc_gpio/</link>
					<comments>https://www.learningtopi.com/templates/orangepi-5-testing-with-sbc_gpio/#comments</comments>
		
		<dc:creator><![CDATA[tdunteman]]></dc:creator>
		<pubDate>Wed, 30 Aug 2023 05:30:35 +0000</pubDate>
				<category><![CDATA[OrangePi 5]]></category>
		<category><![CDATA[SBC]]></category>
		<category><![CDATA[templates]]></category>
		<category><![CDATA[OrangePi]]></category>
		<category><![CDATA[python sbc_gpio]]></category>
		<category><![CDATA[rk3588s]]></category>
		<guid isPermaLink="false">https://www.learningtopi.com/?p=1216</guid>

					<description><![CDATA[<p>After a lot of success with the Radxa Rock 5B, I saw that Orange Pi was offering several different boards using the same Rockchip RK3588 or RK3588S chips. I decided to pick up the Orange Pi 5 that uses the RK3588S so I could check out the differences between the RK3588 and RK3588S. Also, since...</p>
<p>The post <a href="https://www.learningtopi.com/templates/orangepi-5-testing-with-sbc_gpio/">OrangePi 5 &#8211; Testing with sbc_gpio</a> appeared first on <a href="https://www.learningtopi.com">Learning to Pi</a>.</p>
]]></description>
										<content:encoded><![CDATA[
<p>After a lot of success with the Radxa Rock 5B, I saw that Orange Pi was offering several different boards using the same Rockchip RK3588 or RK3588S chips.  I decided to pick up the Orange Pi 5 that uses the RK3588S so I could check out the differences between the RK3588 and RK3588S.  Also, since both platforms are quite similar, I wanted to see how support and usability differed between the different vendors.  This is my first OrangePi board, so I was looking forward to it!</p>



<div class="wp-block-columns is-layout-flex wp-container-core-columns-is-layout-9d6595d7 wp-block-columns-is-layout-flex">
<div class="wp-block-column is-layout-flow wp-block-column-is-layout-flow">
<div class="wp-block-ht-block-toc  is-style-outline htoc htoc--position-wide toc-list-style-plain" data-htoc-state="expanded"><span class="htoc__title"><span class="ht_toc_title">Table of Contents</span><span class="htoc__toggle"><svg xmlns="http://www.w3.org/2000/svg" width="16" height="16"><g fill="#444"><path d="M15 7H1c-.6 0-1 .4-1 1s.4 1 1 1h14c.6 0 1-.4 1-1s-.4-1-1-1z"></path><path d="M15 1H1c-.6 0-1 .4-1 1s.4 1 1 1h14c.6 0 1-.4 1-1s-.4-1-1-1zM15 13H1c-.6 0-1 .4-1 1s.4 1 1 1h14c.6 0 1-.4 1-1s-.4-1-1-1z"></path></g></svg></span></span><div class="htoc__itemswrap"><ul class="ht_toc_list"><li class=""><a href="#htoc-scoring-and-specs">Orange Pi 5 Specs</a></li><li class=""><a href="#htoc-sbc-scoring-results">SBC Scoring Results</a></li><li class=""><a href="#htoc-gpio-s-1-1">GPIO&#8217;s (0/1)</a></li><li class=""><a href="#htoc-ir-1-1">IR (1/1)</a></li><li class=""><a href="#htoc-i2c-0-1">I2C (1/1)</a></li><li class=""><a href="#htoc-spi-1-2">SPI (1/2)</a></li><li class=""><a href="#htoc-uart-0-1">UART (1/1)</a></li><li class=""><a href="#htoc-subjective-performance-1-2">Subjective Performance (2/2)</a></li><li class=""><a href="#htoc-ease-of-use-0-2">Ease of Use (1/2)</a></li><li class=""><a href="#htoc-software-updates-1-2">Software Updates (1/2)</a><ul class="ht_toc_child_list"><li class=""><a href="#htoc-kernel">Kernel</a></li><li class=""><a href="#htoc-system">System</a></li></ul></li><li class=""><a href="#htoc-community-0-2">Community (1/2)</a></li><li class=""><a href="#htoc-issues">Issues</a></li><li class=""><a href="#htoc-overall-5-14">Overall (9/14)</a></li></ul></div></div>
</div>



<div class="wp-block-column is-layout-flow wp-block-column-is-layout-flow">
<figure class="wp-block-gallery has-nested-images columns-1 is-cropped wp-block-gallery-1 is-layout-flex wp-block-gallery-is-layout-flex">
<figure class="wp-block-image size-large"><img fetchpriority="high" decoding="async" width="661" height="468" data-id="1232" src="https://www.learningtopi.com/wp-content/uploads/orangepi5-board.png" alt="http://www.orangepi.org/html/hardWare/computerAndMicrocontrollers/details/Orange-Pi-5.html" class="wp-image-1232" srcset="https://www.learningtopi.com/wp-content/uploads/orangepi5-board.png 661w, https://www.learningtopi.com/wp-content/uploads/orangepi5-board-300x212.png 300w, https://www.learningtopi.com/wp-content/uploads/orangepi5-board-150x106.png 150w" sizes="(max-width: 661px) 100vw, 661px" /></figure>



<figure class="wp-block-image size-large"><img decoding="async" width="593" height="592" data-id="1233" src="https://www.learningtopi.com/wp-content/uploads/orangepi5-board2.png" alt="http://www.orangepi.org/html/hardWare/computerAndMicrocontrollers/details/Orange-Pi-5.html" class="wp-image-1233" srcset="https://www.learningtopi.com/wp-content/uploads/orangepi5-board2.png 593w, https://www.learningtopi.com/wp-content/uploads/orangepi5-board2-300x299.png 300w, https://www.learningtopi.com/wp-content/uploads/orangepi5-board2-150x150.png 150w" sizes="(max-width: 593px) 100vw, 593px" /></figure>
</figure>
</div>
</div>



<h2 class="wp-block-heading" id="htoc-scoring-and-specs">Orange Pi 5 Specs</h2>



<p>The specs for the OrangePi 5 are similar to the Radxa Rock 5B, but there are a few variances.  The OrangePi 5 is a smaller board that uses the RK3588S chip (as opposed to the RK3588).  The RK3588S is essentially a cut down version of the RK3588.  The PCIe 3.0 has been removed which means that an NVMe SSD will need to use the PCIe 2.0 that the Rock 5B has for the wireless module.  This also means that if you want to use an NVMe SSD, you&#8217;ll need to use USB for your WiFi.</p>



<blockquote class="wp-block-quote is-layout-flow wp-block-quote-is-layout-flow">
<p id="htoc-n1">NOTE:  My testing was all performed using the Orange Pi 5.  There are two similar boards available that have some slightly different options:</p>



<ul class="wp-block-list">
<li>OrangePi 5B &#8211; Removes the PCIe port and replaces it with built-in WiFi and Bluetooth.  Same RK3588S with a 26 pin header (rather than the standard 40)/</li>



<li>OrangePi 5 Plus &#8211; This is more similar to the Radxa Rock 5B.  Uses the RK3588, has dual PCIe (1x M-Key and 1x E-key), dual HDMI out, eMMC interface, 40pin GPIO</li>
</ul>



<p id="htoc-i">I intentionally chose to skip the OrangePi 5 Plus since it is nearly identical to the Raxda Rock 5B.  The OrangePi 5 has less GPIO ports and less PCIe, but it is also smaller and costs less.  Based on what I&#8217;ve seen I would expect the OrangePi 5 Plus to perform nearly identical to the Radxa Rock 5B.</p>
</blockquote>



<table id="tablepress-6" class="tablepress tablepress-id-6">
<thead>
<tr class="row-1">
	<td class="column-1" style="width:20%;"></td><th class="column-2" style="width:80%;">OrangePi 5 (and 5B)</th>
</tr>
</thead>
<tbody class="row-striping row-hover">
<tr class="row-2">
	<td class="column-1">CPU</td><td class="column-2">Rockchip RK3588S<br />
4x ARM Cortex-A76 (408Mhz &#8211; 2.4Ghz)<br />
4x ARM Cortex-A55 (408Mhz &#8211; 1.8Ghz)</td>
</tr>
<tr class="row-3">
	<td class="column-1">NPU</td><td class="column-2">6 TOPS  INT4/INT8/INT16/FP16<br />
TensorFlow/MXNet/PyTorch/Caffe can be easily converted<br />
300Mhz &#8211; 1Ghz (per /sys/class/devfreq/fdab0000.npu/available_frequencies</td>
</tr>
<tr class="row-4">
	<td class="column-1">Memory</td><td class="column-2">4/8/16/32GB LPDDR4</td>
</tr>
<tr class="row-5">
	<td class="column-1">GPU</td><td class="column-2">ARM Mali-G610 MP4 3D GPU<br />
4 cores (300Mhz &#8211; 1Ghz)</td>
</tr>
<tr class="row-6">
	<td class="column-1">Video Decoding</td><td class="column-2">H.264, H.265 HEVC (8/10bit), VP8, VP9, VC-1, AVC, JPEG</td>
</tr>
<tr class="row-7">
	<td class="column-1">Video Encoding</td><td class="column-2">H.264, H.265 HEVC (8/10bit), VP8, VP9, VC-1, AVC, JPEG</td>
</tr>
<tr class="row-8">
	<td class="column-1">GPU FP16/FP32/FP64</td><td class="column-2">? / 610 / ? GFLOPS</td>
</tr>
<tr class="row-9">
	<td class="column-1">Video Out</td><td class="column-2">1x HDMI + 1x DisplayPort 1.4 (via USB-C) + 2x MIPI D-PHY TX 4 Lane</td>
</tr>
<tr class="row-10">
	<td class="column-1">Video In</td><td class="column-2">MIPI CSI 4Lane + 2x MIPI D-PHY RX 4 Lane</td>
</tr>
<tr class="row-11">
	<td class="column-1">Storage</td><td class="column-2">MicroSD<br />
16MB QSPI bootflash<br />
M.2 M-Key (supports 2242 only)<br />
** 5B includes 32/64/128GB eMMC</td>
</tr>
<tr class="row-12">
	<td class="column-1">USB</td><td class="column-2">1x USB 3.0 Type-A<br />
2x UsB 2.0 Type-A<br />
1x USB 3.1 Type-C</td>
</tr>
<tr class="row-13">
	<td class="column-1">PCIe</td><td class="column-2">PCIe 2.0 M.2 M key (up to 2242 SSD only!)<br />
** 5B has NO PCIe slot (builtin WiFi/BT instead)</td>
</tr>
<tr class="row-14">
	<td class="column-1">Networking</td><td class="column-2">YT8531C Gigabit Ethernet<br />
** 5B includes Dual-band WiFi6</td>
</tr>
<tr class="row-15">
	<td class="column-1">Bluetooth</td><td class="column-2">None<br />
** 5B includes 5.0 with BLE support</td>
</tr>
<tr class="row-16">
	<td class="column-1">I2C</td><td class="column-2">up to 3x</td>
</tr>
<tr class="row-17">
	<td class="column-1">SPI</td><td class="column-2">up to 1x</td>
</tr>
<tr class="row-18">
	<td class="column-1">UART</td><td class="column-2">up to 4x</td>
</tr>
<tr class="row-19">
	<td class="column-1">PWM</td><td class="column-2">up to 5x</td>
</tr>
<tr class="row-20">
	<td class="column-1">ADC (analog to digital)</td><td class="column-2">N/A</td>
</tr>
<tr class="row-21">
	<td class="column-1">CAN Bus</td><td class="column-2">up to 2x</td>
</tr>
<tr class="row-22">
	<td class="column-1">General GPIO / Other</td><td class="column-2">up to 17x</td>
</tr>
<tr class="row-23">
	<td class="column-1">Power</td><td class="column-2">USB-C 5v 4A</td>
</tr>
<tr class="row-24">
	<td class="column-1">Kernel Support</td><td class="column-2">5.10 (<a href="https://github.com/orangepi-xunlong/linux-orangepi/tree/orange-pi-5.10-rk3588" target="_blank" rel="noopener">Orange Pi fork</a>)</td>
</tr>
<tr class="row-25">
	<td class="column-1">Purchase Links</td><td class="column-2"><a href="https://www.amazon.com/Orange-Pi-Frequency-Development-Android12/dp/B0BN17BRYY/ref=sr_1_3?crid=HJQ357XB16FK&amp;keywords=orange%2Bpi%2B5&amp;qid=1693201723&amp;sprefix=ornge%2Bpi%2B%2Caps%2C159&amp;sr=8-3&amp;ufe=app_do%3Aamzn1.fos.f5122f16-c3e8-4386-bf32-63e904010ad0&amp;th=1" target="_blank" rel="noopener">OrangePi 5 8GB (Amazon)</a><br />
<a href="https://www.aliexpress.us/item/3256804755535571.html?spm=a2g0o.productlist.main.5.3ad9fc0bkGy88I&amp;algo_pvid=90279085-5d57-4d34-b821-269c7405083a&amp;algo_exp_id=90279085-5d57-4d34-b821-269c7405083a-2&amp;pdp_npi=4%40dis%21USD%2185.00%2185.0%21%21%2185.00%21%21%402101d64d16932019284023832eb1f8%2112000034095080979%21sea%21US%210%21A&amp;curPageLogUid=7gFDcqWb1nTz" target="_blank" rel="noopener">OrangePi 5 8GB (AliExpress)</a><br />
<a href="https://www.amazon.com/Orange-Pi-Rockchip-Frequency-Development/dp/B0BZ48S5Y8/ref=sr_1_8?crid=V4JOLUV00GP7&amp;keywords=orange%2Bpi%2B5b&amp;qid=1693201825&amp;sprefix=ornge%2Bpi%2B5b%2Caps%2C157&amp;sr=8-8&amp;ufe=app_do%3Aamzn1.fos.f5122f16-c3e8-4386-bf32-63e904010ad0&amp;th=1" target="_blank" rel="noopener">OrangePi 5B 8GB WiFi (Amazon)</a><br />
<a href="https://www.aliexpress.us/item/3256805169475894.html?spm=a2g0o.productlist.main.13.5d864a95iiMDbv&amp;algo_pvid=d48b083f-f862-472d-955b-723f48b77413&amp;algo_exp_id=d48b083f-f862-472d-955b-723f48b77413-6&amp;pdp_npi=4%40dis%21USD%21105.00%21105.0%21%21%21105.00%21%21%402103231116932019782871599e62b1%2112000032727653072%21sea%21US%210%21A&amp;curPageLogUid=SO1jLhbN4Qli" target="_blank" rel="noopener">OrangePi 5B 8GB WiFi (AliExpress)</a></td>
</tr>
</tbody>
</table>
<!-- #tablepress-6 from cache -->


<h2 class="wp-block-heading" id="htoc-sbc-scoring-results">SBC Scoring Results</h2>



<div class="wp-block-columns is-layout-flex wp-container-core-columns-is-layout-9d6595d7 wp-block-columns-is-layout-flex">
<div class="wp-block-column is-layout-flow wp-block-column-is-layout-flow" style="flex-basis:50%">
<table id="tablepress-10" class="tablepress tablepress-id-10">
<thead>
<tr class="row-1">
	<th class="column-1" style="width:50%;">Category</th><th class="column-2" style="width:50%;">OrangePi 5</th>
</tr>
</thead>
<tbody class="row-striping row-hover">
<tr class="row-2">
	<td class="column-1">Tests &#8211; GPIO&#8217;s (1pt)</td><td class="column-2">0/1</td>
</tr>
<tr class="row-3">
	<td class="column-1">Tests &#8211; IR (1pt)</td><td class="column-2">1/1</td>
</tr>
<tr class="row-4">
	<td class="column-1">Tests &#8211; I2C (1pt)</td><td class="column-2">1/1</td>
</tr>
<tr class="row-5">
	<td class="column-1">Tests &#8211; SPI (2pt)</td><td class="column-2">1/2</td>
</tr>
<tr class="row-6">
	<td class="column-1">Tests &#8211; UART (1pt)</td><td class="column-2">1/1</td>
</tr>
<tr class="row-7">
	<td class="column-1">Subjective Performance (2pt)</td><td class="column-2">2/2</td>
</tr>
<tr class="row-8">
	<td class="column-1">Ease of Use (2pt)</td><td class="column-2">1/2</td>
</tr>
<tr class="row-9">
	<td class="column-1">Software Updates (2pt)</td><td class="column-2">1/2</td>
</tr>
<tr class="row-10">
	<td class="column-1">Community (2pt)</td><td class="column-2">1/2</td>
</tr>
</tbody>
<tfoot>
<tr class="row-11">
	<th class="column-1">Overall (14pt)</th><th class="column-2">9/14</th>
</tr>
</tfoot>
</table>
<!-- #tablepress-10 from cache --></div>



<div class="wp-block-column is-layout-flow wp-block-column-is-layout-flow" style="flex-basis:50%">
<p>Scoring the SBC for comparison purposes. Scoring will be based on the following criteria:<br><strong>&#8211; GPIO (1pt) &#8211;</strong> LED and button tests passed and there are at least 8 usable GPIO&#8217;s<br><strong>&#8211; I2C (1pt) &#8211;</strong> I2C display tests passed<br><strong>&#8211; SPI (1pt) &#8211;</strong> SPI tests passed (BME280 and DHT11 over SPI)<br><strong>&#8211; UART (1pt) &#8211;</strong> UART tests passed and multiple UARTs are available<br><strong>&#8211; Subjective Performance (1pt) &#8211;</strong> Was the system responsive and functional overall<br><strong>&#8211; Ease of Use (1pt) &#8211;</strong> How easy was it to setup and use for the sbc_gpio tests? Can it be reconfigured quickly?<br><strong>&#8211; Software Updates (2pt) &#8211;</strong> How frequently does the system get updates? 1pt for base system, 1pt for kernel<br><strong>&#8211; Community (2pt) &#8211;</strong> Finding answers to questions, getting recommendations and help is an important part of using a SBC</p>
</div>
</div>



<h2 class="wp-block-heading" id="htoc-gpio-s-1-1">GPIO&#8217;s (0/1)</h2>



<p>Before you cry foul, I didn&#8217;t knock off points for the fewer number of GPIO&#8217;s (uses a 26 pin header instead of a 40 pin).  I bought this board knowing that there were fewer GPIO pins.  I knocked off the GPIO point because I was unable to get internal pull-up or pull-down resistors to work AT ALL.  Using libgpiod tools, I tested setting the pull-up and pull-down on multiple different pins and was unable to see any change.</p>



<p>The lack of pull-up and pull-down made me go back and re-test this on multiple other systems including:</p>



<ul class="wp-block-list">
<li>Radxa Rock 5B (RK3588) &#8211; ALSO wouldn&#8217;t apply internal pull-up or pull-down</li>



<li>Raspberry Pi 4B (Broadcom BCM2711) &#8211; Works perfectly!</li>



<li>Visionfive Starfive 2 (RISC-V JH7110) &#8211; Works perfectly! (Happened to be sitting on my desk, stay tuned for an article for this device)</li>



<li>BIGTREETECH CB1 (Allwinner H616) &#8211; Works perfectly (within the confines of the pull-up/down resistors being a different value on some pins, see my <a href="https://www.learningtopi.com/sbc/cb1/bigtreetech-cb1/" target="_blank" rel="noreferrer noopener">CB1 article </a>for more)</li>
</ul>



<p>I did find reference to the pull-up/down in the Rockchip datasheets for the <a href="https://learningtopi.github.io/datasheets/Rockchip%20RK3588.pdf" target="_blank" rel="noreferrer noopener">RK3588</a>/<a href="https://learningtopi.github.io/datasheets/Rockchip%20RK3588S.pdf" target="_blank" rel="noreferrer noopener">RK3588S </a>but can&#8217;t seem to get it to work on either the OrangePi 5 or Radxa Rock 5B.  For now, external pull-up/down resistors are required.</p>



<blockquote class="wp-block-quote is-layout-flow wp-block-quote-is-layout-flow">
<p id="htoc-n">NOTE:  I did post a question in the Radxa (for the Rock 5B) forum but haven&#8217;t had a single response as of yet.</p>
</blockquote>



<h2 class="wp-block-heading" id="htoc-ir-1-1">IR (1/1)</h2>



<p>Just like the Rock 5B, the OrangePi 5 handled all the IR tests with no problem at all.  The only downside is that you need to create the overlays yourself since OrangePi doesn&#8217;t include them in the built-in overlays.  However, all the necessary drivers are already compiled into the kernel, and the <code>orangepi-config</code> tool had a section to install LIRC daemon and tools:</p>



<figure class="wp-block-image size-full"><img decoding="async" width="540" height="374" src="https://www.learningtopi.com/wp-content/uploads/orangepi-config-lirc.png" alt="" class="wp-image-1217" srcset="https://www.learningtopi.com/wp-content/uploads/orangepi-config-lirc.png 540w, https://www.learningtopi.com/wp-content/uploads/orangepi-config-lirc-300x208.png 300w, https://www.learningtopi.com/wp-content/uploads/orangepi-config-lirc-150x104.png 150w" sizes="(max-width: 540px) 100vw, 540px" /></figure>



<p>I&#8217;ll get into the <code>orangepi-config</code> tool more in the Ease of Use section.  A copy of the overlay files can be found on our <a href="https://learningtopi.github.io/orangepi5" target="_blank" rel="noreferrer noopener">GitHub files share</a>.  OrangePi uses UBOOT startup with <code>boot.scr </code>that already incorporates a mechanism to add your own custom overlays.  Simply copy the compiled overlay files (dbto) to the <code>/boot/overlay-user </code>directory, then add the following line to the<code> /boot/orangepiEnv.txt</code> file:</p>



<pre class="wp-block-code"><code>user_overlays=gpio-ir-recv-1d2 gpio-ir-tx-1d3</code></pre>



<p>After a reboot, both LIRC devices are initialized and ready to go!  Not quite as easy as a Raspberry Pi, but pretty close.</p>



<h2 class="wp-block-heading" id="htoc-i2c-0-1">I2C (1/1)</h2>



<p>Not a lot to say here.  Unlike the BIGTREETECH CB1 which used a software I2C driver, there are 3x I2C devices exposed from the RK3588S SOC.  I was impressed that they managed to configure 3x as optional on the 26 pin header.  The orangepi-config tool has the option to enable the I2C:</p>



<figure class="wp-block-image size-full"><img loading="lazy" decoding="async" width="308" height="651" src="https://www.learningtopi.com/wp-content/uploads/orangepi-config-i2c.png" alt="" class="wp-image-1218" srcset="https://www.learningtopi.com/wp-content/uploads/orangepi-config-i2c.png 308w, https://www.learningtopi.com/wp-content/uploads/orangepi-config-i2c-142x300.png 142w, https://www.learningtopi.com/wp-content/uploads/orangepi-config-i2c-71x150.png 71w, https://www.learningtopi.com/wp-content/uploads/orangepi-config-i2c-300x634.png 300w" sizes="auto, (max-width: 308px) 100vw, 308px" /></figure>



<p>Alternatively, you can add <code>i2c5-m3</code> to the <code>overlays </code>line in the<code> /boot/orangepiEnv.txt</code> file.</p>



<p>Everything with the I2C display worked perfectly.</p>



<h2 class="wp-block-heading" id="htoc-spi-1-2">SPI (1/2)</h2>



<p>For the SPI test, I used both a BME280 and DHT22 connected to SPI.  (I created a Python library for <a href="https://www.learningtopi.com/sbc/python_dht11_spi/">reading DHT from the SPI</a> bus since bit-banging has become too unreliable).  Both worked, but I couldn&#8217;t run them both at the same time since OrangePi only exposed one SPI bus on the 26 pin header.  We can&#8217;t connect the DHT22 to the same SPI bus as another device due to pull-up issues on the MISO port.  I docked a point due to the fact that only one SPI bus was available.  (I am working on a way to make the DHT SPI Python setup work alongside other SPI devices, more to come.)</p>



<p>Enabling the SPI bus is again a breeze using the <code>orangepi-config</code> tool.</p>



<figure class="wp-block-image size-full"><img loading="lazy" decoding="async" width="308" height="651" src="https://www.learningtopi.com/wp-content/uploads/orangepi-config-spi.png" alt="" class="wp-image-1219" srcset="https://www.learningtopi.com/wp-content/uploads/orangepi-config-spi.png 308w, https://www.learningtopi.com/wp-content/uploads/orangepi-config-spi-142x300.png 142w, https://www.learningtopi.com/wp-content/uploads/orangepi-config-spi-71x150.png 71w, https://www.learningtopi.com/wp-content/uploads/orangepi-config-spi-300x634.png 300w" sizes="auto, (max-width: 308px) 100vw, 308px" /></figure>



<p>Alternatively, you can add <code>spi4-m0-cs1-spidev</code> to the <code>overlays </code>line in the<code> /boot/orangepiEnv.txt</code> file.</p>



<p>The only confusing part is making sure you select the right one.  Only <code>spi4-m0 </code>is exposed on the 26 pin header.  It would be nice if OrangePi would just list the available overlays.</p>



<h2 class="wp-block-heading" id="htoc-uart-0-1">UART (1/1)</h2>



<p>The UART tests passed without a hitch on the OrangePi 5 just like with the Radxa Rock 5B.  I had essentially 100% success except for 1 test out of 15,000 always seems to fail.  The Raspberry Pi 4B and 3B always seemed to end up in the 90-93% success rate that struck me as a buffering issue.  The OrangePi 5 and Rock 5B based on the Rockchip 3588(S) worked flawlessly.</p>



<p>The only minor irritation here is that separate from the 26 pin header is a 3 pin serial header that is used for debugging.  I have not yet found a way to re-purpose this UART port for use in the OS.  If this could be converted to a standard UART interface that would free up additional ports on the limited 26 pin header.</p>



<p>Enabling the UART is again a breeze using the <code>orangepi-config</code> tool.</p>



<figure class="wp-block-image size-full"><img loading="lazy" decoding="async" width="308" height="645" src="https://www.learningtopi.com/wp-content/uploads/orangepi-config-uart.png" alt="" class="wp-image-1220" srcset="https://www.learningtopi.com/wp-content/uploads/orangepi-config-uart.png 308w, https://www.learningtopi.com/wp-content/uploads/orangepi-config-uart-143x300.png 143w, https://www.learningtopi.com/wp-content/uploads/orangepi-config-uart-72x150.png 72w, https://www.learningtopi.com/wp-content/uploads/orangepi-config-uart-300x628.png 300w" sizes="auto, (max-width: 308px) 100vw, 308px" /></figure>



<p>Alternatively, you can add <code>uart0-m2</code> to the <code>overlays </code>line in the<code> /boot/orangepiEnv.txt</code> file.</p>



<h2 class="wp-block-heading" id="htoc-subjective-performance-1-2">Subjective Performance (2/2)</h2>



<p>The RK3588S in the OrangePi 5 is essentially the same as the RK3588 in the Rock 5B when it comes to CPU.  Both have 4x A76 (up to 2.4Ghz) and 4x A55 (up to 1.8Ghz).  My main bottleneck was the SD card I was booting from.  I have an NVMe SSD to install, I just haven&#8217;t set it up yet.  As far as I&#8217;m concerned, the RK3588(S) is good enough to use as a normal desktop.</p>



<p>OrangePi also has ZRAM pre-configured in their image (virtual swap space using compressed RAM, see my <a href="https://www.learningtopi.com/uncategorized/zram-for-your-sbc/" target="_blank" rel="noreferrer noopener">article on ZRAM</a> for more info).  I&#8217;ve found that swap setup isn&#8217;t configured by all vendors, so I was pleased to see this.  I also saw that ZRAM was used to create a compressed mount point for <code>/var/log</code>.  This is something I haven&#8217;t seen on other images from board vendors.  Moving logging into RAM loses persistence, but for devices running on SD cards it will boost performance by eliminating a lot of background writes, and extend the life of your SD card.</p>



<h2 class="wp-block-heading" id="htoc-ease-of-use-0-2">Ease of Use (1/2)</h2>



<p>I really want to give OrangePi props for their <code>orangepi-config</code> tool.  This is the ONLY vendor I&#8217;ve found so far with a tool that can come close to matching the <code>raspi-config </code>tool.  The <code>orangepi-config </code>tool even has several features that <code>raspi-config </code>doesn&#8217;t have.</p>



<p>I showed some parts of the orangepi-config tool above while configuring the I2C, SPI and UART overlays.</p>



<figure class="wp-block-gallery has-nested-images columns-3 is-cropped wp-block-gallery-2 is-layout-flex wp-block-gallery-is-layout-flex">
<figure class="wp-block-image size-large"><img loading="lazy" decoding="async" width="653" height="276" data-id="1227" src="https://www.learningtopi.com/wp-content/uploads/orangepi-config-main.png" alt="" class="wp-image-1227" srcset="https://www.learningtopi.com/wp-content/uploads/orangepi-config-main.png 653w, https://www.learningtopi.com/wp-content/uploads/orangepi-config-main-300x127.png 300w, https://www.learningtopi.com/wp-content/uploads/orangepi-config-main-150x63.png 150w" sizes="auto, (max-width: 653px) 100vw, 653px" /></figure>



<figure class="wp-block-image size-large"><img loading="lazy" decoding="async" width="585" height="218" data-id="1230" src="https://www.learningtopi.com/wp-content/uploads/orangepi-config-system.png" alt="" class="wp-image-1230" srcset="https://www.learningtopi.com/wp-content/uploads/orangepi-config-system.png 585w, https://www.learningtopi.com/wp-content/uploads/orangepi-config-system-300x112.png 300w, https://www.learningtopi.com/wp-content/uploads/orangepi-config-system-150x56.png 150w" sizes="auto, (max-width: 585px) 100vw, 585px" /></figure>



<figure class="wp-block-image size-large"><img loading="lazy" decoding="async" width="522" height="218" data-id="1222" src="https://www.learningtopi.com/wp-content/uploads/orangep-config-bootloader.png" alt="" class="wp-image-1222" srcset="https://www.learningtopi.com/wp-content/uploads/orangep-config-bootloader.png 522w, https://www.learningtopi.com/wp-content/uploads/orangep-config-bootloader-300x125.png 300w, https://www.learningtopi.com/wp-content/uploads/orangep-config-bootloader-150x63.png 150w" sizes="auto, (max-width: 522px) 100vw, 522px" /></figure>



<figure class="wp-block-image size-large"><img loading="lazy" decoding="async" width="653" height="429" data-id="1226" src="https://www.learningtopi.com/wp-content/uploads/orangepi-config-boot-config.png" alt="" class="wp-image-1226" srcset="https://www.learningtopi.com/wp-content/uploads/orangepi-config-boot-config.png 653w, https://www.learningtopi.com/wp-content/uploads/orangepi-config-boot-config-300x197.png 300w, https://www.learningtopi.com/wp-content/uploads/orangepi-config-boot-config-150x99.png 150w, https://www.learningtopi.com/wp-content/uploads/orangepi-config-boot-config-350x230.png 350w" sizes="auto, (max-width: 653px) 100vw, 653px" /></figure>



<figure class="wp-block-image size-large"><img loading="lazy" decoding="async" width="604" height="291" data-id="1225" src="https://www.learningtopi.com/wp-content/uploads/orangepi-config-network.png" alt="" class="wp-image-1225" srcset="https://www.learningtopi.com/wp-content/uploads/orangepi-config-network.png 604w, https://www.learningtopi.com/wp-content/uploads/orangepi-config-network-300x145.png 300w, https://www.learningtopi.com/wp-content/uploads/orangepi-config-network-150x72.png 150w" sizes="auto, (max-width: 604px) 100vw, 604px" /></figure>



<figure class="wp-block-image size-large"><img loading="lazy" decoding="async" width="751" height="204" data-id="1228" src="https://www.learningtopi.com/wp-content/uploads/orangepi-config-ssh.png" alt="" class="wp-image-1228" srcset="https://www.learningtopi.com/wp-content/uploads/orangepi-config-ssh.png 751w, https://www.learningtopi.com/wp-content/uploads/orangepi-config-ssh-300x81.png 300w, https://www.learningtopi.com/wp-content/uploads/orangepi-config-ssh-150x41.png 150w" sizes="auto, (max-width: 751px) 100vw, 751px" /></figure>



<figure class="wp-block-image size-large"><img loading="lazy" decoding="async" width="308" height="645" data-id="1220" src="https://www.learningtopi.com/wp-content/uploads/orangepi-config-uart.png" alt="" class="wp-image-1220" srcset="https://www.learningtopi.com/wp-content/uploads/orangepi-config-uart.png 308w, https://www.learningtopi.com/wp-content/uploads/orangepi-config-uart-143x300.png 143w, https://www.learningtopi.com/wp-content/uploads/orangepi-config-uart-72x150.png 72w, https://www.learningtopi.com/wp-content/uploads/orangepi-config-uart-300x628.png 300w" sizes="auto, (max-width: 308px) 100vw, 308px" /></figure>



<figure class="wp-block-image size-large"><img loading="lazy" decoding="async" width="308" height="651" data-id="1219" src="https://www.learningtopi.com/wp-content/uploads/orangepi-config-spi.png" alt="" class="wp-image-1219" srcset="https://www.learningtopi.com/wp-content/uploads/orangepi-config-spi.png 308w, https://www.learningtopi.com/wp-content/uploads/orangepi-config-spi-142x300.png 142w, https://www.learningtopi.com/wp-content/uploads/orangepi-config-spi-71x150.png 71w, https://www.learningtopi.com/wp-content/uploads/orangepi-config-spi-300x634.png 300w" sizes="auto, (max-width: 308px) 100vw, 308px" /></figure>



<figure class="wp-block-image size-large"><img loading="lazy" decoding="async" width="308" height="651" data-id="1218" src="https://www.learningtopi.com/wp-content/uploads/orangepi-config-i2c.png" alt="" class="wp-image-1218" srcset="https://www.learningtopi.com/wp-content/uploads/orangepi-config-i2c.png 308w, https://www.learningtopi.com/wp-content/uploads/orangepi-config-i2c-142x300.png 142w, https://www.learningtopi.com/wp-content/uploads/orangepi-config-i2c-71x150.png 71w, https://www.learningtopi.com/wp-content/uploads/orangepi-config-i2c-300x634.png 300w" sizes="auto, (max-width: 308px) 100vw, 308px" /></figure>



<figure class="wp-block-image size-large"><img loading="lazy" decoding="async" width="540" height="374" data-id="1217" src="https://www.learningtopi.com/wp-content/uploads/orangepi-config-lirc.png" alt="" class="wp-image-1217" srcset="https://www.learningtopi.com/wp-content/uploads/orangepi-config-lirc.png 540w, https://www.learningtopi.com/wp-content/uploads/orangepi-config-lirc-300x208.png 300w, https://www.learningtopi.com/wp-content/uploads/orangepi-config-lirc-150x104.png 150w" sizes="auto, (max-width: 540px) 100vw, 540px" /></figure>



<figure class="wp-block-image size-large"><img loading="lazy" decoding="async" width="606" height="189" data-id="1229" src="https://www.learningtopi.com/wp-content/uploads/orangepi-config-personal.png" alt="" class="wp-image-1229" srcset="https://www.learningtopi.com/wp-content/uploads/orangepi-config-personal.png 606w, https://www.learningtopi.com/wp-content/uploads/orangepi-config-personal-300x94.png 300w, https://www.learningtopi.com/wp-content/uploads/orangepi-config-personal-150x47.png 150w" sizes="auto, (max-width: 606px) 100vw, 606px" /></figure>



<figure class="wp-block-image size-large"><img loading="lazy" decoding="async" width="603" height="167" data-id="1223" src="https://www.learningtopi.com/wp-content/uploads/orangepi-config-3rdparty.png" alt="" class="wp-image-1223" srcset="https://www.learningtopi.com/wp-content/uploads/orangepi-config-3rdparty.png 603w, https://www.learningtopi.com/wp-content/uploads/orangepi-config-3rdparty-300x83.png 300w, https://www.learningtopi.com/wp-content/uploads/orangepi-config-3rdparty-150x42.png 150w" sizes="auto, (max-width: 603px) 100vw, 603px" /></figure>



<figure class="wp-block-image size-large"><img loading="lazy" decoding="async" width="487" height="269" data-id="1224" src="https://www.learningtopi.com/wp-content/uploads/orangepi-config-help.png" alt="" class="wp-image-1224" srcset="https://www.learningtopi.com/wp-content/uploads/orangepi-config-help.png 487w, https://www.learningtopi.com/wp-content/uploads/orangepi-config-help-300x166.png 300w, https://www.learningtopi.com/wp-content/uploads/orangepi-config-help-150x83.png 150w" sizes="auto, (max-width: 487px) 100vw, 487px" /></figure>
</figure>



<p>As you can see, we have a range of options available:</p>



<ul class="wp-block-list">
<li>Programming the bootloader to different devices</li>



<li>Editing the <code>orangepiEnv.txt</code> file</li>



<li>Selecting overlays</li>



<li>Configuring network settings</li>



<li>Installing / uninstalling LIRC</li>



<li>Time zone</li>



<li>SSH options (including OTP)</li>



<li>Even some 3rd Party software</li>
</ul>



<p>I really would give this a 2/2 if not for a few oddities:</p>



<ul class="wp-block-list">
<li>Overlay page lists overlays that are not applicable (i.e. SPI overlays that use pins not exposed on the OrangePi 5, although they may work on the OrangePi 5 Pro)</li>



<li>Change some setting aren&#8217;t reflected until you close the app and re-open it (i.e. the time zone)</li>



<li>It isn&#8217;t always clear what selecting something will do.  For example, selecting &#8220;Avahi&#8221; from the system settings menu will kick off downloading and installing packages, as well as configuring them without any clear message as to what was about to happen.</li>



<li>Crashed several times</li>
</ul>



<p>The orangepi-config tool is excellent but has some rough edges.  I would certainly start here to configure your SBC.</p>



<h2 class="wp-block-heading" id="htoc-software-updates-1-2">Software Updates (1/2)</h2>



<h3 class="wp-block-heading" id="htoc-kernel">Kernel</h3>



<p>Just like with every SBC I&#8217;ve worked with that ISN&#8217;T a Raspberry Pi, the kernel doesn&#8217;t seem to be getting any updates.  The OrangePi 5 uses the same 5.10.110 kernel that is used by the Radxa Rock 5B (not entirely surprising since they are almost the same chip).  They both appear to use the same Rockchip kernel as their base, and I don&#8217;t see any security updates being applied.</p>



<p>It seems safe to assume that Rockchip selected 5.10 since it is an LTS release that is slated for support through December 2026.  However, they forked at 5.10.110 and the kernel has continued on to 5.10.192 (as of August 2023).  This seems to defeat the purpose of using an LTS kernel if you aren&#8217;t ever going to update it.</p>



<h3 class="wp-block-heading" id="htoc-system">System</h3>



<p>Here is where things get a bit strange.  The image I downloaded was the official OrangePi 5 Ubuntu 22.04 (jammy) release.  For some reason rather than using Ubuntu mirrors, the system is configured to use Huawei servers for Ubuntu and <code>aliyun.com</code> for Docker.  Here are the apt sources (from <code>/etc/apt/sources.list</code> and <code>/etc/apt/sources.list.d/docker.list</code>):</p>



<pre class="wp-block-code"><code>deb http://repo.huaweicloud.com/ubuntu-ports/ jammy main restricted universe multiverse
deb http://repo.huaweicloud.com/ubuntu-ports/ jammy-security main restricted universe multiverse
deb http://repo.huaweicloud.com/ubuntu-ports/ jammy-updates main restricted universe multiverse
deb http://repo.huaweicloud.com/ubuntu-ports/ jammy-backports main restricted universe multiverse
deb &#91;arch=arm64] https://mirrors.aliyun.com/docker-ce/linux/ubuntu jammy stable
</code></pre>



<p>The aliyun.com mirror for docker seems to be a Docker supported mirror (based on its presence in the <a href="https://get.docker.com/">Docker install script</a>).  The Huawei mirror also seems legit based on <a href="https://launchpad.net/ubuntu/+mirror/repo.huaweicloud.com-archive">https://launchpad.net/ubuntu/+mirror/repo.huaweicloud.com-archive</a>.  I get that OrangePi is a Chinese company, and these mirrors may make the most sense for them, but it would be nice to see an image for those of us not in China.  Using a wired connection on my Gigabit internet, I was seeing up to 200ms latency to the Huawei mirrors (NOTE: repo.huaweicloud.com resolved to a CDN, so milage here may vary).</p>



<p>Unusual APT sources aside, they do appear to mirror the official Ubuntu release, so we are getting updates.  It was also nice to see a 22.04 image rather than the 20.04 that some other vendors provide.</p>



<h2 class="wp-block-heading" id="htoc-community-0-2">Community (1/2)</h2>



<p>There is an OrangePi forum (<a href="http://www.orangepi.org/orangepibbsen/">http://www.orangepi.org/orangepibbsen/</a>), however it seems relatively small.  The forum also covers a wide range of SBC boards that OrangePi offers which can be good and bad.  On the plus side, the OrangePi 5 is not their first board, so the setup seems well thought out.  The downside is it has been difficult to find much for this specific board.  Searching the forum for &#8220;OrangePi 5&#8221; only found 31 matches and quite a few of those weren&#8217;t for the OrangePi 5.</p>



<p>This also brings me to another issue, the name.  OrangePi is the company, the model is &#8220;5&#8221;.  There is also a &#8220;5B&#8221; (which is basically the same board with WiFi and BT in place of the PCIe slot) and a &#8220;5 Pro&#8221; which is a different chip (RK3588 instead of the RK3588S).  The &#8220;5 Pro&#8221; has quite a few different features including two PCIe slots and a 40 pin GPIO header.  Searching for the OrangePi 5 has actually been a bit of a struggle.  I keep getting results for the &#8220;5 Pro&#8221; that don&#8217;t apply, or just end up with OrangePi articles that have the number &#8220;5&#8221; somewhere in them.  More characters in the name would make searching a bit easier.  Even making it a &#8220;5A&#8221; and &#8220;5B&#8221; would help.</p>



<h2 class="wp-block-heading" id="htoc-issues">Issues</h2>



<p>In the <a href="#htoc-gpio-s-1-1">GPIO </a>section I covered the issue with the internal pull-up and pull-down.  I was not able to get either to work on any of the pins I tested using multiple version of libgpiod.  This isn&#8217;t a total show-stopper, it just means that external pull-up or pull-down resistors are required until I can figure out if they are just not supported on the RK3588/RK3588S or if it is a bug that needs fixing.</p>



<p>The other issues are pretty minor.  I only have 1 <a href="#htoc-spi-1-2">SPI </a>bus available which meant I couldn&#8217;t test the BME280 and DHT22 at the same time (this is a limitation of how I am reading the DHT22 sensor and not a limitation of the SPI bus itself).  I was also a bit surprised by the APT repos, but that should be configurable.</p>



<h2 class="wp-block-heading" id="htoc-overall-5-14">Overall (9/14)</h2>



<p>All in all, this is a very solid system.  The <code>orangepi-config</code> utility gives a level of usability that my Radxa Rock 5B was missing.  You can tell that OrangePi has been building SBC&#8217;s for some time now based of the effort put into the software.</p>



<p>The only real caution here is the limited number of GPIO&#8217;s and the issue with internal pull-up/pull-down resistors.  If you think you&#8217;ll need 2x SPI or just more GPIO&#8217;s in general then I would suggest looking at the OrangePi 5 Pro instead (where the full 40 pin header is available).  This board only scored lower than the Radxa Rock 5B due to the single SPI bus.</p>



<p>One last note on a performance perspective.  the RK3588S appears to drop the PCIe 3.0 x4 bus that is present on the RK3588.  That means that the NVMe slot is connected to the PCIe 2.0 x1 bus.  The theoretical throughput limit is 500MB/sec which will still outperform eMMC or SD cards by a healthy margin.</p>



<p>I would highly recommend the OrangePi 5 (or one of the variants)!</p>
<p>The post <a href="https://www.learningtopi.com/templates/orangepi-5-testing-with-sbc_gpio/">OrangePi 5 &#8211; Testing with sbc_gpio</a> appeared first on <a href="https://www.learningtopi.com">Learning to Pi</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://www.learningtopi.com/templates/orangepi-5-testing-with-sbc_gpio/feed/</wfw:commentRss>
			<slash:comments>2</slash:comments>
		
		
			</item>
		<item>
		<title>Bigtreetech CB1</title>
		<link>https://www.learningtopi.com/sbc/cb1/bigtreetech-cb1/</link>
					<comments>https://www.learningtopi.com/sbc/cb1/bigtreetech-cb1/#respond</comments>
		
		<dc:creator><![CDATA[tdunteman]]></dc:creator>
		<pubDate>Fri, 28 Jul 2023 07:01:15 +0000</pubDate>
				<category><![CDATA[Bigtreetech CB1]]></category>
		<category><![CDATA[SBC]]></category>
		<category><![CDATA[CB1]]></category>
		<category><![CDATA[python sbc_gpio]]></category>
		<guid isPermaLink="false">https://www.learningtopi.com/?p=1178</guid>

					<description><![CDATA[<p>I picked up the Bigtreetech CB1 (CM4 compatible) along with their Pi4B adapter (base for the CB1 or the Raspberry Pi Compute Module 4) for a stellar price. They are currently selling the CB1 module with the Pi4B for $36.98. Even though it only has 1GB of RAM, I figured it was worth a shot...</p>
<p>The post <a href="https://www.learningtopi.com/sbc/cb1/bigtreetech-cb1/">Bigtreetech CB1</a> appeared first on <a href="https://www.learningtopi.com">Learning to Pi</a>.</p>
]]></description>
										<content:encoded><![CDATA[
<p>I picked up the <a href="https://biqu.equipment/products/pi4b-adapter-v1-0?variant=39919128969314">Bigtreetech CB1</a> (CM4 compatible) along with their Pi4B adapter (base for the CB1 or the Raspberry Pi Compute Module 4) for a stellar price.  They are currently selling the CB1 module with the Pi4B for $36.98.  Even though it only has 1GB of RAM, I figured it was worth a shot so I ordered it along with the $5.90 heatsink (which I discovered is a necessity).</p>



<p>I&#8217;ll walk through what I learned with this device and show some of the use cases it may come in handy, as well as where some of the shortfalls are.</p>



<div class="wp-block-columns is-layout-flex wp-container-core-columns-is-layout-9d6595d7 wp-block-columns-is-layout-flex">
<div class="wp-block-column is-layout-flow wp-block-column-is-layout-flow">
<div class="wp-block-ht-block-toc  is-style-outline htoc htoc--position-wide toc-list-style-plain" data-htoc-state="expanded"><span class="htoc__title"><span class="ht_toc_title">Table of Contents</span></span><div class="htoc__itemswrap"><ul class="ht_toc_list"><li class=""><a href="#htoc-s">Scoring and Specs</a></li><li class=""><a href="#htoc-sbc-scoring-results">SBC Scoring Results</a></li><li class=""><a href="#htoc-gpio-s-1-1">GPIO&#8217;s (1/1)</a><ul class="ht_toc_child_list"><li class=""><a href="#htoc-the-pinout">The Pinout Confusion</a></li><li class=""><a href="#htoc-o">Official Pinout Table</a></li><li class=""><a href="#htoc-l">Logic Level &#8211; 1.8v or 3.3v?</a></li><li class=""><a href="#htoc-pull-up-pull-down-resistors">Pull-up / Pull-down Resistors</a></li></ul></li><li class=""><a href="#htoc-ir-1-1">IR (1/1)</a></li><li class=""><a href="#htoc-i2c-0-1">I2C (0/1)</a></li><li class=""><a href="#htoc-spi-1-2">SPI (1/2)</a></li><li class=""><a href="#htoc-uart-0-1">UART (0/1)</a></li><li class=""><a href="#htoc-subjective-performance-1-2">Subjective Performance (1/2)</a></li><li class=""><a href="#htoc-ease-of-use-0-2">Ease of Use (0/2)</a></li><li class=""><a href="#htoc-software-updates-1-2">Software Updates (1/2)</a></li><li class=""><a href="#htoc-community-0-2">Community (0/2)</a></li><li class=""><a href="#htoc-issues">Issues</a><ul class="ht_toc_child_list"><li class=""><a href="#htoc-security-groups-and-udev-not-setup-for-i2c-and-spi">Security Groups and UDEV not setup for I2C and SPI</a></li><li class=""><a href="#htoc-no-i2c-only-overlay">No I2C only overlay</a></li><li class=""><a href="#htoc-pins-that-don-t-work-pg6-pg7-pg8-pg9">Pins that don&#8217;t work (PG6, PG7, PG8, PG9)</a></li><li class=""><a href="#htoc-uart0-overlaps-with-twi-and-pwm">UART0 overlaps with TWI and PWM</a></li><li class=""><a href="#htoc-uart0-doesn-t-work-over-115200">UART0 doesn&#8217;t work over 115200</a></li><li class=""><a href="#htoc-pull-up-pull-down-resistor-inconsistancy">Pull-up / Pull-down Resistor Inconsistancy</a></li></ul></li><li class=""><a href="#htoc-overall-5-14">Overall (5/14)</a></li></ul></div></div>
</div>



<div class="wp-block-column is-layout-flow wp-block-column-is-layout-flow">
<figure class="wp-block-gallery has-nested-images columns-1 is-cropped wp-block-gallery-3 is-layout-flex wp-block-gallery-is-layout-flex">
<figure class="wp-block-image size-full is-style-default"><img loading="lazy" decoding="async" width="412" height="302" data-id="1180" src="https://www.learningtopi.com/wp-content/uploads/cb1-e1690006962553.webp" alt="" class="wp-image-1180" srcset="https://www.learningtopi.com/wp-content/uploads/cb1-e1690006962553.webp 412w, https://www.learningtopi.com/wp-content/uploads/cb1-e1690006962553-300x220.webp 300w, https://www.learningtopi.com/wp-content/uploads/cb1-e1690006962553-150x110.webp 150w" sizes="auto, (max-width: 412px) 100vw, 412px" /></figure>



<figure class="wp-block-image size-full"><img loading="lazy" decoding="async" width="484" height="349" data-id="1181" src="https://www.learningtopi.com/wp-content/uploads/Pi4B-carrier-e1690006984986.webp" alt="" class="wp-image-1181" srcset="https://www.learningtopi.com/wp-content/uploads/Pi4B-carrier-e1690006984986.webp 484w, https://www.learningtopi.com/wp-content/uploads/Pi4B-carrier-e1690006984986-300x216.webp 300w, https://www.learningtopi.com/wp-content/uploads/Pi4B-carrier-e1690006984986-150x108.webp 150w" sizes="auto, (max-width: 484px) 100vw, 484px" /></figure>



<figure class="wp-block-image size-full"><img loading="lazy" decoding="async" width="464" height="336" data-id="1182" src="https://www.learningtopi.com/wp-content/uploads/cb1-heatsink-e1690007003898.webp" alt="" class="wp-image-1182" srcset="https://www.learningtopi.com/wp-content/uploads/cb1-heatsink-e1690007003898.webp 464w, https://www.learningtopi.com/wp-content/uploads/cb1-heatsink-e1690007003898-300x217.webp 300w, https://www.learningtopi.com/wp-content/uploads/cb1-heatsink-e1690007003898-150x109.webp 150w" sizes="auto, (max-width: 464px) 100vw, 464px" /></figure>
</figure>
</div>
</div>



<h2 class="wp-block-heading" id="htoc-s">Scoring and Specs</h2>



<p>Here is a breakdown of the scoring.  I&#8217;ll cover each section below to describe how I came to the numbers.</p>



<p>The specifications for the CB1 that I was able to collect are available below:</p>



<blockquote class="wp-block-quote is-layout-flow wp-block-quote-is-layout-flow">
<p id="htoc-n">NOTE: The Pi4B carrier board has capabilities that the CB1 doesn&#8217;t (i.e. a Gigabit NIC).  The specifications are specific to the CB1 itself.</p>
</blockquote>



<table id="tablepress-6-no-2" class="tablepress tablepress-id-6">
<thead>
<tr class="row-1">
	<td class="column-1" style="width:20%;"></td><th class="column-2" style="width:80%;">BIGTREETECH CB1 w/ Pi4B Adapter v1.0</th>
</tr>
</thead>
<tbody class="row-striping row-hover">
<tr class="row-2">
	<td class="column-1">CPU</td><td class="column-2">Allwinner H616<br />
4x ARM Cortex-A53 (? &#8211; 1.5Ghz)</td>
</tr>
<tr class="row-3">
	<td class="column-1">NPU</td><td class="column-2">N/A</td>
</tr>
<tr class="row-4">
	<td class="column-1">Memory</td><td class="column-2">512MB / 1GB (1GB only with eMMC)</td>
</tr>
<tr class="row-5">
	<td class="column-1">GPU</td><td class="column-2">ARM Mali G31 MP2<br />
2 cores (650Mhz)</td>
</tr>
<tr class="row-6">
	<td class="column-1">Video Decoding</td><td class="column-2">H.265, H.264</td>
</tr>
<tr class="row-7">
	<td class="column-1">Video Encoding</td><td class="column-2">H.264</td>
</tr>
<tr class="row-8">
	<td class="column-1">GPU FP16/FP32/FP64</td><td class="column-2">? / 20.8 / ? GFLOPS</td>
</tr>
<tr class="row-9">
	<td class="column-1">Video Out</td><td class="column-2">(Pi4B Carrier Board) 2x micro-HDMI</td>
</tr>
<tr class="row-10">
	<td class="column-1">Video In</td><td class="column-2">n/a (MIPI CSI on Pi4B bpard, but not functional with CB1)</td>
</tr>
<tr class="row-11">
	<td class="column-1">Storage</td><td class="column-2">eMMC 16 / 32 GB<br />
(Pi4B Carrier Board) MicroSD</td>
</tr>
<tr class="row-12">
	<td class="column-1">USB</td><td class="column-2">(Pi4B Carrier Board) 4x USB 2.0 Type-A</td>
</tr>
<tr class="row-13">
	<td class="column-1">PCIe</td><td class="column-2">N/A</td>
</tr>
<tr class="row-14">
	<td class="column-1">Networking</td><td class="column-2">100Mbps Ethernet (Pi4B Carrier Board is 1Gbps capable, but CB1 is not)<br />
Realtek 8189 802.11n 2.4Ghz WiFi</td>
</tr>
<tr class="row-15">
	<td class="column-1">Bluetooth</td><td class="column-2">N/A</td>
</tr>
<tr class="row-16">
	<td class="column-1">I2C</td><td class="column-2">None, software driver provided</td>
</tr>
<tr class="row-17">
	<td class="column-1">SPI</td><td class="column-2">up to 1x</td>
</tr>
<tr class="row-18">
	<td class="column-1">UART</td><td class="column-2">up to 1x (overlaps with PWM)</td>
</tr>
<tr class="row-19">
	<td class="column-1">PWM</td><td class="column-2">up to 1x (overlaps with UART)</td>
</tr>
<tr class="row-20">
	<td class="column-1">ADC (analog to digital)</td><td class="column-2">N/A</td>
</tr>
<tr class="row-21">
	<td class="column-1">CAN Bus</td><td class="column-2">up to 1x (not tested)</td>
</tr>
<tr class="row-22">
	<td class="column-1">General GPIO / Other</td><td class="column-2">up to 16x (docs say 20x.  Couldn&#8217;t get PG6,PG7,PG8,PG9 to work)</td>
</tr>
<tr class="row-23">
	<td class="column-1">Power</td><td class="column-2">(Pi4B Carrier Board) 5v DC with USB-C plug 2A</td>
</tr>
<tr class="row-24">
	<td class="column-1">Kernel Support</td><td class="column-2">5.16 (<a href="https://github.com/bigtreetech/CB1-Kernel" target="_blank" rel="noopener">Kernel Repo</a>)</td>
</tr>
<tr class="row-25">
	<td class="column-1">Purchase Links</td><td class="column-2"><a href="https://biqu.equipment/products/pi4b-adapter-v1-0"><a href="https://biqu.equipment/products/pi4b-adapter-v1-0" target="_blank" rel="noopener">Biqu</a><br />
<a href="https://www.amazon.com/BIGTREETECH-Adapter-Support-Octopus-Raspberry-Pi/dp/B0BLN8VCVN/ref=sr_1_7_sspa?keywords=cb1+bigtreetech&amp;qid=1689918970&amp;refinements=p_n_deal_type%3A23566065011&amp;sprefix=CB1+big%2Caps%2C123&amp;sr=8-7-spons&amp;ufe=app_do%3Aamzn1.fos.006c50ae-5d4c-4777-9bc0-4513d670b6bc&amp;sp_csd=d2lkZ2V0TmFtZT1zcF9tdGY&amp;psc=1" target="_blank" rel="noopener">Amazon</a></a></td>
</tr>
</tbody>
</table>



<h2 class="wp-block-heading" id="htoc-sbc-scoring-results">SBC Scoring Results</h2>



<div class="wp-block-columns is-layout-flex wp-container-core-columns-is-layout-9d6595d7 wp-block-columns-is-layout-flex">
<div class="wp-block-column is-layout-flow wp-block-column-is-layout-flow" style="flex-basis:50%">
<table id="tablepress-10-no-2" class="tablepress tablepress-id-10">
<thead>
<tr class="row-1">
	<th class="column-1" style="width:50%;">Category</th><th class="column-2" style="width:50%;">BIGTREETECH CB1 w/ Pi4B Adapter v1.0</th>
</tr>
</thead>
<tbody class="row-striping row-hover">
<tr class="row-2">
	<td class="column-1">Tests &#8211; GPIO&#8217;s (1pt)</td><td class="column-2">1/1</td>
</tr>
<tr class="row-3">
	<td class="column-1">Tests &#8211; IR (1pt)</td><td class="column-2">1/1</td>
</tr>
<tr class="row-4">
	<td class="column-1">Tests &#8211; I2C (1pt)</td><td class="column-2">0/1</td>
</tr>
<tr class="row-5">
	<td class="column-1">Tests &#8211; SPI (2pt)</td><td class="column-2">1/2</td>
</tr>
<tr class="row-6">
	<td class="column-1">Tests &#8211; UART (1pt)</td><td class="column-2">0/1</td>
</tr>
<tr class="row-7">
	<td class="column-1">Subjective Performance (2pt)</td><td class="column-2">1/2</td>
</tr>
<tr class="row-8">
	<td class="column-1">Ease of Use (2pt)</td><td class="column-2">0/2</td>
</tr>
<tr class="row-9">
	<td class="column-1">Software Updates (2pt)</td><td class="column-2">1/2</td>
</tr>
<tr class="row-10">
	<td class="column-1">Community (2pt)</td><td class="column-2">0/2</td>
</tr>
</tbody>
<tfoot>
<tr class="row-11">
	<th class="column-1">Overall (14pt)</th><th class="column-2">5/14</th>
</tr>
</tfoot>
</table>
<!-- #tablepress-10-no-2 from cache --></div>



<div class="wp-block-column is-layout-flow wp-block-column-is-layout-flow" style="flex-basis:50%">
<p>Scoring the SBC for comparison purposes. Scoring will be based on the following criteria:<br><strong>&#8211; GPIO (1pt) &#8211;</strong> LED and button tests passed and there are at least 8 usable GPIO&#8217;s<br><strong>&#8211; I2C (1pt) &#8211;</strong> I2C display tests passed<br><strong>&#8211; SPI (1pt) &#8211;</strong> SPI tests passed (BME280 and DHT11 over SPI)<br><strong>&#8211; UART (1pt) &#8211;</strong> UART tests passed and multiple UARTs are available<br><strong>&#8211; Subjective Performance (1pt) &#8211;</strong> Was the system responsive and functional overall<br><strong>&#8211; Ease of Use (1pt) &#8211;</strong> How easy was it to setup and use for the sbc_gpio tests? Can it be reconfigured quickly?<br><strong>&#8211; Software Updates (2pt) &#8211;</strong> How frequently does the system get updates? 1pt for base system, 1pt for kernel<br><strong>&#8211; Community (2pt) &#8211;</strong> Finding answers to questions, getting recommendations and help is an important part of using a SBC</p>
</div>
</div>



<h2 class="wp-block-heading" id="htoc-gpio-s-1-1">GPIO&#8217;s (1/1)</h2>



<p>I gave a point for GPIO&#8217;s because the CB1 has more than 8.  However there are 8 pins on the 40 pin header that are not connected (per their documentation).  I found an additional 4 that were present in the documentation but flat out wouldn&#8217;t work (PG6, PG7, PG8 and PG9).</p>



<blockquote class="wp-block-quote is-layout-flow wp-block-quote-is-layout-flow">
<p id="htoc-note-the-allwinner-h616-has-tons-of-available-gpio-s-spi-i2c-uart-etc-etc-for-whatever-reason-they-just-aren-t-connected-to-pins-that-you-can-use-this-will-become-a-common-theme">NOTE:  The Allwinner H616 has TONS of available GPIO&#8217;s, SPI, I2C, UART, etc, etc.  For whatever reason they just aren&#8217;t connected to pins that you can use.  This will become a common theme.</p>
</blockquote>



<h3 class="wp-block-heading" id="htoc-the-pinout">The Pinout Confusion</h3>



<p>I copied the HTML directly from the CB1 <a href="https://github.com/bigtreetech/CB1/blob/master/readme.md" target="_blank" rel="noreferrer noopener">readme file</a>.  Understanding the table took a bit.  There are apparently two different versions of the CB1.  Mine has no eMMC.  I couldn&#8217;t find the eMMC version anywhere.  You can also see that the pin layout is different between the two CB1&#8217;s (with and without eMMC).  They throw in the Pi CM4 for reference as well as some other board (BTT Pi) which just adds to the confusion.</p>



<h3 class="wp-block-heading" id="htoc-o">Official Pinout Table</h3>



<table style="color:black">
<tr>
    <td rowspan=2 align=center bgcolor=gray>
        Pin
    </td>
    <td colspan=2 align=center bgcolor=#B7DEE8>
        BTT Pi
    </td>
    <td colspan=2 align=center bgcolor=#E6B8B7>
        CB1 eMMC
    </td>
    <td colspan=2 align=center bgcolor=#CCC0DA>
        CB1
    </td>
    <td colspan=2 align=center bgcolor=#D8E4BC>
        CM4
    </td>
    <td colspan=2 align=center bgcolor=#D8E4BC>
        CM4
    </td>
    <td colspan=2 align=center bgcolor=#CCC0DA>
        CB1
    </td>
    <td colspan=2 align=center bgcolor=#E6B8B7>
        CB1 eMMC
    </td>
    <td colspan=2 align=center bgcolor=#B7DEE8>
        BTT Pi
    </td>
    <td rowspan=2 align=center bgcolor=gray>
        Pin
    </td>
</tr>

<tr>
    <td bgcolor=#B7DEE8>
        Signal
    </td>
    <td align=center bgcolor=#B7DEE8>
        Description
    </td>
    <td align=center bgcolor=#E6B8B7>
        Signal
    </td>
    <td align=center bgcolor=#E6B8B7>
        Description
    </td>
    <td align=center bgcolor=#CCC0DA>
        Signal
    </td>
    <td align=center bgcolor=#CCC0DA>
        Description
    </td>
    <td align=center bgcolor=#D8E4BC>
        Signal
    </td>
    <td align=center bgcolor=#D8E4BC>
        Description
    </td>
    <td align=center bgcolor=#D8E4BC>
        Signal
    </td>
    <td align=center bgcolor=#D8E4BC>
        Description
    </td>
    <td align=center bgcolor=#CCC0DA>
        Signal
    </td>
    <td align=center bgcolor=#CCC0DA>
        Description
    </td>
    <td align=center bgcolor=#E6B8B7>
        Signal
    </td>
    <td align=center bgcolor=#E6B8B7>
        Description
    </td>
    <td align=center bgcolor=#B7DEE8>
        Signal
    </td>
    <td align=center bgcolor=#B7DEE8>
        Description
    </td>
</tr>

<tr>
    <td bgcolor=gray>
        1
    </td>
    <td colspan=2 align=center bgcolor=yellow>
        3.3V
    </td>
    <td colspan=2 align=center bgcolor=yellow>
        3.3V
    </td>
    <td colspan=2 align=center bgcolor=yellow>
        3.3V
    </td>
    <td colspan=2 align=center bgcolor=yellow>
        3.3V
    </td>
    <td colspan=2 align=center bgcolor=red>
        5V
    </td>
    <td colspan=2 align=center bgcolor=red>
        5V
    </td>
    <td colspan=2 align=center bgcolor=red>
        5V
    </td>
    <td colspan=2 align=center bgcolor=red>
        5V
    </td>
    <td bgcolor=gray>
        2
    </td>
</tr>

<tr>
    <td bgcolor=gray>
        3
    </td>
    <td bgcolor=#B7DEE8>
        PC3
    </td>
    <td align=center bgcolor=#B7DEE8>
        GPIO67
    </td>
    <td colspan=2 align=center bgcolor=gray>
        NC
    </td>
    <td colspan=2 align=center bgcolor=gray>
        NC
    </td>
    <td align=center bgcolor=#D8E4BC>
        GPIO2
    </td>
    <td align=center bgcolor=#D8E4BC>
        I2C1 SDA
    </td>
    <td colspan=2 align=center bgcolor=red>
        5V
    </td>
    <td colspan=2 align=center bgcolor=red>
        5V
    </td>
    <td colspan=2 align=center bgcolor=red>
        5V
    </td>
    <td colspan=2 align=center bgcolor=red>
        5V
    </td>
    <td bgcolor=gray>
        4
    </td>
</tr>

<tr>
    <td bgcolor=gray>
        5
    </td>
    <td bgcolor=#B7DEE8>
        PC0
    </td>
    <td align=center bgcolor=#B7DEE8>
        GPIO64
    </td>
    <td colspan=2 align=center bgcolor=gray>
        NC
    </td>
    <td colspan=2 align=center bgcolor=gray>
        NC
    </td>
    <td align=center bgcolor=#D8E4BC>
        GPIO3
    </td>
    <td align=center bgcolor=#D8E4BC>
        I2C1 SCL
    </td>
    <td colspan=2 align=center bgcolor=black>
        <font color=white>GND</font>
    </td>
    <td colspan=2 align=center bgcolor=black>
        <font color=white>GND</font>
    </td>
    <td colspan=2 align=center bgcolor=black>
        <font color=white>GND</font>
    </td>
    <td colspan=2 align=center bgcolor=black>
        <font color=white>GND</font>
    </td>
    <td bgcolor=gray>
        6
    </td>
</tr>

<tr>
    <td bgcolor=gray>
        7
    </td>
    <td bgcolor=#B7DEE8>
        PC7
    </td>
    <td align=center bgcolor=#B7DEE8>
        GPIO71
    </td>
    <td align=center bgcolor=#E6B8B7>
        PI14
    </td>
    <td align=center bgcolor=#E6B8B7>
        GPIO170
    </td>
    <td align=center bgcolor=#CCC0DA>
        PC7
    </td>
    <td align=center bgcolor=#CCC0DA>
        GPIO71
    </td>
    <td align=center bgcolor=#D8E4BC>
        GPIO4
    </td>
    <td align=center bgcolor=#D8E4BC>
        GPCLK0
    </td>
    <td align=center bgcolor=#D8E4BC>
        GPIO14
    </td>
    <td align=center bgcolor=#D8E4BC>
        UART TX
    </td>
    <td align=center bgcolor=#CCC0DA>
        PH0
    </td>
    <td align=center bgcolor=#CCC0DA>
        GPIO224, UART0_TX
    </td>
    <td align=center bgcolor=#E6B8B7>
        PH0
    </td>
    <td align=center bgcolor=#E6B8B7>
        GPIO224, UART0_TX
    </td>
    <td align=center bgcolor=#B7DEE8>
        PH0
    </td>
    <td align=center bgcolor=#B7DEE8>
        GPIO224, UART0_TX
    </td>
    <td bgcolor=gray>
        8
    </td>
</tr>

<tr>
    <td bgcolor=gray>
        9
    </td>
    <td colspan=2 align=center bgcolor=black>
        <font color=white>GND</font>
    </td>
    <td colspan=2 align=center bgcolor=black>
        <font color=white>GND</font>
    </td>
    <td colspan=2 align=center bgcolor=black>
        <font color=white>GND</font>
    </td>
    <td colspan=2 align=center bgcolor=black>
        <font color=white>GND</font>
    </td>
    <td align=center bgcolor=#D8E4BC>
        GPIO15
    </td>
    <td align=center bgcolor=#D8E4BC>
        UART RX
    </td>
    <td align=center bgcolor=#CCC0DA>
        PH1
    </td>
    <td align=center bgcolor=#CCC0DA>
        GPIO225, UART0_RX
    </td>
    <td align=center bgcolor=#E6B8B7>
        PH1
    </td>
    <td align=center bgcolor=#E6B8B7>
        GPIO225, UART0_RX
    </td>
    <td align=center bgcolor=#B7DEE8>
        PH1
    </td>
    <td align=center bgcolor=#B7DEE8>
        GPIO225, UART0_RX
    </td>
    <td bgcolor=gray>
        10
    </td>
</tr>

<tr>
    <td bgcolor=gray>
        11
    </td>
    <td bgcolor=#B7DEE8>
        PC14
    </td>
    <td align=center bgcolor=#B7DEE8>
        GPIO78
    </td>
    <td align=center bgcolor=#E6B8B7>
        PI15
    </td>
    <td align=center bgcolor=#E6B8B7>
        GPIO271
    </td>
    <td align=center bgcolor=#CCC0DA>
        PC14
    </td>
    <td align=center bgcolor=#CCC0DA>
        GPIO78
    </td>
    <td align=center bgcolor=#D8E4BC>
        GPIO17
    </td>
    <td align=center bgcolor=#D8E4BC>
        SPI1 CE1
    </td>
    <td align=center bgcolor=#D8E4BC>
        GPIO18
    </td>
    <td align=center bgcolor=#D8E4BC>
        PCM CLK
    </td>
    <td align=center bgcolor=#CCC0DA>
        PC13
    </td>
    <td align=center bgcolor=#CCC0DA>
        GPIO77
    </td>
    <td align=center bgcolor=#E6B8B7>
        PI7
    </td>
    <td align=center bgcolor=#E6B8B7>
        GPIO263
    </td>
    <td align=center bgcolor=#B7DEE8>
        PC13
    </td>
    <td align=center bgcolor=#B7DEE8>
        GPIO77
    </td>
    <td bgcolor=gray>
        12
    </td>
</tr>

<tr>
    <td bgcolor=gray>
        13
    </td>
    <td bgcolor=#B7DEE8>
        PC12
    </td>
    <td align=center bgcolor=#B7DEE8>
        GPIO76
    </td>
    <td align=center bgcolor=#E6B8B7>
        PI6
    </td>
    <td align=center bgcolor=#E6B8B7>
        GPIO262
    </td>
    <td align=center bgcolor=#CCC0DA>
        PC12
    </td>
    <td align=center bgcolor=#CCC0DA>
        GPIO76
    </td>
    <td align=center bgcolor=#D8E4BC>
        GPIO27
    </td>
    <td align=center bgcolor=#D8E4BC>
        <br />
    </td>
    <td colspan=2 align=center bgcolor=black>
        <font color=white>GND</font>
    </td>
    <td colspan=2 align=center bgcolor=black>
        <font color=white>GND</font>
    </td>
    <td colspan=2 align=center bgcolor=black>
        <font color=white>GND</font>
    </td>
    <td colspan=2 align=center bgcolor=black>
        <font color=white>GND</font>
    </td>
    <td bgcolor=gray>
        14
    </td>
</tr>

<tr>
    <td bgcolor=gray>
        15
    </td>
    <td bgcolor=#B7DEE8>
        PC10
    </td>
    <td align=center bgcolor=#B7DEE8>
        74
    </td>
    <td align=center bgcolor=#E6B8B7>
        PI4
    </td>
    <td align=center bgcolor=#E6B8B7>
        GPIO260
    </td>
    <td align=center bgcolor=#CCC0DA>
        PC10
    </td>
    <td align=center bgcolor=#CCC0DA>
        GPIO74
    </td>
    <td align=center bgcolor=#D8E4BC>
        GPIO22
    </td>
    <td align=center bgcolor=#D8E4BC>
        <br />
    </td>
    <td align=center bgcolor=#D8E4BC>
        GPIO23
    </td>
    <td align=center bgcolor=#D8E4BC>
        <br />
    </td>
    <td align=center bgcolor=#CCC0DA>
        PC11
    </td>
    <td align=center bgcolor=#CCC0DA>
        GPIO75
    </td>
    <td align=center bgcolor=#E6B8B7>
        PI5
    </td>
    <td align=center bgcolor=#E6B8B7>
        GPIO261
    </td>
    <td align=center bgcolor=#B7DEE8>
        PC11
    </td>
    <td align=center bgcolor=#B7DEE8>
        GPIO75
    </td>
    <td bgcolor=gray>
        16
    </td>
</tr>

<tr>
    <td bgcolor=gray>
        17
    </td>
    <td colspan=2 align=center bgcolor=yellow>
        3.3V
    </td>
    <td colspan=2 align=center bgcolor=yellow>
        3.3V
    </td>
    <td colspan=2 align=center bgcolor=yellow>
        3.3V
    </td>
    <td colspan=2 align=center bgcolor=yellow>
        3.3V
    </td>
    <td align=center bgcolor=#D8E4BC>
        GPIO24
    </td>
    <td align=center bgcolor=#D8E4BC>
        <br />
    </td>
    <td align=center bgcolor=#CCC0DA>
        PC9
    </td>
    <td align=center bgcolor=#CCC0DA>
        GPIO73
    </td>
    <td align=center bgcolor=#E6B8B7>
        PI3
    </td>
    <td align=center bgcolor=#E6B8B7>
        GPIO259
    </td>
    <td align=center bgcolor=#B7DEE8>
        PC9
    </td>
    <td align=center bgcolor=#B7DEE8>
        GPIO73
    </td>
    <td bgcolor=gray>
        18
    </td>
</tr>

<tr>
    <td bgcolor=gray>
        19
    </td>
    <td bgcolor=#B7DEE8>
        PH7
    </td>
    <td align=center bgcolor=#B7DEE8>
        GPIO231, SPI1_MOSI
    </td>
    <td align=center bgcolor=#E6B8B7>
        PH7
    </td>
    <td align=center bgcolor=#E6B8B7>
        GPIO231, SPI1_MOSI
    </td>
    <td align=center bgcolor=#CCC0DA>
        PH7
    </td>
    <td align=center bgcolor=#CCC0DA>
        GPIO231, SPI1_MOSI
    </td>
    <td align=center bgcolor=#D8E4BC>
        GPIO10
    </td>
    <td align=center bgcolor=#D8E4BC>
        SPI0 MOSI
    </td>
    <td colspan=2 align=center bgcolor=black>
        <font color=white>GND</font>
    </td>
    <td colspan=2 align=center bgcolor=black>
        <font color=white>GND</font>
    </td>
    <td colspan=2 align=center bgcolor=black>
        <font color=white>GND</font>
    </td>
    <td colspan=2 align=center bgcolor=black>
        <font color=white>GND</font>
    </td>
    <td bgcolor=gray>
        20
    </td>
</tr>

<tr>
    <td bgcolor=gray>
        21
    </td>
    <td bgcolor=#B7DEE8>
        PH8
    </td>
    <td align=center bgcolor=#B7DEE8>
        GPIO232, SPI1_MISO
    </td>
    <td align=center bgcolor=#E6B8B7>
        PH8
    </td>
    <td align=center bgcolor=#E6B8B7>
        GPIO232, SPI1_MISO
    </td>
    <td align=center bgcolor=#CCC0DA>
        PH8
    </td>
    <td align=center bgcolor=#CCC0DA>
        GPIO232, SPI1_MISO
    </td>
    <td align=center bgcolor=#D8E4BC>
        GPIO9
    </td>
    <td align=center bgcolor=#D8E4BC>
        SPI0 MISO
    </td>
    <td align=center bgcolor=#D8E4BC>
        GPIO25
    </td>
    <td align=center bgcolor=#D8E4BC>
        <br />
    </td>
    <td colspan=2 align=center bgcolor=gray>
        NC
    </td>
    <td colspan=2 align=center bgcolor=gray>
        NC
    </td>
    <td align=center bgcolor=#B7DEE8>
        PG13
    </td>
    <td align=center bgcolor=#B7DEE8>
        GPIO205
    </td>
    <td bgcolor=gray>
        22
    </td>
</tr>

<tr>
    <td bgcolor=gray>
        23
    </td>
    <td bgcolor=#B7DEE8>
        PH6
    </td>
    <td align=center bgcolor=#B7DEE8>
        GPIO230, SPI1_CLK
    </td>
    <td align=center bgcolor=#E6B8B7>
        PH6
    </td>
    <td align=center bgcolor=#E6B8B7>
        GPIO230, SPI1_CLK
    </td>
    <td align=center bgcolor=#CCC0DA>
        PH6
    </td>
    <td align=center bgcolor=#CCC0DA>
        GPIO230, SPI1_CLK
    </td>
    <td align=center bgcolor=#D8E4BC>
        GPIO11
    </td>
    <td align=center bgcolor=#D8E4BC>
        SPI0 SCLK
    </td>
    <td align=center bgcolor=#D8E4BC>
        GPIO8
    </td>
    <td align=center bgcolor=#D8E4BC>
        SPI0 CE0
    </td>
    <td colspan=2 align=center bgcolor=gray>
        NC
    </td>
    <td colspan=2 align=center bgcolor=gray>
        NC
    </td>
    <td align=center bgcolor=#B7DEE8>
        PG12
    </td>
    <td align=center bgcolor=#B7DEE8>
        GPIO204
    </td>
    <td bgcolor=gray>
        24
    </td>
</tr>

<tr>
    <td bgcolor=gray>
        25
    </td>
    <td colspan=2 align=center bgcolor=black>
        <font color=white>GND</font>
    </td>
    <td colspan=2 align=center bgcolor=black>
        <font color=white>GND</font>
    </td>
    <td colspan=2 align=center bgcolor=black>
        <font color=white>GND</font>
    </td>
    <td colspan=2 align=center bgcolor=black>
        <font color=white>GND</font>
    </td>
    <td align=center bgcolor=#D8E4BC>
        GPIO7
    </td>
    <td align=center bgcolor=#D8E4BC>
        SPI0 CE1
    </td>
    <td align=center bgcolor=#CCC0DA>
        PG8
    </td>
    <td align=center bgcolor=#CCC0DA>
        GPIO200
    </td>
    <td align=center bgcolor=#E6B8B7>
        PI11
    </td>
    <td align=center bgcolor=#E6B8B7>
        GPIO267
    </td>
    <td align=center bgcolor=#B7DEE8>
        PI9
    </td>
    <td align=center bgcolor=#B7DEE8>
        GPIO265
    </td>
    <td bgcolor=gray>
        26
    </td>
</tr>

<tr>
    <td bgcolor=gray>
        27
    </td>
    <td bgcolor=#B7DEE8>
        PC2
    </td>
    <td align=center bgcolor=#B7DEE8>
        GPIO66
    </td>
    <td colspan=2 align=center bgcolor=gray>
        NC
    </td>
    <td colspan=2 align=center bgcolor=gray>
        NC
    </td>
    <td align=center bgcolor=#D8E4BC>
        GPIO0
    </td>
    <td align=center bgcolor=#D8E4BC>
        EEPROM SDA
    </td>
    <td align=center bgcolor=#D8E4BC>
        GPIO1
    </td>
    <td align=center bgcolor=#D8E4BC>
        EEPROM SCL
    </td>
    <td align=center bgcolor=#CCC0DA>
        PG7
    </td>
    <td align=center bgcolor=#CCC0DA>
        GPIO199
    </td>
    <td align=center bgcolor=#E6B8B7>
        PI10
    </td>
    <td align=center bgcolor=#E6B8B7>
        GPIO266
    </td>
    <td align=center bgcolor=#B7DEE8>
        PI10
    </td>
    <td align=center bgcolor=#B7DEE8>
        GPIO266
    </td>
    <td bgcolor=gray>
        28
    </td>
</tr>

<tr>
    <td bgcolor=gray>
        29
    </td>
    <td bgcolor=#B7DEE8>
        PC4
    </td>
    <td align=center bgcolor=#B7DEE8>
        GPIO68
    </td>
    <td colspan=2 align=center bgcolor=gray>
        NC
    </td>
    <td colspan=2 align=center bgcolor=gray>
        NC
    </td>
    <td align=center bgcolor=#D8E4BC>
        GPIO5
    </td>
    <td align=center bgcolor=#D8E4BC>
        GPCLK1
    </td>
    <td colspan=2 align=center bgcolor=black>
        <font color=white>GND</font>
    </td>
    <td colspan=2 align=center bgcolor=black>
        <font color=white>GND</font>
    </td>
    <td colspan=2 align=center bgcolor=black>
        <font color=white>GND</font>
    </td>
    <td colspan=2 align=center bgcolor=black>
        <font color=white>GND</font>
    </td>
    <td bgcolor=gray>
        30
    </td>
</tr>

<tr>
    <td bgcolor=gray>
        31
    </td>
    <td bgcolor=#B7DEE8>
        PI5
    </td>
    <td align=center bgcolor=#B7DEE8>
        GPIO261
    </td>
    <td align=center bgcolor=#E6B8B7>
        PI9
    </td>
    <td align=center bgcolor=#E6B8B7>
        GPIO265
    </td>
    <td align=center bgcolor=#CCC0DA>
        PG6
    </td>
    <td align=center bgcolor=#CCC0DA>
        GPIO198
    </td>
    <td align=center bgcolor=#D8E4BC>
        GPIO6
    </td>
    <td align=center bgcolor=#D8E4BC>
        GPCLK2
    </td>
    <td align=center bgcolor=#D8E4BC>
        GPIO12
    </td>
    <td align=center bgcolor=#D8E4BC>
        PWM0
    </td>
    <td align=center bgcolor=#CCC0DA>
        PG9
    </td>
    <td align=center bgcolor=#CCC0DA>
        GPIO201
    </td>
    <td align=center bgcolor=#E6B8B7>
        PI12
    </td>
    <td align=center bgcolor=#E6B8B7>
        GPIO268
    </td>
    <td align=center bgcolor=#B7DEE8>
        PI6
    </td>
    <td align=center bgcolor=#B7DEE8>
        GPIO262
    </td>
    <td bgcolor=gray>
        32
    </td>
</tr>

<tr>
    <td bgcolor=gray>
        33
    </td>
    <td bgcolor=#B7DEE8>
        PI14
    </td>
    <td align=center bgcolor=#B7DEE8>
        GPIO270
    </td>
    <td colspan=2 align=center bgcolor=gray>
        NC
    </td>
    <td colspan=2 align=center bgcolor=gray>
        NC
    </td>
    <td align=center bgcolor=#D8E4BC>
        GPIO13
    </td>
    <td align=center bgcolor=#D8E4BC>
        PWM1
    </td>
    <td colspan=2 align=center bgcolor=black>
        <font color=white>GND</font>
    </td>
    <td colspan=2 align=center bgcolor=black>
        <font color=white>GND</font>
    </td>
    <td colspan=2 align=center bgcolor=black>
        <font color=white>GND</font>
    </td>
    <td colspan=2 align=center bgcolor=black>
        <font color=white>GND</font>
    </td>
    <td bgcolor=gray>
        34
    </td>
</tr>

<tr>
    <td bgcolor=gray>
        35
    </td>
    <td bgcolor=#B7DEE8>
        PC6
    </td>
    <td align=center bgcolor=#B7DEE8>
        GPIO70
    </td>
    <td align=center bgcolor=#E6B8B7>
        PI1
    </td>
    <td align=center bgcolor=#E6B8B7>
        GPIO257
    </td>
    <td align=center bgcolor=#CCC0DA>
        PC6
    </td>
    <td align=center bgcolor=#CCC0DA>
        GPIO70
    </td>
    <td align=center bgcolor=#D8E4BC>
        GPIO19
    </td>
    <td align=center bgcolor=#D8E4BC>
        PCM FS
    </td>
    <td align=center bgcolor=#D8E4BC>
        GPIO16
    </td>
    <td align=center bgcolor=#D8E4BC>
        SPI1 CE2
    </td>
    <td colspan=2 align=center bgcolor=gray>
        NC
    </td>
    <td colspan=2 align=center bgcolor=gray>
        NC
    </td>
    <td align=center bgcolor=#B7DEE8>
        PG11
    </td>
    <td align=center bgcolor=#B7DEE8>
        GPIO203
    </td>
    <td bgcolor=gray>
        36
    </td>
</tr>

<tr>
    <td bgcolor=gray>
        37
    </td>
    <td bgcolor=#B7DEE8>
        PC15
    </td>
    <td align=center bgcolor=#B7DEE8>
        GPIO79
    </td>
    <td align=center bgcolor=#E6B8B7>
        PI13
    </td>
    <td align=center bgcolor=#E6B8B7>
        GPIO269
    </td>
    <td align=center bgcolor=#CCC0DA>
        PC15
    </td>
    <td align=center bgcolor=#CCC0DA>
        GPIO79
    </td>
    <td align=center bgcolor=#D8E4BC>
        GPIO26
    </td>
    <td align=center bgcolor=#D8E4BC>
        <br />
    </td>
    <td align=center bgcolor=#D8E4BC>
        GPIO20
    </td>
    <td align=center bgcolor=#D8E4BC>
        PCM DIN
    </td>
    <td align=center bgcolor=#CCC0DA>
        PH10
    </td>
    <td align=center bgcolor=#CCC0DA>
        GPIO234, IR_RX
    </td>
    <td align=center bgcolor=#E6B8B7>
        PH10
    </td>
    <td align=center bgcolor=#E6B8B7>
        GPIO234, IR_RX
    </td>
    <td align=center bgcolor=#B7DEE8>
        PH4
    </td>
    <td align=center bgcolor=#B7DEE8>
        GPIO228
    </td>
    <td bgcolor=gray>
        38
    </td>
</tr>

<tr>
    <td bgcolor=gray>
        39
    </td>
    <td colspan=2 align=center bgcolor=black>
        <font color=white>GND</font>
    </td>
    <td colspan=2 align=center bgcolor=black>
        <font color=white>GND</font>
    </td>
    <td colspan=2 align=center bgcolor=black>
        <font color=white>GND</font>
    </td>
    <td colspan=2 align=center bgcolor=black>
        <font color=white>GND</font>
    </td>
    <td align=center bgcolor=#D8E4BC>
        GPIO21
    </td>
    <td align=center bgcolor=#D8E4BC>
        PCM DOUT
    </td>
    <td align=center bgcolor=#CCC0DA>
        PC8
    </td>
    <td align=center bgcolor=#CCC0DA>
        GPIO72
    </td>
    <td align=center bgcolor=#E6B8B7>
        PI2
    </td>
    <td align=center bgcolor=#E6B8B7>
        GPIO258
    </td>
    <td align=center bgcolor=#B7DEE8>
        PC8
    </td>
    <td align=center bgcolor=#B7DEE8>
        GPIO72
    </td>
    <td bgcolor=gray>
        40
    </td>
</tr>

</table>



<h3 class="wp-block-heading" id="htoc-l">Logic Level &#8211; 1.8v or 3.3v?</h3>



<p>You&#8217;ll also find if you read through the <a href="https://github.com/bigtreetech/CB1/blob/master/BIGTREETECH%20CB1%20User%20Manual.pdf" target="_blank" rel="noreferrer noopener">manual </a>(page 12) that if you have version 2.1 of the board PC6, PC7, PC8, PC9, PC10, PC11, PC12, PC13, PC14 and PC4 pins use logic voltage of 1.8v, but if you have version 2.2 it is 3.3v.  I&#8217;ve never before seen anything like this.  You&#8217;ll need to be sure of which version you have before laying out your project.</p>



<h3 class="wp-block-heading" id="htoc-pull-up-pull-down-resistors">Pull-up / Pull-down Resistors</h3>



<p>While testing my GPIO input that I&#8217;ve used on every other board I&#8217;ve tested I also discovered that the H616 SoC uses different pull-up/pull-down resistors for different blocks of pins.  Directly from the H616 datasheet:</p>



<ul class="wp-block-list">
<li>For PL0~PL1 ports the Rpu and Rpd are 4.7kΩ ±20%</li>



<li>For PC0, PC3 ~PC7, PF3 , PF6, a nd PG1~PG5 ports, the Rpu and Rpd are 15kΩ ±20%</li>



<li>For other GPIO ports, the Rpu and Rpd are 100kΩ ±20%</li>
</ul>



<p>For reference the Raspberry Pi uses pull-up / pull-down resistors that are 50-65kΩ.  I happened to pick port that had a 4.7kΩ pull-down which caused my button which was connected to 3.3v through a 1kΩ resistor not to work.  This is the first platform I&#8217;ve used that had different internal resistor values depending on the pin.  BEWARE!</p>



<h2 class="wp-block-heading" id="htoc-ir-1-1">IR (1/1)</h2>



<p>Here I was pleasantly suprised.  The CB1 H616 SoC includes a hardware IR receiver.  This resulted in a 85% success rate used in conjunction with the GPIO bit-banging IR transmitter.  While 85% may not seem great it was actually an improvement over the Pi4B using the software IR receiver.  Only the Rock 5B with it&#8217;s massive processing power managed a 100% success rate on the IR test so far.</p>



<p>Given that IR is subject to external interference, I believe that the CB1 would work for a project requiring an IR receiver.</p>



<h2 class="wp-block-heading" id="htoc-i2c-0-1">I2C (0/1)</h2>



<p>The H616 can support up to <em><strong>6</strong></em> TWI interfaces.  </p>



<blockquote class="wp-block-quote is-layout-flow wp-block-quote-is-layout-flow">
<p id="htoc-i-had-to-look-it-up-and-apparently-twi-is-electrically-compatible-with-i2c-it-appears-that-the-twi-two-wire-interface-was-created-to-avoid-trademark-issues">I had to look it up and apparently TWI is electrically compatible with I2C.  It appears that the &#8220;TWI&#8221; (Two-Wire-Interface) was created to avoid trademark issues.  </p>
</blockquote>



<p>While the SoC can support up to 6 there are only 2 pins exposed that connect to a TWI/I2C interface (per the H616 documentation).  That is PH0 and PH1.  These ALSO are the only two ports that connect to a UART interface.</p>



<p>I did test disabling the UART and testing the ports as TWI/I2C but to no avail.  I was unable to get it to pick up that I had any devices connected on the TWI/I2C bus.  Given that Bigtreetech didn&#8217;t include any overalys for the TWI/I2C I have to assume that there was some other board design choice that makes this impossible.</p>



<p>Bigtreetech DID provide an overlay to enable a software based I2C bus which works about as well as it did on the <a href="https://www.learningtopi.com/uncategorized/atomic-pi-pros-but-mostly-cons/">Atomic Pi</a>.  Which is to say, it works ok as long as your device is idle, but trying to use the soft I2C bus during the tests resulted in an 18% success in writing to the display.  The rest of the time I ended up with garbled text displaying.</p>



<p>I would avoid using software bit-banging I2C unless there is no other option.  From my experience the soft I2C and SPI drivers are error prone.</p>



<p>Also as a note the &#8220;biqu&#8221; default user wasn&#8217;t added to the i2c group.</p>



<p>A copy of overlay files I created are available on our GitHub files here:  <a href="https://learningtopi.github.io/cb1" target="_blank" rel="noreferrer noopener">https://learningtopi.github.io/cb1</a></p>



<h2 class="wp-block-heading" id="htoc-spi-1-2">SPI (1/2)</h2>



<p>I gave the CB1 one of two possible points.  This was because only ONE if the TWO SPI interfaces on the H616 were exposed on pins (SPI1 for some reason).  I was able to get the SPI bus to work with both my <a href="https://www.learningtopi.com/sbc/python_dht11_spi/" target="_blank" rel="noreferrer noopener">bmx280_spi</a> and <a href="https://www.learningtopi.com/sbc/python_dht11_spi/">dht11_spi</a> packages, but can&#8217;t use both at the same time (DHT11 setup causes a conflict which I&#8217;ll have to look into later).</p>



<p>Also once the overlay was enabled and the SPI devices were created the system wasn&#8217;t setup for anyone other than root.  Running the following and rebooting will resolve this issue.  It is an inconvienience that this isn&#8217;t setup out of the box.</p>



<pre class="wp-block-code"><code>groupadd spi 
echo 'SUBSYSTEM=="spidev", GROUP="spi", MODE="0660"' &gt; /etc/udev/rules.d/99-spi.rules 
usermod -G spi -a biqu </code></pre>



<p>Last note on SPI, Bigtreetech provides an overlay to enable SPI1_cs0 and SPI1_cs1, however regardless if which one you use both CS0 and CS1 are enabled for SPI1.  After digging through the dtb files (using <code>fdtdump</code>) it appears that they are not propperly setting CS pins to disabled.  This CAN be done with an overlay (I tested it to verify), but it is a bit odd to provide specific SPI1_CS0 and SPI1_CS1 overlays if they aren&#8217;t being controlled individually.</p>



<p>A copy of overlay files I created are available on our GitHub files here:  <a href="https://learningtopi.github.io/cb1" target="_blank" rel="noreferrer noopener">https://learningtopi.github.io/cb1</a></p>



<h2 class="wp-block-heading" id="htoc-uart-0-1">UART (0/1)</h2>



<p>UART was an extreme disapointment.  Everything worked great up to 115200 baud.  Once I moved from 115200 to 230400 I started to see issues when receiveing on the UART interface (sending from the USB), however traffic going from UART to USB still worked.  At 460800 UART to USB failed far more often then not.  576000 and 921600 were a lost cause.</p>



<p>I did test moving the USB interface to my Rock 5B and just used <a href="https://pypi.org/project/pyserial/" target="_blank" rel="noreferrer noopener">pySerial</a> to send and receive back and forth.  I experienced the exact issues at the same speeds.  There has to be something either with the carrier board or the setup on the CB1 itself causing this problem.</p>



<p>I ended up with a 42% overall success rate which I consider a failure.  Unless you know you won&#8217;t need higher than a 115200 baud, I would suggest looking at a different platform.  Basically any other SBC.</p>



<h2 class="wp-block-heading" id="htoc-subjective-performance-1-2">Subjective Performance (1/2)</h2>



<p>Performance-wise, the CB1 feels pretty snappy.  I will note that I am running a trimmed down Debian Bookworm image from Bigtreetech with no GUI.  Given that we only have 1GB of RAM I would only consider this for a non-GUI headless system anyway.</p>



<p>I&#8217;ll also note that the positive performance may be partially due to the fact that Bigtreetech disabled CPU speed scaling in their kernel.  This may make some sense if you look at the board as a controller for a 3D printer, but for an IOT device this is not my ideal setup.  I mentioned earlier that the heatsink is really required and this is why.  This system runs HOT.  WAY hotter than other SBC&#8217;s given that this only has 4x A53 cores.</p>



<figure class="wp-block-gallery has-nested-images columns-default wp-block-gallery-4 is-layout-flex wp-block-gallery-is-layout-flex">
<figure class="wp-block-image size-full"><img loading="lazy" decoding="async" width="485" height="669" data-id="1197" src="https://www.learningtopi.com/wp-content/uploads/rock5b-idle-temps.png" alt="" class="wp-image-1197" srcset="https://www.learningtopi.com/wp-content/uploads/rock5b-idle-temps.png 485w, https://www.learningtopi.com/wp-content/uploads/rock5b-idle-temps-217x300.png 217w, https://www.learningtopi.com/wp-content/uploads/rock5b-idle-temps-109x150.png 109w, https://www.learningtopi.com/wp-content/uploads/rock5b-idle-temps-300x414.png 300w" sizes="auto, (max-width: 485px) 100vw, 485px" /></figure>



<figure class="wp-block-image size-full"><img loading="lazy" decoding="async" width="423" height="348" data-id="1196" src="https://www.learningtopi.com/wp-content/uploads/cb1-idle-temps.png" alt="" class="wp-image-1196" srcset="https://www.learningtopi.com/wp-content/uploads/cb1-idle-temps.png 423w, https://www.learningtopi.com/wp-content/uploads/cb1-idle-temps-300x247.png 300w, https://www.learningtopi.com/wp-content/uploads/cb1-idle-temps-150x123.png 150w" sizes="auto, (max-width: 423px) 100vw, 423px" /></figure>
</figure>



<p>For comparison, on the left is my Rock 5B which has the Rk3588 (4x A76 + 4x A55 cores) running at 52-53°C (125-127°F) compared to 57°C (134°F).  Both systems have a passive heatsink (albiet the Rock 5B has a much larger one).</p>



<p>Since they disabled CPU scaling in the kernel, as far as I know this means that the kernel can&#8217;t throttle the CPU if temperature reaches critical.</p>



<h2 class="wp-block-heading" id="htoc-ease-of-use-0-2">Ease of Use (0/2)</h2>



<p>I would say the biggest issue with usability is overlays.  There are only a handful available:</p>



<ul class="wp-block-list">
<li><strong>disable_uart0</strong>:<strong>  </strong>This one is pretty self explanitory and works as you would expect</li>



<li><strong>ir</strong>:  This one is also self explanitory and enables the IR receiver</li>



<li><strong>light</strong>:  Not clear why this is called &#8220;light&#8221;.  It disables UART0, enables the bit-banging I2C as well as the PWM.  Without dumping the DTBO file you really wouldn&#8217;t have a clue what this is doing</li>



<li><strong>mcp2515</strong>:  This one enables the mcp2515 CAN bus, but also SPI1.  Why SPI?  I am not familiar with CAN buses, but from the system overlay it appears that the mcp2515 is a sub-object to spi@5011000 (SPI1).</li>



<li><strong>pwm</strong>:  This enables the only available, PWM but DOESN&#8217;T disable the UART (which is on the same set of pins).  So make sure you also include <code>disable_uart0 </code>if you use this.</li>



<li><strong>spidev0_0</strong>:  Not sure why this is even here, SPI0 isn&#8217;t exposed on any pins</li>



<li><strong>spidev1_0, spidev1_1, spidev1_2</strong>: These are frustrating.  They all turn on SPI1 with 2x CS (0 and 1).  Under the spi@5011000 device, the cs pins are set uising the &#8220;cs-gpios&#8221; field.  None of these overlays edit this field.  You CAN edit or remove CS pins by creating your own overlay to edit this field, but having these overlays not do what they imply is confusing.</li>
</ul>



<p>The CB1 kernel DOES include the configfs which is a great feature to adding overlays after boot.  This doesn&#8217;t however overcome the lack of documentation, pins that aren&#8217;t connected, pins that are supposed to be connected and aren&#8217;t, lack of hardware I2C, single UART and overlaping functions on pins with no alternatives available.</p>



<p>If you decide to buy a CB1 for something other than running a 3D printer, be prepared to write your own overlay files.</p>



<blockquote class="wp-block-quote is-layout-flow wp-block-quote-is-layout-flow">
<p id="htoc-i">A copy of overlay files I created are available on our GitHub files here:  <a href="https://learningtopi.github.io/cb1" target="_blank" rel="noreferrer noopener">https://learningtopi.github.io/cb1</a></p>
</blockquote>



<h2 class="wp-block-heading" id="htoc-software-updates-1-2">Software Updates (1/2)</h2>



<p>The CB1 image I downloaded is a Debian Bookworm build which is very promising.  It appears that they are up to date on their distributions!  Bookworm (Debian 12) was only recently released.  The downside is the kernel.  The CB1 is running 5.16 which was NOT a long term train (5.15 was).  5.16 stopped receiving security updates <a href="https://endoflife.date/linux" target="_blank" rel="noreferrer noopener">over a year ago</a> (April 2022).  The bizzare thing is that they appear to have started with 5.16.17 in August of 2022 AFTER support was ended.  And they didn&#8217;t even start with the last release which was 5.16.20.</p>



<p>You may be able to keep the system up to date, but the kernel was out of support when they started.</p>



<h2 class="wp-block-heading" id="htoc-community-0-2">Community (0/2)</h2>



<p>I could find practically no community for the CB1.  The first discussion board I found for the CB1 (<a href="https://github.com/bigtreetech/CB1/discussions" target="_blank" rel="noreferrer noopener">https://github.com/bigtreetech/CB1/discussions</a>) says it is abandoned (not a good start) and only has a handful of discussions from 2022.  The link at the top of this discussion board linked to another discussion board (<a href="https://github.com/bigtreetech/CB1/discussions/8" target="_blank" rel="noreferrer noopener">https://github.com/bigtreetech/CB1/discussions/8</a>) that ALSO says it is abandoned.  This page had a total of 6 comments and 9 replies.  This just takes you to a discussion for the Bullseye minimal image (which I&#8217;m not even running): <a href="https://github.com/bigtreetech/CB1/discussions/9" target="_blank" rel="noreferrer noopener">https://github.com/bigtreetech/CB1/discussions/9</a>.  Again here there was still only 25 comments and 43 replies.</p>



<p>Don&#8217;t expect to find a lot of community feedback for this board.</p>



<h2 class="wp-block-heading" id="htoc-issues">Issues</h2>



<h3 class="wp-block-heading" id="htoc-security-groups-and-udev-not-setup-for-i2c-and-spi">Security Groups and UDEV not setup for I2C and SPI</h3>



<p>I mentioned under the <a href="#htoc-i2c-0-1">I2C</a> section that the <code>biqu</code> default user wasn&#8217;t in the <code>i2c</code> user group.  For <a href="#htoc-spi-1-2">SPI</a>, devices were created with only root access.  I had to create the <code>spi</code> group, create a <code>udev</code> rule and add the <code>biqu</code> user to the <code>spi</code> group.  While this is not extraordinarily complicated to do, if you are are not familiar with the udev rules it may take some time to setup non-root access.  More mature SBC platforms have this configured out of the box ready to use.</p>



<h3 class="wp-block-heading" id="htoc-no-i2c-only-overlay">No I2C only overlay</h3>



<p>Also in the <a href="#htoc-i2c-0-1">I2C</a> section I called out the lack of a dedicated I2C overlay (even though it is a bit-banging software overlay and not a hardware one).  The &#8220;light&#8221; and &#8220;tft&#8221; overlays turn on I2C in addition to other functions that you may or may not want.  (For example &#8220;tft&#8221; also disables the HDMI port, &#8220;light&#8221; disables the only UART and enables PWM in its place.)</p>



<p>There is of course nothing stopping you from creating your own overlay files.  The CB1 uses a <code>boot.cmd</code> UBOOT script that includes a check for user provided overlays.  Simply create the <code>/boot/overlay-user</code> directory and place your compiled DTBO files here.  In the <code>BoardEnv.txt</code> file, add a line for user_overlays.  Then just add a space separated list of overlays you want to create.</p>



<h3 class="wp-block-heading" id="htoc-pins-that-don-t-work-pg6-pg7-pg8-pg9">Pins that don&#8217;t work (PG6, PG7, PG8, PG9)</h3>



<p>For some unknown reason these 4 pins just wouldn&#8217;t work.  They are documented in the pinout, I could reserve the pins but setting them high or low had no affect.  Using my oscilliscope I was never able to get a signal on these pins.  All I get is background static the same as I get on the pins that Bigtreetech marked as &#8220;not connected&#8221;.  Not sure why these pins don&#8217;t work since they are listed on the schematic (<a href="https://github.com/bigtreetech/CB1/blob/master/Hardware/BIGTREETECH_CB1_V22_220812_SCH.pdf">https://github.com/bigtreetech/CB1/blob/master/Hardware/BIGTREETECH_CB1_V22_220812_SCH.pdf</a>) on connector A1-100.</p>



<h3 class="wp-block-heading" id="htoc-uart0-overlaps-with-twi-and-pwm">UART0 overlaps with TWI and PWM</h3>



<p>The PH0 and PH1 pins are the only pins that can be used for UART0, TWI (I2C although I still couldn&#8217;t get this to work) and PWM.  You get to pick one of these three functions.  None of the other connected pins support any of these functions (other than running the soft I2C driver).  This is severly limiting in terms of what functions are available.</p>



<h3 class="wp-block-heading" id="htoc-uart0-doesn-t-work-over-115200">UART0 doesn&#8217;t work over 115200</h3>



<p>I was not able to figure out what caused this, but the only UART interface doesn&#8217;t work consistently (or at all) over 115200 baud.  While this may work for some projects, it does show that SOMETHING is wrong design wise.  Unfortunately I don&#8217;t have another board with an H616 for comparison so I don&#8217;t know if this is an Allwinner H616 chip level issue or if this is a Bigtreetech CB1 issue.</p>



<h3 class="wp-block-heading" id="htoc-pull-up-pull-down-resistor-inconsistancy">Pull-up / Pull-down Resistor Inconsistancy</h3>



<p>I covered this above (<a href="#htoc-pull-up-pull-down-resistors">#htoc-pull-up-pull-down-resistors</a>).  Some pins use different pull-up and pull-down resistors.  This caused my input button setup on my breadboard not to function at all on certain pins.  After I swapped the resistor I was using to the 3.3V rail it worked fine, it just took some time to sort out what the issue was.  I have not run across this particular setup on other SoC&#8217;s.  I&#8217;ll be on the lookout from now on.</p>



<h2 class="wp-block-heading" id="htoc-overall-5-14">Overall (5/14)</h2>



<p>If you consider the original intended purpose of this board (to run a 3D printer), most of the issues and problems I ran across are probably non-issues.  Trying to use this board as a general IOT device is far more problematic.  The lack of functions exposed on pins make it extremely hard to find a good use for this device.  The only 2 things that I didn&#8217;t have any major issues with was SPI (other than missing udev setup and security groups) and IR.  I2C is software based, the UART didn&#8217;t work consistently (or at all) over 115200 and 4 of the GPIO&#8217;s documented in their notes wouldn&#8217;t work.  There are also 6 pins that just aren&#8217;t connected to anything (on TOP of the 4 I couldn&#8217;t get to work).</p>



<p>All in all I would say if you aren&#8217;t planning to use this for a 3D printer I would suggest looking for an alternative.  It may work for some specific use cases, but you will likely need to recompile the kernel to get CPU throttling turned back on and you have limited IO functionality.</p>



<p>A copy of overlay files I created are available on our GitHub files here:  <a href="https://learningtopi.github.io/cb1" target="_blank" rel="noreferrer noopener">https://learningtopi.github.io/cb1</a></p>
<p>The post <a href="https://www.learningtopi.com/sbc/cb1/bigtreetech-cb1/">Bigtreetech CB1</a> appeared first on <a href="https://www.learningtopi.com">Learning to Pi</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://www.learningtopi.com/sbc/cb1/bigtreetech-cb1/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>sbc_gpio: Pi 4B vs Rock 5B</title>
		<link>https://www.learningtopi.com/sbc/sbc_gpio-pi-4b-vs-rock-5b/</link>
					<comments>https://www.learningtopi.com/sbc/sbc_gpio-pi-4b-vs-rock-5b/#respond</comments>
		
		<dc:creator><![CDATA[tdunteman]]></dc:creator>
		<pubDate>Wed, 21 Jun 2023 05:56:44 +0000</pubDate>
				<category><![CDATA[Raspberry Pi SBC]]></category>
		<category><![CDATA[Rock5B]]></category>
		<category><![CDATA[SBC]]></category>
		<category><![CDATA[Pi4B]]></category>
		<category><![CDATA[python sbc_gpio]]></category>
		<guid isPermaLink="false">https://www.learningtopi.com/?p=994</guid>

					<description><![CDATA[<p>One of my goals over the past couple of years has been to find a suitable replacement for the Raspberry Pi 4B as supplies have been low and costs have been high.&#160; During the past couple of years, I’ve purchased several different boards to test out.&#160; Now that I have a GPIO abstraction layer and...</p>
<p>The post <a href="https://www.learningtopi.com/sbc/sbc_gpio-pi-4b-vs-rock-5b/">sbc_gpio: Pi 4B vs Rock 5B</a> appeared first on <a href="https://www.learningtopi.com">Learning to Pi</a>.</p>
]]></description>
										<content:encoded><![CDATA[
<p>One of my goals over the past couple of years has been to find a suitable replacement for the Raspberry Pi 4B as supplies have been low and costs have been high.&nbsp; During the past couple of years, I’ve purchased several different boards to test out.&nbsp; Now that I have a GPIO abstraction layer and test library (you can read about it <a href="https://www.learningtopi.com/tag/python-sbc_gpio/">here</a> or read the library documentation <a href="https://www.learningtopi.com/tag/python-sbc_gpio/">here</a>) I am ready to start sharing some results.  So without further ado, here is the first installment of the sbc_gpio: Pi 4B vs Rock 5B.</p>



<div class="wp-block-columns is-layout-flex wp-container-core-columns-is-layout-9d6595d7 wp-block-columns-is-layout-flex">
<div class="wp-block-column is-layout-flow wp-block-column-is-layout-flow"><div class="wp-block-image">
<figure class="aligncenter size-large is-resized"><img loading="lazy" decoding="async" src="https://www.learningtopi.com/wp-content/uploads/2022/04/Raspberry_Pi_4_Model_B_-_Side-streched-scaled-1024x385.jpg" alt="" class="wp-image-80" width="508" height="191" srcset="https://www.learningtopi.com/wp-content/uploads/2022/04/Raspberry_Pi_4_Model_B_-_Side-streched-scaled-1024x385.jpg 1024w, https://www.learningtopi.com/wp-content/uploads/2022/04/Raspberry_Pi_4_Model_B_-_Side-streched-scaled-300x113.jpg 300w, https://www.learningtopi.com/wp-content/uploads/2022/04/Raspberry_Pi_4_Model_B_-_Side-streched-scaled-150x56.jpg 150w, https://www.learningtopi.com/wp-content/uploads/2022/04/Raspberry_Pi_4_Model_B_-_Side-streched-scaled-768x289.jpg 768w, https://www.learningtopi.com/wp-content/uploads/2022/04/Raspberry_Pi_4_Model_B_-_Side-streched-scaled-1536x578.jpg 1536w, https://www.learningtopi.com/wp-content/uploads/2022/04/Raspberry_Pi_4_Model_B_-_Side-streched-scaled-2048x770.jpg 2048w" sizes="auto, (max-width: 508px) 100vw, 508px" /></figure>
</div></div>



<div class="wp-block-column is-layout-flow wp-block-column-is-layout-flow"><div class="wp-block-image">
<figure class="aligncenter size-full is-resized"><img loading="lazy" decoding="async" src="https://www.learningtopi.com/wp-content/uploads/500px-Rock5b-v142-angel.jpg" alt="" class="wp-image-468" width="309" height="258"/></figure>
</div></div>
</div>



<p>The purpose of the comparisons is not to showcase CPU, memory, NIC’s etc.&nbsp; The test library I’ll be using is intended to test GPIO and other functionality from Python.&nbsp; The idea is to compare the setup and functionality of the following:</p>



<ul class="wp-block-list">
<li><strong>IR </strong>– using LIRC to both send and receive an infrared signal</li>



<li><strong>BMX </strong>– using SPI to read from a BME280 or BMP280 sensor</li>



<li><strong>I2C_DISPLAY </strong>&#8211;&nbsp; writes content to an 16&#215;2 LCD display connected via I2C</li>



<li><strong>DHT_SPI </strong>– uses the SPI bus to read from a DHT11 or DHT22.  See the <a href="https://www.learningtopi.com/sbc/python_dht11_spi/" target="_blank" rel="noreferrer noopener">DHT11_SPI </a>class for more details on how to set this up</li>



<li><strong>LED </strong>– Flash an LED using the GPIO</li>



<li><strong>BUTTON </strong>– Watch for input on a GPIO</li>



<li><strong>UART </strong>– Send and receive data between a UART and USB to serial adapter</li>
</ul>



<p>The purpose of the test isn’t to compare CPU and memory specs, but it is good to start with an understanding of how the hardware stacks up.</p>



<h2 class="wp-block-heading">Hardware Specs</h2>



<table id="tablepress-6-no-3" class="tablepress tablepress-id-6">
<thead>
<tr class="row-1">
	<td class="column-1" style="width:20%;"></td><th class="column-2" style="width:40%;">Raspberry Pi 4B</th><th class="column-3" style="width:40%;">Radxa Rock 5B</th>
</tr>
</thead>
<tbody class="row-striping row-hover">
<tr class="row-2">
	<td class="column-1">CPU</td><td class="column-2">Broadcom BCM2711<br />
4x ARM Cortex-A72 (600Mhz &#8211; 1.8GHz)</td><td class="column-3">Rockchip RK3588<br />
4x ARM Cortex-A76 (408Mhz &#8211; 2.4Ghz)<br />
4x ARM Cortex-A55 (408Mhz &#8211; 1.8Ghz)</td>
</tr>
<tr class="row-3">
	<td class="column-1">NPU</td><td class="column-2">N/A</td><td class="column-3">6 TOPS  INT4/INT8/INT16/FP16<br />
TensorFlow/MXNet/PyTorch/Caffe can be easily converted<br />
300Mhz &#8211; 1Ghz (per /sys/class/devfreq/fdab0000.npu/available_frequencies</td>
</tr>
<tr class="row-4">
	<td class="column-1">Memory</td><td class="column-2">1/2/4/8GB LPDDR4 3200Mhz 32-bit bus</td><td class="column-3">4/8/16GB LPDDR4 2112Mhz 64-bit bus</td>
</tr>
<tr class="row-5">
	<td class="column-1">GPU</td><td class="column-2">Broadcom VideoCore VI <br />
4 cores (200 &#8211; 500Mhz)</td><td class="column-3">ARM Mali-G610 MP4 3D GPU<br />
4 cores (300Mhz &#8211; 1Ghz)</td>
</tr>
<tr class="row-6">
	<td class="column-1">Video Decoding</td><td class="column-2">H.264, H.265 HEVC (8/10bit), VP8, VP9, VC-1, AVC, JPEG</td><td class="column-3">H.264, H.265 HEVC (8/10bit), VP8, VP9, VC-1, AVC, JPEG</td>
</tr>
<tr class="row-7">
	<td class="column-1">Video Encoding</td><td class="column-2">H.264, JPEG</td><td class="column-3">H.264, H.265 HEVC (8/10bit), VP8, VP9, VC-1, AVC, JPEG</td>
</tr>
<tr class="row-8">
	<td class="column-1">GPU FP16/FP32/FP64</td><td class="column-2">64 / 32 / 8 GFLOPS</td><td class="column-3">? / 610 / ? GFLOPS</td>
</tr>
<tr class="row-9">
	<td class="column-1">Video Out</td><td class="column-2">2x micro HDMI + MIPI DSI</td><td class="column-3">2x HDMI + MIPI DSI</td>
</tr>
<tr class="row-10">
	<td class="column-1">Video In</td><td class="column-2">MIPI CSI</td><td class="column-3">1x micro HDMI + MIPI CSI</td>
</tr>
<tr class="row-11">
	<td class="column-1">Storage</td><td class="column-2">MicroSD<br />
USB 3.0 attached storage is supported</td><td class="column-3">PCIe 3.0 x4 M.2 M-key (up to 2280)<br />
MicroSD<br />
eMMC socket (<a href="https://wiki.radxa.com/Rock5/hardware/emmc" rel="noopener" target="_blank">ODroid compatible</a>)<br />
16MB SPI flash bootloader</td>
</tr>
<tr class="row-12">
	<td class="column-1">USB</td><td class="column-2">2x USB 2.0 Type-A<br />
2x USB 3.0 Type-A</td><td class="column-3">2x USB 2.0 Type-A<br />
2x USB 3.0 Type-A</td>
</tr>
<tr class="row-13">
	<td class="column-1">PCIe</td><td class="column-2">N/A<br />
</td><td class="column-3">PCIe 3.0 x4 M.2 M key (up to 2280 SSD for storage)<br />
PCIe 2.0 M.2 E key (for WiFi/Bluetooth module)<br />
</td>
</tr>
<tr class="row-14">
	<td class="column-1">Networking</td><td class="column-2">1Gbps Broadcom (BCM54213PE)<br />
802.11ac 2.4/5Ghz (Infineon CYW43455)</td><td class="column-3">2.5Gbps RTL8125 NIC<br />
No builtin wireless (<a href="https://wiki.radxa.com/Rock5/hardware/wifi" rel="noopener" target="_blank">requires PCIe M.2 E key module</a>)</td>
</tr>
<tr class="row-15">
	<td class="column-1">Bluetooth</td><td class="column-2">Bluetooth 5.0, BLE (BCM54213PE)<br />
</td><td class="column-3">No builtin wireless (<a href="https://wiki.radxa.com/Rock5/hardware/wifi" rel="noopener" target="_blank">requires PCIe M.2 E key module</a>)</td>
</tr>
<tr class="row-16">
	<td class="column-1">I2C</td><td class="column-2">up to 6x</td><td class="column-3">up to 5x</td>
</tr>
<tr class="row-17">
	<td class="column-1">SPI</td><td class="column-2">up to 6x (however some SPI pins overlap with other SPI devices so all can&#8217;t be used at once)</td><td class="column-3">up to 3x</td>
</tr>
<tr class="row-18">
	<td class="column-1">UART</td><td class="column-2">up to 6x UART</td><td class="column-3">up to 4x (<a href="https://wiki.radxa.com/Rock5/hardware/5b/gpio" rel="noopener" target="_blank">5x listed on GPIO pinout</a>, uart1 on pinout doesn&#8217;t have an overlay file.  There are 2 additional overlay files that don&#8217;t match to pins on the GPIO header &#8211; uart 6 and 8)</td>
</tr>
<tr class="row-19">
	<td class="column-1">PWM</td><td class="column-2">up to 4x (2 PWM controllers with 2 outputs each)</td><td class="column-3">up to 10x (<a href="https://wiki.radxa.com/Rock5/hardware/5b/gpio" rel="noopener" target="_blank">10x listed on GPIO pinout</a>, 4 additional overlay files that don&#8217;t match to pins on the GPIO header)</td>
</tr>
<tr class="row-20">
	<td class="column-1">ADC (analog to digital)</td><td class="column-2">N/A</td><td class="column-3">1x (could not find an overlay or any documentation for it yet)</td>
</tr>
<tr class="row-21">
	<td class="column-1">CAN Bus</td><td class="column-2">N/A</td><td class="column-3">1x (listed on GPIO pinout but no builtin overlay and driver isn&#8217;t compiled in the default kernel)</td>
</tr>
<tr class="row-22">
	<td class="column-1">General GPIO / Other</td><td class="column-2">up to 28x</td><td class="column-3">up to 26x</td>
</tr>
<tr class="row-23">
	<td class="column-1">Power</td><td class="column-2">5v DC with USB-C plug 3A<br />
5v DC on pins 2&amp;4 3A</td><td class="column-3">USB PD 2.0 12/15/20v with 2amp or higher<br />
9-20v DC power with USB-C plug<br />
5v PoE power on pins 2&amp;4</td>
</tr>
<tr class="row-24">
	<td class="column-1">Kernel Support</td><td class="column-2">6.1 (<a href="https://github.com/raspberrypi/linux" rel="noopener" target="_blank">RPI fork</a>, updates are pushed back to mainline)</td><td class="column-3">5.10 (<a href="https://github.com/radxa/kernel" rel="noopener" target="_blank">Radxa fork</a>, <a href="https://gitlab.collabora.com/hardware-enablement/rockchip-3588/notes-for-rockchip-3588/-/blob/main/mainline-status.md" rel="noopener" target="_blank">RK3588 mainline integration status</a>)</td>
</tr>
<tr class="row-25">
	<td class="column-1">Purchase Links</td><td class="column-2"><a href="https://amzn.to/3PlH0w9" target="_blank" rel="noopener">Amazon (1/2/4GB models)</a><br />
<a href="https://amzn.to/43IQJB4" target="_blank" rel="noopener">Amazon (8GB model)<a/></td><td class="column-3"><a href="https://amzn.to/46a49Yy" target="_blank" rel="noopener">Amazon (8GB model)</a><br />
<a href="https://www.okdo.com/us/p/okdo-rock-5-model-b-8gb-single-board-computer-rockchip-rk3588-arm-cortex-a76-cortex-a55/?utm_source=google&amp;utm_medium=surfaces&amp;utm_campaign=usafeed_shopping&amp;utm_content=surfaces_across_google&amp;gad=1&amp;gclid=CjwKCAjw-b-kBhB-EiwA4fvKrAGH2b9-MV_nTBrrw1tVYKqw1g_XKtoWi8_b5k_L1U5l5jaBvwhmLhoCSM0QAvD_BwE&amp;gclsrc=aw.ds" target="_blank" rel="noopener">OKDO (8GB model)</a></td>
</tr>
</tbody>
</table>



<p>The Raspberry Pi 4B in particular was impressive when it came out in 2019 the power boost over the Pi 3B was massive.&nbsp; I still found though that using the GUI with anything more than bare basics was way to slow for it to operate as a desktop replacement.&nbsp; The Rock 5B by comparison has become my defacto desktop for everything except for some apps that are Windows specific or that just aren’t available on Linux ARM yet.&nbsp; You can read about the software setup I have running <a href="https://www.learningtopi.com/uncategorized/radxa-rock-5b-software/">here</a> (includes Chromium with Chrome sync, XRDP for remote access, SSSD for AD Authentication, Blender and Cura for 3D Printing).</p>



<h2 class="wp-block-heading">Hardware Setup</h2>



<p>In order to keep the document a resonable length, I broke out the hardware configuration for both the Raspberry Pi 4B and Radxa Rock 5B into separate documents.  The Pi 4B setup was straightforward and only required some edits in the /boot/config.txt file.  The Rock 5B on the other hand required a kernel recompile (in order to add the IR drivers) and new overlay files.  I documented the process for both:</p>



<p><a href="https://www.learningtopi.com/sbc/raspberry-pi/raspberry-pi-4b-sbc_gpio/" target="_blank" rel="noreferrer noopener">Raspberry Pi 4B sbc_gpio hardware setup</a></p>



<p><a href="https://www.learningtopi.com/sbc/radxa-rock-5b-setup-for-sbc_gpio/" target="_blank" rel="noreferrer noopener">Radxa Rock 5B sbc_gpio hardware setup</a></p>



<h2 class="wp-block-heading">Results</h2>



<p>I figured I would start with the results, then walk back through the setup and differences.&nbsp; I executed an hour long run of my sbc_gpio test using threading to run all tests simultaneously (FYI I also tested with async and didn’t see any appreciable differences).&nbsp;</p>



<table id="tablepress-7" class="tablepress tablepress-id-7">
<thead>
<tr class="row-1">
	<td class="column-1"></td><th class="column-2">Pi 4B (RPi.GPIO)</th><th class="column-3">Pi 4B (gpiod)</th><th class="column-4">Rock 5B (gpiod)</th>
</tr>
</thead>
<tbody class="row-striping row-hover">
<tr class="row-2">
	<td class="column-1">LED</td><td class="column-2">OK</td><td class="column-3">OK</td><td class="column-4">OK</td>
</tr>
<tr class="row-3">
	<td class="column-1">Button</td><td class="column-2">OK</td><td class="column-3">OK</td><td class="column-4">OK</td>
</tr>
<tr class="row-4">
	<td class="column-1">I2C Display</td><td class="column-2">3188 / 3188 &#8211; 100%</td><td class="column-3">3163 / 3163 – 100%</td><td class="column-4">3218 / 3218 – 100%</td>
</tr>
<tr class="row-5">
	<td class="column-1">BMP/BME280 SPI</td><td class="column-2">3253 / 3253 &#8211; 100%</td><td class="column-3">3255 / 3255 – 100%</td><td class="column-4">3247 / 3247 – 100%</td>
</tr>
<tr class="row-6">
	<td class="column-1">DHT11/22 (over SPI)</td><td class="column-2">1676 / 1701 &#8211; 99%</td><td class="column-3">1662 / 1698 – 98%</td><td class="column-4">1605 / 1685 – 95%</td>
</tr>
<tr class="row-7">
	<td class="column-1">IR Tx/Rx</td><td class="column-2">1609 / 2545 &#8211; 63%</td><td class="column-3">1376 / 2544 – 54%</td><td class="column-4">2540 / 2540 – 100%</td>
</tr>
<tr class="row-8">
	<td class="column-1">UART <-> CP2102</td><td class="column-2">13155 / 14266 &#8211; 92%</td><td class="column-3">12663 / 13992 – 91%</td><td class="column-4">15148 / 15150 – 99.99%</td>
</tr>
</tbody>
</table>
<!-- #tablepress-7 from cache -->


<p>The results here were a bit startling. I expected the Pi4B to take everything I threw at it and not miss a beat. The DHT11 over SPI (which you can read more about <a href="https://www.learningtopi.com/sbc/python_dht11_spi/">here</a>) I expected some failures. My SPI library is still <strong>vastly </strong>better than the old bit banging DHT11 library, but it isn&#8217;t perfect. </p>



<p>The infrared failures surprised me. I ran multiple tests and had varying results, but in general rarely saw much higher than the 54% above.  Not sure what is causing IR to perform so poorly.  I am using the same IR LED and IR receiver as I did on the Rock 5B, and both use the <code>gpio-ir-tx</code> and <code>gpio-ir-recv </code>kernel drivers.  I&#8217;ll need to do some further tests to determine if it is a send or receive problem.</p>



<p>I was also shocked at the UART results. I didn’t expect as many failures as I saw.  While it was only about 9%, this was a lot higher than I expected for basic serial communication.  For my test the UART connects directly to a CP2102 USB to serial adapter that connects back to the SBC.&nbsp; I iterate through a range of baud rates (9600, 115200, 230400, 460800, 576000 and 921600) and data sizes (64, 128, 256, 512, 1024 and 2048) and track the results.&nbsp; I also track the send from the UART port (and received on USB) separately from the reverse.  Here is a breakdown of the UART results on the Pi 4B.</p>



<h3 class="wp-block-heading">Pi4B UART Breakdown &#8211; Transmission Size</h3>



<table id="tablepress-8" class="tablepress tablepress-id-8">
<thead>
<tr class="row-1">
	<th class="column-1">Size (bytes)</th><th class="column-2">UART -> USB CP2102</th><th class="column-3">USB CP2102 -> UART</th>
</tr>
</thead>
<tbody class="row-striping row-hover">
<tr class="row-2">
	<td class="column-1">64</td><td class="column-2">1166 / 1166 – 100%</td><td class="column-3">1123 / 1166 – 96.3%</td>
</tr>
<tr class="row-3">
	<td class="column-1">128</td><td class="column-2">1166 / 1166 – 100%</td><td class="column-3">903 / 1166 – 77.4%</td>
</tr>
<tr class="row-4">
	<td class="column-1">256</td><td class="column-2">1081 / 1166 – 92.7%</td><td class="column-3">1055 / 1166 – 90.5%</td>
</tr>
<tr class="row-5">
	<td class="column-1">512</td><td class="column-2">1081 / 1166 – 92.7%</td><td class="column-3">988 / 1166 – 84.7%</td>
</tr>
<tr class="row-6">
	<td class="column-1">1024</td><td class="column-2">1166 / 1166 – 100%</td><td class="column-3">953 / 1166 – 81.7%</td>
</tr>
<tr class="row-7">
	<td class="column-1">2048</td><td class="column-2">1166 / 1166 – 100%</td><td class="column-3">815 / 1166 – 69.9%</td>
</tr>
</tbody>
<tfoot>
<tr class="row-8">
	<th class="column-1">TOTAL</th><th class="column-2">6826 / 6996 – 97.6%</th><th class="column-3">5837 / 6996 – 83.4%</th>
</tr>
</tfoot>
</table>
<!-- #tablepress-8 from cache -->


<p>Looking at the breakdown we see that there is a BIG difference depending on which side is sending vs receiving.&nbsp; I haven’t been able to determine if the issue is on the USB sending side, or the UART receiving side yet, but there is a very definitive issue and from the spread across data sizes it doesn’t appear to be directly related to the size (although we do see a drop in success rates as we move from 256 to 2048 bytes).</p>



<table id="tablepress-9" class="tablepress tablepress-id-9">
<thead>
<tr class="row-1">
	<th class="column-1">Baudrate</th><th class="column-2">UART -> USB</th><th class="column-3">USB -> UART</th>
</tr>
</thead>
<tbody class="row-striping row-hover">
<tr class="row-2">
	<td class="column-1">9600</td><td class="column-2">1000 / 1170 – 85.5%</td><td class="column-3">635 / 1170 – 54.3%</td>
</tr>
<tr class="row-3">
	<td class="column-1">115200</td><td class="column-2">1170 / 1170 – 100%</td><td class="column-3">910 / 1170 – 77.8%</td>
</tr>
<tr class="row-4">
	<td class="column-1">230400</td><td class="column-2">1164 / 1164 – 100%</td><td class="column-3">1033 / 1164 – 88.7%</td>
</tr>
<tr class="row-5">
	<td class="column-1">460800</td><td class="column-2">1164 / 1164 – 100%</td><td class="column-3">1043 / 1164 – 89.6%</td>
</tr>
<tr class="row-6">
	<td class="column-1">576000</td><td class="column-2">1164 / 1164 – 100%</td><td class="column-3">1132 / 1164 – 97.3%</td>
</tr>
<tr class="row-7">
	<td class="column-1">921600</td><td class="column-2">1164 / 1164 – 100%</td><td class="column-3">1084 / 1164 – 93.1%</td>
</tr>
</tbody>
<tfoot>
<tr class="row-8">
	<th class="column-1">TOTAL</th><th class="column-2">6826 / 6996 – 97.6%</th><th class="column-3">5837 / 6996 – 83.4%</th>
</tr>
</tfoot>
</table>
<!-- #tablepress-9 from cache -->


<p>When we look at the data grouped by baud, we see some interesting results.&nbsp; ALL the drops from UART to USB happened at 9600 which seems counterintuitive.&nbsp; This leads me to believe there may be a buffering issue.&nbsp; The lower data rate requires the UART driver / hardware to hold data for a longer period of time while the bits are transmitted.&nbsp; We see a similar pattern from USB to UART.&nbsp; As the data rate moves up from 9600 to 57600 we see the success rate IMPROVE.&nbsp; At 921600 we see a slight drop off.&nbsp; This again makes me think buffering issues. &nbsp;Lower data rates that take longer to finish a transmission have a higher failure rate.</p>



<p>Looking at all this makes me lean toward an issue on the UART side sending at low data rates as well as receiving at low data rates.&nbsp; I used the same CP2102 on the Rock 5B and saw no issues so I wouldn’t expect that this is the issue.&nbsp; I’ll keep digging for more details and post and update if I find anything, but for now I’m going to say this is most likely due to a difference between how the Broadcom BCM2711 and Rockchip RK35688 handle the UART.</p>



<h2 class="wp-block-heading">Setting up the SBC&#8217;s</h2>



<p>Due to the length it takes to run through the setup, I&#8217;ll break these out into separate posts for each board.  </p>



<p>As a summary though, configuring the Pi 4B was a breeze.  The <code>raspi-config</code> tool can be used to configure the I2C, 1st SPI and UART.  For the 2nd SPI, IR Tx and IR Rx, the configuration needs to be done in the <code>/boot/config.txt </code>file directly.  After adding the relevant overlay config all that is required is to save and reboot.  The Raspberry Pi even provides a mechanism for dynamically applying overlays without rebooting!  (I haven&#8217;t tested this, but documentation is available <a href="https://www.raspberrypi.com/documentation/computers/configuration.html#part3.5" target="_blank" rel="noreferrer noopener">here</a>)</p>



<p>The Rock 5B is considerably more difficult.  There is no equivalent to the <code>raspi-config </code>tool, so edits need to be made to the <code>/boot/config.txt </code>file directly.  Adding the I2C, both SPI and UART overlays is straightfoward, however there is a problem with the IR.  The stock kernel from Radxa didn&#8217;t include the necessary kernel drivers, so we had to recompile the kernel to include them.  I addition there are no overlay files for IR so those need to be created as well.  I walk through the process in my setup guide for the Rock 5B, however this is a far more complicated process than the Pi 4B.</p>



<h2 class="wp-block-heading">Conclusion</h2>



<p>Setting up the Rock 5B can be a bit of a headache if you need an overlay that isn&#8217;t included by default, and the Rock 5B doesn&#8217;t have an overlay available for IR, CAN or ADC.  If you plan to use anything beyond I2C, SPI, UART or general GPIO expect the Rock 5B to be more complex to setup and use.  That being said the results speak for themselves.  If the Pi 4B is the gold standard, the Rock 5B has the potential to take the crown!  All we need is some improvements in compiled drivers and overlays to call the Rock 5B the new gold standard!</p>



<blockquote class="wp-block-quote is-layout-flow wp-block-quote-is-layout-flow">
<p>NOTE:  I&#8217;ve seen many articules reviewing the Rock 5B call out the lack of builtin wireless as the reason the Rock 5B isn&#8217;t ready to take over the crown.  Personally I disagree with that assessment.  Radxa provides a PCIe M-key slot that can be used with multiple different wireless cards (see supported lists <a href="https://wiki.radxa.com/Rock5/hardware/wifi" target="_blank" rel="noreferrer noopener">here</a>).  Adding a wifi card does add a bit to the price but allows for more options and an upgrade path down the road.</p>
</blockquote>
<p>The post <a href="https://www.learningtopi.com/sbc/sbc_gpio-pi-4b-vs-rock-5b/">sbc_gpio: Pi 4B vs Rock 5B</a> appeared first on <a href="https://www.learningtopi.com">Learning to Pi</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://www.learningtopi.com/sbc/sbc_gpio-pi-4b-vs-rock-5b/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>Radxa Rock 5B Setup for sbc_gpio</title>
		<link>https://www.learningtopi.com/sbc/radxa-rock-5b-setup-for-sbc_gpio/</link>
					<comments>https://www.learningtopi.com/sbc/radxa-rock-5b-setup-for-sbc_gpio/#respond</comments>
		
		<dc:creator><![CDATA[tdunteman]]></dc:creator>
		<pubDate>Tue, 20 Jun 2023 05:36:02 +0000</pubDate>
				<category><![CDATA[Rock5B]]></category>
		<category><![CDATA[SBC]]></category>
		<category><![CDATA[kernel compile]]></category>
		<category><![CDATA[overlays]]></category>
		<category><![CDATA[python sbc_gpio]]></category>
		<guid isPermaLink="false">https://www.learningtopi.com/?p=1052</guid>

					<description><![CDATA[<p>If you are looking for the results of the&#160;sbc_gpio&#160;tests, please check out our sbc_gpio Pi 4B vs Rock 5B comparison. Configuring the Radxa Rock 5B for our&#160;sbc_gpio&#160;test require 1x I2C, 2x SPI, 1x UART and 2x IR (1 Tx and 1 Rx). All the configuration will need to be done directly in the /boot/config.txt file....</p>
<p>The post <a href="https://www.learningtopi.com/sbc/radxa-rock-5b-setup-for-sbc_gpio/">Radxa Rock 5B Setup for sbc_gpio</a> appeared first on <a href="https://www.learningtopi.com">Learning to Pi</a>.</p>
]]></description>
										<content:encoded><![CDATA[
<div class="wp-block-columns is-layout-flex wp-container-core-columns-is-layout-9d6595d7 wp-block-columns-is-layout-flex">
<div class="wp-block-column is-layout-flow wp-block-column-is-layout-flow"><div class="wp-block-image">
<figure class="aligncenter size-full is-resized"><img loading="lazy" decoding="async" src="https://www.learningtopi.com/wp-content/uploads/500px-Rock5b-v142-angel.jpg" alt="" class="wp-image-468" width="353" height="296" srcset="https://www.learningtopi.com/wp-content/uploads/500px-Rock5b-v142-angel.jpg 500w, https://www.learningtopi.com/wp-content/uploads/500px-Rock5b-v142-angel-300x252.jpg 300w, https://www.learningtopi.com/wp-content/uploads/500px-Rock5b-v142-angel-150x126.jpg 150w" sizes="auto, (max-width: 353px) 100vw, 353px" /></figure>
</div></div>



<div class="wp-block-column is-layout-flow wp-block-column-is-layout-flow">
<figure class="wp-block-image size-full"><img loading="lazy" decoding="async" width="300" height="280" src="https://www.learningtopi.com/wp-content/uploads/300px-Start_5b.png" alt="" class="wp-image-467" srcset="https://www.learningtopi.com/wp-content/uploads/300px-Start_5b.png 300w, https://www.learningtopi.com/wp-content/uploads/300px-Start_5b-150x140.png 150w" sizes="auto, (max-width: 300px) 100vw, 300px" /></figure>
</div>
</div>



<p>If you are looking for the results of the&nbsp;<code>sbc_gpio&nbsp;</code>tests, please check out our <a href="https://www.learningtopi.com/sbc/sbc_gpio-pi-4b-vs-rock-5b/">sbc_gpio Pi 4B vs Rock 5B</a> comparison.</p>



<p>Configuring the Radxa Rock 5B for our&nbsp;<code>sbc_gpio&nbsp;</code>test require 1x I2C, 2x SPI, 1x UART and 2x IR (1 Tx and 1 Rx). All the configuration will need to be done directly in the <code>/boot/config.txt</code> file.  Radxa does not have a tool similar to<code> raspi-config</code> on the Raspberry Pi.</p>



<blockquote class="wp-block-quote is-layout-flow wp-block-quote-is-layout-flow">
<p>For reference the IR receiver we are using is a TSOP38238&nbsp;receiver diode.  You can find them here:  <a href="https://amzn.to/3PjZm0x" target="_blank" rel="noreferrer noopener">https://amzn.to/3PjZm0x</a>.  We are also using IR LED&#8217;s that you can find here: <a href="https://amzn.to/3XdDlCw" target="_blank" rel="noreferrer noopener">https://amzn.to/3XdDlCw</a></p>
<cite>We are an Amazon affiliate and may receive some compensation from any products purchased.  Affiliations and ads are how we can provide the content that we do!</cite></blockquote>



<blockquote class="wp-block-quote is-layout-flow wp-block-quote-is-layout-flow">
<p>NOTE:  After any changes to the <code>/boot/config.txt </code>file, you MUST run <code>"sudo update_extlinux.sh"</code> to update the<code> /boot/extlinux/extlinux.conf</code> file.  If you don&#8217;t run the <code>update_extlinux.sh</code> script the changes to the <code>/boot/config.txt</code> file won&#8217;t ever be applied.</p>
</blockquote>



<h2 class="wp-block-heading">I2C, SPI and UART Overlays</h2>



<p>The I2C, SPI and UART overlays are easily configured using the /boot/config.txt file.  The following lines will add overlays for I2C7, SPI0, SPI1 and UART2:</p>



<pre class="wp-block-code"><code>dtoverlay=rk3588-i2c7-m3
dtoverlay=rk3588-spi0-m2-cs0-spidev
dtoverlay=rk3588-spi1-m1-cs0-spidev
dtoverlay=rk3588-urat2-m0</code></pre>



<blockquote class="wp-block-quote is-layout-flow wp-block-quote-is-layout-flow">
<p>NOTE:  After any changes to the <code>/boot/config.txt </code>file, you MUST run <code>"sudo update_extlinux.sh"</code> to update the<code> /boot/extlinux/extlinux.conf</code> file.  If you don&#8217;t run the <code>update_extlinux.sh</code> script the changes to the <code>/boot/config.txt</code> file won&#8217;t ever be applied.</p>
</blockquote>



<p>This gets everything except the infrared quickly and easily.  Of course IR is where we run into an issue&#8230;</p>



<h2 class="wp-block-heading">Infrared Transmit and Receive</h2>



<p>There are two issues with setting up IR on the Rock 5B:</p>



<ol class="wp-block-list">
<li>The stock Radxa kernel (5.10.110) does not have any IR Tx or Rx modules compiled in it</li>



<li>There is no overlay for IR Tx or Rx compiled and available</li>
</ol>



<p>Before we can run an infrared tests, we will need to fix both of these issues.</p>



<h3 class="wp-block-heading">Compile the kernel with IR modules</h3>



<p>First step is we need to recompile the kernel.  Radxa has decent instructions available on their website:  <a href="https://wiki.radxa.com/Rock5/guide/build-kernel-on-5b" target="_blank" rel="noreferrer noopener">https://wiki.radxa.com/Rock5/guide/build-kernel-on-5b</a></p>



<blockquote class="wp-block-quote is-layout-flow wp-block-quote-is-layout-flow">
<p>I put in a merge request to the Radxa kernel to enable IR modules in future kernel builds (<a href="https://github.com/radxa/kernel/pull/128" target="_blank" rel="noreferrer noopener">https://github.com/radxa/kernel/pull/128</a>).  Before you recompile the kernel, check to see if the module is included for the Tx and Rx bit-banging driver.  Run the following commands:</p>



<p>sudo modinfo gpio-ir-tx</p>



<p>sudo modinfo gpio-ir-recv</p>
</blockquote>



<p>The Radxa kernel build instructions from the guide above assumes that you are compiling on the Rock 5B itself.  It you are intending to compile on a different system, there are more steps that need to be performed to setup cross platform compilation.</p>



<p>Here is a summary of the steps (from the <a href="https://wiki.radxa.com/Rock5/guide/build-kernel-on-5b" target="_blank" rel="noreferrer noopener">Radxa guide</a>):</p>



<h4 class="wp-block-heading">Install Prerequisites</h4>



<pre class="wp-block-code"><code>sudo apt-get update
 &amp;&amp; sudo apt-get install -y git  device-tree-compiler libncurses5 libncurses5-dev build-essential libssl-dev mtools bc python dosfstools bison flex rsync u-boot-tools make</code></pre>



<h4 class="wp-block-heading">Clone the Source Code</h4>



<pre class="wp-block-code"><code>mkdir ~/rk3588-sdk &amp;&amp; cd ~/rk3588-sdk
git clone -b linux-5.10-gen-rkr3.4 https://github.com/radxa/kernel.git
git clone -b master https://github.com/radxa/rkbin.git
git clone -b debian https://github.com/radxa/build.git</code></pre>



<p>You can of course clone to a different folder.  The examples from Radxa will assume that all the code is in the <code>~/rk3588-sdk</code> folder.</p>



<h4 class="wp-block-heading">Update the Kernel Config</h4>



<p>The next step is to update the kernel config to include the IR modules.</p>



<pre class="wp-block-preformatted">cd ~/rk3588-sdk/kernel
make rockchip_linux_defconfig
make menuconfig</pre>



<p>This will load the text menu configuration utility for the kernel.  On the main menu scroll down to the &#8220;Device Drivers&#8221; section and hit ENTER to select it (the &#8212;&gt; at the end of the line indicates that there is a submenu).</p>



<figure class="wp-block-image size-full"><img loading="lazy" decoding="async" width="799" height="460" src="https://www.learningtopi.com/wp-content/uploads/kernel-compile-drivers.png" alt="" class="wp-image-1089" srcset="https://www.learningtopi.com/wp-content/uploads/kernel-compile-drivers.png 799w, https://www.learningtopi.com/wp-content/uploads/kernel-compile-drivers-300x173.png 300w, https://www.learningtopi.com/wp-content/uploads/kernel-compile-drivers-150x86.png 150w, https://www.learningtopi.com/wp-content/uploads/kernel-compile-drivers-768x442.png 768w" sizes="auto, (max-width: 799px) 100vw, 799px" /></figure>



<p>On the Device Drivers page, scroll down until you reach &#8220;Remote Controller support&#8221;.  The left column should show a &#8220;[ ]&#8221; which signifies that it is not currently included in the kernel.  Hit &#8220;M&#8221; or SPACE until it changes to a &#8220;&lt;M&gt;&#8221;.  Then hit ENTER to enter the &#8220;Remote Controller Support&#8221; sub-menu.</p>



<figure class="wp-block-image size-full"><img loading="lazy" decoding="async" width="796" height="509" src="https://www.learningtopi.com/wp-content/uploads/kernel-compile-rc-support.png" alt="" class="wp-image-1092" srcset="https://www.learningtopi.com/wp-content/uploads/kernel-compile-rc-support.png 796w, https://www.learningtopi.com/wp-content/uploads/kernel-compile-rc-support-300x192.png 300w, https://www.learningtopi.com/wp-content/uploads/kernel-compile-rc-support-150x96.png 150w, https://www.learningtopi.com/wp-content/uploads/kernel-compile-rc-support-768x491.png 768w" sizes="auto, (max-width: 796px) 100vw, 796px" /></figure>



<p>Here we need to enable the &#8220;LIRC user interface&#8221; by hitting the SPACEBAR.  After this is set to &#8220;[*]&#8221;, move down to the &#8220;Remote Controller Decoders&#8221; and hit SPACE again.  When the 1st column changes to &#8220;[*]&#8221;  the submenu for the decoders will be activated.  Just select them all by using the SPACE or &#8220;M&#8221; key.  Use the right arrow key to select &#8220;EXIT&#8221; from the list of options at the bottom to go back up a menu.</p>



<figure class="wp-block-image size-full"><img loading="lazy" decoding="async" width="800" height="456" src="https://www.learningtopi.com/wp-content/uploads/kernel-compile-rc-sub.png" alt="" class="wp-image-1091" srcset="https://www.learningtopi.com/wp-content/uploads/kernel-compile-rc-sub.png 800w, https://www.learningtopi.com/wp-content/uploads/kernel-compile-rc-sub-300x171.png 300w, https://www.learningtopi.com/wp-content/uploads/kernel-compile-rc-sub-150x86.png 150w, https://www.learningtopi.com/wp-content/uploads/kernel-compile-rc-sub-768x438.png 768w" sizes="auto, (max-width: 800px) 100vw, 800px" /></figure>



<p>Select &#8220;Remote Controller Devices&#8221; and hit SPACE.  Once the 1st column changes to &#8220;[*]&#8221; hit enter to enter the menu.  From here select at a minimum the &#8220;GPIO IR remote control&#8221; and &#8220;GPIO IR Bit Banging Transmitter&#8221;.  I additionally added the &#8220;SPI connected IR LED&#8221; and &#8220;PWM IR transmitter&#8221; for future use.</p>



<figure class="wp-block-image size-full"><img loading="lazy" decoding="async" width="797" height="455" src="https://www.learningtopi.com/wp-content/uploads/kernel-compile-rc-drivers.png" alt="" class="wp-image-1090" srcset="https://www.learningtopi.com/wp-content/uploads/kernel-compile-rc-drivers.png 797w, https://www.learningtopi.com/wp-content/uploads/kernel-compile-rc-drivers-300x171.png 300w, https://www.learningtopi.com/wp-content/uploads/kernel-compile-rc-drivers-150x86.png 150w, https://www.learningtopi.com/wp-content/uploads/kernel-compile-rc-drivers-768x438.png 768w" sizes="auto, (max-width: 797px) 100vw, 797px" /></figure>



<p>Once the updates have been made, use the right arrow to move over to &#8220;Save&#8221; on the bottom list, and save the config as &#8220;.config&#8221; (this is the default config file).</p>



<figure class="wp-block-image size-full"><img loading="lazy" decoding="async" width="799" height="453" src="https://www.learningtopi.com/wp-content/uploads/kernel-compile-save.png" alt="" class="wp-image-1093" srcset="https://www.learningtopi.com/wp-content/uploads/kernel-compile-save.png 799w, https://www.learningtopi.com/wp-content/uploads/kernel-compile-save-300x170.png 300w, https://www.learningtopi.com/wp-content/uploads/kernel-compile-save-150x85.png 150w, https://www.learningtopi.com/wp-content/uploads/kernel-compile-save-768x435.png 768w" sizes="auto, (max-width: 799px) 100vw, 799px" /></figure>



<h4 class="wp-block-heading">Compile the Kernel and Install It</h4>



<p>After you save, exit out of all the menus until you are back at the command line.  Next run the following commands to prep the new configuration for the kernel build.</p>



<pre class="wp-block-code"><code>make savedefconfig
cp defconfig arch/arm64/configs/rockchip_linux_defconfig</code></pre>



<p>Next (but not last), we need to build the kernel.  This will take some time to complete:</p>



<pre class="wp-block-code"><code>cd ~/rk3588-sdk
./build/mk-kernel.sh rk3588-rock-5b</code></pre>



<p>After you finish the kernel build, verify that the files are present:</p>



<pre class="wp-block-preformatted">$ ls out/kernel/
Image  rk3588-rock-5b.dtb</pre>



<p>The last step is to convert your new kernel image into a &#8220;deb&#8221; package that you can install in Debian, Ubuntu, or any other Debian based system that you are running.  You will need to add a release number that will be appended to the kernel.  This will append a value after 5.10.110-&#8221; in the filename.  For differentiation, the lastest build I have from Radxa&#8217;s APT repo is 37.  I typically start at 1000 to make it easy to identify.</p>



<pre class="wp-block-preformatted">./build/pack-kernel.sh -d rockchip_linux_defconfig -r 1000</pre>



<p>Once the pack-kernel script is complete, you will now have a series of packages ready to be installed:</p>



<pre class="wp-block-preformatted">$ ls out/packages/
linux-5.10.110-99-rockchip-g9fd61a9a9912_5.10.110-1000-rockchip_arm64.changes
linux-headers-5.10.110-99-rockchip-g9fd61a9a9912_5.10.110-1000-rockchip_arm64.deb
linux-image-5.10.110-99-rockchip-g9fd61a9a9912-dbg_5.10.110-1000-rockchip_arm64.deb
linux-image-5.10.110-99-rockchip-g9fd61a9a9912_5.10.110-1000-rockchip_arm64.deb
linux-libc-dev_5.10.110-1000-rockchip_arm64.deb</pre>



<p>You will need to install the &#8220;image&#8221; and &#8220;headers&#8221; package.  There are two packages named &#8220;linux-image&#8221;, you will only need the one that DOES NOT include the &#8220;-dbg&#8221; text.  This copy of the kernel includes debugging components that I&#8217;m sure you won&#8217;t require if you are reading this post!  Just install the images using &#8220;dpkg&#8221;:</p>



<pre class="wp-block-code"><code>sudo dpkg -i out/packages/linux-image-5.10.110-99-rockchip-g9fd61a9a9912_5.10.110-1000-rockchip_arm64.deb
sudo dpkg -i out/packages/linux-headers-5.10.110-99-rockchip-g9fd61a9a9912_5.10.110-1000-rockchip_arm64.deb</code></pre>



<h4 class="wp-block-heading">Check Your Kernel</h4>



<p>If you check the <code>/boot/extlinux/extlinux.conf</code> file, you should see your new kernel build listed as the first image.  Reboot and verify with <code>uname -a</code>!  If you see your specific kernel build number then you are done and ready to move on to overlays!</p>



<h3 class="wp-block-heading">Create the Overlays</h3>



<p>First off, what is an overlay?  For reference we are in fact refering to a Device Tree Overlay.  A device tree overlay can performs two functions for us: </p>



<p>1st &#8211; The overlay is read during the boot process and is used to enable parts of the hardware that are not enabled by default.  An example here is enabling the UART, SPI or I2C devices that we did previously.  These use the same pins as regular GPIO&#8217;s and the hardware has to be told to enable the UART functions in the hardware chip.</p>



<p>2nd &#8211; The overlay associates a kernel driver with a hardware device.  For the case of infrared, we need to tell the kernel what GPIO pin we want, how to configure that pin (i.e. pull up or down) and associate it with a driver.</p>



<h4 class="wp-block-heading">Overlay Caveats to keep in mind</h4>



<p>In order to run our IR tests, we will need to create 2 overlays, one for the transmit LED, and one for the receiver, but first a few notes:</p>



<ul class="wp-block-list">
<li>The overlay is in a DTS file, but all DTS files must be compiled to DTB or DTBO files for use during the boot process.  (Think of this like a C file that needs to be compiled to a binary.)</li>



<li>The compiled DTBO file needs to be accessible VERY early in the boot process, so they must all be located in the <code>/boot</code> dir.</li>



<li>There are different mechanisms used by different vendors to load DTBO overlay files.  The Rock 5B uses uboot and extlinux to apply device tree overlays and start the Linux kernel.  With Raspberry Pi OS, the config.txt file is loaded and parsed to get overlay parameters (i.e. which GPIO to use).  Uboot does not allow this, so this means we need to create a compiled DTBO file with the exact parameters (including GPIO pin).</li>



<li>Radxa&#8217;s <code>update_extlinush.sh</code> file (remember you have to run this after <code>/boot/config.tx</code>t changes) wipes and reloads the DTBO overlay files in the <code>/boot/dtbs directory</code>.</li>
</ul>



<h4 class="wp-block-heading">IR Rx Overlay</h4>



<p>The IR Rx overlay will need to use the <code>gpio-ir-</code>recv driver we compiled into the kernel previously.  We will also need to assign the GPIO pin we want to use.  For our example we will be using pin 3A3 (gpio chip 3, pin 11).  The TSOP38238&nbsp;IR sensor is active low (as opposed to high), so we also need to let the kernel know this.</p>



<p>Here is the DTS file contents.  We will need to save this file somewhere (doesn&#8217;t need to be on the boot partition) so we can compile it into a DTBO.  For reference, we will use the name <code>rk3588-ir-rx.dts</code> for consistency with the other rk3588 overlays.</p>



<pre class="wp-block-code"><code>// Definitions for ir-gpio-recv module
/dts-v1/;
/plugin/;

#include "dt-bindings/gpio/gpio.h"

/ {

        fragment@0 {
                target-path = "/";
                __overlay__ {
                        gpio_ir_recv: gpio_ir_recv {
                                compatible = "gpio-ir-receiver";
                                status = "okay";
                                gpios = &lt;&amp;gpio3 11 GPIO_ACTIVE_LOW&gt;;
                                pinctrl-names = "default";
                        };
                };
        };
};</code></pre>



<p>Once we have the DTS file defined, we can compile it to a DTBO:</p>



<pre class="wp-block-code"><code>dtc -i dts -O dtb rk3588-ir-rx.dts rk3588-ir-rx.dtbo</code></pre>



<h4 class="wp-block-heading">IR Tx Overlay</h4>



<p>The IR Tx overlay will need to use the <code>gpio-ir-tx</code> driver we compiled into the kernel previously.  We will also need to assign the GPIO pin we want to use.  For our example we will be using pin 3A2 (gpio chip 3, pin 10).</p>



<p>Here is the DTS file contents.  We will need to save this file somewhere (doesn&#8217;t need to be on the boot partition) so we can compile it into a DTBO.  For reference, we will use the name <code>rk3588-ir-tx.dts</code> for consistency with the other rk3588 overlays.</p>



<pre class="wp-block-code"><code>// Definitions for ir-gpio-tx module
/dts-v1/;
/plugin/;

/ {

        fragment@0 {
                target-path = "/";
                __overlay__ {
                        gpio_ir_tx {
                                compatible = "gpio-ir-tx";
                                status = "okay";
                                gpios = &lt;&amp;gpio3 10 0&gt;;
                                pinctrl-names = "default";
                        };
                };
        };
};</code></pre>



<p>Once we have the DTS file defined, we can compile it to a DTBO:</p>



<pre class="wp-block-code"><code>dtc -i dts -O dtb rk3588-ir-tx.dts rk3588-ir-tx.dtbo</code></pre>



<h4 class="wp-block-heading">Applying your Overlay at Boot</h4>



<p>Now that we have our DTBO files, we need to configure the system to load them on boot.  The <code>update_extlinux.sh</code> script clears all files in the <code>/boot/dtbs</code> folder and reloads from <code>/usr/lib/linux-image-***</code> so we can&#8217;t put the files here.  We will create a new folder for our DTBO files.</p>



<pre class="wp-block-code"><code>sudo mkdir /boot/custom_dtbs
sudo cp rk3588-ir-tx.dtbo /boot/custom_dtbs
sudo cp rk3588-ir-rx.dtbo /boot/custom_dtbs</code></pre>



<p>This will put our DTBO files where the kernel can get them during the initialization process.  The last step is adding theoverlays into the<code> /boot/extlinux/extlinux.conf</code> file.  Here we need to add our overlays to the <code>fdtoverlays </code>line under the kernel.  If the line already exists (like shown here with the uart7 overlay), just add a space and the new overlay.  If there is no <code>fdtoverlay </code>line, add one after the <code>devicetreedir </code>and before the <code>append </code>lines.</p>



<blockquote class="wp-block-quote is-layout-flow wp-block-quote-is-layout-flow">
<p>NOTE:  There will likely be multiple kernels listed.  The system will boot the first so technically you only need to add to the <code>fdtoverlay </code>on the first kernel.  For consistency with the<code> update_extlinux.sh</code> script though I add mine to all the kernels.</p>



<p>The path in the extlinux.conf file may appear odd.  At this point only the boot partition is loaded, and it is loaded as the root partition.  So make sure your path is &#8220;/custom_dtbs/&#8230;&#8221; and not &#8220;/boot/custom_dtbs/&#8230;&#8221;.</p>
</blockquote>



<pre class="wp-block-code"><code>label kernel-5.10.110-2002-rockchip-g76d0450ea961
    kernel /vmlinuz-5.10.110-2002-rockchip-g76d0450ea961
    initrd /initrd.img-5.10.110-2002-rockchip-g76d0450ea961
    devicetreedir /dtbs/5.10.110-2002-rockchip-g76d0450ea961
    fdtoverlays  /dtbs/5.10.110-2002-rockchip-g76d0450ea961/rockchip/overlay/rk3588-uart7-m2.dtbo <mark>/custom_dtbs/rk3588-ir-tx.dtbo /custom_dtbs/rk3588-ir-rx.dtbo</mark>
    append   root=UUID=e29639d9-0c16-4501-8e64-50995cc715e5 earlycon=uart8250,mmio32,0xfeb50000 console=ttyFIQ0 console=tty1 consoleblank=0 loglevel=0 panic=10 rootwait rw init=/sbin/init rootfstype=ext4 cgroup_enable=cpuset cgroup_memory=1 cgroup_enable=memory swapaccount=1 irqchip.gicv3_pseudo_nmi=0 switolb=1 coherent_pool=2M</code></pre>



<p>That it!  Just reboot to load the overlays.  You can confirm they are loaded by running dmesg | less and searching for &#8220;gpio-ir-&#8221; or &#8220;lirc&#8221;.  (LIRC setup will be reflected in the sbc_gpio test since it is common setup for all systems.)</p>



<blockquote class="wp-block-quote is-layout-flow wp-block-quote-is-layout-flow">
<p>CAUTION!!  We manually edited the /boot/extlinux/extlinux.conf file.  The next time you run the udpate_extlinux.sh script your changes will be lost!  This ALSO includes any kernel update that may be installed as this script is a triggered action.</p>



<p>I am working on some alternative methodsd that can help with this, but it isn&#8217;t ready for prime time yet.</p>
</blockquote>



<h2 class="wp-block-heading">Summary</h2>



<p>What we saw here is that setting up the Rock 5B is easy as long as you are using one of the predefined overlays.  Moving off the defined list of overlays into infrared we had to not only create our own overlay but also recompile the kernel to include the drivers we needed.  I fully expect to run into similar issues with drivers based on how the kernel is configured.  It appears that the decision was to minimize size rather than include the maximum number of modules.</p>



<p>If you came here from our <a href="https://www.learningtopi.com/sbc/sbc_gpio-pi-4b-vs-rock-5b/">sbc_gpio test result page</a>, feel free to jump back over to the results! </p>
<p>The post <a href="https://www.learningtopi.com/sbc/radxa-rock-5b-setup-for-sbc_gpio/">Radxa Rock 5B Setup for sbc_gpio</a> appeared first on <a href="https://www.learningtopi.com">Learning to Pi</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://www.learningtopi.com/sbc/radxa-rock-5b-setup-for-sbc_gpio/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>Raspberry Pi 4B Setup for sbc_gpio</title>
		<link>https://www.learningtopi.com/sbc/raspberry-pi/raspberry-pi-4b-sbc_gpio/</link>
					<comments>https://www.learningtopi.com/sbc/raspberry-pi/raspberry-pi-4b-sbc_gpio/#respond</comments>
		
		<dc:creator><![CDATA[tdunteman]]></dc:creator>
		<pubDate>Thu, 15 Jun 2023 06:22:10 +0000</pubDate>
				<category><![CDATA[Raspberry Pi SBC]]></category>
		<category><![CDATA[SBC]]></category>
		<category><![CDATA[overlays]]></category>
		<category><![CDATA[Pi4B]]></category>
		<category><![CDATA[python sbc_gpio]]></category>
		<guid isPermaLink="false">https://www.learningtopi.com/?p=1031</guid>

					<description><![CDATA[<p>If you are looking for the results of the sbc_gpio tests, please check out our sbc_gpio Pi 4B vs Rock 5B comparison. Configuring the sbc_gpio for the Raspberry Pi 4B test requires 1x I2C, 2x SPI, 1x UART and 2x IR (1 Tx and 1 Rx). All the configuration can be done directly in the...</p>
<p>The post <a href="https://www.learningtopi.com/sbc/raspberry-pi/raspberry-pi-4b-sbc_gpio/">Raspberry Pi 4B Setup for sbc_gpio</a> appeared first on <a href="https://www.learningtopi.com">Learning to Pi</a>.</p>
]]></description>
										<content:encoded><![CDATA[<div class="wp-block-image">
<figure class="aligncenter size-large is-resized"><img loading="lazy" decoding="async" src="https://www.learningtopi.com/wp-content/uploads/2022/04/Raspberry_Pi_4_Model_B_-_Side-streched-scaled-1024x385.jpg" alt="" class="wp-image-80" width="635" height="238" srcset="https://www.learningtopi.com/wp-content/uploads/2022/04/Raspberry_Pi_4_Model_B_-_Side-streched-scaled-1024x385.jpg 1024w, https://www.learningtopi.com/wp-content/uploads/2022/04/Raspberry_Pi_4_Model_B_-_Side-streched-scaled-300x113.jpg 300w, https://www.learningtopi.com/wp-content/uploads/2022/04/Raspberry_Pi_4_Model_B_-_Side-streched-scaled-150x56.jpg 150w, https://www.learningtopi.com/wp-content/uploads/2022/04/Raspberry_Pi_4_Model_B_-_Side-streched-scaled-768x289.jpg 768w, https://www.learningtopi.com/wp-content/uploads/2022/04/Raspberry_Pi_4_Model_B_-_Side-streched-scaled-1536x578.jpg 1536w, https://www.learningtopi.com/wp-content/uploads/2022/04/Raspberry_Pi_4_Model_B_-_Side-streched-scaled-2048x770.jpg 2048w" sizes="auto, (max-width: 635px) 100vw, 635px" /></figure>
</div>


<p>If you are looking for the results of the <code>sbc_gpio </code>tests, please check out our <a href="https://www.learningtopi.com/sbc/sbc_gpio-pi-4b-vs-rock-5b/">sbc_gpio Pi 4B vs Rock 5B</a> comparison.</p>



<p>Configuring the <code>sbc_gpio </code>for the Raspberry Pi 4B test requires 1x I2C, 2x SPI, 1x UART and 2x IR (1 Tx and 1 Rx).  All the configuration can be done directly in the <code>/boot/config.txt</code> file.  Alternatively, some of the overlays may use the <code>raspi-config</code> tool (1x I2C, 1x SPI, 1x UART).</p>



<p>In all, the setup is quick and easy and only takes a few minutes.  RPI does support applying overlays without a reboot, however I generally just add the configuration and reboot to apply the changes.</p>



<div class="wp-block-ht-block-toc is-style-outline htoc htoc--position-wide toc-list-style-plain" data-htoc-state="expanded"><span class="htoc__title"><span class="ht_toc_title">Table of Contents</span></span><div class="htoc__itemswrap"><ul class="ht_toc_list"><li class=""><a href="#htoc-raspi-config-vs-boot-config-txt">Raspi-config vs /boot/config.txt</a></li><li class=""><a href="#htoc-i2c0-16x2-lcd-display1">I2C0 &#8211; 16&#215;2 LCD display</a></li><li class=""><a href="#htoc-spi0-bme280-bmp280">SPI0 &#8211; BME280 / BMP280</a></li><li class=""><a href="#htoc-spi1-bme280-bmp280">SPI1 &#8211; BME280 / BMP280</a></li><li class=""><a href="#htoc-uart0-for-serial-communication">UART0 &#8211; for serial communication</a></li><li class=""><a href="#htoc-infrared-transmit-and-receive">Infrared Transmit and Receive</a></li><li class=""><a href="#htoc-summary">Summary</a></li></ul></div></div>



<h2 class="wp-block-heading" id="htoc-raspi-config-vs-boot-config-txt">Raspi-config vs /boot/config.txt</h2>



<p>The <code>raspi-config </code>tool is a quick and easy way to setup your Raspberry Pi SBC for some of the typical overlays, but not all overlays are exposed using this tool.  For anything beyond the basics, you&#8217;ll need to edit the <code>/boot/config.txt</code> file directly.  You can also bypass the<code> raspi-config</code> tool and edit the <code>/boot/config.txt</code> file manually for all overlays if you prefer.  Where applicable I&#8217;ll show both methods for reference.</p>



<p>You can find a full breakdown of available /boot/config.txt file options on the <a href="https://www.raspberrypi.com/documentation/computers/config_txt.html" target="_blank" rel="noreferrer noopener">Raspberry Pi website</a>.</p>



<p>In the <code>raspi-config</code> tool, overlays can be accessed from the &#8220;Interface Options&#8221; menu:</p>



<figure class="wp-block-image size-full"><img loading="lazy" decoding="async" width="883" height="439" src="https://www.learningtopi.com/wp-content/uploads/image-32.png" alt="" class="wp-image-1032" srcset="https://www.learningtopi.com/wp-content/uploads/image-32.png 883w, https://www.learningtopi.com/wp-content/uploads/image-32-300x149.png 300w, https://www.learningtopi.com/wp-content/uploads/image-32-150x75.png 150w, https://www.learningtopi.com/wp-content/uploads/image-32-768x382.png 768w, https://www.learningtopi.com/wp-content/uploads/image-32-850x423.png 850w" sizes="auto, (max-width: 883px) 100vw, 883px" /></figure>



<h2 class="wp-block-heading" id="htoc-i2c0-16x2-lcd-display1">I2C0 &#8211; 16&#215;2 LCD display</h2>



<p>Only the 1st I2C bus can be configured from the <code>raspi-config</code> tool:</p>



<figure class="wp-block-image size-full"><img loading="lazy" decoding="async" width="964" height="447" src="https://www.learningtopi.com/wp-content/uploads/image-33.png" alt="" class="wp-image-1033" srcset="https://www.learningtopi.com/wp-content/uploads/image-33.png 964w, https://www.learningtopi.com/wp-content/uploads/image-33-300x139.png 300w, https://www.learningtopi.com/wp-content/uploads/image-33-150x70.png 150w, https://www.learningtopi.com/wp-content/uploads/image-33-768x356.png 768w, https://www.learningtopi.com/wp-content/uploads/image-33-850x394.png 850w" sizes="auto, (max-width: 964px) 100vw, 964px" /></figure>



<figure class="wp-block-image size-full"><img loading="lazy" decoding="async" width="791" height="450" src="https://www.learningtopi.com/wp-content/uploads/image-34.png" alt="" class="wp-image-1034" srcset="https://www.learningtopi.com/wp-content/uploads/image-34.png 791w, https://www.learningtopi.com/wp-content/uploads/image-34-300x171.png 300w, https://www.learningtopi.com/wp-content/uploads/image-34-150x85.png 150w, https://www.learningtopi.com/wp-content/uploads/image-34-768x437.png 768w" sizes="auto, (max-width: 791px) 100vw, 791px" /></figure>



<p>Alternatively the following can be set in the <code>/boot/config.txt</code> file:</p>



<pre class="wp-block-code"><code>dtparam=i2c_arm=on</code></pre>



<h2 class="wp-block-heading" id="htoc-spi0-bme280-bmp280">SPI0 &#8211; BME280 / BMP280</h2>



<p>This uses our <code>dht11_spi</code> python library that uses the input on the SPI bus in conjunction with an output GPIO pin and a transistor to trigger and read the DHT11 sensor.  You can read more about the dht11_spi library <a href="https://www.learningtopi.com/sbc/python_dht11_spi/" target="_blank" rel="noreferrer noopener">here</a>.  Only the 1st SPI bus (spi0) can be configured using the <code>raspi-config</code> tool:</p>



<figure class="wp-block-image size-full"><img loading="lazy" decoding="async" width="964" height="447" src="https://www.learningtopi.com/wp-content/uploads/image-33.png" alt="" class="wp-image-1033" srcset="https://www.learningtopi.com/wp-content/uploads/image-33.png 964w, https://www.learningtopi.com/wp-content/uploads/image-33-300x139.png 300w, https://www.learningtopi.com/wp-content/uploads/image-33-150x70.png 150w, https://www.learningtopi.com/wp-content/uploads/image-33-768x356.png 768w, https://www.learningtopi.com/wp-content/uploads/image-33-850x394.png 850w" sizes="auto, (max-width: 964px) 100vw, 964px" /></figure>



<figure class="wp-block-image size-full"><img decoding="async" src="https://www.learningtopi.com/wp-content/uploads/image-35.png" alt="" class="wp-image-1036"/></figure>



<p>Alternatively the following can be set in the <code>/boot/config.txt</code> file:</p>



<pre class="wp-block-code"><code>dtparam=spi=on
dtoverlay=spi0-1cs
</code></pre>



<h2 class="wp-block-heading" id="htoc-spi1-bme280-bmp280">SPI1 &#8211; BME280 / BMP280</h2>



<p>Any SPI buses after the first need to be enabled from the <code>/boot/config.txt </code>file directly.  The following will enable the SPI1 bus with 1 CS.</p>



<pre class="wp-block-code"><code>dtoverlay=spi1-1cs</code></pre>



<h2 class="wp-block-heading" id="htoc-uart0-for-serial-communication">UART0 &#8211; for serial communication</h2>



<p>The UART0 interface will be used for sending serial traffic to a CP2102 USB to serial converter.  The CP2102 USB port will connect back to the SBC.  No drivers are needed for the CP2102 (necessary drivers are already present in the Linux kernel).</p>



<p>The UART0 serial port can be enabled using <code>raspi-config</code>.  The first question is used to enable a console port to the Raspberry Pi over UART0 (select NO).  The second question enables the UART0 interface for use by applications (select YES):</p>



<figure class="wp-block-image size-full"><img loading="lazy" decoding="async" width="788" height="448" src="https://www.learningtopi.com/wp-content/uploads/image-39.png" alt="" class="wp-image-1044" srcset="https://www.learningtopi.com/wp-content/uploads/image-39.png 788w, https://www.learningtopi.com/wp-content/uploads/image-39-300x171.png 300w, https://www.learningtopi.com/wp-content/uploads/image-39-150x85.png 150w, https://www.learningtopi.com/wp-content/uploads/image-39-768x437.png 768w" sizes="auto, (max-width: 788px) 100vw, 788px" /></figure>



<figure class="wp-block-image size-full"><img loading="lazy" decoding="async" width="786" height="452" src="https://www.learningtopi.com/wp-content/uploads/image-38.png" alt="" class="wp-image-1042" srcset="https://www.learningtopi.com/wp-content/uploads/image-38.png 786w, https://www.learningtopi.com/wp-content/uploads/image-38-300x173.png 300w, https://www.learningtopi.com/wp-content/uploads/image-38-150x86.png 150w, https://www.learningtopi.com/wp-content/uploads/image-38-768x442.png 768w" sizes="auto, (max-width: 786px) 100vw, 786px" /></figure>



<p>Alternatively, the UART can be enabled in the <code>/boot/config.txt </code>file:</p>



<pre class="wp-block-code"><code>enable_uart=1</code></pre>



<h2 class="wp-block-heading" id="htoc-infrared-transmit-and-receive">Infrared Transmit and Receive</h2>



<p>Infrared transmit or receive ports cannot be set using the <code>raspi-config </code>tool.  In the <code>/boot/config.txt</code> file the following will enable a transmit (gpio-ir-tx) and receive (gpio-ir) pin.  Replace the gpio_pin value with the appropriate number.</p>



<pre class="wp-block-code"><code>dtoverlay=gpio-ir,gpio_pin=23
dtoverlay=gpio-ir-tx,gpio_pin=24</code></pre>



<p>You can create additional transmit or receive IR devices by simply adding another dtoverlay line with a new gpio pin number.</p>



<h2 class="wp-block-heading" id="htoc-summary">Summary</h2>



<p>You will find that the Raspberry Pi platform is EXTREMELY well documented and running through the setup is a breeze.  None of the overlays required any complex configuration.  Most could be setup using the <code>raspi-config</code> wizard.  There was also no need to run any update tools after modifying the <code>/boot/config.txt </code>file (like on some other platforms).</p>



<p>If you came here from our&nbsp;<a href="https://www.learningtopi.com/sbc/sbc_gpio-pi-4b-vs-rock-5b/">sbc_gpio test result page</a>, feel free to jump back over to the results!</p>
<p>The post <a href="https://www.learningtopi.com/sbc/raspberry-pi/raspberry-pi-4b-sbc_gpio/">Raspberry Pi 4B Setup for sbc_gpio</a> appeared first on <a href="https://www.learningtopi.com">Learning to Pi</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://www.learningtopi.com/sbc/raspberry-pi/raspberry-pi-4b-sbc_gpio/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
	</channel>
</rss>
