<?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>Pi4B Archives - Learning to Pi</title>
	<atom:link href="https://www.learningtopi.com/tag/pi4b/feed/" rel="self" type="application/rss+xml" />
	<link>https://www.learningtopi.com/tag/pi4b/</link>
	<description>Programming Python on SBC&#039;s and Microcontrollers</description>
	<lastBuildDate>Fri, 20 Oct 2023 15:32:46 +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>Pi4B Archives - Learning to Pi</title>
	<link>https://www.learningtopi.com/tag/pi4b/</link>
	<width>32</width>
	<height>32</height>
</image> 
	<item>
		<title>RPI5 or Rock 5B?</title>
		<link>https://www.learningtopi.com/sbc/raspberry-pi/rpi5-or-rock-5b/</link>
					<comments>https://www.learningtopi.com/sbc/raspberry-pi/rpi5-or-rock-5b/#respond</comments>
		
		<dc:creator><![CDATA[tdunteman]]></dc:creator>
		<pubDate>Thu, 19 Oct 2023 23:09:39 +0000</pubDate>
				<category><![CDATA[Raspberry Pi SBC]]></category>
		<category><![CDATA[SBC]]></category>
		<category><![CDATA[Pi4B]]></category>
		<category><![CDATA[Rock5B]]></category>
		<category><![CDATA[RPI5]]></category>
		<guid isPermaLink="false">https://www.learningtopi.com/?p=1241</guid>

					<description><![CDATA[<p>It is official! The Raspberry Pi 5 is being released October 2023! (Official product page) I expect it will be some time before I can get my hands on one. Until then I will need to compare specifications. Lets take a look at the RPI5 and the Rock 5B. NOTE: This article will compare the...</p>
<p>The post <a href="https://www.learningtopi.com/sbc/raspberry-pi/rpi5-or-rock-5b/">RPI5 or Rock 5B?</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">
<p>It is official!  The Raspberry Pi 5 is being released October 2023!  (<a href="https://www.raspberrypi.com/products/raspberry-pi-5/" target="_blank" rel="noreferrer noopener">Official product page</a>)  I expect it will be some time before I can get my hands on one.  Until then I will need to compare specifications.  Lets take a look at the RPI5 and the Rock 5B.</p>



<blockquote class="wp-block-quote is-layout-flow wp-block-quote-is-layout-flow">
<p>NOTE:  This article will compare the specification of the Pi 5 as is currently available.  Some details may change.  There has also been some elusion to new features that will be enabled down the road.</p>
</blockquote>



<p>Over the past few years as Raspberry Pi stock has been hard to get a hold of I&#8217;ve started testing SBC&#8217;s from other vendors (Radxa, OrangePi, Banana Pi, Atomic Pi, Mango Pi, etc).  I&#8217;ve currently settled on a Rock 5B with the Rockchip RK3588 as my primary board.</p>
</div>



<div class="wp-block-column is-layout-flow wp-block-column-is-layout-flow">
<figure class="wp-block-image size-full"><img fetchpriority="high" decoding="async" width="1000" height="1000" src="https://www.learningtopi.com/wp-content/uploads/rpi5.jpg" alt="" class="wp-image-1255" srcset="https://www.learningtopi.com/wp-content/uploads/rpi5.jpg 1000w, https://www.learningtopi.com/wp-content/uploads/rpi5-300x300.jpg 300w, https://www.learningtopi.com/wp-content/uploads/rpi5-150x150.jpg 150w, https://www.learningtopi.com/wp-content/uploads/rpi5-768x768.jpg 768w, https://www.learningtopi.com/wp-content/uploads/rpi5-850x850.jpg 850w" sizes="(max-width: 1000px) 100vw, 1000px" /></figure>
</div>
</div>



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



<p>I included the Pi 4B in addition to the Pi 5 and Radxa Rock 5B for comparison.  I don&#8217;t believe anyone would argue that the Pi 5 isn&#8217;t a very welcome upgrade to the Pi 4B, but how does it stack up to the top line RK3588 based SBC&#8217;s that you can get from Radxa, Orange Pi or others?</p>



<table id="tablepress-6" class="tablepress tablepress-id-6">
<thead>
<tr class="row-1">
	<td class="column-1" style="width:10%;"></td><th class="column-2" style="width:35%;">Raspberry Pi 4B</th><th class="column-3" style="width:20%;">Radxa Rock 5B</th><th class="column-4" style="width:35%;">Raspberry Pi 5</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><td class="column-4">Broadcom BCM2712<br />
4x ARM Cortex-A76 (??? &#8211; 2.4Ghz)</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><td class="column-4">N/A</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><td class="column-4">4/8GB LPDDR4X 4267Mhz (at launch)</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><td class="column-4">Broadcom VideoCore VII<br />
4 cores (?? &#8211; 800 Mhz)</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><td class="column-4">H.264, H.265</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><td class="column-4"></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><td class="column-4">? / 51.2 / ? 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><td class="column-4">2x micro HDMI + 2x MIPI 4-lane (can be used for cameras or displays)</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><td class="column-4">2x MIPI 4-lane (can be used for cameras or displays)</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><td class="column-4">microSD (supports SDR104)</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><td class="column-4">2x USB 3.0 (supports concurrent 5Gbps)<br />
2x USB 2.0</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><td class="column-4">PCIe 2.0 x1 (requires M.2 HAT or other adapter)</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><td class="column-4">1Gbps Broadcom (BCM54213PE)<br />
802.11ac 2.4/5Ghz (Infineon CYW43455)</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><td class="column-4">Bluetooth 5.0, BLE (BCM54213PE)<br />
</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><td class="column-4">TBD</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><td class="column-4">TBD</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><td class="column-4">TBD</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><td class="column-4">TBD</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><td class="column-4">TBD</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><td class="column-4">TBD</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><td class="column-4">up to 28x<br />
Builtin RTC w/ external battery</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><td class="column-4">USB-C 5v 5A<br />
Includes a power button</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><td class="column-4"></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><td class="column-4"></td>
</tr>
</tbody>
</table>
<!-- #tablepress-6 from cache -->


<h2 class="wp-block-heading">CPU &#8211; Advantage Rock 5B</h2>



<p>The 4x A76 cores of the Pi 5 are a big update from the 4x A72&#8217;s in the 4B.  Personally I never felt that the Pi 4B was powerful enough for a GUI if you intend to use it as a regular desktop.  The Rock 5B on the other hand has become my defacto standard desktop.</p>



<p>It is a bit disapointing to see that the RPI5 went with 4x A76 cores without the added 4x A55 cores of the RK3588.  This seems even more odd when you look at the release dates of the different ARM cores:</p>



<ul class="wp-block-list">
<li>A72 &#8211; 2016 (RPI4)</li>



<li>A76 &#8211; 2018 (RPI5 / RK3588)</li>



<li>A78 &#8211; 2020</li>



<li>A710 &#8211; 2021</li>



<li>A715 &#8211; 2022</li>



<li>A720 &#8211; 2023</li>
</ul>



<p>It does take some time from an ARM release before new cores start showing up in devices, but I&#8217;m surprised that the RPI5 didn&#8217;t take advantage of the A78 to leapfrog the competition.  Based on benchmarks of others with pre-release RPI5&#8217;s (<a href="https://www.youtube.com/watch?v=nBtOEmUqASQ" target="_blank" rel="noreferrer noopener">https://www.youtube.com/watch?v=nBtOEmUqASQ</a>) the RPI5 is coming out already at a performance disadvantage.</p>



<h2 class="wp-block-heading">RAM &#8211; Draw</h2>



<p>Both platforms are running LPDDR4.  The Rock 5B lists 2112Mhz vs RPI5&#8217;s 4267Mhz, but don&#8217;t be fooled by that.  From what I have seen, some platforms double the frequency if it is setup in dual channel.  The 2112Mhz reported by the Rock 5B comes directly from UBoot.  I have seen Radxa list it as 4224Mhz in some places.  </p>



<p>Both platforms offer 4 and 8GB platforms.  Rock 5B also offers a 16GB.  Based on the datasheet the RK3588 is capable of addressing up to 32GB.  I&#8217;m glad to see 4GB is the bottom end here.  Given the CPU capabilities running 1 or 2GB of RAM seems like a waste.  Personally I would run with 8GB unless there is a use case where you know 4GB will be sufficient.</p>



<h2 class="wp-block-heading">NPU &#8211; Advantage Rock 5B</h2>



<p>Personally I haven&#8217;t found an application to use the NPU available on the RK3588 yet, however it is surprising that in the day and age of everything AI that Raspberry Pi didn&#8217;t include one.  This may come down to a Broadcom issue, but it does add another reason customers may choose a different platform.  Given the number of years between Raspberry Pi releases, that means it could be 3+ years before we see a Raspberry Pi with an NPU.</p>



<h2 class="wp-block-heading">GPU &#8211; Draw?</h2>



<p>I generally don&#8217;t tax the GPU on my systems very heavily, and it is also difficult to compare GPU specs.  Both systems seem to have a 4 core GPU.  The Mali G610 MP4 on the RK3588 runs at 1Ghz and the Video Core VII on the RPI5 runs at 800Mhz.  The Mali G610 MP4 data I could find reported 610 GFLOPS at FP32 vs the 51.2 GFLOPS for the Video Core VII.  Does this mean that video is 10x better?  Probably not.  I&#8217;ll leave the video comparison to video experts.</p>



<h2 class="wp-block-heading">Storage &#8211; Advantage Rock 5B</h2>



<p>The Rock 5B comes with 3 storage options:</p>



<ul class="wp-block-list">
<li>Micro-SD with SDR104 support &#8211; Max at 104MBps</li>



<li>eMMC port &#8211; Max at 400MBps</li>



<li>M.2 PCIe 3.0 x4 supporting a standard 2280 SSD &#8211; Max at 4000MBps</li>
</ul>



<p>Moving away from the typical SD card MASSIVELY boosts performance.  The eMMC modules were quick, but nothing matches a PCIe SSD.  </p>



<p>The RPI5 also has 3 options:</p>



<ul class="wp-block-list">
<li>Mircro-SD with SDR104 support &#8211; Max at 104MBps</li>



<li>PCIe 2.0 x1 (requires a HAT with M.2 port as there is none onboard) &#8211; Max at 500MBps</li>



<li>USB 3.0 (each USB3 port runs as a separate USB 3.0 controller with a full 5Gbps throughput) &#8211; Max at ~500MBps</li>
</ul>



<p>The RPI5 increases the throughput on the MicroSD over the Pi4B, but doesn&#8217;t give anywhere near desktop level performance.  This may be adaquate for a headless IOT device, but for anything running a desktop application this level of performance is abysmal.</p>



<p>PCIe 2.0&#215;1 or USB3 could be used to increase storage throughput, but you are still maxed out at 500MBps.  For comparison I have a Crucial P3 500GB SSD in my Rock 5B rated for 3500MBps read and 3000MBps write (PCIe 3.0 x4).  I am surprised that Raspberry Pi didn&#8217;t provide any ability to handle the typical SSD&#8217;s that are available in desktops today.</p>



<p>I had to dig to find out that the Rock 5B / RK3588 does in fact support SDR104.  For confirmation I popped a SanDisk Extreme microSD card in:</p>



<pre class="wp-block-code"><code>&#91;4578960.554989] mmc_host mmc1: Bus speed (slot 0) = 198000000Hz (slot req 200000000Hz, actual 198000000HZ div = 0)
&#91;4578960.665326] dwmmc_rockchip fe2c0000.mmc: Successfully tuned phase to 360
&#91;4578960.665358] <strong>mmc1: new ultra high speed SDR104 SDXC card at address e624</strong>
&#91;4578960.666296] mmcblk1: mmc1:e624 SN64G 59.5 GiB </code></pre>



<p>The RPI5 still suffers from what I believe is the worst drawback to the PI4B, slow storage.</p>



<h2 class="wp-block-heading">USB &#8211; Draw</h2>



<p>The RPI5 documentation specifically calls out that the 2x USB 3.0 ports are controlled individually which means full 5Gbps on EACH port.  This is great when you compare to the Pi 4B which has a single USB3 controller that supports both ports.</p>



<p>After digging through Rockchip RK3588 datasheets and testing different USB 3 devices on my Rock 5B, I can confirm that the Rock 5B also has dual USB3 controllers.  It can be a bit tough to discern from the datasheet, but it appears that the RK3588 chip was designed to run displayport over those dual USB3 controllers (although I should note it does not appear that Radxa configured the Rock 5B to support displayport over USB3).</p>



<h2 class="wp-block-heading">GPIO / I2C / SPI / UART / etc &#8211; Draw</h2>



<p>I&#8217;m calling GPIO and other functions on the 40 pin header a draw.  There is some variance on how many I2C and SPI buses each can handle, but both are highly configurable and can support multiple of each.  The Rock 5B documentation does also call out an ADC sensor (which I have never found documentation or overlay files for) as well as a CAN bus (which I haven&#8217;t had a use for yet).</p>



<p>The only drawback I have for the Rock 5B is the issue I found will pull-up/pull-down (detailed <a href="https://www.learningtopi.com/templates/orangepi-5-testing-with-sbc_gpio/" target="_blank" rel="noreferrer noopener">here</a> for the Orange Pi 5, but applies to the Rock 5B as well).  I have been unable to get any information on why these don&#8217;t work or if they should.  For now I&#8217;ve stuck to external pull-up/down resistors.</p>



<h2 class="wp-block-heading">Power &#8211; Draw</h2>



<p>It appears that Raspberry Pi has in fact added support for USB-C PD!  That means the dreaded undervolt message may finally be a thing of the past!  There does seem to be a drawback though.  Using USB-C PD the PI5 does not have full power available for USB devices.  I don&#8217;t have information on exactly what the limit is, but apparently this is not a factor with the 5V 5A official power supply.</p>



<p>I wish more companies would adopt USB-C PD!  I&#8217;ve now acculumated quite a few power supplies that are looking for a new use!</p>



<h2 class="wp-block-heading">Kernel and Software &#8211; Advantage RPI5</h2>



<p>Software is where Raspberry Pi devices truely shine.  They have by far the most mature and well maintained software ecosystem.  Raspberry Pi 4&#8217;s are running kernel 6.1 while Rock 5B&#8217;s are stuck on 5.10.  I also see VERY few kernel updates from Radxa which means we aren&#8217;t getting security updates even though 5.10 is an LTS release.</p>



<p>Raspberry Pi also has by far the best confguraiton tool (raspi-config) that other platforms are typically lacking.  Radxa has no interface that can be used to select overlays or other board configuration options.  The only other company I&#8217;ve seen with a near-peer tool is Orange Pi (covered it in detail <a href="https://www.learningtopi.com/templates/orangepi-5-testing-with-sbc_gpio/" target="_blank" rel="noreferrer noopener">here</a>).</p>



<p>If you are new to SBC&#8217;s and GPIO&#8217;s, the Raspberry Pi is by FAR the easiest to learn on.  If you are familiar enough with applying overlays, the Rock 5B provides a high level of capability, you just have to know where to look.</p>



<h2 class="wp-block-heading">Networking &#8211; RPI5</h2>



<p>Over the past few years we&#8217;ve seen a slow shift to 2.5Gbps Ethernet as a pseudo standard.  More deivces are shipping with 2.5Gbps NIC&#8217;s, and retail switches are coming down in price to make it a reasonable option for home use.  We are also starting to see 1Gbps+ home internet, so the shift to faster Ethernet switches is now starting to be a necessity.</p>



<p>That being said, the Rock 5B ships with 2.5Gbps Ethernet, but the RPI5 does not (1Gbps only).  While I don&#8217;t count this as a big red mark against the Pi, it is an odd choice since it will likely be 3+ years before we get another Raspberry Pi.</p>



<p>While the Rock 5B does come with 2.5Gbps ethernet, it comes without WiFi or Bluetooth.  There is a PCIe 2.0 x1 E-Key M.2 port (separate from the PCIe 3.0 x4 M.2 used for storage) for a WiFi / Bluetooth card so it can be added.  This does just introduce additional cost if WiFi or Bluetooth is required,  The RPI5 comes equipped with 802.11ac 2.4/5Ghz WiFi and Bluetooth 5.0 with BLE built-in.</p>



<h2 class="wp-block-heading">Size &#8211; Depends on your need</h2>



<p>The RPI5 follows the typical (now defacto standard) Raspberry Pi size: 85x56mm (3.370×2.224in).  The Rock 5B actually follows the Pico-ITX form factor: 100x72mm (3.93&#215;2.83in).  This is a bit larger, but is still a compact system.  If size is the biggest concern there is either the Pi Zero 2 W or multiple other similar sized boards available.  There are also RK3588 boards that are smaller if size is truely a deciding factor.  Personally I&#8217;m ok with the larger size  coming with vastly increased storage speed, USB-C PD support, more and faster PCI-e, NPU, etc.</p>



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



<p>There are quite a few odd design choices with the RPI5 that I feel put it behind the curve:</p>



<ul class="wp-block-list">
<li>Quad core A76 &#8211; Missing the added 4x A55 cores of the RK3588, and not sure why newer A78 cores weren&#8217;t used.</li>



<li>1Gbps Ethernet &#8211; The standard today for new devices is moving to 2.5Gbps.</li>



<li>No NPU &#8211; Other high end boards (i.e. anything based on the RK3588) include NPU&#8217;s.  It would still be possible to add an external NPU via PCIe or USB3, it just consumes valuable ports.</li>



<li>Faster storage!  The SD104 update to the microSD is a nice addition, but the platform can&#8217;t compete with even years old desktop storage.</li>
</ul>



<p>It seems like Raspberry Pi has become the slow moving Titantic and other vendors are pushing the boundaries further.  I will certainly get a RPI5 as soon as I can find one. (I still haven&#8217;t found a Zero 2 W for less than an exorbitant price.) It is very unlikely that I&#8217;ll replace my Rock 5B as a desktop anytime soon.</p>



<h2 class="wp-block-heading">Final Notes</h2>



<p>If you are new to SBC&#8217;s the RPI5 (or even a PI4B if you can find them) is the best place to start.  If you are looking for something with higher capacity to act as a file server, media server, etc, I think the Rock 5B and other equivalent RK3588 based systems are still the best option.  Since the shortage of Pi&#8217;s during the pandemic, I&#8217;ve branched out and now don&#8217;t feel the Raspberry Pi is king of the hill any longer.  I&#8217;m looking forward to seeing what the next generation of boards will bring!</p>
<p>The post <a href="https://www.learningtopi.com/sbc/raspberry-pi/rpi5-or-rock-5b/">RPI5 or 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/raspberry-pi/rpi5-or-rock-5b/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 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="(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 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-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: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>



<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>



<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>



<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>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>
