<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://wiki.pine64.org/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Lupyuen</id>
	<title>PINE64 - User contributions [en]</title>
	<link rel="self" type="application/atom+xml" href="https://wiki.pine64.org/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Lupyuen"/>
	<link rel="alternate" type="text/html" href="https://wiki.pine64.org/wiki/Special:Contributions/Lupyuen"/>
	<updated>2026-04-27T00:33:21Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.37.1</generator>
	<entry>
		<id>https://wiki.pine64.org/index.php?title=Ox64&amp;diff=21203</id>
		<title>Ox64</title>
		<link rel="alternate" type="text/html" href="https://wiki.pine64.org/index.php?title=Ox64&amp;diff=21203"/>
		<updated>2024-01-01T00:24:16Z</updated>

		<summary type="html">&lt;p&gt;Lupyuen: Add article &amp;quot;Nim on a Real-Time Operating System: Apache NuttX RTOS + Ox64 BL808 SBC&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[File:Ox64_board.jpg|thumb|right|The Ox64]]&lt;br /&gt;
[[File:Ox64 pinout.png|thumb|Pinout of the production version]]&lt;br /&gt;
[[File:RISC-V.png|thumb|right|Powered by RISC-V]]&lt;br /&gt;
&lt;br /&gt;
The '''Ox64''' is a RISC-V based single-board computer based on the Bouffalo Lab BL808 RISC-V SoC with C906 64-bit and E907/E902 32-bit CPU cores supported by 64 MB of embedded PSRAM memory, and with built-in WiFi, Bluetooh and Zigbee radio interfaces. The Ox64 comes in a breadboard-friendly form-factor, has a microSD card slot, a USB 2.0 Type-C port, and many other peripheral interfaces for makers to integrate with sensors and other devices.&lt;br /&gt;
&lt;br /&gt;
== Software Releases ==&lt;br /&gt;
&lt;br /&gt;
=== Quick Links to the Source of OS Images Build ===&lt;br /&gt;
&lt;br /&gt;
There is a community effort to bring updated kernels, peripherals and buildroot - Lots of communication happening in the #ox64-nutcracker channel. &lt;br /&gt;
&lt;br /&gt;
* [https://github.com/openbouffalo/buildroot_bouffalo buildroot] bringing all the work below together with a bootable kernel and updated filesystem images for SD cards &lt;br /&gt;
* [https://github.com/smaeul/u-boot/tree/bl808 U-Boot] and [https://github.com/smaeul/opensbi/tree/bl808 OpenSBI] work by Smauel&lt;br /&gt;
* [https://github.com/arm000/linux-bl808/tree/linux-next/mboxic Kernel] IRQChip, SDCard, and (WIP) USB by arm000, Alexander Horner and others&lt;br /&gt;
* [https://github.com/openbouffalo/OBLFR OpenBouffalo Firmware] low_load drivers by Fishwaldo and others&lt;br /&gt;
&lt;br /&gt;
Original Linux Images provided by Bouffalo - Very basic '''alpha build''' which are only fit for board bring up and testing purposes. &lt;br /&gt;
&lt;br /&gt;
* [https://github.com/bouffalolab/bl808_linux Linux for BL808]&lt;br /&gt;
* [https://wiki.pine64.org/wiki/File:Linux_BL808.pdf Installation Instructions for Linux on BL808 (Chinese)]&lt;br /&gt;
* [https://wiki.pine64.org/wiki/File:Linux_BL808_en.pdf Installation Instructions for Linux on BL808 (machine translated to English)]&lt;br /&gt;
&lt;br /&gt;
Toolchain:&lt;br /&gt;
&lt;br /&gt;
* elf_newlib_toolchain/bin/riscv64-unknown-elf-gcc (Xuantie-900 elf newlib gcc Toolchain V2.2.5 B-20220323) 10.2.0&lt;br /&gt;
* linux_toolchain/bin/riscv64-unknown-linux-gnu-gcc (Xuantie-900 linux-5.10.4 glibc gcc Toolchain V2.2.4 B-20211227) 10.2.0&lt;br /&gt;
* cmake version 3.19.3&lt;br /&gt;
&lt;br /&gt;
=== Software Development Kits ===&lt;br /&gt;
* [https://github.com/bouffalolab/bl_mcu_sdk BL808 MCU SDK]&lt;br /&gt;
* [https://dev.bouffalolab.com/download BLDevCube Flashing Tool for Windows, macOS and Ubuntu x64]&lt;br /&gt;
* [https://wiki.pine64.org/wiki/File:Ox64_BL808UART_connect.pdf Ox64 UART Flashing Guide], see the [https://gist.github.com/lupyuen/7a0c697b89abccda8e38b33dfe5ebaff notes]&lt;br /&gt;
* [https://github.com/lupyuen/lupyuen.github.io/releases/download/ox64/bl808_demo_event.bin BL808 Demo Firmware: bl808_demo_event.bin], see the [https://gist.github.com/lupyuen/7a0c697b89abccda8e38b33dfe5ebaff notes]&lt;br /&gt;
* [https://github.com/lupyuen/lupyuen.github.io/releases/download/ox64/whole_flash_data.bin BL808 UART Log Firmware: whole_flash_data.bin], see the [https://gist.github.com/lupyuen/7a0c697b89abccda8e38b33dfe5ebaff notes]&lt;br /&gt;
* [https://github.com/lupyuen/lupyuen.github.io/releases/download/ox64/BL808.DVK.Quick.Start.pdf BL808 DVK Quick Start]&lt;br /&gt;
* [https://github.com/bouffalolab/bl808_linux/tree/main/opensbi-0.6-808 OpenSBI for BL808]&lt;br /&gt;
* [https://github.com/bouffalolab/bl-pac/tree/main/bl808 Rust Peripheral Access Crate (PAC) for BL808]&lt;br /&gt;
* [https://github.com/bouffalolab/bl-pac/blob/main/bl808/bl808.svd System View Description (SVD) for BL808]&lt;br /&gt;
&lt;br /&gt;
== SoC and Memory Specification ==&lt;br /&gt;
&lt;br /&gt;
[[File:Bouffalo_Lab_icon.png|right]]&lt;br /&gt;
&lt;br /&gt;
Based on the [https://en.bouffalolab.com/product/ Bouffalo Lab BL808]&lt;br /&gt;
&lt;br /&gt;
[[File:BL808_Block_Diagram.jpg|500px]]&lt;br /&gt;
&lt;br /&gt;
=== CPU Architecture ===&lt;br /&gt;
&lt;br /&gt;
[[File:T-Head.png|right|200px]]&lt;br /&gt;
&lt;br /&gt;
T-Head C906 480 MHz 64-bit RISC-V CPU:&lt;br /&gt;
&lt;br /&gt;
* Supports RISC-V RV64IMAFCV instruction architecture&lt;br /&gt;
* Five-stage single-issue sequentially executed pipeline&lt;br /&gt;
* Level-1 instruction and data cache of Harvard architecture, with a size of 32 KB and a cache line of 64B&lt;br /&gt;
* Sv39 memory management unit, realizing the conversion of virtual and real addresses and memory management&lt;br /&gt;
* jTLB that supports 128 entries&lt;br /&gt;
* Supports AXI 4.0 128-bit master interface&lt;br /&gt;
* Supports core local interrupt (CLINT) and platform-level interrupt controller (PLIC)&lt;br /&gt;
* With 80 external interrupt sources, 3 bits for configuring interrupt priority&lt;br /&gt;
* Supports BHT (8K) and BTB&lt;br /&gt;
* Compatible with RISC-V PMP, 8 configurable areas&lt;br /&gt;
* Supports hardware performance monitor (HPM) units&lt;br /&gt;
* See [https://www.t-head.cn/product/c906?lang=en here]&lt;br /&gt;
&lt;br /&gt;
T-Head E907 320 MHz 32-bit RISC-V CPU:&lt;br /&gt;
&lt;br /&gt;
* Supports RISC-V RV32IMAFCP instruction set&lt;br /&gt;
* Supports RISC-V 32-bit/16-bit mixed instruction set&lt;br /&gt;
* Supports RISC-V machine mode and user mode&lt;br /&gt;
* Thirty-two 32-bit integer general purpose registers (GPR) and thirty-two 32-bit/64-bit floating-point GPRs&lt;br /&gt;
* Integer (5-stage)/floating-point (7-stage), single-issue, sequentially executed pipeline&lt;br /&gt;
* Supports AXI 4.0 main device interface and AHB 5.0 peripheral interface&lt;br /&gt;
* 32K instruction cache, two-way set associative structure&lt;br /&gt;
* 16K data cache, two-way set associative structure&lt;br /&gt;
* See [https://www.t-head.cn/product/e907?lang=en here]&lt;br /&gt;
&lt;br /&gt;
T-Head E902 150 MHz 32-bit RISC-V CPU:&lt;br /&gt;
&lt;br /&gt;
* See [https://www.t-head.cn/product/e902?lang=en here]&lt;br /&gt;
&lt;br /&gt;
=== System Memory ===&lt;br /&gt;
* Embedded 64MB PSRAM&lt;br /&gt;
&lt;br /&gt;
== Board Features ==&lt;br /&gt;
&lt;br /&gt;
=== Network ===&lt;br /&gt;
* 2.4 GHz 1T1R WiFi 802.11 b/g/n&lt;br /&gt;
* Bluetooth 5.2&lt;br /&gt;
* Zigbee&lt;br /&gt;
* 10/100 Mbit/s Ethernet (optional, on expansion board)&lt;br /&gt;
&lt;br /&gt;
=== Storage ===&lt;br /&gt;
* On-board 16 Mbit (2 MB) or 128 Mbit (16 MB) XSPI NOR flash memory&lt;br /&gt;
* MicroSD, supports SDHC and SDXC (only on the 128 Mbit version)&lt;br /&gt;
&lt;br /&gt;
=== Expansion Ports ===&lt;br /&gt;
* USB 2.0 OTG port&lt;br /&gt;
* 26 GPIO pins, including SPI, I&amp;lt;sup&amp;gt;2&amp;lt;/sup&amp;gt;C and UART functionality, possible I&amp;lt;sup&amp;gt;2&amp;lt;/sup&amp;gt;S and GMII expansion&lt;br /&gt;
* Dual-lane MiPi CSI port, located at USB-C port, for camera module&lt;br /&gt;
&lt;br /&gt;
=== Audio ===&lt;br /&gt;
* Microphone (optional, on the camera module)&lt;br /&gt;
* Speaker (optional, on the camera module)&lt;br /&gt;
&lt;br /&gt;
== Board Information, Schematics and Certifications ==&lt;br /&gt;
[[File:Ox64 ethphy.png|thumb|Pinout for wiring ethernet PHY to EMAC]]&lt;br /&gt;
&lt;br /&gt;
* Baseboard dimensions: 51 mm x 21 mm x 19 mm x 3.5 mm (breadboard friendly)&lt;br /&gt;
* Input power: 5 V, 0.5 A through the microUSB or USB-C ports&lt;br /&gt;
&lt;br /&gt;
Production version schematic:&lt;br /&gt;
&lt;br /&gt;
* [https://files.pine64.org/doc/ox64/PINE64_Ox64-Schematic-202221018.pdf Ox64 Schematic 20221018 v1.1]&lt;br /&gt;
* [https://files.pine64.org/doc/ox64/PINE64_Ox64_PCB_Placement-Top-20221018.pdf Ox64 PCB Component placement(ToP) 20221018 v1.1]&lt;br /&gt;
* [https://files.pine64.org/doc/ox64/PINE64_Ox64_PCB_Placement-Bottom-20221018.pdf Ox64 PCB Component placement(Bottom) 20221018 v1.1]&lt;br /&gt;
&lt;br /&gt;
Prototype (dispatched to developers) schematic:&lt;br /&gt;
* [https://files.pine64.org/doc/ox64/PINE64_Ox64-Schematic-202221007.pdf Ox64 Schematic 20221007 v1.0]&lt;br /&gt;
* [https://files.pine64.org/doc/ox64/PINE64_Ox64_PCB_Placement-Top-20221007.pdf Ox64 PCB Component placement(ToP) 20221007 v1.0]&lt;br /&gt;
* [https://files.pine64.org/doc/ox64/PINE64_Ox64_PCB_Placement-Bottom-20221007.pdf Ox64 PCB Component placement(Bottom) 20221007 v1.0]&lt;br /&gt;
&lt;br /&gt;
Certifications:&lt;br /&gt;
* Disclaimer: Please note that PINE64 SBC is not a &amp;quot;final&amp;quot; product and in general certification is not necessary.&lt;br /&gt;
* Not yet available&lt;br /&gt;
&lt;br /&gt;
== Datasheets for Components and Peripherals ==&lt;br /&gt;
&lt;br /&gt;
Bouffalo BL808 SoC information:&lt;br /&gt;
* [https://raw.githubusercontent.com/bouffalolab/bl_docs/main/BL808_DS/en/BL808_DS_1.2_en.pdf Bouffalo Lab BL808 SoC Datasheet]&lt;br /&gt;
* [https://raw.githubusercontent.com/bouffalolab/bl_docs/main/BL808_RM/en/BL808_RM_en_1.3.pdf Bouffalo Lab BL808 SoC Reference Manual]&lt;br /&gt;
&lt;br /&gt;
SPI NOR Flash information:&lt;br /&gt;
* [https://files.pine64.org/doc/datasheet/ox64/gd25lq16e_rev1.2_20210108.pdf GigaDevice 16Mb XSPI-Flash Datasheet]&lt;br /&gt;
* [https://files.pine64.org/doc/datasheet/star64/gd25lq128e_rev1.0_20210513.pdf GigaDevice 128Mb XSPI-Flash Datasheet]&lt;br /&gt;
* [https://wiki.pine64.org/images/5/5d/W25Q128JW_RevB_11042019-1761358.pdf Winbond 128Mb QSPI-Flash Datasheet] (W25Q128JWSQ)&lt;br /&gt;
&lt;br /&gt;
Power Regulator information:&lt;br /&gt;
* [https://files.pine64.org/doc/datasheet/ox64/IA2014-03.pdf Innovation Analog Tech IA2014 Step_down Converter Datasheet]&lt;br /&gt;
&lt;br /&gt;
MicroSD socket information:&lt;br /&gt;
* [https://files.pine64.org/doc/datasheet/ox64/TF%20PUSH%20type%20socket%20specification.pdf Push type microSD socket specification]&lt;br /&gt;
&lt;br /&gt;
== Compatible UARTs when in bootloader mode ==&lt;br /&gt;
&lt;br /&gt;
When the Ox64 is in bootloader mode, some UARTs are unable to communicate with it. When this is the case, utilities such as BLDevCube are unable to actually program the device. If you see &amp;quot;Shake hand fail&amp;quot; and an empty ack, and your device is in bootloader mode, then it is likely an incompatible UART.&lt;br /&gt;
&lt;br /&gt;
The below devices have been tested and verified as working:&lt;br /&gt;
* Raspberry Pi Pico - running the following [https://github.com/sanjay900/ox64-uart/releases/tag/v1.1 UART firmware] (GP4 and GP5 are used for port 0, GP12 and GP13 for port 1)&lt;br /&gt;
* Compiled binary for Pi Pico and connectivity diagram is [https://github.com/Kris-Sekula/Pine64_Ox64_SBC/tree/main/uart here] &lt;br /&gt;
* ESP32 with CP210x - bridge the EN pin to ground to disable the ESP32 itself, and then connect the TX on the esp32 to 14 on the Ox64 and RX to pin 15. Note that only baud rate 115200 works, and this doesn't seem to work for everyone)&lt;br /&gt;
* Stand-alone CP2102 dongle works at 115200 baud. Brand used was HiLetgo.&lt;br /&gt;
* STM32F401 BlackPill - running the [https://github.com/blackmagic-debug/blackmagic/tree/main/src/platforms/blackpillv2 Black Magic Debug] firmware&lt;br /&gt;
* STM32F103C8T6 BluePill - running Black Magic Debug.&lt;br /&gt;
* Some UART adapters based on the FT232H (note that the FT232RL does not work, and neither does the Pine 64 JTAG)&lt;br /&gt;
* Some CH340G based adapters work and some don't.&lt;br /&gt;
&lt;br /&gt;
== Resources and Articles ==&lt;br /&gt;
* [https://youtube.com/watch?v=czRtF-UNiEY A short video] on how to connect to the Ox64, flash and boot&lt;br /&gt;
* [https://youtu.be/vPAk5sq_Ilc Another video] that covers soldering pins, connecting via Pi Pico and flashing Linux and U-Boot&lt;br /&gt;
* [https://wiki.pine64.org/images/5/59/How_to_Run_Ox64.pdf Step-by-step tutorial] for how to build, flash and run Ox64&lt;br /&gt;
* [https://gist.github.com/lupyuen/7a0c697b89abccda8e38b33dfe5ebaff First batch of Ox64 won't appear as USB serial port]&lt;br /&gt;
* [https://gist.github.com/lupyuen/2087e9b3fb40aab5e0795bb02a265a3b First batch of Ox64 tested OK with CH340C/G]&lt;br /&gt;
* [https://www.robertlipe.com/bl808-not-symmetric/ First thoughts on the (a)symmetry of Bouffalo Labs BL808 as in Pine64 Ox64]&lt;br /&gt;
* [https://thelittleengineerthatcould.blogspot.com/2022/12/the-8-linux-computer-part-2.html The $8 linux computer (with picoprobe-rp2040 programming instructions)]&lt;br /&gt;
* [https://github.com/p4ddy1/pine_ox64/blob/main/build_toolchain_macos.md Building the Xuantie GNU Toolchain for Ox64 on macOS and Apple Silicon]&lt;br /&gt;
&lt;br /&gt;
Ox64 BL808 RISC-V SBC articles by [https://lupyuen.codeberg.page/ Lup Yuen LEE]:&lt;br /&gt;
* [https://lupyuen.codeberg.page/articles/ox64.html Booting Linux and (maybe) Apache NuttX RTOS]&lt;br /&gt;
* [https://lupyuen.codeberg.page/articles/ox2.html Starting Apache NuttX real-time operating system]&lt;br /&gt;
* [https://lupyuen.codeberg.page/articles/mmu.html Sv39 Memory Management Unit]&lt;br /&gt;
* [https://lupyuen.codeberg.page/articles/app.html NuttX Apps and Initial RAM Disk]&lt;br /&gt;
* [https://lupyuen.codeberg.page/articles/plic2.html UART Interrupt and Platform-Level Interrupt Controller (PLIC)]&lt;br /&gt;
* [https://lupyuen.codeberg.page/articles/plic3.html Fixing the UART Interrupt and Platform-Level Interrupt Controller]&lt;br /&gt;
* [https://www.hackster.io/lupyuen/8-risc-v-sbc-on-a-real-time-operating-system-ox64-nuttx-474358 $8 RISC-V SBC on a Real-Time Operating System: Ox64 + NuttX]&lt;br /&gt;
* [https://lupyuen.codeberg.page/articles/nim.html Nim on a Real-Time Operating System: Apache NuttX RTOS + Ox64 BL808 SBC]&lt;br /&gt;
&lt;br /&gt;
Git repositories:&lt;br /&gt;
* [https://github.com/sfranzyshen/arduino-bl808 Community made Arduino Core specifically for the Bouffalo Labs BL808 RISC-V MCU] (initial development has been postponed until further notice)&lt;br /&gt;
&lt;br /&gt;
== Development Efforts ==&lt;br /&gt;
* [https://twitter.com/gamelaster/status/1583916501400068096 Ox64 boots Linux successfully]&lt;br /&gt;
* [https://twitter.com/btashton/status/1586381334439923713?t=w5xRRUR74HGK2O1Zg_aFyw&amp;amp;s=19 Brennan Ashton is porting Apache NuttX RTOS and OpenAMP (Asymmetric Multiprocessing) to BL808]&lt;br /&gt;
* [https://twitter.com/thanos_engine/status/1585153938092761093 Phone Concept for BL808]&lt;br /&gt;
&lt;br /&gt;
== Build==&lt;br /&gt;
&lt;br /&gt;
Open the terminal and create a new directory for the build:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
mkdir buildroot_bouffalo &amp;amp;&amp;amp; cd buildroot_bouffalo&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Clone the primary Buildroot repository and the specific Buildroot Bouffalo repository:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
git clone https://github.com/buildroot/buildroot&lt;br /&gt;
git clone https://github.com/openbouffalo/buildroot_bouffalo&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Define an environment variable for the Buildroot Bouffalo overlay path:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
export BR_BOUFFALO_OVERLAY_PATH=$(pwd)/buildroot_bouffalo&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Change directory into the cloned Buildroot folder:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
cd buildroot&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Apply the default configuration for Pine64 Ox64:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
make BR2_EXTERNAL=$BR_BOUFFALO_OVERLAY_PATH pine64_ox64_defconfig&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Use the &amp;lt;code&amp;gt;menuconfig&amp;lt;/code&amp;gt; tool to adjust build settings:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
make menuconfig&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
'''Note''': Within &amp;lt;code&amp;gt;menuconfig&amp;lt;/code&amp;gt;:&lt;br /&gt;
* Navigate to &amp;lt;code&amp;gt;Target Architecture&amp;lt;/code&amp;gt;&lt;br /&gt;
* Enable &amp;lt;code&amp;gt;Integer Multiplication and Division (M)&amp;lt;/code&amp;gt;&lt;br /&gt;
* Enable &amp;lt;code&amp;gt;Atomic Instructions (A)&amp;lt;/code&amp;gt;&lt;br /&gt;
* Enable &amp;lt;code&amp;gt;Single-precision Floating-point (F)&amp;lt;/code&amp;gt;&lt;br /&gt;
* Enable &amp;lt;code&amp;gt;Double-precision Floating-point (D)&amp;lt;/code&amp;gt;&lt;br /&gt;
* Set &amp;lt;code&amp;gt;Target ABI&amp;lt;/code&amp;gt; to &amp;lt;code&amp;gt;lp64d&amp;lt;/code&amp;gt;&lt;br /&gt;
[[File:target ABI setting.png|thumb|right|200px|target ABI setting]]&lt;br /&gt;
* Under &amp;lt;code&amp;gt;Toolchain&amp;lt;/code&amp;gt;, enable &amp;lt;code&amp;gt;Fortran support&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;OpenMP support&amp;lt;/code&amp;gt;&lt;br /&gt;
[[File:toolchain setting.png|thumb|right|200px|toolchain setting]]&lt;br /&gt;
&lt;br /&gt;
Initiate the build process:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
make&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
'''Note''': Before executing the &amp;lt;code&amp;gt;make&amp;lt;/code&amp;gt; command, ensure your &amp;lt;code&amp;gt;PATH&amp;lt;/code&amp;gt; variable doesn't have spaces.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Flashing Ox64 SBC and SD Card for Newbies==&lt;br /&gt;
This section explains how to flash Ox64 board and the SD card to boot the system. It's very low level for newbies.&lt;br /&gt;
&lt;br /&gt;
[[File:Pine Serial v2.png|thumb|right|200px|Wiring Raspberry Pico Pi to Pine64 Ox64 SBC]]&lt;br /&gt;
&lt;br /&gt;
=== Prepare the Environment === &lt;br /&gt;
You need a Linux machine, a Uart module (i.e Raspberry Pico Pi), the Ox64 board and a SD card.&lt;br /&gt;
&lt;br /&gt;
Start a terminal session and set the working directory&lt;br /&gt;
 cd ~/Downloads&lt;br /&gt;
 mkdir ox64 ox64/devcube183&lt;br /&gt;
 cd ~/Downloads/ox64/devcube183&lt;br /&gt;
&lt;br /&gt;
Get flasher DevCube 1.8.3 from one of mirrored servers and decompress it:&lt;br /&gt;
* https://openbouffalo.org/static-assets/bldevcube/BouffaloLabDevCube-v1.8.3.zip&lt;br /&gt;
* https://hachyderm.io/@mkroman/110787218805897192 &amp;gt; https://pub.rwx.im/~mk/bouffalolab/BouffaloLabDevCube-v1.8.3.zip&lt;br /&gt;
* https://we.tl/t-eJWShQJ4iF&lt;br /&gt;
* https://cdn.discordapp.com/attachments/771032441971802142/1145565853962735639/BouffaloLabDevCube-v1.8.3.zip&lt;br /&gt;
&lt;br /&gt;
''SHA1: 0f2619e87d946f936f63ae97b0efd674357b1166''&lt;br /&gt;
&lt;br /&gt;
''SHA256SUMS: e6e6db316359da40d29971a1889d41c9e97d5b1ff1a8636e9e6960b6ff960913''&lt;br /&gt;
&lt;br /&gt;
 wget https://openbouffalo.org/static-assets/bldevcube/BouffaloLabDevCube-v1.8.3.zip&lt;br /&gt;
 unzip BouffaloLabDevCube-v1.8.3.zip&lt;br /&gt;
 chmod u+x BLDevCube-ubuntu&lt;br /&gt;
&lt;br /&gt;
Download compressed file from https://github.com/openbouffalo/buildroot_bouffalo/releases/ and decompress it.&lt;br /&gt;
&lt;br /&gt;
(You can also get the compressed the file from https://github.com/openbouffalo/buildroot_bouffalo/releases/download/v1.0.1/bl808-linux-pine64_ox64_full_defconfig.tar.gz)&lt;br /&gt;
&lt;br /&gt;
 cd ~/Downloads/ox64&lt;br /&gt;
 mkdir openbouffalo &amp;amp;&amp;amp; cd openbouffalo&lt;br /&gt;
 wget https://github.com/openbouffalo/buildroot_bouffalo/releases/download/v1.0.1/bl808-linux-pine64_ox64_full_defconfig.tar.gz&lt;br /&gt;
 tar -xvzf bl808-linux-pine64_ox64_full_defconfig.tar.gz&lt;br /&gt;
&lt;br /&gt;
 You'll get this structure&lt;br /&gt;
   |_ firmware/&lt;br /&gt;
   |_ firmware/m0_lowload_bl808_m0.bin&lt;br /&gt;
   |_ firmware/bl808-firmware.bin&lt;br /&gt;
   |_ firmware/d0_lowload_bl808_d0.bin&lt;br /&gt;
   |_ firmware/sdcard-pine64_ox64_full_defconfig.img.xz&lt;br /&gt;
&lt;br /&gt;
=== Flash Ox64  === &lt;br /&gt;
Connect the the Uart module (i.e Raspberry Pico Pi) for serial communicate from PC to Ox64&lt;br /&gt;
&lt;br /&gt;
 ls /dev/ttyACM*&lt;br /&gt;
&lt;br /&gt;
There are two new ports to choose from : /dev/ttyACM0  /dev/ttyACM1, use the lower number.&lt;br /&gt;
&lt;br /&gt;
 minicom -b 2000000 -D /dev/ttyACM0&lt;br /&gt;
&lt;br /&gt;
Set ox64 board to programming mode&lt;br /&gt;
&lt;br /&gt;
* Press BOOT button&lt;br /&gt;
* Apply power&lt;br /&gt;
* Release BOOT button&lt;br /&gt;
&lt;br /&gt;
Close minicom. Open a new terminal window to run DevCube flasher&lt;br /&gt;
&lt;br /&gt;
 cd ~/Downloads/ox64/devcube183&lt;br /&gt;
 ./BLDevCube-ubuntu&lt;br /&gt;
&lt;br /&gt;
Select chip [BL808], press Finish and switch to [MCU] tab&lt;br /&gt;
&lt;br /&gt;
 M0 Group[group0] Image Addr [0x58000000] [PATH to m0_lowload_bl808_m0.bin]&lt;br /&gt;
 D0 Group[group0] Image Addr [0x58100000] [PATH to d0_lowload_bl808_d0.bin]&lt;br /&gt;
 Interface: Uart&lt;br /&gt;
 Port/SN: /dev/ttyACM1&lt;br /&gt;
 Uart rate 2000000&lt;br /&gt;
 UART TX is physical pin 1/GPIO 14.&lt;br /&gt;
 UART RX is physical pin 2/GPIO 15.&lt;br /&gt;
 Click 'Create &amp;amp; Download' and wait until it's done&lt;br /&gt;
&lt;br /&gt;
Switch to [IOT] tab&lt;br /&gt;
 Enable 'Single Download', set Address with 0x800000, choose [PATH to bl808-firmware.bin]&lt;br /&gt;
 Click 'Create &amp;amp; Download' again and wait until it's done&lt;br /&gt;
 Close DevCube&lt;br /&gt;
&lt;br /&gt;
=== Alternative: Open-Source Flashing ===&lt;br /&gt;
For those who do not want to use the DevCube, BouffaloLab provide open-source flashing packages &amp;amp;mdash; &amp;lt;code&amp;gt;bflb-iot-tool&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;bflb-mcu-tool&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
: Note: While these packages do contain binaries in addition to the Python source code, those binaries do not appear to be used for UART flashing.&lt;br /&gt;
&lt;br /&gt;
Execute the following commands to flash the BL808. Note that the addresses are different to the ones you would use in the DevCube.&lt;br /&gt;
&lt;br /&gt;
: Reminder: UART TX is physical pin 1/GPIO 14, UART RX is physical pin 2/GPIO 15.&lt;br /&gt;
 pip install bflb-iot-tool # we are *not* using bflb-mcu-tool&lt;br /&gt;
 &lt;br /&gt;
 bflb-iot-tool --chipname bl808 --interface uart --port /dev/ttyACM0 --addr 0x000000 --firmware firmware/m0_lowload_bl808_m0.bin --single&lt;br /&gt;
 bflb-iot-tool --chipname bl808 --interface uart --port /dev/ttyACM0 --addr 0x100000 --firmware firmware/d0_lowload_bl808_d0.bin --single&lt;br /&gt;
 bflb-iot-tool --chipname bl808 --interface uart --port /dev/ttyACM0 --addr 0x800000 --firmware firmware/bl808-firmware.bin --single&lt;br /&gt;
&lt;br /&gt;
=== Flash SD Card ===&lt;br /&gt;
Insert SD card into PC, find address [/dev/sdb], erase initial space and flash sdcard.xxxx.img file.&lt;br /&gt;
&lt;br /&gt;
 cd ~/Downloads/ox64/openbouffalo/firmware&lt;br /&gt;
 xz -v -d -k sdcard-pine64_ox64_full_defconfig.img.xz&lt;br /&gt;
 sudo dd if=/dev/zero of=/dev/sdb count=1 bs=32768 &lt;br /&gt;
 sudo dd if=~/Downloads/ox64/openbouffalo/firmware/sdcard-pine64_ox64_full_defconfig.img of=/dev/sdb bs=1M status=progress conv=fsync&lt;br /&gt;
&lt;br /&gt;
=== First Booting ===&lt;br /&gt;
&lt;br /&gt;
Insert SD card into Ox64 and set a tty connection to Ox64 board&lt;br /&gt;
* Serial Console access:&lt;br /&gt;
* UART TX is physical pin 32/GPIO 16.&lt;br /&gt;
* UART RX is physical pin 31/GPIO 17.&lt;br /&gt;
* Baud 2000000.&lt;br /&gt;
&lt;br /&gt;
 minicom -b 2000000 -D /dev/ttyACM0&lt;br /&gt;
&lt;br /&gt;
Re-Apply power to ox64&lt;br /&gt;
&lt;br /&gt;
Enjoy the boot!&lt;br /&gt;
&lt;br /&gt;
PS. To investigate running services&lt;br /&gt;
 pstree | head -5&lt;br /&gt;
   init-+-dhcpcd---3*[dhcpcd]&lt;br /&gt;
        |-dropbear&lt;br /&gt;
        |-klogd&lt;br /&gt;
        |-login---sh-+-head&lt;br /&gt;
        |            `-pstree&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Category:Ox64]] [[Category:Bouffalo BL808]]&lt;/div&gt;</summary>
		<author><name>Lupyuen</name></author>
	</entry>
	<entry>
		<id>https://wiki.pine64.org/index.php?title=Ox64&amp;diff=21183</id>
		<title>Ox64</title>
		<link rel="alternate" type="text/html" href="https://wiki.pine64.org/index.php?title=Ox64&amp;diff=21183"/>
		<updated>2023-12-16T23:07:37Z</updated>

		<summary type="html">&lt;p&gt;Lupyuen: Add article &amp;quot;$8 RISC-V SBC on a Real-Time Operating System: Ox64 + NuttX&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[File:Ox64_board.jpg|thumb|right|The Ox64]]&lt;br /&gt;
[[File:Ox64 pinout.png|thumb|Pinout of the production version]]&lt;br /&gt;
[[File:RISC-V.png|thumb|right|Powered by RISC-V]]&lt;br /&gt;
&lt;br /&gt;
The '''Ox64''' is a RISC-V based single-board computer based on the Bouffalo Lab BL808 RISC-V SoC with C906 64-bit and E907/E902 32-bit CPU cores supported by 64 MB of embedded PSRAM memory, and with built-in WiFi, Bluetooh and Zigbee radio interfaces. The Ox64 comes in a breadboard-friendly form-factor, has a microSD card slot, a USB 2.0 Type-C port, and many other peripheral interfaces for makers to integrate with sensors and other devices.&lt;br /&gt;
&lt;br /&gt;
== Software Releases ==&lt;br /&gt;
&lt;br /&gt;
=== Quick Links to the Source of OS Images Build ===&lt;br /&gt;
&lt;br /&gt;
There is a community effort to bring updated kernels, peripherals and buildroot - Lots of communication happening in the #ox64-nutcracker channel. &lt;br /&gt;
&lt;br /&gt;
* [https://github.com/openbouffalo/buildroot_bouffalo buildroot] bringing all the work below together with a bootable kernel and updated filesystem images for SD cards &lt;br /&gt;
* [https://github.com/smaeul/u-boot/tree/bl808 U-Boot] and [https://github.com/smaeul/opensbi/tree/bl808 OpenSBI] work by Smauel&lt;br /&gt;
* [https://github.com/arm000/linux-bl808/tree/linux-next/mboxic Kernel] IRQChip, SDCard, and (WIP) USB by arm000, Alexander Horner and others&lt;br /&gt;
* [https://github.com/openbouffalo/OBLFR OpenBouffalo Firmware] low_load drivers by Fishwaldo and others&lt;br /&gt;
&lt;br /&gt;
Original Linux Images provided by Bouffalo - Very basic '''alpha build''' which are only fit for board bring up and testing purposes. &lt;br /&gt;
&lt;br /&gt;
* [https://github.com/bouffalolab/bl808_linux Linux for BL808]&lt;br /&gt;
* [https://wiki.pine64.org/wiki/File:Linux_BL808.pdf Installation Instructions for Linux on BL808 (Chinese)]&lt;br /&gt;
* [https://wiki.pine64.org/wiki/File:Linux_BL808_en.pdf Installation Instructions for Linux on BL808 (machine translated to English)]&lt;br /&gt;
&lt;br /&gt;
Toolchain:&lt;br /&gt;
&lt;br /&gt;
* elf_newlib_toolchain/bin/riscv64-unknown-elf-gcc (Xuantie-900 elf newlib gcc Toolchain V2.2.5 B-20220323) 10.2.0&lt;br /&gt;
* linux_toolchain/bin/riscv64-unknown-linux-gnu-gcc (Xuantie-900 linux-5.10.4 glibc gcc Toolchain V2.2.4 B-20211227) 10.2.0&lt;br /&gt;
* cmake version 3.19.3&lt;br /&gt;
&lt;br /&gt;
=== Software Development Kits ===&lt;br /&gt;
* [https://github.com/bouffalolab/bl_mcu_sdk BL808 MCU SDK]&lt;br /&gt;
* [https://dev.bouffalolab.com/download BLDevCube Flashing Tool for Windows, macOS and Ubuntu x64]&lt;br /&gt;
* [https://wiki.pine64.org/wiki/File:Ox64_BL808UART_connect.pdf Ox64 UART Flashing Guide], see the [https://gist.github.com/lupyuen/7a0c697b89abccda8e38b33dfe5ebaff notes]&lt;br /&gt;
* [https://github.com/lupyuen/lupyuen.github.io/releases/download/ox64/bl808_demo_event.bin BL808 Demo Firmware: bl808_demo_event.bin], see the [https://gist.github.com/lupyuen/7a0c697b89abccda8e38b33dfe5ebaff notes]&lt;br /&gt;
* [https://github.com/lupyuen/lupyuen.github.io/releases/download/ox64/whole_flash_data.bin BL808 UART Log Firmware: whole_flash_data.bin], see the [https://gist.github.com/lupyuen/7a0c697b89abccda8e38b33dfe5ebaff notes]&lt;br /&gt;
* [https://github.com/lupyuen/lupyuen.github.io/releases/download/ox64/BL808.DVK.Quick.Start.pdf BL808 DVK Quick Start]&lt;br /&gt;
* [https://github.com/bouffalolab/bl808_linux/tree/main/opensbi-0.6-808 OpenSBI for BL808]&lt;br /&gt;
* [https://github.com/bouffalolab/bl-pac/tree/main/bl808 Rust Peripheral Access Crate (PAC) for BL808]&lt;br /&gt;
* [https://github.com/bouffalolab/bl-pac/blob/main/bl808/bl808.svd System View Description (SVD) for BL808]&lt;br /&gt;
&lt;br /&gt;
== SoC and Memory Specification ==&lt;br /&gt;
&lt;br /&gt;
[[File:Bouffalo_Lab_icon.png|right]]&lt;br /&gt;
&lt;br /&gt;
Based on the [https://en.bouffalolab.com/product/ Bouffalo Lab BL808]&lt;br /&gt;
&lt;br /&gt;
[[File:BL808_Block_Diagram.jpg|500px]]&lt;br /&gt;
&lt;br /&gt;
=== CPU Architecture ===&lt;br /&gt;
&lt;br /&gt;
[[File:T-Head.png|right|200px]]&lt;br /&gt;
&lt;br /&gt;
T-Head C906 480 MHz 64-bit RISC-V CPU:&lt;br /&gt;
&lt;br /&gt;
* Supports RISC-V RV64IMAFCV instruction architecture&lt;br /&gt;
* Five-stage single-issue sequentially executed pipeline&lt;br /&gt;
* Level-1 instruction and data cache of Harvard architecture, with a size of 32 KB and a cache line of 64B&lt;br /&gt;
* Sv39 memory management unit, realizing the conversion of virtual and real addresses and memory management&lt;br /&gt;
* jTLB that supports 128 entries&lt;br /&gt;
* Supports AXI 4.0 128-bit master interface&lt;br /&gt;
* Supports core local interrupt (CLINT) and platform-level interrupt controller (PLIC)&lt;br /&gt;
* With 80 external interrupt sources, 3 bits for configuring interrupt priority&lt;br /&gt;
* Supports BHT (8K) and BTB&lt;br /&gt;
* Compatible with RISC-V PMP, 8 configurable areas&lt;br /&gt;
* Supports hardware performance monitor (HPM) units&lt;br /&gt;
* See [https://www.t-head.cn/product/c906?lang=en here]&lt;br /&gt;
&lt;br /&gt;
T-Head E907 320 MHz 32-bit RISC-V CPU:&lt;br /&gt;
&lt;br /&gt;
* Supports RISC-V RV32IMAFCP instruction set&lt;br /&gt;
* Supports RISC-V 32-bit/16-bit mixed instruction set&lt;br /&gt;
* Supports RISC-V machine mode and user mode&lt;br /&gt;
* Thirty-two 32-bit integer general purpose registers (GPR) and thirty-two 32-bit/64-bit floating-point GPRs&lt;br /&gt;
* Integer (5-stage)/floating-point (7-stage), single-issue, sequentially executed pipeline&lt;br /&gt;
* Supports AXI 4.0 main device interface and AHB 5.0 peripheral interface&lt;br /&gt;
* 32K instruction cache, two-way set associative structure&lt;br /&gt;
* 16K data cache, two-way set associative structure&lt;br /&gt;
* See [https://www.t-head.cn/product/e907?lang=en here]&lt;br /&gt;
&lt;br /&gt;
T-Head E902 150 MHz 32-bit RISC-V CPU:&lt;br /&gt;
&lt;br /&gt;
* See [https://www.t-head.cn/product/e902?lang=en here]&lt;br /&gt;
&lt;br /&gt;
=== System Memory ===&lt;br /&gt;
* Embedded 64MB PSRAM&lt;br /&gt;
&lt;br /&gt;
== Board Features ==&lt;br /&gt;
&lt;br /&gt;
=== Network ===&lt;br /&gt;
* 2.4 GHz 1T1R WiFi 802.11 b/g/n&lt;br /&gt;
* Bluetooth 5.2&lt;br /&gt;
* Zigbee&lt;br /&gt;
* 10/100 Mbit/s Ethernet (optional, on expansion board)&lt;br /&gt;
&lt;br /&gt;
=== Storage ===&lt;br /&gt;
* On-board 16 Mbit (2 MB) or 128 Mbit (16 MB) XSPI NOR flash memory&lt;br /&gt;
* MicroSD, supports SDHC and SDXC (only on the 128 Mbit version)&lt;br /&gt;
&lt;br /&gt;
=== Expansion Ports ===&lt;br /&gt;
* USB 2.0 OTG port&lt;br /&gt;
* 26 GPIO pins, including SPI, I&amp;lt;sup&amp;gt;2&amp;lt;/sup&amp;gt;C and UART functionality, possible I&amp;lt;sup&amp;gt;2&amp;lt;/sup&amp;gt;S and GMII expansion&lt;br /&gt;
* Dual-lane MiPi CSI port, located at USB-C port, for camera module&lt;br /&gt;
&lt;br /&gt;
=== Audio ===&lt;br /&gt;
* Microphone (optional, on the camera module)&lt;br /&gt;
* Speaker (optional, on the camera module)&lt;br /&gt;
&lt;br /&gt;
== Board Information, Schematics and Certifications ==&lt;br /&gt;
[[File:Ox64 ethphy.png|thumb|Pinout for wiring ethernet PHY to EMAC]]&lt;br /&gt;
&lt;br /&gt;
* Baseboard dimensions: 51 mm x 21 mm x 19 mm x 3.5 mm (breadboard friendly)&lt;br /&gt;
* Input power: 5 V, 0.5 A through the microUSB or USB-C ports&lt;br /&gt;
&lt;br /&gt;
Production version schematic:&lt;br /&gt;
&lt;br /&gt;
* [https://files.pine64.org/doc/ox64/PINE64_Ox64-Schematic-202221018.pdf Ox64 Schematic 20221018 v1.1]&lt;br /&gt;
* [https://files.pine64.org/doc/ox64/PINE64_Ox64_PCB_Placement-Top-20221018.pdf Ox64 PCB Component placement(ToP) 20221018 v1.1]&lt;br /&gt;
* [https://files.pine64.org/doc/ox64/PINE64_Ox64_PCB_Placement-Bottom-20221018.pdf Ox64 PCB Component placement(Bottom) 20221018 v1.1]&lt;br /&gt;
&lt;br /&gt;
Prototype (dispatched to developers) schematic:&lt;br /&gt;
* [https://files.pine64.org/doc/ox64/PINE64_Ox64-Schematic-202221007.pdf Ox64 Schematic 20221007 v1.0]&lt;br /&gt;
* [https://files.pine64.org/doc/ox64/PINE64_Ox64_PCB_Placement-Top-20221007.pdf Ox64 PCB Component placement(ToP) 20221007 v1.0]&lt;br /&gt;
* [https://files.pine64.org/doc/ox64/PINE64_Ox64_PCB_Placement-Bottom-20221007.pdf Ox64 PCB Component placement(Bottom) 20221007 v1.0]&lt;br /&gt;
&lt;br /&gt;
Certifications:&lt;br /&gt;
* Disclaimer: Please note that PINE64 SBC is not a &amp;quot;final&amp;quot; product and in general certification is not necessary.&lt;br /&gt;
* Not yet available&lt;br /&gt;
&lt;br /&gt;
== Datasheets for Components and Peripherals ==&lt;br /&gt;
&lt;br /&gt;
Bouffalo BL808 SoC information:&lt;br /&gt;
* [https://raw.githubusercontent.com/bouffalolab/bl_docs/main/BL808_DS/en/BL808_DS_1.2_en.pdf Bouffalo Lab BL808 SoC Datasheet]&lt;br /&gt;
* [https://raw.githubusercontent.com/bouffalolab/bl_docs/main/BL808_RM/en/BL808_RM_en_1.3.pdf Bouffalo Lab BL808 SoC Reference Manual]&lt;br /&gt;
&lt;br /&gt;
SPI NOR Flash information:&lt;br /&gt;
* [https://files.pine64.org/doc/datasheet/ox64/gd25lq16e_rev1.2_20210108.pdf GigaDevice 16Mb XSPI-Flash Datasheet]&lt;br /&gt;
* [https://files.pine64.org/doc/datasheet/star64/gd25lq128e_rev1.0_20210513.pdf GigaDevice 128Mb XSPI-Flash Datasheet]&lt;br /&gt;
* [https://wiki.pine64.org/images/5/5d/W25Q128JW_RevB_11042019-1761358.pdf Winbond 128Mb QSPI-Flash Datasheet] (W25Q128JWSQ)&lt;br /&gt;
&lt;br /&gt;
Power Regulator information:&lt;br /&gt;
* [https://files.pine64.org/doc/datasheet/ox64/IA2014-03.pdf Innovation Analog Tech IA2014 Step_down Converter Datasheet]&lt;br /&gt;
&lt;br /&gt;
MicroSD socket information:&lt;br /&gt;
* [https://files.pine64.org/doc/datasheet/ox64/TF%20PUSH%20type%20socket%20specification.pdf Push type microSD socket specification]&lt;br /&gt;
&lt;br /&gt;
== Compatible UARTs when in bootloader mode ==&lt;br /&gt;
&lt;br /&gt;
When the Ox64 is in bootloader mode, some UARTs are unable to communicate with it. When this is the case, utilities such as BLDevCube are unable to actually program the device. If you see &amp;quot;Shake hand fail&amp;quot; and an empty ack, and your device is in bootloader mode, then it is likely an incompatible UART.&lt;br /&gt;
&lt;br /&gt;
The below devices have been tested and verified as working:&lt;br /&gt;
* Raspberry Pi Pico - running the following [https://github.com/sanjay900/ox64-uart/releases/tag/v1.1 UART firmware] (GP4 and GP5 are used for port 0, GP12 and GP13 for port 1)&lt;br /&gt;
* Compiled binary for Pi Pico and connectivity diagram is [https://github.com/Kris-Sekula/Pine64_Ox64_SBC/tree/main/uart here] &lt;br /&gt;
* ESP32 with CP210x - bridge the EN pin to ground to disable the ESP32 itself, and then connect the TX on the esp32 to 14 on the Ox64 and RX to pin 15. Note that only baud rate 115200 works, and this doesn't seem to work for everyone)&lt;br /&gt;
* Stand-alone CP2102 dongle works at 115200 baud. Brand used was HiLetgo.&lt;br /&gt;
* STM32F401 BlackPill - running the [https://github.com/blackmagic-debug/blackmagic/tree/main/src/platforms/blackpillv2 Black Magic Debug] firmware&lt;br /&gt;
* STM32F103C8T6 BluePill - running Black Magic Debug.&lt;br /&gt;
* Some UART adapters based on the FT232H (note that the FT232RL does not work, and neither does the Pine 64 JTAG)&lt;br /&gt;
* Some CH340G based adapters work and some don't.&lt;br /&gt;
&lt;br /&gt;
== Resources and Articles ==&lt;br /&gt;
* [https://youtube.com/watch?v=czRtF-UNiEY A short video] on how to connect to the Ox64, flash and boot&lt;br /&gt;
* [https://youtu.be/vPAk5sq_Ilc Another video] that covers soldering pins, connecting via Pi Pico and flashing Linux and U-Boot&lt;br /&gt;
* [https://wiki.pine64.org/images/5/59/How_to_Run_Ox64.pdf Step-by-step tutorial] for how to build, flash and run Ox64&lt;br /&gt;
* [https://gist.github.com/lupyuen/7a0c697b89abccda8e38b33dfe5ebaff First batch of Ox64 won't appear as USB serial port]&lt;br /&gt;
* [https://gist.github.com/lupyuen/2087e9b3fb40aab5e0795bb02a265a3b First batch of Ox64 tested OK with CH340C/G]&lt;br /&gt;
* [https://www.robertlipe.com/bl808-not-symmetric/ First thoughts on the (a)symmetry of Bouffalo Labs BL808 as in Pine64 Ox64]&lt;br /&gt;
* [https://thelittleengineerthatcould.blogspot.com/2022/12/the-8-linux-computer-part-2.html The $8 linux computer (with picoprobe-rp2040 programming instructions)]&lt;br /&gt;
* [https://github.com/p4ddy1/pine_ox64/blob/main/build_toolchain_macos.md Building the Xuantie GNU Toolchain for Ox64 on macOS and Apple Silicon]&lt;br /&gt;
&lt;br /&gt;
Ox64 BL808 RISC-V SBC articles by [https://lupyuen.codeberg.page/ Lup Yuen LEE]:&lt;br /&gt;
* [https://lupyuen.codeberg.page/articles/ox64.html Booting Linux and (maybe) Apache NuttX RTOS]&lt;br /&gt;
* [https://lupyuen.codeberg.page/articles/ox2.html Starting Apache NuttX real-time operating system]&lt;br /&gt;
* [https://lupyuen.codeberg.page/articles/mmu.html Sv39 Memory Management Unit]&lt;br /&gt;
* [https://lupyuen.codeberg.page/articles/app.html NuttX Apps and Initial RAM Disk]&lt;br /&gt;
* [https://lupyuen.codeberg.page/articles/plic2.html UART Interrupt and Platform-Level Interrupt Controller (PLIC)]&lt;br /&gt;
* [https://lupyuen.codeberg.page/articles/plic3.html Fixing the UART Interrupt and Platform-Level Interrupt Controller]&lt;br /&gt;
* [https://www.hackster.io/lupyuen/8-risc-v-sbc-on-a-real-time-operating-system-ox64-nuttx-474358 $8 RISC-V SBC on a Real-Time Operating System: Ox64 + NuttX]&lt;br /&gt;
&lt;br /&gt;
Git repositories:&lt;br /&gt;
* [https://github.com/sfranzyshen/arduino-bl808 Community made Arduino Core specifically for the Bouffalo Labs BL808 RISC-V MCU] (initial development has been postponed until further notice)&lt;br /&gt;
&lt;br /&gt;
== Development Efforts ==&lt;br /&gt;
* [https://twitter.com/gamelaster/status/1583916501400068096 Ox64 boots Linux successfully]&lt;br /&gt;
* [https://twitter.com/btashton/status/1586381334439923713?t=w5xRRUR74HGK2O1Zg_aFyw&amp;amp;s=19 Brennan Ashton is porting Apache NuttX RTOS and OpenAMP (Asymmetric Multiprocessing) to BL808]&lt;br /&gt;
* [https://twitter.com/thanos_engine/status/1585153938092761093 Phone Concept for BL808]&lt;br /&gt;
&lt;br /&gt;
== Build==&lt;br /&gt;
&lt;br /&gt;
Open the terminal and create a new directory for the build:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
mkdir buildroot_bouffalo &amp;amp;&amp;amp; cd buildroot_bouffalo&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Clone the primary Buildroot repository and the specific Buildroot Bouffalo repository:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
git clone https://github.com/buildroot/buildroot&lt;br /&gt;
git clone https://github.com/openbouffalo/buildroot_bouffalo&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Define an environment variable for the Buildroot Bouffalo overlay path:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
export BR_BOUFFALO_OVERLAY_PATH=$(pwd)/buildroot_bouffalo&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Change directory into the cloned Buildroot folder:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
cd buildroot&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Apply the default configuration for Pine64 Ox64:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
make BR2_EXTERNAL=$BR_BOUFFALO_OVERLAY_PATH pine64_ox64_defconfig&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Use the &amp;lt;code&amp;gt;menuconfig&amp;lt;/code&amp;gt; tool to adjust build settings:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
make menuconfig&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
'''Note''': Within &amp;lt;code&amp;gt;menuconfig&amp;lt;/code&amp;gt;:&lt;br /&gt;
* Navigate to &amp;lt;code&amp;gt;Target Architecture&amp;lt;/code&amp;gt;&lt;br /&gt;
* Enable &amp;lt;code&amp;gt;Integer Multiplication and Division (M)&amp;lt;/code&amp;gt;&lt;br /&gt;
* Enable &amp;lt;code&amp;gt;Atomic Instructions (A)&amp;lt;/code&amp;gt;&lt;br /&gt;
* Enable &amp;lt;code&amp;gt;Single-precision Floating-point (F)&amp;lt;/code&amp;gt;&lt;br /&gt;
* Enable &amp;lt;code&amp;gt;Double-precision Floating-point (D)&amp;lt;/code&amp;gt;&lt;br /&gt;
* Set &amp;lt;code&amp;gt;Target ABI&amp;lt;/code&amp;gt; to &amp;lt;code&amp;gt;lp64d&amp;lt;/code&amp;gt;&lt;br /&gt;
[[File:target ABI setting.png|thumb|right|200px|target ABI setting]]&lt;br /&gt;
* Under &amp;lt;code&amp;gt;Toolchain&amp;lt;/code&amp;gt;, enable &amp;lt;code&amp;gt;Fortran support&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;OpenMP support&amp;lt;/code&amp;gt;&lt;br /&gt;
[[File:toolchain setting.png|thumb|right|200px|toolchain setting]]&lt;br /&gt;
&lt;br /&gt;
Initiate the build process:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
make&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
'''Note''': Before executing the &amp;lt;code&amp;gt;make&amp;lt;/code&amp;gt; command, ensure your &amp;lt;code&amp;gt;PATH&amp;lt;/code&amp;gt; variable doesn't have spaces.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Flashing Ox64 SBC and SD Card for Newbies==&lt;br /&gt;
This section explains how to flash Ox64 board and the SD card to boot the system. It's very low level for newbies.&lt;br /&gt;
&lt;br /&gt;
[[File:Pine Serial v2.png|thumb|right|200px|Wiring Raspberry Pico Pi to Pine64 Ox64 SBC]]&lt;br /&gt;
&lt;br /&gt;
=== Prepare the Environment === &lt;br /&gt;
You need a Linux machine, a Uart module (i.e Raspberry Pico Pi), the Ox64 board and a SD card.&lt;br /&gt;
&lt;br /&gt;
Start a terminal session and set the working directory&lt;br /&gt;
 cd ~/Downloads&lt;br /&gt;
 mkdir ox64 ox64/devcube183&lt;br /&gt;
 cd ~/Downloads/ox64/devcube183&lt;br /&gt;
&lt;br /&gt;
Get flasher DevCube 1.8.3 from one of mirrored servers and decompress it:&lt;br /&gt;
* https://openbouffalo.org/static-assets/bldevcube/BouffaloLabDevCube-v1.8.3.zip&lt;br /&gt;
* https://hachyderm.io/@mkroman/110787218805897192 &amp;gt; https://pub.rwx.im/~mk/bouffalolab/BouffaloLabDevCube-v1.8.3.zip&lt;br /&gt;
* https://we.tl/t-eJWShQJ4iF&lt;br /&gt;
* https://cdn.discordapp.com/attachments/771032441971802142/1145565853962735639/BouffaloLabDevCube-v1.8.3.zip&lt;br /&gt;
&lt;br /&gt;
''SHA1: 0f2619e87d946f936f63ae97b0efd674357b1166''&lt;br /&gt;
&lt;br /&gt;
''SHA256SUMS: e6e6db316359da40d29971a1889d41c9e97d5b1ff1a8636e9e6960b6ff960913''&lt;br /&gt;
&lt;br /&gt;
 wget https://openbouffalo.org/static-assets/bldevcube/BouffaloLabDevCube-v1.8.3.zip&lt;br /&gt;
 unzip BouffaloLabDevCube-v1.8.3.zip&lt;br /&gt;
 chmod u+x BLDevCube-ubuntu&lt;br /&gt;
&lt;br /&gt;
Download compressed file from https://github.com/openbouffalo/buildroot_bouffalo/releases/ and decompress it.&lt;br /&gt;
&lt;br /&gt;
(You can also get the compressed the file from https://github.com/openbouffalo/buildroot_bouffalo/releases/download/v1.0.1/bl808-linux-pine64_ox64_full_defconfig.tar.gz)&lt;br /&gt;
&lt;br /&gt;
 cd ~/Downloads/ox64&lt;br /&gt;
 mkdir openbouffalo &amp;amp;&amp;amp; cd openbouffalo&lt;br /&gt;
 wget https://github.com/openbouffalo/buildroot_bouffalo/releases/download/v1.0.1/bl808-linux-pine64_ox64_full_defconfig.tar.gz&lt;br /&gt;
 tar -xvzf bl808-linux-pine64_ox64_full_defconfig.tar.gz&lt;br /&gt;
&lt;br /&gt;
 You'll get this structure&lt;br /&gt;
   |_ firmware/&lt;br /&gt;
   |_ firmware/m0_lowload_bl808_m0.bin&lt;br /&gt;
   |_ firmware/bl808-firmware.bin&lt;br /&gt;
   |_ firmware/d0_lowload_bl808_d0.bin&lt;br /&gt;
   |_ firmware/sdcard-pine64_ox64_full_defconfig.img.xz&lt;br /&gt;
&lt;br /&gt;
=== Flash Ox64  === &lt;br /&gt;
Connect the the Uart module (i.e Raspberry Pico Pi) for serial communicate from PC to Ox64&lt;br /&gt;
&lt;br /&gt;
 ls /dev/ttyACM*&lt;br /&gt;
&lt;br /&gt;
There are two new ports to choose from : /dev/ttyACM0  /dev/ttyACM1, use the lower number.&lt;br /&gt;
&lt;br /&gt;
 minicom -b 2000000 -D /dev/ttyACM0&lt;br /&gt;
&lt;br /&gt;
Set ox64 board to programming mode&lt;br /&gt;
&lt;br /&gt;
* Press BOOT button&lt;br /&gt;
* Apply power&lt;br /&gt;
* Release BOOT button&lt;br /&gt;
&lt;br /&gt;
Close minicom. Open a new terminal window to run DevCube flasher&lt;br /&gt;
&lt;br /&gt;
 cd ~/Downloads/ox64/devcube183&lt;br /&gt;
 ./BLDevCube-ubuntu&lt;br /&gt;
&lt;br /&gt;
Select chip [BL808], press Finish and switch to [MCU] tab&lt;br /&gt;
&lt;br /&gt;
 M0 Group[group0] Image Addr [0x58000000] [PATH to m0_lowload_bl808_m0.bin]&lt;br /&gt;
 D0 Group[group0] Image Addr [0x58100000] [PATH to d0_lowload_bl808_d0.bin]&lt;br /&gt;
 Interface: Uart&lt;br /&gt;
 Port/SN: /dev/ttyACM1&lt;br /&gt;
 Uart rate 2000000&lt;br /&gt;
 UART TX is physical pin 1/GPIO 14.&lt;br /&gt;
 UART RX is physical pin 2/GPIO 15.&lt;br /&gt;
 Click 'Create &amp;amp; Download' and wait until it's done&lt;br /&gt;
&lt;br /&gt;
Switch to [IOT] tab&lt;br /&gt;
 Enable 'Single Download', set Address with 0x800000, choose [PATH to bl808-firmware.bin]&lt;br /&gt;
 Click 'Create &amp;amp; Download' again and wait until it's done&lt;br /&gt;
 Close DevCube&lt;br /&gt;
&lt;br /&gt;
=== Alternative: Open-Source Flashing ===&lt;br /&gt;
For those who do not want to use the DevCube, BouffaloLab provide open-source flashing packages &amp;amp;mdash; &amp;lt;code&amp;gt;bflb-iot-tool&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;bflb-mcu-tool&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
: Note: While these packages do contain binaries in addition to the Python source code, those binaries do not appear to be used for UART flashing.&lt;br /&gt;
&lt;br /&gt;
Execute the following commands to flash the BL808. Note that the addresses are different to the ones you would use in the DevCube.&lt;br /&gt;
&lt;br /&gt;
: Reminder: UART TX is physical pin 1/GPIO 14, UART RX is physical pin 2/GPIO 15.&lt;br /&gt;
 pip install bflb-iot-tool # we are *not* using bflb-mcu-tool&lt;br /&gt;
 &lt;br /&gt;
 bflb-iot-tool --chipname bl808 --interface uart --port /dev/ttyACM0 --addr 0x000000 --firmware firmware/m0_lowload_bl808_m0.bin --single&lt;br /&gt;
 bflb-iot-tool --chipname bl808 --interface uart --port /dev/ttyACM0 --addr 0x100000 --firmware firmware/d0_lowload_bl808_d0.bin --single&lt;br /&gt;
 bflb-iot-tool --chipname bl808 --interface uart --port /dev/ttyACM0 --addr 0x800000 --firmware firmware/bl808-firmware.bin --single&lt;br /&gt;
&lt;br /&gt;
=== Flash SD Card ===&lt;br /&gt;
Insert SD card into PC, find address [/dev/sdb], erase initial space and flash sdcard.xxxx.img file.&lt;br /&gt;
&lt;br /&gt;
 cd ~/Downloads/ox64/openbouffalo/firmware&lt;br /&gt;
 xz -v -d -k sdcard-pine64_ox64_full_defconfig.img.xz&lt;br /&gt;
 sudo dd if=/dev/zero of=/dev/sdb count=1 bs=32768 &lt;br /&gt;
 sudo dd if=~/Downloads/ox64/openbouffalo/firmware/sdcard-pine64_ox64_full_defconfig.img of=/dev/sdb bs=1M status=progress conv=fsync&lt;br /&gt;
&lt;br /&gt;
=== First Booting ===&lt;br /&gt;
&lt;br /&gt;
Insert SD card into Ox64 and set a tty connection to Ox64 board&lt;br /&gt;
* Serial Console access:&lt;br /&gt;
* UART TX is physical pin 32/GPIO 16.&lt;br /&gt;
* UART RX is physical pin 31/GPIO 17.&lt;br /&gt;
* Baud 2000000.&lt;br /&gt;
&lt;br /&gt;
 minicom -b 2000000 -D /dev/ttyACM0&lt;br /&gt;
&lt;br /&gt;
Re-Apply power to ox64&lt;br /&gt;
&lt;br /&gt;
Enjoy the boot!&lt;br /&gt;
&lt;br /&gt;
PS. To investigate running services&lt;br /&gt;
 pstree | head -5&lt;br /&gt;
   init-+-dhcpcd---3*[dhcpcd]&lt;br /&gt;
        |-dropbear&lt;br /&gt;
        |-klogd&lt;br /&gt;
        |-login---sh-+-head&lt;br /&gt;
        |            `-pstree&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Category:Ox64]] [[Category:Bouffalo BL808]]&lt;/div&gt;</summary>
		<author><name>Lupyuen</name></author>
	</entry>
	<entry>
		<id>https://wiki.pine64.org/index.php?title=Ox64&amp;diff=21170</id>
		<title>Ox64</title>
		<link rel="alternate" type="text/html" href="https://wiki.pine64.org/index.php?title=Ox64&amp;diff=21170"/>
		<updated>2023-12-09T23:34:48Z</updated>

		<summary type="html">&lt;p&gt;Lupyuen: Add article &amp;quot;Fixed the UART Interrupt and Platform-Level Interrupt Controller&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[File:Ox64_board.jpg|thumb|right|The Ox64]]&lt;br /&gt;
[[File:Ox64 pinout.png|thumb|Pinout of the production version]]&lt;br /&gt;
[[File:RISC-V.png|thumb|right|Powered by RISC-V]]&lt;br /&gt;
&lt;br /&gt;
The '''Ox64''' is a RISC-V based single-board computer based on the Bouffalo Lab BL808 RISC-V SoC with C906 64-bit and E907/E902 32-bit CPU cores supported by 64 MB of embedded PSRAM memory, and with built-in WiFi, Bluetooh and Zigbee radio interfaces. The Ox64 comes in a breadboard-friendly form-factor, has a microSD card slot, a USB 2.0 Type-C port, and many other peripheral interfaces for makers to integrate with sensors and other devices.&lt;br /&gt;
&lt;br /&gt;
== Software Releases ==&lt;br /&gt;
&lt;br /&gt;
=== Quick Links to the Source of OS Images Build ===&lt;br /&gt;
&lt;br /&gt;
There is a community effort to bring updated kernels, peripherals and buildroot - Lots of communication happening in the #ox64-nutcracker channel. &lt;br /&gt;
&lt;br /&gt;
* [https://github.com/openbouffalo/buildroot_bouffalo buildroot] bringing all the work below together with a bootable kernel and updated filesystem images for SD cards &lt;br /&gt;
* [https://github.com/smaeul/u-boot/tree/bl808 U-Boot] and [https://github.com/smaeul/opensbi/tree/bl808 OpenSBI] work by Smauel&lt;br /&gt;
* [https://github.com/arm000/linux-bl808/tree/linux-next/mboxic Kernel] IRQChip, SDCard, and (WIP) USB by arm000, Alexander Horner and others&lt;br /&gt;
* [https://github.com/openbouffalo/OBLFR OpenBouffalo Firmware] low_load drivers by Fishwaldo and others&lt;br /&gt;
&lt;br /&gt;
Original Linux Images provided by Bouffalo - Very basic '''alpha build''' which are only fit for board bring up and testing purposes. &lt;br /&gt;
&lt;br /&gt;
* [https://github.com/bouffalolab/bl808_linux Linux for BL808]&lt;br /&gt;
* [https://wiki.pine64.org/wiki/File:Linux_BL808.pdf Installation Instructions for Linux on BL808 (Chinese)]&lt;br /&gt;
* [https://wiki.pine64.org/wiki/File:Linux_BL808_en.pdf Installation Instructions for Linux on BL808 (machine translated to English)]&lt;br /&gt;
&lt;br /&gt;
Toolchain:&lt;br /&gt;
&lt;br /&gt;
* elf_newlib_toolchain/bin/riscv64-unknown-elf-gcc (Xuantie-900 elf newlib gcc Toolchain V2.2.5 B-20220323) 10.2.0&lt;br /&gt;
* linux_toolchain/bin/riscv64-unknown-linux-gnu-gcc (Xuantie-900 linux-5.10.4 glibc gcc Toolchain V2.2.4 B-20211227) 10.2.0&lt;br /&gt;
* cmake version 3.19.3&lt;br /&gt;
&lt;br /&gt;
=== Software Development Kits ===&lt;br /&gt;
* [https://github.com/bouffalolab/bl_mcu_sdk BL808 MCU SDK]&lt;br /&gt;
* [https://dev.bouffalolab.com/download BLDevCube Flashing Tool for Windows, macOS and Ubuntu x64]&lt;br /&gt;
* [https://wiki.pine64.org/wiki/File:Ox64_BL808UART_connect.pdf Ox64 UART Flashing Guide], see the [https://gist.github.com/lupyuen/7a0c697b89abccda8e38b33dfe5ebaff notes]&lt;br /&gt;
* [https://github.com/lupyuen/lupyuen.github.io/releases/download/ox64/bl808_demo_event.bin BL808 Demo Firmware: bl808_demo_event.bin], see the [https://gist.github.com/lupyuen/7a0c697b89abccda8e38b33dfe5ebaff notes]&lt;br /&gt;
* [https://github.com/lupyuen/lupyuen.github.io/releases/download/ox64/whole_flash_data.bin BL808 UART Log Firmware: whole_flash_data.bin], see the [https://gist.github.com/lupyuen/7a0c697b89abccda8e38b33dfe5ebaff notes]&lt;br /&gt;
* [https://github.com/lupyuen/lupyuen.github.io/releases/download/ox64/BL808.DVK.Quick.Start.pdf BL808 DVK Quick Start]&lt;br /&gt;
* [https://github.com/bouffalolab/bl808_linux/tree/main/opensbi-0.6-808 OpenSBI for BL808]&lt;br /&gt;
* [https://github.com/bouffalolab/bl-pac/tree/main/bl808 Rust Peripheral Access Crate (PAC) for BL808]&lt;br /&gt;
* [https://github.com/bouffalolab/bl-pac/blob/main/bl808/bl808.svd System View Description (SVD) for BL808]&lt;br /&gt;
&lt;br /&gt;
== SoC and Memory Specification ==&lt;br /&gt;
&lt;br /&gt;
[[File:Bouffalo_Lab_icon.png|right]]&lt;br /&gt;
&lt;br /&gt;
Based on the [https://en.bouffalolab.com/product/ Bouffalo Lab BL808]&lt;br /&gt;
&lt;br /&gt;
[[File:BL808_Block_Diagram.jpg|500px]]&lt;br /&gt;
&lt;br /&gt;
=== CPU Architecture ===&lt;br /&gt;
&lt;br /&gt;
[[File:T-Head.png|right|200px]]&lt;br /&gt;
&lt;br /&gt;
T-Head C906 480 MHz 64-bit RISC-V CPU:&lt;br /&gt;
&lt;br /&gt;
* Supports RISC-V RV64IMAFCV instruction architecture&lt;br /&gt;
* Five-stage single-issue sequentially executed pipeline&lt;br /&gt;
* Level-1 instruction and data cache of Harvard architecture, with a size of 32 KB and a cache line of 64B&lt;br /&gt;
* Sv39 memory management unit, realizing the conversion of virtual and real addresses and memory management&lt;br /&gt;
* jTLB that supports 128 entries&lt;br /&gt;
* Supports AXI 4.0 128-bit master interface&lt;br /&gt;
* Supports core local interrupt (CLINT) and platform-level interrupt controller (PLIC)&lt;br /&gt;
* With 80 external interrupt sources, 3 bits for configuring interrupt priority&lt;br /&gt;
* Supports BHT (8K) and BTB&lt;br /&gt;
* Compatible with RISC-V PMP, 8 configurable areas&lt;br /&gt;
* Supports hardware performance monitor (HPM) units&lt;br /&gt;
* See [https://www.t-head.cn/product/c906?lang=en here]&lt;br /&gt;
&lt;br /&gt;
T-Head E907 320 MHz 32-bit RISC-V CPU:&lt;br /&gt;
&lt;br /&gt;
* Supports RISC-V RV32IMAFCP instruction set&lt;br /&gt;
* Supports RISC-V 32-bit/16-bit mixed instruction set&lt;br /&gt;
* Supports RISC-V machine mode and user mode&lt;br /&gt;
* Thirty-two 32-bit integer general purpose registers (GPR) and thirty-two 32-bit/64-bit floating-point GPRs&lt;br /&gt;
* Integer (5-stage)/floating-point (7-stage), single-issue, sequentially executed pipeline&lt;br /&gt;
* Supports AXI 4.0 main device interface and AHB 5.0 peripheral interface&lt;br /&gt;
* 32K instruction cache, two-way set associative structure&lt;br /&gt;
* 16K data cache, two-way set associative structure&lt;br /&gt;
* See [https://www.t-head.cn/product/e907?lang=en here]&lt;br /&gt;
&lt;br /&gt;
T-Head E902 150 MHz 32-bit RISC-V CPU:&lt;br /&gt;
&lt;br /&gt;
* See [https://www.t-head.cn/product/e902?lang=en here]&lt;br /&gt;
&lt;br /&gt;
=== System Memory ===&lt;br /&gt;
* Embedded 64MB PSRAM&lt;br /&gt;
&lt;br /&gt;
== Board Features ==&lt;br /&gt;
&lt;br /&gt;
=== Network ===&lt;br /&gt;
* 2.4 GHz 1T1R WiFi 802.11 b/g/n&lt;br /&gt;
* Bluetooth 5.2&lt;br /&gt;
* Zigbee&lt;br /&gt;
* 10/100 Mbit/s Ethernet (optional, on expansion board)&lt;br /&gt;
&lt;br /&gt;
=== Storage ===&lt;br /&gt;
* On-board 16 Mbit (2 MB) or 128 Mbit (16 MB) XSPI NOR flash memory&lt;br /&gt;
* MicroSD, supports SDHC and SDXC (only on the 128 Mbit version)&lt;br /&gt;
&lt;br /&gt;
=== Expansion Ports ===&lt;br /&gt;
* USB 2.0 OTG port&lt;br /&gt;
* 26 GPIO pins, including SPI, I&amp;lt;sup&amp;gt;2&amp;lt;/sup&amp;gt;C and UART functionality, possible I&amp;lt;sup&amp;gt;2&amp;lt;/sup&amp;gt;S and GMII expansion&lt;br /&gt;
* Dual-lane MiPi CSI port, located at USB-C port, for camera module&lt;br /&gt;
&lt;br /&gt;
=== Audio ===&lt;br /&gt;
* Microphone (optional, on the camera module)&lt;br /&gt;
* Speaker (optional, on the camera module)&lt;br /&gt;
&lt;br /&gt;
== Board Information, Schematics and Certifications ==&lt;br /&gt;
[[File:Ox64 ethphy.png|thumb|Pinout for wiring ethernet PHY to EMAC]]&lt;br /&gt;
&lt;br /&gt;
* Baseboard dimensions: 51 mm x 21 mm x 19 mm x 3.5 mm (breadboard friendly)&lt;br /&gt;
* Input power: 5 V, 0.5 A through the microUSB or USB-C ports&lt;br /&gt;
&lt;br /&gt;
Production version schematic:&lt;br /&gt;
&lt;br /&gt;
* [https://files.pine64.org/doc/ox64/PINE64_Ox64-Schematic-202221018.pdf Ox64 Schematic 20221018 v1.1]&lt;br /&gt;
* [https://files.pine64.org/doc/ox64/PINE64_Ox64_PCB_Placement-Top-20221018.pdf Ox64 PCB Component placement(ToP) 20221018 v1.1]&lt;br /&gt;
* [https://files.pine64.org/doc/ox64/PINE64_Ox64_PCB_Placement-Bottom-20221018.pdf Ox64 PCB Component placement(Bottom) 20221018 v1.1]&lt;br /&gt;
&lt;br /&gt;
Prototype (dispatched to developers) schematic:&lt;br /&gt;
* [https://files.pine64.org/doc/ox64/PINE64_Ox64-Schematic-202221007.pdf Ox64 Schematic 20221007 v1.0]&lt;br /&gt;
* [https://files.pine64.org/doc/ox64/PINE64_Ox64_PCB_Placement-Top-20221007.pdf Ox64 PCB Component placement(ToP) 20221007 v1.0]&lt;br /&gt;
* [https://files.pine64.org/doc/ox64/PINE64_Ox64_PCB_Placement-Bottom-20221007.pdf Ox64 PCB Component placement(Bottom) 20221007 v1.0]&lt;br /&gt;
&lt;br /&gt;
Certifications:&lt;br /&gt;
* Disclaimer: Please note that PINE64 SBC is not a &amp;quot;final&amp;quot; product and in general certification is not necessary.&lt;br /&gt;
* Not yet available&lt;br /&gt;
&lt;br /&gt;
== Datasheets for Components and Peripherals ==&lt;br /&gt;
&lt;br /&gt;
Bouffalo BL808 SoC information:&lt;br /&gt;
* [https://raw.githubusercontent.com/bouffalolab/bl_docs/main/BL808_DS/en/BL808_DS_1.2_en.pdf Bouffalo Lab BL808 SoC Datasheet]&lt;br /&gt;
* [https://raw.githubusercontent.com/bouffalolab/bl_docs/main/BL808_RM/en/BL808_RM_en_1.3.pdf Bouffalo Lab BL808 SoC Reference Manual]&lt;br /&gt;
&lt;br /&gt;
SPI NOR Flash information:&lt;br /&gt;
* [https://files.pine64.org/doc/datasheet/ox64/gd25lq16e_rev1.2_20210108.pdf GigaDevice 16Mb XSPI-Flash Datasheet]&lt;br /&gt;
* [https://files.pine64.org/doc/datasheet/star64/gd25lq128e_rev1.0_20210513.pdf GigaDevice 128Mb XSPI-Flash Datasheet]&lt;br /&gt;
* [https://wiki.pine64.org/images/5/5d/W25Q128JW_RevB_11042019-1761358.pdf Winbond 128Mb QSPI-Flash Datasheet] (W25Q128JWSQ)&lt;br /&gt;
&lt;br /&gt;
Power Regulator information:&lt;br /&gt;
* [https://files.pine64.org/doc/datasheet/ox64/IA2014-03.pdf Innovation Analog Tech IA2014 Step_down Converter Datasheet]&lt;br /&gt;
&lt;br /&gt;
MicroSD socket information:&lt;br /&gt;
* [https://files.pine64.org/doc/datasheet/ox64/TF%20PUSH%20type%20socket%20specification.pdf Push type microSD socket specification]&lt;br /&gt;
&lt;br /&gt;
== Compatible UARTs when in bootloader mode ==&lt;br /&gt;
&lt;br /&gt;
When the Ox64 is in bootloader mode, some UARTs are unable to communicate with it. When this is the case, utilities such as BLDevCube are unable to actually program the device. If you see &amp;quot;Shake hand fail&amp;quot; and an empty ack, and your device is in bootloader mode, then it is likely an incompatible UART.&lt;br /&gt;
&lt;br /&gt;
The below devices have been tested and verified as working:&lt;br /&gt;
* Raspberry Pi Pico - running the following [https://github.com/sanjay900/ox64-uart/releases/tag/v1.1 UART firmware] (GP4 and GP5 are used for port 0, GP12 and GP13 for port 1)&lt;br /&gt;
* Compiled binary for Pi Pico and connectivity diagram is [https://github.com/Kris-Sekula/Pine64_Ox64_SBC/tree/main/uart here] &lt;br /&gt;
* ESP32 with CP210x - bridge the EN pin to ground to disable the ESP32 itself, and then connect the TX on the esp32 to 14 on the Ox64 and RX to pin 15. Note that only baud rate 115200 works, and this doesn't seem to work for everyone)&lt;br /&gt;
* Stand-alone CP2102 dongle works at 115200 baud. Brand used was HiLetgo.&lt;br /&gt;
* STM32F401 BlackPill - running the [https://github.com/blackmagic-debug/blackmagic/tree/main/src/platforms/blackpillv2 Black Magic Debug] firmware&lt;br /&gt;
* STM32F103C8T6 BluePill - running Black Magic Debug.&lt;br /&gt;
* Some UART adapters based on the FT232H (note that the FT232RL does not work, and neither does the Pine 64 JTAG)&lt;br /&gt;
* Some CH340G based adapters work and some don't.&lt;br /&gt;
&lt;br /&gt;
== Resources and Articles ==&lt;br /&gt;
* [https://youtube.com/watch?v=czRtF-UNiEY A short video] on how to connect to the Ox64, flash and boot&lt;br /&gt;
* [https://youtu.be/vPAk5sq_Ilc Another video] that covers soldering pins, connecting via Pi Pico and flashing Linux and U-Boot&lt;br /&gt;
* [https://wiki.pine64.org/images/5/59/How_to_Run_Ox64.pdf Step-by-step tutorial] for how to build, flash and run Ox64&lt;br /&gt;
* [https://gist.github.com/lupyuen/7a0c697b89abccda8e38b33dfe5ebaff First batch of Ox64 won't appear as USB serial port]&lt;br /&gt;
* [https://gist.github.com/lupyuen/2087e9b3fb40aab5e0795bb02a265a3b First batch of Ox64 tested OK with CH340C/G]&lt;br /&gt;
* [https://www.robertlipe.com/bl808-not-symmetric/ First thoughts on the (a)symmetry of Bouffalo Labs BL808 as in Pine64 Ox64]&lt;br /&gt;
* [https://thelittleengineerthatcould.blogspot.com/2022/12/the-8-linux-computer-part-2.html The $8 linux computer (with picoprobe-rp2040 programming instructions)]&lt;br /&gt;
* [https://github.com/p4ddy1/pine_ox64/blob/main/build_toolchain_macos.md Building the Xuantie GNU Toolchain for Ox64 on macOS and Apple Silicon]&lt;br /&gt;
&lt;br /&gt;
Ox64 BL808 RISC-V SBC articles by [https://lupyuen.codeberg.page/ Lup Yuen LEE]:&lt;br /&gt;
* [https://lupyuen.codeberg.page/articles/ox64.html Booting Linux and (maybe) Apache NuttX RTOS]&lt;br /&gt;
* [https://lupyuen.codeberg.page/articles/ox2.html Starting Apache NuttX real-time operating system]&lt;br /&gt;
* [https://lupyuen.codeberg.page/articles/mmu.html Sv39 Memory Management Unit]&lt;br /&gt;
* [https://lupyuen.codeberg.page/articles/app.html NuttX Apps and Initial RAM Disk]&lt;br /&gt;
* [https://lupyuen.codeberg.page/articles/plic2.html UART Interrupt and Platform-Level Interrupt Controller (PLIC)]&lt;br /&gt;
* [https://lupyuen.codeberg.page/articles/plic3.html Fixed the UART Interrupt and Platform-Level Interrupt Controller]&lt;br /&gt;
&lt;br /&gt;
Git repositories:&lt;br /&gt;
* [https://github.com/sfranzyshen/arduino-bl808 Community made Arduino Core specifically for the Bouffalo Labs BL808 RISC-V MCU] (initial development has been postponed until further notice)&lt;br /&gt;
&lt;br /&gt;
== Development Efforts ==&lt;br /&gt;
* [https://twitter.com/gamelaster/status/1583916501400068096 Ox64 boots Linux successfully]&lt;br /&gt;
* [https://twitter.com/btashton/status/1586381334439923713?t=w5xRRUR74HGK2O1Zg_aFyw&amp;amp;s=19 Brennan Ashton is porting Apache NuttX RTOS and OpenAMP (Asymmetric Multiprocessing) to BL808]&lt;br /&gt;
* [https://twitter.com/thanos_engine/status/1585153938092761093 Phone Concept for BL808]&lt;br /&gt;
&lt;br /&gt;
== Build==&lt;br /&gt;
&lt;br /&gt;
Open the terminal and create a new directory for the build:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
mkdir buildroot_bouffalo &amp;amp;&amp;amp; cd buildroot_bouffalo&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Clone the primary Buildroot repository and the specific Buildroot Bouffalo repository:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
git clone https://github.com/buildroot/buildroot&lt;br /&gt;
git clone https://github.com/openbouffalo/buildroot_bouffalo&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Define an environment variable for the Buildroot Bouffalo overlay path:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
export BR_BOUFFALO_OVERLAY_PATH=$(pwd)/buildroot_bouffalo&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Change directory into the cloned Buildroot folder:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
cd buildroot&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Apply the default configuration for Pine64 Ox64:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
make BR2_EXTERNAL=$BR_BOUFFALO_OVERLAY_PATH pine64_ox64_defconfig&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Use the &amp;lt;code&amp;gt;menuconfig&amp;lt;/code&amp;gt; tool to adjust build settings:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
make menuconfig&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
'''Note''': Within &amp;lt;code&amp;gt;menuconfig&amp;lt;/code&amp;gt;:&lt;br /&gt;
* Navigate to &amp;lt;code&amp;gt;Target Architecture&amp;lt;/code&amp;gt;&lt;br /&gt;
* Enable &amp;lt;code&amp;gt;Integer Multiplication and Division (M)&amp;lt;/code&amp;gt;&lt;br /&gt;
* Enable &amp;lt;code&amp;gt;Atomic Instructions (A)&amp;lt;/code&amp;gt;&lt;br /&gt;
* Enable &amp;lt;code&amp;gt;Single-precision Floating-point (F)&amp;lt;/code&amp;gt;&lt;br /&gt;
* Enable &amp;lt;code&amp;gt;Double-precision Floating-point (D)&amp;lt;/code&amp;gt;&lt;br /&gt;
* Set &amp;lt;code&amp;gt;Target ABI&amp;lt;/code&amp;gt; to &amp;lt;code&amp;gt;lp64d&amp;lt;/code&amp;gt;&lt;br /&gt;
[[File:target ABI setting.png|thumb|right|200px|target ABI setting]]&lt;br /&gt;
* Under &amp;lt;code&amp;gt;Toolchain&amp;lt;/code&amp;gt;, enable &amp;lt;code&amp;gt;Fortran support&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;OpenMP support&amp;lt;/code&amp;gt;&lt;br /&gt;
[[File:toolchain setting.png|thumb|right|200px|toolchain setting]]&lt;br /&gt;
&lt;br /&gt;
Initiate the build process:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
make&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
'''Note''': Before executing the &amp;lt;code&amp;gt;make&amp;lt;/code&amp;gt; command, ensure your &amp;lt;code&amp;gt;PATH&amp;lt;/code&amp;gt; variable doesn't have spaces.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Flashing Ox64 SBC and SD Card for Newbies==&lt;br /&gt;
This section explains how to flash Ox64 board and the SD card to boot the system. It's very low level for newbies.&lt;br /&gt;
&lt;br /&gt;
[[File:Pine Serial v2.png|thumb|right|200px|Wiring Raspberry Pico Pi to Pine64 Ox64 SBC]]&lt;br /&gt;
&lt;br /&gt;
=== Prepare the Environment === &lt;br /&gt;
You need a Linux machine, a Uart module (i.e Raspberry Pico Pi), the Ox64 board and a SD card.&lt;br /&gt;
&lt;br /&gt;
Start a terminal session and set the working directory&lt;br /&gt;
 cd ~/Downloads&lt;br /&gt;
 mkdir ox64 ox64/devcube183&lt;br /&gt;
 cd ~/Downloads/ox64/devcube183&lt;br /&gt;
&lt;br /&gt;
Get flasher DevCube 1.8.3 from one of mirrored servers and decompress it:&lt;br /&gt;
* https://openbouffalo.org/static-assets/bldevcube/BouffaloLabDevCube-v1.8.3.zip&lt;br /&gt;
* https://hachyderm.io/@mkroman/110787218805897192 &amp;gt; https://pub.rwx.im/~mk/bouffalolab/BouffaloLabDevCube-v1.8.3.zip&lt;br /&gt;
* https://we.tl/t-eJWShQJ4iF&lt;br /&gt;
* https://cdn.discordapp.com/attachments/771032441971802142/1145565853962735639/BouffaloLabDevCube-v1.8.3.zip&lt;br /&gt;
&lt;br /&gt;
''SHA1: 0f2619e87d946f936f63ae97b0efd674357b1166''&lt;br /&gt;
&lt;br /&gt;
''SHA256SUMS: e6e6db316359da40d29971a1889d41c9e97d5b1ff1a8636e9e6960b6ff960913''&lt;br /&gt;
&lt;br /&gt;
 wget https://openbouffalo.org/static-assets/bldevcube/BouffaloLabDevCube-v1.8.3.zip&lt;br /&gt;
 unzip BouffaloLabDevCube-v1.8.3.zip&lt;br /&gt;
 chmod u+x BLDevCube-ubuntu&lt;br /&gt;
&lt;br /&gt;
Download compressed file from https://github.com/openbouffalo/buildroot_bouffalo/releases/ and decompress it.&lt;br /&gt;
&lt;br /&gt;
(You can also get the compressed the file from https://github.com/openbouffalo/buildroot_bouffalo/releases/download/v1.0.1/bl808-linux-pine64_ox64_full_defconfig.tar.gz)&lt;br /&gt;
&lt;br /&gt;
 cd ~/Downloads/ox64&lt;br /&gt;
 mkdir openbouffalo &amp;amp;&amp;amp; cd openbouffalo&lt;br /&gt;
 wget https://github.com/openbouffalo/buildroot_bouffalo/releases/download/v1.0.1/bl808-linux-pine64_ox64_full_defconfig.tar.gz&lt;br /&gt;
 tar -xvzf bl808-linux-pine64_ox64_full_defconfig.tar.gz&lt;br /&gt;
&lt;br /&gt;
 You'll get this structure&lt;br /&gt;
   |_ firmware/&lt;br /&gt;
   |_ firmware/m0_lowload_bl808_m0.bin&lt;br /&gt;
   |_ firmware/bl808-firmware.bin&lt;br /&gt;
   |_ firmware/d0_lowload_bl808_d0.bin&lt;br /&gt;
   |_ firmware/sdcard-pine64_ox64_full_defconfig.img.xz&lt;br /&gt;
&lt;br /&gt;
=== Flash Ox64  === &lt;br /&gt;
Connect the the Uart module (i.e Raspberry Pico Pi) for serial communicate from PC to Ox64&lt;br /&gt;
&lt;br /&gt;
 ls /dev/ttyACM*&lt;br /&gt;
&lt;br /&gt;
There are two new ports to choose from : /dev/ttyACM0  /dev/ttyACM1, use the lower number.&lt;br /&gt;
&lt;br /&gt;
 minicom -b 2000000 -D /dev/ttyACM0&lt;br /&gt;
&lt;br /&gt;
Set ox64 board to programming mode&lt;br /&gt;
&lt;br /&gt;
* Press BOOT button&lt;br /&gt;
* Apply power&lt;br /&gt;
* Release BOOT button&lt;br /&gt;
&lt;br /&gt;
Close minicom. Open a new terminal window to run DevCube flasher&lt;br /&gt;
&lt;br /&gt;
 cd ~/Downloads/ox64/devcube183&lt;br /&gt;
 ./BLDevCube-ubuntu&lt;br /&gt;
&lt;br /&gt;
Select chip [BL808], press Finish and switch to [MCU] tab&lt;br /&gt;
&lt;br /&gt;
 M0 Group[group0] Image Addr [0x58000000] [PATH to m0_lowload_bl808_m0.bin]&lt;br /&gt;
 D0 Group[group0] Image Addr [0x58100000] [PATH to d0_lowload_bl808_d0.bin]&lt;br /&gt;
 Interface: Uart&lt;br /&gt;
 Port/SN: /dev/ttyACM1&lt;br /&gt;
 Uart rate 2000000&lt;br /&gt;
 UART TX is physical pin 1/GPIO 14.&lt;br /&gt;
 UART RX is physical pin 2/GPIO 15.&lt;br /&gt;
 Click 'Create &amp;amp; Download' and wait until it's done&lt;br /&gt;
&lt;br /&gt;
Switch to [IOT] tab&lt;br /&gt;
 Enable 'Single Download', set Address with 0x800000, choose [PATH to bl808-firmware.bin]&lt;br /&gt;
 Click 'Create &amp;amp; Download' again and wait until it's done&lt;br /&gt;
 Close DevCube&lt;br /&gt;
&lt;br /&gt;
=== Alternative: Open-Source Flashing ===&lt;br /&gt;
For those who do not want to use the DevCube, BouffaloLab provide open-source flashing packages &amp;amp;mdash; &amp;lt;code&amp;gt;bflb-iot-tool&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;bflb-mcu-tool&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
: Note: While these packages do contain binaries in addition to the Python source code, those binaries do not appear to be used for UART flashing.&lt;br /&gt;
&lt;br /&gt;
Execute the following commands to flash the BL808. Note that the addresses are different to the ones you would use in the DevCube.&lt;br /&gt;
&lt;br /&gt;
: Reminder: UART TX is physical pin 1/GPIO 14, UART RX is physical pin 2/GPIO 15.&lt;br /&gt;
 pip install bflb-iot-tool # we are *not* using bflb-mcu-tool&lt;br /&gt;
 &lt;br /&gt;
 bflb-iot-tool --chipname bl808 --interface uart --port /dev/ttyACM0 --addr 0x000000 --firmware firmware/m0_lowload_bl808_m0.bin --single&lt;br /&gt;
 bflb-iot-tool --chipname bl808 --interface uart --port /dev/ttyACM0 --addr 0x100000 --firmware firmware/d0_lowload_bl808_d0.bin --single&lt;br /&gt;
 bflb-iot-tool --chipname bl808 --interface uart --port /dev/ttyACM0 --addr 0x800000 --firmware firmware/bl808-firmware.bin --single&lt;br /&gt;
&lt;br /&gt;
=== Flash SD Card ===&lt;br /&gt;
Insert SD card into PC, find address [/dev/sdb], erase initial space and flash sdcard.xxxx.img file.&lt;br /&gt;
&lt;br /&gt;
 cd ~/Downloads/ox64/openbouffalo/firmware&lt;br /&gt;
 xz -v -d -k sdcard-pine64_ox64_full_defconfig.img.xz&lt;br /&gt;
 sudo dd if=/dev/zero of=/dev/sdb count=1 bs=32768 &lt;br /&gt;
 sudo dd if=~/Downloads/ox64/openbouffalo/firmware/sdcard-pine64_ox64_full_defconfig.img of=/dev/sdb bs=1M status=progress conv=fsync&lt;br /&gt;
&lt;br /&gt;
=== First Booting ===&lt;br /&gt;
&lt;br /&gt;
Insert SD card into Ox64 and set a tty connection to Ox64 board&lt;br /&gt;
* Serial Console access:&lt;br /&gt;
* UART TX is physical pin 32/GPIO 16.&lt;br /&gt;
* UART RX is physical pin 31/GPIO 17.&lt;br /&gt;
* Baud 2000000.&lt;br /&gt;
&lt;br /&gt;
 minicom -b 2000000 -D /dev/ttyACM0&lt;br /&gt;
&lt;br /&gt;
Re-Apply power to ox64&lt;br /&gt;
&lt;br /&gt;
Enjoy the boot!&lt;br /&gt;
&lt;br /&gt;
PS. To investigate running services&lt;br /&gt;
 pstree | head -5&lt;br /&gt;
   init-+-dhcpcd---3*[dhcpcd]&lt;br /&gt;
        |-dropbear&lt;br /&gt;
        |-klogd&lt;br /&gt;
        |-login---sh-+-head&lt;br /&gt;
        |            `-pstree&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Category:Ox64]] [[Category:Bouffalo BL808]]&lt;/div&gt;</summary>
		<author><name>Lupyuen</name></author>
	</entry>
	<entry>
		<id>https://wiki.pine64.org/index.php?title=Ox64&amp;diff=21160</id>
		<title>Ox64</title>
		<link rel="alternate" type="text/html" href="https://wiki.pine64.org/index.php?title=Ox64&amp;diff=21160"/>
		<updated>2023-12-02T23:08:14Z</updated>

		<summary type="html">&lt;p&gt;Lupyuen: Add article &amp;quot;UART Interrupt and Platform-Level Interrupt Controller (PLIC)&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[File:Ox64_board.jpg|thumb|right|The Ox64]]&lt;br /&gt;
[[File:Ox64 pinout.png|thumb|Pinout of the production version]]&lt;br /&gt;
[[File:RISC-V.png|thumb|right|Powered by RISC-V]]&lt;br /&gt;
&lt;br /&gt;
The '''Ox64''' is a RISC-V based single-board computer based on the Bouffalo Lab BL808 RISC-V SoC with C906 64-bit and E907/E902 32-bit CPU cores supported by 64 MB of embedded PSRAM memory, and with built-in WiFi, Bluetooh and Zigbee radio interfaces. The Ox64 comes in a breadboard-friendly form-factor, has a microSD card slot, a USB 2.0 Type-C port, and many other peripheral interfaces for makers to integrate with sensors and other devices.&lt;br /&gt;
&lt;br /&gt;
== Software Releases ==&lt;br /&gt;
&lt;br /&gt;
=== Quick Links to the Source of OS Images Build ===&lt;br /&gt;
&lt;br /&gt;
There is a community effort to bring updated kernels, peripherals and buildroot - Lots of communication happening in the #ox64-nutcracker channel. &lt;br /&gt;
&lt;br /&gt;
* [https://github.com/openbouffalo/buildroot_bouffalo buildroot] bringing all the work below together with a bootable kernel and updated filesystem images for SD cards &lt;br /&gt;
* [https://github.com/smaeul/u-boot/tree/bl808 U-Boot] and [https://github.com/smaeul/opensbi/tree/bl808 OpenSBI] work by Smauel&lt;br /&gt;
* [https://github.com/arm000/linux-bl808/tree/linux-next/mboxic Kernel] IRQChip, SDCard, and (WIP) USB by arm000, Alexander Horner and others&lt;br /&gt;
* [https://github.com/openbouffalo/OBLFR OpenBouffalo Firmware] low_load drivers by Fishwaldo and others&lt;br /&gt;
&lt;br /&gt;
Original Linux Images provided by Bouffalo - Very basic '''alpha build''' which are only fit for board bring up and testing purposes. &lt;br /&gt;
&lt;br /&gt;
* [https://github.com/bouffalolab/bl808_linux Linux for BL808]&lt;br /&gt;
* [https://wiki.pine64.org/wiki/File:Linux_BL808.pdf Installation Instructions for Linux on BL808 (Chinese)]&lt;br /&gt;
* [https://wiki.pine64.org/wiki/File:Linux_BL808_en.pdf Installation Instructions for Linux on BL808 (machine translated to English)]&lt;br /&gt;
&lt;br /&gt;
Toolchain:&lt;br /&gt;
&lt;br /&gt;
* elf_newlib_toolchain/bin/riscv64-unknown-elf-gcc (Xuantie-900 elf newlib gcc Toolchain V2.2.5 B-20220323) 10.2.0&lt;br /&gt;
* linux_toolchain/bin/riscv64-unknown-linux-gnu-gcc (Xuantie-900 linux-5.10.4 glibc gcc Toolchain V2.2.4 B-20211227) 10.2.0&lt;br /&gt;
* cmake version 3.19.3&lt;br /&gt;
&lt;br /&gt;
=== Software Development Kits ===&lt;br /&gt;
* [https://github.com/bouffalolab/bl_mcu_sdk BL808 MCU SDK]&lt;br /&gt;
* [https://dev.bouffalolab.com/download BLDevCube Flashing Tool for Windows, macOS and Ubuntu x64]&lt;br /&gt;
* [https://wiki.pine64.org/wiki/File:Ox64_BL808UART_connect.pdf Ox64 UART Flashing Guide], see the [https://gist.github.com/lupyuen/7a0c697b89abccda8e38b33dfe5ebaff notes]&lt;br /&gt;
* [https://github.com/lupyuen/lupyuen.github.io/releases/download/ox64/bl808_demo_event.bin BL808 Demo Firmware: bl808_demo_event.bin], see the [https://gist.github.com/lupyuen/7a0c697b89abccda8e38b33dfe5ebaff notes]&lt;br /&gt;
* [https://github.com/lupyuen/lupyuen.github.io/releases/download/ox64/whole_flash_data.bin BL808 UART Log Firmware: whole_flash_data.bin], see the [https://gist.github.com/lupyuen/7a0c697b89abccda8e38b33dfe5ebaff notes]&lt;br /&gt;
* [https://github.com/lupyuen/lupyuen.github.io/releases/download/ox64/BL808.DVK.Quick.Start.pdf BL808 DVK Quick Start]&lt;br /&gt;
* [https://github.com/bouffalolab/bl808_linux/tree/main/opensbi-0.6-808 OpenSBI for BL808]&lt;br /&gt;
* [https://github.com/bouffalolab/bl-pac/tree/main/bl808 Rust Peripheral Access Crate (PAC) for BL808]&lt;br /&gt;
* [https://github.com/bouffalolab/bl-pac/blob/main/bl808/bl808.svd System View Description (SVD) for BL808]&lt;br /&gt;
&lt;br /&gt;
== SoC and Memory Specification ==&lt;br /&gt;
&lt;br /&gt;
[[File:Bouffalo_Lab_icon.png|right]]&lt;br /&gt;
&lt;br /&gt;
Based on the [https://en.bouffalolab.com/product/ Bouffalo Lab BL808]&lt;br /&gt;
&lt;br /&gt;
[[File:BL808_Block_Diagram.jpg|500px]]&lt;br /&gt;
&lt;br /&gt;
=== CPU Architecture ===&lt;br /&gt;
&lt;br /&gt;
[[File:T-Head.png|right|200px]]&lt;br /&gt;
&lt;br /&gt;
T-Head C906 480 MHz 64-bit RISC-V CPU:&lt;br /&gt;
&lt;br /&gt;
* Supports RISC-V RV64IMAFCV instruction architecture&lt;br /&gt;
* Five-stage single-issue sequentially executed pipeline&lt;br /&gt;
* Level-1 instruction and data cache of Harvard architecture, with a size of 32 KB and a cache line of 64B&lt;br /&gt;
* Sv39 memory management unit, realizing the conversion of virtual and real addresses and memory management&lt;br /&gt;
* jTLB that supports 128 entries&lt;br /&gt;
* Supports AXI 4.0 128-bit master interface&lt;br /&gt;
* Supports core local interrupt (CLINT) and platform-level interrupt controller (PLIC)&lt;br /&gt;
* With 80 external interrupt sources, 3 bits for configuring interrupt priority&lt;br /&gt;
* Supports BHT (8K) and BTB&lt;br /&gt;
* Compatible with RISC-V PMP, 8 configurable areas&lt;br /&gt;
* Supports hardware performance monitor (HPM) units&lt;br /&gt;
* See [https://www.t-head.cn/product/c906?lang=en here]&lt;br /&gt;
&lt;br /&gt;
T-Head E907 320 MHz 32-bit RISC-V CPU:&lt;br /&gt;
&lt;br /&gt;
* Supports RISC-V RV32IMAFCP instruction set&lt;br /&gt;
* Supports RISC-V 32-bit/16-bit mixed instruction set&lt;br /&gt;
* Supports RISC-V machine mode and user mode&lt;br /&gt;
* Thirty-two 32-bit integer general purpose registers (GPR) and thirty-two 32-bit/64-bit floating-point GPRs&lt;br /&gt;
* Integer (5-stage)/floating-point (7-stage), single-issue, sequentially executed pipeline&lt;br /&gt;
* Supports AXI 4.0 main device interface and AHB 5.0 peripheral interface&lt;br /&gt;
* 32K instruction cache, two-way set associative structure&lt;br /&gt;
* 16K data cache, two-way set associative structure&lt;br /&gt;
* See [https://www.t-head.cn/product/e907?lang=en here]&lt;br /&gt;
&lt;br /&gt;
T-Head E902 150 MHz 32-bit RISC-V CPU:&lt;br /&gt;
&lt;br /&gt;
* See [https://www.t-head.cn/product/e902?lang=en here]&lt;br /&gt;
&lt;br /&gt;
=== System Memory ===&lt;br /&gt;
* Embedded 64MB PSRAM&lt;br /&gt;
&lt;br /&gt;
== Board Features ==&lt;br /&gt;
&lt;br /&gt;
=== Network ===&lt;br /&gt;
* 2.4 GHz 1T1R WiFi 802.11 b/g/n&lt;br /&gt;
* Bluetooth 5.2&lt;br /&gt;
* Zigbee&lt;br /&gt;
* 10/100 Mbit/s Ethernet (optional, on expansion board)&lt;br /&gt;
&lt;br /&gt;
=== Storage ===&lt;br /&gt;
* On-board 16 Mbit (2 MB) or 128 Mbit (16 MB) XSPI NOR flash memory&lt;br /&gt;
* MicroSD, supports SDHC and SDXC (only on the 128 Mbit version)&lt;br /&gt;
&lt;br /&gt;
=== Expansion Ports ===&lt;br /&gt;
* USB 2.0 OTG port&lt;br /&gt;
* 26 GPIO pins, including SPI, I&amp;lt;sup&amp;gt;2&amp;lt;/sup&amp;gt;C and UART functionality, possible I&amp;lt;sup&amp;gt;2&amp;lt;/sup&amp;gt;S and GMII expansion&lt;br /&gt;
* Dual-lane MiPi CSI port, located at USB-C port, for camera module&lt;br /&gt;
&lt;br /&gt;
=== Audio ===&lt;br /&gt;
* Microphone (optional, on the camera module)&lt;br /&gt;
* Speaker (optional, on the camera module)&lt;br /&gt;
&lt;br /&gt;
== Board Information, Schematics and Certifications ==&lt;br /&gt;
[[File:Ox64 ethphy.png|thumb|Pinout for wiring ethernet PHY to EMAC]]&lt;br /&gt;
&lt;br /&gt;
* Baseboard dimensions: 51 mm x 21 mm x 19 mm x 3.5 mm (breadboard friendly)&lt;br /&gt;
* Input power: 5 V, 0.5 A through the microUSB or USB-C ports&lt;br /&gt;
&lt;br /&gt;
Production version schematic:&lt;br /&gt;
&lt;br /&gt;
* [https://files.pine64.org/doc/ox64/PINE64_Ox64-Schematic-202221018.pdf Ox64 Schematic 20221018 v1.1]&lt;br /&gt;
* [https://files.pine64.org/doc/ox64/PINE64_Ox64_PCB_Placement-Top-20221018.pdf Ox64 PCB Component placement(ToP) 20221018 v1.1]&lt;br /&gt;
* [https://files.pine64.org/doc/ox64/PINE64_Ox64_PCB_Placement-Bottom-20221018.pdf Ox64 PCB Component placement(Bottom) 20221018 v1.1]&lt;br /&gt;
&lt;br /&gt;
Prototype (dispatched to developers) schematic:&lt;br /&gt;
* [https://files.pine64.org/doc/ox64/PINE64_Ox64-Schematic-202221007.pdf Ox64 Schematic 20221007 v1.0]&lt;br /&gt;
* [https://files.pine64.org/doc/ox64/PINE64_Ox64_PCB_Placement-Top-20221007.pdf Ox64 PCB Component placement(ToP) 20221007 v1.0]&lt;br /&gt;
* [https://files.pine64.org/doc/ox64/PINE64_Ox64_PCB_Placement-Bottom-20221007.pdf Ox64 PCB Component placement(Bottom) 20221007 v1.0]&lt;br /&gt;
&lt;br /&gt;
Certifications:&lt;br /&gt;
* Disclaimer: Please note that PINE64 SBC is not a &amp;quot;final&amp;quot; product and in general certification is not necessary.&lt;br /&gt;
* Not yet available&lt;br /&gt;
&lt;br /&gt;
== Datasheets for Components and Peripherals ==&lt;br /&gt;
&lt;br /&gt;
Bouffalo BL808 SoC information:&lt;br /&gt;
* [https://raw.githubusercontent.com/bouffalolab/bl_docs/main/BL808_DS/en/BL808_DS_1.2_en.pdf Bouffalo Lab BL808 SoC Datasheet]&lt;br /&gt;
* [https://raw.githubusercontent.com/bouffalolab/bl_docs/main/BL808_RM/en/BL808_RM_en_1.3.pdf Bouffalo Lab BL808 SoC Reference Manual]&lt;br /&gt;
&lt;br /&gt;
SPI NOR Flash information:&lt;br /&gt;
* [https://files.pine64.org/doc/datasheet/ox64/gd25lq16e_rev1.2_20210108.pdf GigaDevice 16Mb XSPI-Flash Datasheet]&lt;br /&gt;
* [https://files.pine64.org/doc/datasheet/star64/gd25lq128e_rev1.0_20210513.pdf GigaDevice 128Mb XSPI-Flash Datasheet]&lt;br /&gt;
* [https://wiki.pine64.org/images/5/5d/W25Q128JW_RevB_11042019-1761358.pdf Winbond 128Mb QSPI-Flash Datasheet] (W25Q128JWSQ)&lt;br /&gt;
&lt;br /&gt;
Power Regulator information:&lt;br /&gt;
* [https://files.pine64.org/doc/datasheet/ox64/IA2014-03.pdf Innovation Analog Tech IA2014 Step_down Converter Datasheet]&lt;br /&gt;
&lt;br /&gt;
MicroSD socket information:&lt;br /&gt;
* [https://files.pine64.org/doc/datasheet/ox64/TF%20PUSH%20type%20socket%20specification.pdf Push type microSD socket specification]&lt;br /&gt;
&lt;br /&gt;
== Compatible UARTs when in bootloader mode ==&lt;br /&gt;
&lt;br /&gt;
When the Ox64 is in bootloader mode, some UARTs are unable to communicate with it. When this is the case, utilities such as BLDevCube are unable to actually program the device. If you see &amp;quot;Shake hand fail&amp;quot; and an empty ack, and your device is in bootloader mode, then it is likely an incompatible UART.&lt;br /&gt;
&lt;br /&gt;
The below devices have been tested and verified as working:&lt;br /&gt;
* Raspberry Pi Pico - running the following [https://github.com/sanjay900/ox64-uart/releases/tag/v1.1 UART firmware] (GP4 and GP5 are used for port 0, GP12 and GP13 for port 1)&lt;br /&gt;
* Compiled binary for Pi Pico and connectivity diagram is [https://github.com/Kris-Sekula/Pine64_Ox64_SBC/tree/main/uart here] &lt;br /&gt;
* ESP32 with CP210x - bridge the EN pin to ground to disable the ESP32 itself, and then connect the TX on the esp32 to 14 on the Ox64 and RX to pin 15. Note that only baud rate 115200 works, and this doesn't seem to work for everyone)&lt;br /&gt;
* Stand-alone CP2102 dongle works at 115200 baud. Brand used was HiLetgo.&lt;br /&gt;
* STM32F401 BlackPill - running the [https://github.com/blackmagic-debug/blackmagic/tree/main/src/platforms/blackpillv2 Black Magic Debug] firmware&lt;br /&gt;
* STM32F103C8T6 BluePill - running Black Magic Debug.&lt;br /&gt;
* Some UART adapters based on the FT232H (note that the FT232RL does not work, and neither does the Pine 64 JTAG)&lt;br /&gt;
* Some CH340G based adapters work and some don't.&lt;br /&gt;
&lt;br /&gt;
== Resources and Articles ==&lt;br /&gt;
* [https://youtube.com/watch?v=czRtF-UNiEY A short video] on how to connect to the Ox64, flash and boot&lt;br /&gt;
* [https://youtu.be/vPAk5sq_Ilc Another video] that covers soldering pins, connecting via Pi Pico and flashing Linux and U-Boot&lt;br /&gt;
* [https://wiki.pine64.org/images/5/59/How_to_Run_Ox64.pdf Step-by-step tutorial] for how to build, flash and run Ox64&lt;br /&gt;
* [https://gist.github.com/lupyuen/7a0c697b89abccda8e38b33dfe5ebaff First batch of Ox64 won't appear as USB serial port]&lt;br /&gt;
* [https://gist.github.com/lupyuen/2087e9b3fb40aab5e0795bb02a265a3b First batch of Ox64 tested OK with CH340C/G]&lt;br /&gt;
* [https://www.robertlipe.com/bl808-not-symmetric/ First thoughts on the (a)symmetry of Bouffalo Labs BL808 as in Pine64 Ox64]&lt;br /&gt;
* [https://thelittleengineerthatcould.blogspot.com/2022/12/the-8-linux-computer-part-2.html The $8 linux computer (with picoprobe-rp2040 programming instructions)]&lt;br /&gt;
* [https://github.com/p4ddy1/pine_ox64/blob/main/build_toolchain_macos.md Building the Xuantie GNU Toolchain for Ox64 on macOS and Apple Silicon]&lt;br /&gt;
&lt;br /&gt;
Ox64 BL808 RISC-V SBC articles by Lupyuen:&lt;br /&gt;
* [https://lupyuen.codeberg.page/articles/ox64.html Booting Linux and (maybe) Apache NuttX RTOS]&lt;br /&gt;
* [https://lupyuen.codeberg.page/articles/ox2.html Starting Apache NuttX real-time operating system]&lt;br /&gt;
* [https://lupyuen.codeberg.page/articles/mmu.html Sv39 Memory Management Unit]&lt;br /&gt;
* [https://lupyuen.codeberg.page/articles/app.html NuttX Apps and Initial RAM Disk]&lt;br /&gt;
* [https://lupyuen.codeberg.page/articles/plic2.html UART Interrupt and Platform-Level Interrupt Controller (PLIC)]&lt;br /&gt;
&lt;br /&gt;
Git repositories:&lt;br /&gt;
* [https://github.com/sfranzyshen/arduino-bl808 Community made Arduino Core specifically for the Bouffalo Labs BL808 RISC-V MCU] (initial development has been postponed until further notice)&lt;br /&gt;
&lt;br /&gt;
== Development Efforts ==&lt;br /&gt;
* [https://twitter.com/gamelaster/status/1583916501400068096 Ox64 boots Linux successfully]&lt;br /&gt;
* [https://twitter.com/btashton/status/1586381334439923713?t=w5xRRUR74HGK2O1Zg_aFyw&amp;amp;s=19 Brennan Ashton is porting Apache NuttX RTOS and OpenAMP (Asymmetric Multiprocessing) to BL808]&lt;br /&gt;
* [https://twitter.com/thanos_engine/status/1585153938092761093 Phone Concept for BL808]&lt;br /&gt;
&lt;br /&gt;
== Build==&lt;br /&gt;
&lt;br /&gt;
Open the terminal and create a new directory for the build:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
mkdir buildroot_bouffalo &amp;amp;&amp;amp; cd buildroot_bouffalo&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Clone the primary Buildroot repository and the specific Buildroot Bouffalo repository:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
git clone https://github.com/buildroot/buildroot&lt;br /&gt;
git clone https://github.com/openbouffalo/buildroot_bouffalo&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Define an environment variable for the Buildroot Bouffalo overlay path:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
export BR_BOUFFALO_OVERLAY_PATH=$(pwd)/buildroot_bouffalo&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Change directory into the cloned Buildroot folder:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
cd buildroot&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Apply the default configuration for Pine64 Ox64:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
make BR2_EXTERNAL=$BR_BOUFFALO_OVERLAY_PATH pine64_ox64_defconfig&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Use the &amp;lt;code&amp;gt;menuconfig&amp;lt;/code&amp;gt; tool to adjust build settings:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
make menuconfig&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
'''Note''': Within &amp;lt;code&amp;gt;menuconfig&amp;lt;/code&amp;gt;:&lt;br /&gt;
* Navigate to &amp;lt;code&amp;gt;Target Architecture&amp;lt;/code&amp;gt;&lt;br /&gt;
* Enable &amp;lt;code&amp;gt;Integer Multiplication and Division (M)&amp;lt;/code&amp;gt;&lt;br /&gt;
* Enable &amp;lt;code&amp;gt;Atomic Instructions (A)&amp;lt;/code&amp;gt;&lt;br /&gt;
* Enable &amp;lt;code&amp;gt;Single-precision Floating-point (F)&amp;lt;/code&amp;gt;&lt;br /&gt;
* Enable &amp;lt;code&amp;gt;Double-precision Floating-point (D)&amp;lt;/code&amp;gt;&lt;br /&gt;
* Set &amp;lt;code&amp;gt;Target ABI&amp;lt;/code&amp;gt; to &amp;lt;code&amp;gt;lp64d&amp;lt;/code&amp;gt;&lt;br /&gt;
[[File:target ABI setting.png|thumb|right|200px|target ABI setting]]&lt;br /&gt;
* Under &amp;lt;code&amp;gt;Toolchain&amp;lt;/code&amp;gt;, enable &amp;lt;code&amp;gt;Fortran support&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;OpenMP support&amp;lt;/code&amp;gt;&lt;br /&gt;
[[File:toolchain setting.png|thumb|right|200px|toolchain setting]]&lt;br /&gt;
&lt;br /&gt;
Initiate the build process:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
make&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
'''Note''': Before executing the &amp;lt;code&amp;gt;make&amp;lt;/code&amp;gt; command, ensure your &amp;lt;code&amp;gt;PATH&amp;lt;/code&amp;gt; variable doesn't have spaces.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Flashing Ox64 SBC and SD Card for Newbies==&lt;br /&gt;
This section explains how to flash Ox64 board and the SD card to boot the system. It's very low level for newbies.&lt;br /&gt;
&lt;br /&gt;
[[File:Pine Serial v2.png|thumb|right|200px|Wiring Raspberry Pico Pi to Pine64 Ox64 SBC]]&lt;br /&gt;
&lt;br /&gt;
=== Prepare the Environment === &lt;br /&gt;
You need a Linux machine, a Uart module (i.e Raspberry Pico Pi), the Ox64 board and a SD card.&lt;br /&gt;
&lt;br /&gt;
Start a terminal session and set the working directory&lt;br /&gt;
 cd ~/Downloads&lt;br /&gt;
 mkdir ox64 ox64/devcube183&lt;br /&gt;
 cd ~/Downloads/ox64/devcube183&lt;br /&gt;
&lt;br /&gt;
Get flasher DevCube 1.8.3 from one of mirrored servers and decompress it:&lt;br /&gt;
* https://openbouffalo.org/static-assets/bldevcube/BouffaloLabDevCube-v1.8.3.zip&lt;br /&gt;
* https://hachyderm.io/@mkroman/110787218805897192 &amp;gt; https://pub.rwx.im/~mk/bouffalolab/BouffaloLabDevCube-v1.8.3.zip&lt;br /&gt;
* https://we.tl/t-eJWShQJ4iF&lt;br /&gt;
* https://cdn.discordapp.com/attachments/771032441971802142/1145565853962735639/BouffaloLabDevCube-v1.8.3.zip&lt;br /&gt;
&lt;br /&gt;
''SHA1: 0f2619e87d946f936f63ae97b0efd674357b1166''&lt;br /&gt;
&lt;br /&gt;
''SHA256SUMS: e6e6db316359da40d29971a1889d41c9e97d5b1ff1a8636e9e6960b6ff960913''&lt;br /&gt;
&lt;br /&gt;
 wget https://openbouffalo.org/static-assets/bldevcube/BouffaloLabDevCube-v1.8.3.zip&lt;br /&gt;
 unzip BouffaloLabDevCube-v1.8.3.zip&lt;br /&gt;
 chmod u+x BLDevCube-ubuntu&lt;br /&gt;
&lt;br /&gt;
Download compressed file from https://github.com/openbouffalo/buildroot_bouffalo/releases/ and decompress it.&lt;br /&gt;
&lt;br /&gt;
(You can also get the compressed the file from https://github.com/openbouffalo/buildroot_bouffalo/releases/download/v1.0.1/bl808-linux-pine64_ox64_full_defconfig.tar.gz)&lt;br /&gt;
&lt;br /&gt;
 cd ~/Downloads/ox64&lt;br /&gt;
 mkdir openbouffalo &amp;amp;&amp;amp; cd openbouffalo&lt;br /&gt;
 wget https://github.com/openbouffalo/buildroot_bouffalo/releases/download/v1.0.1/bl808-linux-pine64_ox64_full_defconfig.tar.gz&lt;br /&gt;
 tar -xvzf bl808-linux-pine64_ox64_full_defconfig.tar.gz&lt;br /&gt;
&lt;br /&gt;
 You'll get this structure&lt;br /&gt;
   |_ firmware/&lt;br /&gt;
   |_ firmware/m0_lowload_bl808_m0.bin&lt;br /&gt;
   |_ firmware/bl808-firmware.bin&lt;br /&gt;
   |_ firmware/d0_lowload_bl808_d0.bin&lt;br /&gt;
   |_ firmware/sdcard-pine64_ox64_full_defconfig.img.xz&lt;br /&gt;
&lt;br /&gt;
=== Flash Ox64  === &lt;br /&gt;
Connect the the Uart module (i.e Raspberry Pico Pi) for serial communicate from PC to Ox64&lt;br /&gt;
&lt;br /&gt;
 ls /dev/ttyACM*&lt;br /&gt;
&lt;br /&gt;
There are two new ports to choose from : /dev/ttyACM0  /dev/ttyACM1, use the lower number.&lt;br /&gt;
&lt;br /&gt;
 minicom -b 2000000 -D /dev/ttyACM0&lt;br /&gt;
&lt;br /&gt;
Set ox64 board to programming mode&lt;br /&gt;
&lt;br /&gt;
* Press BOOT button&lt;br /&gt;
* Apply power&lt;br /&gt;
* Release BOOT button&lt;br /&gt;
&lt;br /&gt;
Close minicom. Open a new terminal window to run DevCube flasher&lt;br /&gt;
&lt;br /&gt;
 cd ~/Downloads/ox64/devcube183&lt;br /&gt;
 ./BLDevCube-ubuntu&lt;br /&gt;
&lt;br /&gt;
Select chip [BL808], press Finish and switch to [MCU] tab&lt;br /&gt;
&lt;br /&gt;
 M0 Group[group0] Image Addr [0x58000000] [PATH to m0_lowload_bl808_m0.bin]&lt;br /&gt;
 D0 Group[group0] Image Addr [0x58100000] [PATH to d0_lowload_bl808_d0.bin]&lt;br /&gt;
 Interface: Uart&lt;br /&gt;
 Port/SN: /dev/ttyACM1&lt;br /&gt;
 Uart rate 2000000&lt;br /&gt;
 UART TX is physical pin 1/GPIO 14.&lt;br /&gt;
 UART RX is physical pin 2/GPIO 15.&lt;br /&gt;
 Click 'Create &amp;amp; Download' and wait until it's done&lt;br /&gt;
&lt;br /&gt;
Switch to [IOT] tab&lt;br /&gt;
 Enable 'Single Download', set Address with 0x800000, choose [PATH to bl808-firmware.bin]&lt;br /&gt;
 Click 'Create &amp;amp; Download' again and wait until it's done&lt;br /&gt;
 Close DevCube&lt;br /&gt;
&lt;br /&gt;
=== Alternative: Open-Source Flashing ===&lt;br /&gt;
For those who do not want to use the DevCube, BouffaloLab provide open-source flashing packages &amp;amp;mdash; &amp;lt;code&amp;gt;bflb-iot-tool&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;bflb-mcu-tool&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
: Note: While these packages do contain binaries in addition to the Python source code, those binaries do not appear to be used for UART flashing.&lt;br /&gt;
&lt;br /&gt;
Execute the following commands to flash the BL808. Note that the addresses are different to the ones you would use in the DevCube.&lt;br /&gt;
&lt;br /&gt;
: Reminder: UART TX is physical pin 1/GPIO 14, UART RX is physical pin 2/GPIO 15.&lt;br /&gt;
 pip install bflb-iot-tool # we are *not* using bflb-mcu-tool&lt;br /&gt;
 &lt;br /&gt;
 bflb-iot-tool --chipname bl808 --interface uart --port /dev/ttyACM0 --addr 0x000000 --firmware firmware/m0_lowload_bl808_m0.bin --single&lt;br /&gt;
 bflb-iot-tool --chipname bl808 --interface uart --port /dev/ttyACM0 --addr 0x100000 --firmware firmware/d0_lowload_bl808_d0.bin --single&lt;br /&gt;
 bflb-iot-tool --chipname bl808 --interface uart --port /dev/ttyACM0 --addr 0x800000 --firmware firmware/bl808-firmware.bin --single&lt;br /&gt;
&lt;br /&gt;
=== Flash SD Card ===&lt;br /&gt;
Insert SD card into PC, find address [/dev/sdb], erase initial space and flash sdcard.xxxx.img file.&lt;br /&gt;
&lt;br /&gt;
 cd ~/Downloads/ox64/openbouffalo/firmware&lt;br /&gt;
 xz -v -d -k sdcard-pine64_ox64_full_defconfig.img.xz&lt;br /&gt;
 sudo dd if=/dev/zero of=/dev/sdb count=1 bs=32768 &lt;br /&gt;
 sudo dd if=~/Downloads/ox64/openbouffalo/firmware/sdcard-pine64_ox64_full_defconfig.img of=/dev/sdb bs=1M status=progress conv=fsync&lt;br /&gt;
&lt;br /&gt;
=== First Booting ===&lt;br /&gt;
&lt;br /&gt;
Insert SD card into Ox64 and set a tty connection to Ox64 board&lt;br /&gt;
* Serial Console access:&lt;br /&gt;
* UART TX is physical pin 32/GPIO 16.&lt;br /&gt;
* UART RX is physical pin 31/GPIO 17.&lt;br /&gt;
* Baud 2000000.&lt;br /&gt;
&lt;br /&gt;
 minicom -b 2000000 -D /dev/ttyACM0&lt;br /&gt;
&lt;br /&gt;
Re-Apply power to ox64&lt;br /&gt;
&lt;br /&gt;
Enjoy the boot!&lt;br /&gt;
&lt;br /&gt;
PS. To investigate running services&lt;br /&gt;
 pstree | head -5&lt;br /&gt;
   init-+-dhcpcd---3*[dhcpcd]&lt;br /&gt;
        |-dropbear&lt;br /&gt;
        |-klogd&lt;br /&gt;
        |-login---sh-+-head&lt;br /&gt;
        |            `-pstree&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Category:Ox64]] [[Category:Bouffalo BL808]]&lt;/div&gt;</summary>
		<author><name>Lupyuen</name></author>
	</entry>
	<entry>
		<id>https://wiki.pine64.org/index.php?title=Ox64&amp;diff=21151</id>
		<title>Ox64</title>
		<link rel="alternate" type="text/html" href="https://wiki.pine64.org/index.php?title=Ox64&amp;diff=21151"/>
		<updated>2023-11-25T23:53:16Z</updated>

		<summary type="html">&lt;p&gt;Lupyuen: Add articles &amp;quot;Sv39 Memory Management Unit&amp;quot; and &amp;quot;NuttX Apps and Initial RAM Disk&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[File:Ox64_board.jpg|thumb|right|The Ox64]]&lt;br /&gt;
[[File:Ox64 pinout.png|thumb|Pinout of the production version]]&lt;br /&gt;
[[File:RISC-V.png|thumb|right|Powered by RISC-V]]&lt;br /&gt;
&lt;br /&gt;
The '''Ox64''' is a RISC-V based single-board computer based on the Bouffalo Lab BL808 RISC-V SoC with C906 64-bit and E907/E902 32-bit CPU cores supported by 64 MB of embedded PSRAM memory, and with built-in WiFi, Bluetooh and Zigbee radio interfaces. The Ox64 comes in a breadboard-friendly form-factor, has a microSD card slot, a USB 2.0 Type-C port, and many other peripheral interfaces for makers to integrate with sensors and other devices.&lt;br /&gt;
&lt;br /&gt;
== Software Releases ==&lt;br /&gt;
&lt;br /&gt;
=== Quick Links to the Source of OS Images Build ===&lt;br /&gt;
&lt;br /&gt;
There is a community effort to bring updated kernels, peripherals and buildroot - Lots of communication happening in the #ox64-nutcracker channel. &lt;br /&gt;
&lt;br /&gt;
* [https://github.com/openbouffalo/buildroot_bouffalo buildroot] bringing all the work below together with a bootable kernel and updated filesystem images for SD cards &lt;br /&gt;
* [https://github.com/smaeul/u-boot/tree/bl808 U-Boot] and [https://github.com/smaeul/opensbi/tree/bl808 OpenSBI] work by Smauel&lt;br /&gt;
* [https://github.com/arm000/linux-bl808/tree/linux-next/mboxic Kernel] IRQChip, SDCard, and (WIP) USB by arm000, Alexander Horner and others&lt;br /&gt;
* [https://github.com/openbouffalo/OBLFR OpenBouffalo Firmware] low_load drivers by Fishwaldo and others&lt;br /&gt;
&lt;br /&gt;
Original Linux Images provided by Bouffalo - Very basic '''alpha build''' which are only fit for board bring up and testing purposes. &lt;br /&gt;
&lt;br /&gt;
* [https://github.com/bouffalolab/bl808_linux Linux for BL808]&lt;br /&gt;
* [https://wiki.pine64.org/wiki/File:Linux_BL808.pdf Installation Instructions for Linux on BL808 (Chinese)]&lt;br /&gt;
* [https://wiki.pine64.org/wiki/File:Linux_BL808_en.pdf Installation Instructions for Linux on BL808 (machine translated to English)]&lt;br /&gt;
&lt;br /&gt;
Toolchain:&lt;br /&gt;
&lt;br /&gt;
* elf_newlib_toolchain/bin/riscv64-unknown-elf-gcc (Xuantie-900 elf newlib gcc Toolchain V2.2.5 B-20220323) 10.2.0&lt;br /&gt;
* linux_toolchain/bin/riscv64-unknown-linux-gnu-gcc (Xuantie-900 linux-5.10.4 glibc gcc Toolchain V2.2.4 B-20211227) 10.2.0&lt;br /&gt;
* cmake version 3.19.3&lt;br /&gt;
&lt;br /&gt;
=== Software Development Kits ===&lt;br /&gt;
* [https://github.com/bouffalolab/bl_mcu_sdk BL808 MCU SDK]&lt;br /&gt;
* [https://dev.bouffalolab.com/download BLDevCube Flashing Tool for Windows, macOS and Ubuntu x64]&lt;br /&gt;
* [https://wiki.pine64.org/wiki/File:Ox64_BL808UART_connect.pdf Ox64 UART Flashing Guide], see the [https://gist.github.com/lupyuen/7a0c697b89abccda8e38b33dfe5ebaff notes]&lt;br /&gt;
* [https://github.com/lupyuen/lupyuen.github.io/releases/download/ox64/bl808_demo_event.bin BL808 Demo Firmware: bl808_demo_event.bin], see the [https://gist.github.com/lupyuen/7a0c697b89abccda8e38b33dfe5ebaff notes]&lt;br /&gt;
* [https://github.com/lupyuen/lupyuen.github.io/releases/download/ox64/whole_flash_data.bin BL808 UART Log Firmware: whole_flash_data.bin], see the [https://gist.github.com/lupyuen/7a0c697b89abccda8e38b33dfe5ebaff notes]&lt;br /&gt;
* [https://github.com/lupyuen/lupyuen.github.io/releases/download/ox64/BL808.DVK.Quick.Start.pdf BL808 DVK Quick Start]&lt;br /&gt;
* [https://github.com/bouffalolab/bl808_linux/tree/main/opensbi-0.6-808 OpenSBI for BL808]&lt;br /&gt;
* [https://github.com/bouffalolab/bl-pac/tree/main/bl808 Rust Peripheral Access Crate (PAC) for BL808]&lt;br /&gt;
* [https://github.com/bouffalolab/bl-pac/blob/main/bl808/bl808.svd System View Description (SVD) for BL808]&lt;br /&gt;
&lt;br /&gt;
== SoC and Memory Specification ==&lt;br /&gt;
&lt;br /&gt;
[[File:Bouffalo_Lab_icon.png|right]]&lt;br /&gt;
&lt;br /&gt;
Based on the [https://en.bouffalolab.com/product/ Bouffalo Lab BL808]&lt;br /&gt;
&lt;br /&gt;
[[File:BL808_Block_Diagram.jpg|500px]]&lt;br /&gt;
&lt;br /&gt;
=== CPU Architecture ===&lt;br /&gt;
&lt;br /&gt;
[[File:T-Head.png|right|200px]]&lt;br /&gt;
&lt;br /&gt;
T-Head C906 480 MHz 64-bit RISC-V CPU:&lt;br /&gt;
&lt;br /&gt;
* Supports RISC-V RV64IMAFCV instruction architecture&lt;br /&gt;
* Five-stage single-issue sequentially executed pipeline&lt;br /&gt;
* Level-1 instruction and data cache of Harvard architecture, with a size of 32 KB and a cache line of 64B&lt;br /&gt;
* Sv39 memory management unit, realizing the conversion of virtual and real addresses and memory management&lt;br /&gt;
* jTLB that supports 128 entries&lt;br /&gt;
* Supports AXI 4.0 128-bit master interface&lt;br /&gt;
* Supports core local interrupt (CLINT) and platform-level interrupt controller (PLIC)&lt;br /&gt;
* With 80 external interrupt sources, 3 bits for configuring interrupt priority&lt;br /&gt;
* Supports BHT (8K) and BTB&lt;br /&gt;
* Compatible with RISC-V PMP, 8 configurable areas&lt;br /&gt;
* Supports hardware performance monitor (HPM) units&lt;br /&gt;
* See [https://www.t-head.cn/product/c906?lang=en here]&lt;br /&gt;
&lt;br /&gt;
T-Head E907 320 MHz 32-bit RISC-V CPU:&lt;br /&gt;
&lt;br /&gt;
* Supports RISC-V RV32IMAFCP instruction set&lt;br /&gt;
* Supports RISC-V 32-bit/16-bit mixed instruction set&lt;br /&gt;
* Supports RISC-V machine mode and user mode&lt;br /&gt;
* Thirty-two 32-bit integer general purpose registers (GPR) and thirty-two 32-bit/64-bit floating-point GPRs&lt;br /&gt;
* Integer (5-stage)/floating-point (7-stage), single-issue, sequentially executed pipeline&lt;br /&gt;
* Supports AXI 4.0 main device interface and AHB 5.0 peripheral interface&lt;br /&gt;
* 32K instruction cache, two-way set associative structure&lt;br /&gt;
* 16K data cache, two-way set associative structure&lt;br /&gt;
* See [https://www.t-head.cn/product/e907?lang=en here]&lt;br /&gt;
&lt;br /&gt;
T-Head E902 150 MHz 32-bit RISC-V CPU:&lt;br /&gt;
&lt;br /&gt;
* See [https://www.t-head.cn/product/e902?lang=en here]&lt;br /&gt;
&lt;br /&gt;
=== System Memory ===&lt;br /&gt;
* Embedded 64MB PSRAM&lt;br /&gt;
&lt;br /&gt;
== Board Features ==&lt;br /&gt;
&lt;br /&gt;
=== Network ===&lt;br /&gt;
* 2.4 GHz 1T1R WiFi 802.11 b/g/n&lt;br /&gt;
* Bluetooth 5.2&lt;br /&gt;
* Zigbee&lt;br /&gt;
* 10/100 Mbit/s Ethernet (optional, on expansion board)&lt;br /&gt;
&lt;br /&gt;
=== Storage ===&lt;br /&gt;
* On-board 16 Mbit (2 MB) or 128 Mbit (16 MB) XSPI NOR flash memory&lt;br /&gt;
* MicroSD, supports SDHC and SDXC (only on the 128 Mbit version)&lt;br /&gt;
&lt;br /&gt;
=== Expansion Ports ===&lt;br /&gt;
* USB 2.0 OTG port&lt;br /&gt;
* 26 GPIO pins, including SPI, I&amp;lt;sup&amp;gt;2&amp;lt;/sup&amp;gt;C and UART functionality, possible I&amp;lt;sup&amp;gt;2&amp;lt;/sup&amp;gt;S and GMII expansion&lt;br /&gt;
* Dual-lane MiPi CSI port, located at USB-C port, for camera module&lt;br /&gt;
&lt;br /&gt;
=== Audio ===&lt;br /&gt;
* Microphone (optional, on the camera module)&lt;br /&gt;
* Speaker (optional, on the camera module)&lt;br /&gt;
&lt;br /&gt;
== Board Information, Schematics and Certifications ==&lt;br /&gt;
[[File:Ox64 ethphy.png|thumb|Pinout for wiring ethernet PHY to EMAC]]&lt;br /&gt;
&lt;br /&gt;
* Baseboard dimensions: 51 mm x 21 mm x 19 mm x 3.5 mm (breadboard friendly)&lt;br /&gt;
* Input power: 5 V, 0.5 A through the microUSB or USB-C ports&lt;br /&gt;
&lt;br /&gt;
Production version schematic:&lt;br /&gt;
&lt;br /&gt;
* [https://files.pine64.org/doc/ox64/PINE64_Ox64-Schematic-202221018.pdf Ox64 Schematic 20221018 v1.1]&lt;br /&gt;
* [https://files.pine64.org/doc/ox64/PINE64_Ox64_PCB_Placement-Top-20221018.pdf Ox64 PCB Component placement(ToP) 20221018 v1.1]&lt;br /&gt;
* [https://files.pine64.org/doc/ox64/PINE64_Ox64_PCB_Placement-Bottom-20221018.pdf Ox64 PCB Component placement(Bottom) 20221018 v1.1]&lt;br /&gt;
&lt;br /&gt;
Prototype (dispatched to developers) schematic:&lt;br /&gt;
* [https://files.pine64.org/doc/ox64/PINE64_Ox64-Schematic-202221007.pdf Ox64 Schematic 20221007 v1.0]&lt;br /&gt;
* [https://files.pine64.org/doc/ox64/PINE64_Ox64_PCB_Placement-Top-20221007.pdf Ox64 PCB Component placement(ToP) 20221007 v1.0]&lt;br /&gt;
* [https://files.pine64.org/doc/ox64/PINE64_Ox64_PCB_Placement-Bottom-20221007.pdf Ox64 PCB Component placement(Bottom) 20221007 v1.0]&lt;br /&gt;
&lt;br /&gt;
Certifications:&lt;br /&gt;
* Disclaimer: Please note that PINE64 SBC is not a &amp;quot;final&amp;quot; product and in general certification is not necessary.&lt;br /&gt;
* Not yet available&lt;br /&gt;
&lt;br /&gt;
== Datasheets for Components and Peripherals ==&lt;br /&gt;
&lt;br /&gt;
Bouffalo BL808 SoC information:&lt;br /&gt;
* [https://raw.githubusercontent.com/bouffalolab/bl_docs/main/BL808_DS/en/BL808_DS_1.2_en.pdf Bouffalo Lab BL808 SoC Datasheet]&lt;br /&gt;
* [https://raw.githubusercontent.com/bouffalolab/bl_docs/main/BL808_RM/en/BL808_RM_en_1.3.pdf Bouffalo Lab BL808 SoC Reference Manual]&lt;br /&gt;
&lt;br /&gt;
SPI NOR Flash information:&lt;br /&gt;
* [https://files.pine64.org/doc/datasheet/ox64/gd25lq16e_rev1.2_20210108.pdf GigaDevice 16Mb XSPI-Flash Datasheet]&lt;br /&gt;
* [https://files.pine64.org/doc/datasheet/star64/gd25lq128e_rev1.0_20210513.pdf GigaDevice 128Mb XSPI-Flash Datasheet]&lt;br /&gt;
* [https://wiki.pine64.org/images/5/5d/W25Q128JW_RevB_11042019-1761358.pdf Winbond 128Mb QSPI-Flash Datasheet] (W25Q128JWSQ)&lt;br /&gt;
&lt;br /&gt;
Power Regulator information:&lt;br /&gt;
* [https://files.pine64.org/doc/datasheet/ox64/IA2014-03.pdf Innovation Analog Tech IA2014 Step_down Converter Datasheet]&lt;br /&gt;
&lt;br /&gt;
MicroSD socket information:&lt;br /&gt;
* [https://files.pine64.org/doc/datasheet/ox64/TF%20PUSH%20type%20socket%20specification.pdf Push type microSD socket specification]&lt;br /&gt;
&lt;br /&gt;
== Compatible UARTs when in bootloader mode ==&lt;br /&gt;
&lt;br /&gt;
When the Ox64 is in bootloader mode, some UARTs are unable to communicate with it. When this is the case, utilities such as BLDevCube are unable to actually program the device. If you see &amp;quot;Shake hand fail&amp;quot; and an empty ack, and your device is in bootloader mode, then it is likely an incompatible UART.&lt;br /&gt;
&lt;br /&gt;
The below devices have been tested and verified as working:&lt;br /&gt;
* Raspberry Pi Pico - running the following [https://github.com/sanjay900/ox64-uart/releases/tag/v1.1 UART firmware] (GP4 and GP5 are used for port 0, GP12 and GP13 for port 1)&lt;br /&gt;
* Compiled binary for Pi Pico and connectivity diagram is [https://github.com/Kris-Sekula/Pine64_Ox64_SBC/tree/main/uart here] &lt;br /&gt;
* ESP32 with CP210x - bridge the EN pin to ground to disable the ESP32 itself, and then connect the TX on the esp32 to 14 on the Ox64 and RX to pin 15. Note that only baud rate 115200 works, and this doesn't seem to work for everyone)&lt;br /&gt;
* Stand-alone CP2102 dongle works at 115200 baud. Brand used was HiLetgo.&lt;br /&gt;
* STM32F401 BlackPill - running the [https://github.com/blackmagic-debug/blackmagic/tree/main/src/platforms/blackpillv2 Black Magic Debug] firmware&lt;br /&gt;
* STM32F103C8T6 BluePill - running Black Magic Debug.&lt;br /&gt;
* Some UART adapters based on the FT232H (note that the FT232RL does not work, and neither does the Pine 64 JTAG)&lt;br /&gt;
* Some CH340G based adapters work and some don't.&lt;br /&gt;
&lt;br /&gt;
== Resources ==&lt;br /&gt;
* [https://lupyuen.codeberg.page/articles/ox64.html Ox64 BL808 RISC-V SBC: Booting Linux and (maybe) Apache NuttX RTOS]&lt;br /&gt;
* [https://youtube.com/watch?v=czRtF-UNiEY A short video] on how to connect to the Ox64, flash and boot&lt;br /&gt;
* [https://youtu.be/vPAk5sq_Ilc Another video] that covers soldering pins, connecting via Pi Pico and flashing Linux and U-Boot&lt;br /&gt;
* [https://wiki.pine64.org/images/5/59/How_to_Run_Ox64.pdf Step-by-step tutorial] for how to build, flash and run Ox64&lt;br /&gt;
* [https://gist.github.com/lupyuen/7a0c697b89abccda8e38b33dfe5ebaff First batch of Ox64 won't appear as USB serial port]&lt;br /&gt;
* [https://gist.github.com/lupyuen/2087e9b3fb40aab5e0795bb02a265a3b First batch of Ox64 tested OK with CH340C/G]&lt;br /&gt;
* [https://www.robertlipe.com/bl808-not-symmetric/ First thoughts on the (a)symmetry of Bouffalo Labs BL808 as in Pine64 Ox64]&lt;br /&gt;
* [https://thelittleengineerthatcould.blogspot.com/2022/12/the-8-linux-computer-part-2.html The $8 linux computer (with picoprobe-rp2040 programming instructions)]&lt;br /&gt;
* [https://github.com/p4ddy1/pine_ox64/blob/main/build_toolchain_macos.md Building the Xuantie GNU Toolchain for Ox64 on macOS and Apple Silicon]&lt;br /&gt;
* [https://lupyuen.codeberg.page/articles/ox2.html RISC-V Ox64 BL808 SBC: Starting Apache NuttX real-time operating system]&lt;br /&gt;
* [https://lupyuen.codeberg.page/articles/mmu.html RISC-V Ox64 BL808 SBC: Sv39 Memory Management Unit]&lt;br /&gt;
* [https://lupyuen.codeberg.page/articles/app.html RISC-V Ox64 BL808 SBC: NuttX Apps and Initial RAM Disk]&lt;br /&gt;
&lt;br /&gt;
Git repositories:&lt;br /&gt;
* [https://github.com/sfranzyshen/arduino-bl808 Community made Arduino Core specifically for the Bouffalo Labs BL808 RISC-V MCU] (Initial development has been postponed until further notice.)&lt;br /&gt;
&lt;br /&gt;
== Development Efforts ==&lt;br /&gt;
* [https://twitter.com/gamelaster/status/1583916501400068096 Ox64 boots Linux successfully]&lt;br /&gt;
* [https://twitter.com/btashton/status/1586381334439923713?t=w5xRRUR74HGK2O1Zg_aFyw&amp;amp;s=19 Brennan Ashton is porting Apache NuttX RTOS and OpenAMP (Asymmetric Multiprocessing) to BL808]&lt;br /&gt;
* [https://twitter.com/thanos_engine/status/1585153938092761093 Phone Concept for BL808]&lt;br /&gt;
&lt;br /&gt;
== Build==&lt;br /&gt;
&lt;br /&gt;
Open the terminal and create a new directory for the build:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
mkdir buildroot_bouffalo &amp;amp;&amp;amp; cd buildroot_bouffalo&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Clone the primary Buildroot repository and the specific Buildroot Bouffalo repository:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
git clone https://github.com/buildroot/buildroot&lt;br /&gt;
git clone https://github.com/openbouffalo/buildroot_bouffalo&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Define an environment variable for the Buildroot Bouffalo overlay path:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
export BR_BOUFFALO_OVERLAY_PATH=$(pwd)/buildroot_bouffalo&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Change directory into the cloned Buildroot folder:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
cd buildroot&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Apply the default configuration for Pine64 Ox64:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
make BR2_EXTERNAL=$BR_BOUFFALO_OVERLAY_PATH pine64_ox64_defconfig&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Use the &amp;lt;code&amp;gt;menuconfig&amp;lt;/code&amp;gt; tool to adjust build settings:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
make menuconfig&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
'''Note''': Within &amp;lt;code&amp;gt;menuconfig&amp;lt;/code&amp;gt;:&lt;br /&gt;
* Navigate to &amp;lt;code&amp;gt;Target Architecture&amp;lt;/code&amp;gt;&lt;br /&gt;
* Enable &amp;lt;code&amp;gt;Integer Multiplication and Division (M)&amp;lt;/code&amp;gt;&lt;br /&gt;
* Enable &amp;lt;code&amp;gt;Atomic Instructions (A)&amp;lt;/code&amp;gt;&lt;br /&gt;
* Enable &amp;lt;code&amp;gt;Single-precision Floating-point (F)&amp;lt;/code&amp;gt;&lt;br /&gt;
* Enable &amp;lt;code&amp;gt;Double-precision Floating-point (D)&amp;lt;/code&amp;gt;&lt;br /&gt;
* Set &amp;lt;code&amp;gt;Target ABI&amp;lt;/code&amp;gt; to &amp;lt;code&amp;gt;lp64d&amp;lt;/code&amp;gt;&lt;br /&gt;
[[File:target ABI setting.png|thumb|right|200px|target ABI setting]]&lt;br /&gt;
* Under &amp;lt;code&amp;gt;Toolchain&amp;lt;/code&amp;gt;, enable &amp;lt;code&amp;gt;Fortran support&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;OpenMP support&amp;lt;/code&amp;gt;&lt;br /&gt;
[[File:toolchain setting.png|thumb|right|200px|toolchain setting]]&lt;br /&gt;
&lt;br /&gt;
Initiate the build process:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
make&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
'''Note''': Before executing the &amp;lt;code&amp;gt;make&amp;lt;/code&amp;gt; command, ensure your &amp;lt;code&amp;gt;PATH&amp;lt;/code&amp;gt; variable doesn't have spaces.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Flashing Ox64 SBC and SD Card for Newbies==&lt;br /&gt;
This section explains how to flash Ox64 board and the SD card to boot the system. It's very low level for newbies.&lt;br /&gt;
&lt;br /&gt;
[[File:Pine Serial v2.png|thumb|right|200px|Wiring Raspberry Pico Pi to Pine64 Ox64 SBC]]&lt;br /&gt;
&lt;br /&gt;
=== Prepare the Environment === &lt;br /&gt;
You need a Linux machine, a Uart module (i.e Raspberry Pico Pi), the Ox64 board and a SD card.&lt;br /&gt;
&lt;br /&gt;
Start a terminal session and set the working directory&lt;br /&gt;
 cd ~/Downloads&lt;br /&gt;
 mkdir ox64 ox64/devcube183&lt;br /&gt;
 cd ~/Downloads/ox64/devcube183&lt;br /&gt;
&lt;br /&gt;
Get flasher DevCube 1.8.3 from one of mirrored servers and decompress it:&lt;br /&gt;
* https://openbouffalo.org/static-assets/bldevcube/BouffaloLabDevCube-v1.8.3.zip&lt;br /&gt;
* https://hachyderm.io/@mkroman/110787218805897192 &amp;gt; https://pub.rwx.im/~mk/bouffalolab/BouffaloLabDevCube-v1.8.3.zip&lt;br /&gt;
* https://we.tl/t-eJWShQJ4iF&lt;br /&gt;
* https://cdn.discordapp.com/attachments/771032441971802142/1145565853962735639/BouffaloLabDevCube-v1.8.3.zip&lt;br /&gt;
&lt;br /&gt;
''SHA1: 0f2619e87d946f936f63ae97b0efd674357b1166''&lt;br /&gt;
&lt;br /&gt;
''SHA256SUMS: e6e6db316359da40d29971a1889d41c9e97d5b1ff1a8636e9e6960b6ff960913''&lt;br /&gt;
&lt;br /&gt;
 wget https://openbouffalo.org/static-assets/bldevcube/BouffaloLabDevCube-v1.8.3.zip&lt;br /&gt;
 unzip BouffaloLabDevCube-v1.8.3.zip&lt;br /&gt;
 chmod u+x BLDevCube-ubuntu&lt;br /&gt;
&lt;br /&gt;
Download compressed file from https://github.com/openbouffalo/buildroot_bouffalo/releases/ and decompress it.&lt;br /&gt;
&lt;br /&gt;
(You can also get the compressed the file from https://github.com/openbouffalo/buildroot_bouffalo/releases/download/v1.0.1/bl808-linux-pine64_ox64_full_defconfig.tar.gz)&lt;br /&gt;
&lt;br /&gt;
 cd ~/Downloads/ox64&lt;br /&gt;
 mkdir openbouffalo &amp;amp;&amp;amp; cd openbouffalo&lt;br /&gt;
 wget https://github.com/openbouffalo/buildroot_bouffalo/releases/download/v1.0.1/bl808-linux-pine64_ox64_full_defconfig.tar.gz&lt;br /&gt;
 tar -xvzf bl808-linux-pine64_ox64_full_defconfig.tar.gz&lt;br /&gt;
&lt;br /&gt;
 You'll get this structure&lt;br /&gt;
   |_ firmware/&lt;br /&gt;
   |_ firmware/m0_lowload_bl808_m0.bin&lt;br /&gt;
   |_ firmware/bl808-firmware.bin&lt;br /&gt;
   |_ firmware/d0_lowload_bl808_d0.bin&lt;br /&gt;
   |_ firmware/sdcard-pine64_ox64_full_defconfig.img.xz&lt;br /&gt;
&lt;br /&gt;
=== Flash Ox64  === &lt;br /&gt;
Connect the the Uart module (i.e Raspberry Pico Pi) for serial communicate from PC to Ox64&lt;br /&gt;
&lt;br /&gt;
 ls /dev/ttyACM*&lt;br /&gt;
&lt;br /&gt;
There are two new ports to choose from : /dev/ttyACM0  /dev/ttyACM1, use the lower number.&lt;br /&gt;
&lt;br /&gt;
 minicom -b 2000000 -D /dev/ttyACM0&lt;br /&gt;
&lt;br /&gt;
Set ox64 board to programming mode&lt;br /&gt;
&lt;br /&gt;
* Press BOOT button&lt;br /&gt;
* Apply power&lt;br /&gt;
* Release BOOT button&lt;br /&gt;
&lt;br /&gt;
Close minicom. Open a new terminal window to run DevCube flasher&lt;br /&gt;
&lt;br /&gt;
 cd ~/Downloads/ox64/devcube183&lt;br /&gt;
 ./BLDevCube-ubuntu&lt;br /&gt;
&lt;br /&gt;
Select chip [BL808], press Finish and switch to [MCU] tab&lt;br /&gt;
&lt;br /&gt;
 M0 Group[group0] Image Addr [0x58000000] [PATH to m0_lowload_bl808_m0.bin]&lt;br /&gt;
 D0 Group[group0] Image Addr [0x58100000] [PATH to d0_lowload_bl808_d0.bin]&lt;br /&gt;
 Interface: Uart&lt;br /&gt;
 Port/SN: /dev/ttyACM1&lt;br /&gt;
 Uart rate 2000000&lt;br /&gt;
 UART TX is physical pin 1/GPIO 14.&lt;br /&gt;
 UART RX is physical pin 2/GPIO 15.&lt;br /&gt;
 Click 'Create &amp;amp; Download' and wait until it's done&lt;br /&gt;
&lt;br /&gt;
Switch to [IOT] tab&lt;br /&gt;
 Enable 'Single Download', set Address with 0x800000, choose [PATH to bl808-firmware.bin]&lt;br /&gt;
 Click 'Create &amp;amp; Download' again and wait until it's done&lt;br /&gt;
 Close DevCube&lt;br /&gt;
&lt;br /&gt;
=== Alternative: Open-Source Flashing ===&lt;br /&gt;
For those who do not want to use the DevCube, BouffaloLab provide open-source flashing packages &amp;amp;mdash; &amp;lt;code&amp;gt;bflb-iot-tool&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;bflb-mcu-tool&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
: Note: While these packages do contain binaries in addition to the Python source code, those binaries do not appear to be used for UART flashing.&lt;br /&gt;
&lt;br /&gt;
Execute the following commands to flash the BL808. Note that the addresses are different to the ones you would use in the DevCube.&lt;br /&gt;
&lt;br /&gt;
: Reminder: UART TX is physical pin 1/GPIO 14, UART RX is physical pin 2/GPIO 15.&lt;br /&gt;
 pip install bflb-iot-tool # we are *not* using bflb-mcu-tool&lt;br /&gt;
 &lt;br /&gt;
 bflb-iot-tool --chipname bl808 --interface uart --port /dev/ttyACM0 --addr 0x000000 --firmware firmware/m0_lowload_bl808_m0.bin --single&lt;br /&gt;
 bflb-iot-tool --chipname bl808 --interface uart --port /dev/ttyACM0 --addr 0x100000 --firmware firmware/d0_lowload_bl808_d0.bin --single&lt;br /&gt;
 bflb-iot-tool --chipname bl808 --interface uart --port /dev/ttyACM0 --addr 0x800000 --firmware firmware/bl808-firmware.bin --single&lt;br /&gt;
&lt;br /&gt;
=== Flash SD Card ===&lt;br /&gt;
Insert SD card into PC, find address [/dev/sdb], erase initial space and flash sdcard.xxxx.img file.&lt;br /&gt;
&lt;br /&gt;
 cd ~/Downloads/ox64/openbouffalo/firmware&lt;br /&gt;
 xz -v -d -k sdcard-pine64_ox64_full_defconfig.img.xz&lt;br /&gt;
 sudo dd if=/dev/zero of=/dev/sdb count=1 bs=32768 &lt;br /&gt;
 sudo dd if=~/Downloads/ox64/openbouffalo/firmware/sdcard-pine64_ox64_full_defconfig.img of=/dev/sdb bs=1M status=progress conv=fsync&lt;br /&gt;
&lt;br /&gt;
=== First Booting ===&lt;br /&gt;
&lt;br /&gt;
Insert SD card into Ox64 and set a tty connection to Ox64 board&lt;br /&gt;
* Serial Console access:&lt;br /&gt;
* UART TX is physical pin 32/GPIO 16.&lt;br /&gt;
* UART RX is physical pin 31/GPIO 17.&lt;br /&gt;
* Baud 2000000.&lt;br /&gt;
&lt;br /&gt;
 minicom -b 2000000 -D /dev/ttyACM0&lt;br /&gt;
&lt;br /&gt;
Re-Apply power to ox64&lt;br /&gt;
&lt;br /&gt;
Enjoy the boot!&lt;br /&gt;
&lt;br /&gt;
PS. To investigate running services&lt;br /&gt;
 pstree | head -5&lt;br /&gt;
   init-+-dhcpcd---3*[dhcpcd]&lt;br /&gt;
        |-dropbear&lt;br /&gt;
        |-klogd&lt;br /&gt;
        |-login---sh-+-head&lt;br /&gt;
        |            `-pstree&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Category:Ox64]] [[Category:Bouffalo BL808]]&lt;/div&gt;</summary>
		<author><name>Lupyuen</name></author>
	</entry>
	<entry>
		<id>https://wiki.pine64.org/index.php?title=Ox64&amp;diff=21123</id>
		<title>Ox64</title>
		<link rel="alternate" type="text/html" href="https://wiki.pine64.org/index.php?title=Ox64&amp;diff=21123"/>
		<updated>2023-11-11T23:34:16Z</updated>

		<summary type="html">&lt;p&gt;Lupyuen: Add article &amp;quot;RISC-V Ox64 BL808 SBC: Starting Apache NuttX Real-Time Operating System&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[File:Ox64_board.jpg|thumb|right|The Ox64]]&lt;br /&gt;
[[File:Ox64 pinout.png|thumb|Pinout of the production version]]&lt;br /&gt;
[[File:RISC-V.png|thumb|right|Powered by RISC-V]]&lt;br /&gt;
&lt;br /&gt;
The '''Ox64''' is a RISC-V based single-board computer based on the Bouffalo Lab BL808 RISC-V SoC with C906 64-bit and E907/E902 32-bit CPU cores supported by 64 MB of embedded PSRAM memory, and with built-in WiFi, Bluetooh and Zigbee radio interfaces. The Ox64 comes in a breadboard-friendly form-factor, has a microSD card slot, a USB 2.0 Type-C port, and many other peripheral interfaces for makers to integrate with sensors and other devices.&lt;br /&gt;
&lt;br /&gt;
== Software Releases ==&lt;br /&gt;
&lt;br /&gt;
=== Quick Links to the Source of OS Images Build ===&lt;br /&gt;
&lt;br /&gt;
There is a community effort to bring updated kernels, peripherals and buildroot - Lots of communication happening in the #ox64-nutcracker channel. &lt;br /&gt;
&lt;br /&gt;
* [https://github.com/openbouffalo/buildroot_bouffalo buildroot] bringing all the work below together with a bootable kernel and updated filesystem images for SD cards &lt;br /&gt;
* [https://github.com/smaeul/u-boot/tree/bl808 U-Boot] and [https://github.com/smaeul/opensbi/tree/bl808 OpenSBI] work by Smauel&lt;br /&gt;
* [https://github.com/arm000/linux-bl808/tree/linux-next/mboxic Kernel] IRQChip, SDCard, and (WIP) USB by arm000, Alexander Horner and others&lt;br /&gt;
* [https://github.com/openbouffalo/OBLFR OpenBouffalo Firmware] low_load drivers by Fishwaldo and others&lt;br /&gt;
&lt;br /&gt;
Original Linux Images provided by Bouffalo - Very basic '''alpha build''' which are only fit for board bring up and testing purposes. &lt;br /&gt;
&lt;br /&gt;
* [https://github.com/bouffalolab/bl808_linux Linux for BL808]&lt;br /&gt;
* [https://wiki.pine64.org/wiki/File:Linux_BL808.pdf Installation Instructions for Linux on BL808 (Chinese)]&lt;br /&gt;
* [https://wiki.pine64.org/wiki/File:Linux_BL808_en.pdf Installation Instructions for Linux on BL808 (machine translated to English)]&lt;br /&gt;
&lt;br /&gt;
Toolchain:&lt;br /&gt;
&lt;br /&gt;
* elf_newlib_toolchain/bin/riscv64-unknown-elf-gcc (Xuantie-900 elf newlib gcc Toolchain V2.2.5 B-20220323) 10.2.0&lt;br /&gt;
* linux_toolchain/bin/riscv64-unknown-linux-gnu-gcc (Xuantie-900 linux-5.10.4 glibc gcc Toolchain V2.2.4 B-20211227) 10.2.0&lt;br /&gt;
* cmake version 3.19.3&lt;br /&gt;
&lt;br /&gt;
=== Software Development Kits ===&lt;br /&gt;
* [https://github.com/bouffalolab/bl_mcu_sdk BL808 MCU SDK]&lt;br /&gt;
* [https://dev.bouffalolab.com/download BLDevCube Flashing Tool for Windows, macOS and Ubuntu x64]&lt;br /&gt;
* [https://wiki.pine64.org/wiki/File:Ox64_BL808UART_connect.pdf Ox64 UART Flashing Guide], see the [https://gist.github.com/lupyuen/7a0c697b89abccda8e38b33dfe5ebaff notes]&lt;br /&gt;
* [https://github.com/lupyuen/lupyuen.github.io/releases/download/ox64/bl808_demo_event.bin BL808 Demo Firmware: bl808_demo_event.bin], see the [https://gist.github.com/lupyuen/7a0c697b89abccda8e38b33dfe5ebaff notes]&lt;br /&gt;
* [https://github.com/lupyuen/lupyuen.github.io/releases/download/ox64/whole_flash_data.bin BL808 UART Log Firmware: whole_flash_data.bin], see the [https://gist.github.com/lupyuen/7a0c697b89abccda8e38b33dfe5ebaff notes]&lt;br /&gt;
* [https://github.com/lupyuen/lupyuen.github.io/releases/download/ox64/BL808.DVK.Quick.Start.pdf BL808 DVK Quick Start]&lt;br /&gt;
* [https://github.com/bouffalolab/bl808_linux/tree/main/opensbi-0.6-808 OpenSBI for BL808]&lt;br /&gt;
* [https://github.com/bouffalolab/bl-pac/tree/main/bl808 Rust Peripheral Access Crate (PAC) for BL808]&lt;br /&gt;
* [https://github.com/bouffalolab/bl-pac/blob/main/bl808/bl808.svd System View Description (SVD) for BL808]&lt;br /&gt;
&lt;br /&gt;
== SoC and Memory Specification ==&lt;br /&gt;
&lt;br /&gt;
[[File:Bouffalo_Lab_icon.png|right]]&lt;br /&gt;
&lt;br /&gt;
Based on the [https://en.bouffalolab.com/product/ Bouffalo Lab BL808]&lt;br /&gt;
&lt;br /&gt;
[[File:BL808_Block_Diagram.jpg|500px]]&lt;br /&gt;
&lt;br /&gt;
=== CPU Architecture ===&lt;br /&gt;
&lt;br /&gt;
[[File:T-Head.png|right|200px]]&lt;br /&gt;
&lt;br /&gt;
T-Head C906 480 MHz 64-bit RISC-V CPU:&lt;br /&gt;
&lt;br /&gt;
* Supports RISC-V RV64IMAFCV instruction architecture&lt;br /&gt;
* Five-stage single-issue sequentially executed pipeline&lt;br /&gt;
* Level-1 instruction and data cache of Harvard architecture, with a size of 32 KB and a cache line of 64B&lt;br /&gt;
* Sv39 memory management unit, realizing the conversion of virtual and real addresses and memory management&lt;br /&gt;
* jTLB that supports 128 entries&lt;br /&gt;
* Supports AXI 4.0 128-bit master interface&lt;br /&gt;
* Supports core local interrupt (CLINT) and platform-level interrupt controller (PLIC)&lt;br /&gt;
* With 80 external interrupt sources, 3 bits for configuring interrupt priority&lt;br /&gt;
* Supports BHT (8K) and BTB&lt;br /&gt;
* Compatible with RISC-V PMP, 8 configurable areas&lt;br /&gt;
* Supports hardware performance monitor (HPM) units&lt;br /&gt;
* See [https://www.t-head.cn/product/c906?lang=en here]&lt;br /&gt;
&lt;br /&gt;
T-Head E907 320 MHz 32-bit RISC-V CPU:&lt;br /&gt;
&lt;br /&gt;
* Supports RISC-V RV32IMAFCP instruction set&lt;br /&gt;
* Supports RISC-V 32-bit/16-bit mixed instruction set&lt;br /&gt;
* Supports RISC-V machine mode and user mode&lt;br /&gt;
* Thirty-two 32-bit integer general purpose registers (GPR) and thirty-two 32-bit/64-bit floating-point GPRs&lt;br /&gt;
* Integer (5-stage)/floating-point (7-stage), single-issue, sequentially executed pipeline&lt;br /&gt;
* Supports AXI 4.0 main device interface and AHB 5.0 peripheral interface&lt;br /&gt;
* 32K instruction cache, two-way set associative structure&lt;br /&gt;
* 16K data cache, two-way set associative structure&lt;br /&gt;
* See [https://www.t-head.cn/product/e907?lang=en here]&lt;br /&gt;
&lt;br /&gt;
T-Head E902 150 MHz 32-bit RISC-V CPU:&lt;br /&gt;
&lt;br /&gt;
* See [https://www.t-head.cn/product/e902?lang=en here]&lt;br /&gt;
&lt;br /&gt;
=== System Memory ===&lt;br /&gt;
* Embedded 64MB PSRAM&lt;br /&gt;
&lt;br /&gt;
== Board Features ==&lt;br /&gt;
&lt;br /&gt;
=== Network ===&lt;br /&gt;
* 2.4 GHz 1T1R WiFi 802.11 b/g/n&lt;br /&gt;
* Bluetooth 5.2&lt;br /&gt;
* Zigbee&lt;br /&gt;
* 10/100 Mbit/s Ethernet (optional, on expansion board)&lt;br /&gt;
&lt;br /&gt;
=== Storage ===&lt;br /&gt;
* On-board 16 Mbit (2 MB) or 128 Mbit (16 MB) XSPI NOR flash memory&lt;br /&gt;
* MicroSD, supports SDHC and SDXC (only on the 128 Mbit version)&lt;br /&gt;
&lt;br /&gt;
=== Expansion Ports ===&lt;br /&gt;
* USB 2.0 OTG port&lt;br /&gt;
* 26 GPIO pins, including SPI, I&amp;lt;sup&amp;gt;2&amp;lt;/sup&amp;gt;C and UART functionality, possible I&amp;lt;sup&amp;gt;2&amp;lt;/sup&amp;gt;S and GMII expansion&lt;br /&gt;
* Dual-lane MiPi CSI port, located at USB-C port, for camera module&lt;br /&gt;
&lt;br /&gt;
=== Audio ===&lt;br /&gt;
* Microphone (optional, on the camera module)&lt;br /&gt;
* Speaker (optional, on the camera module)&lt;br /&gt;
&lt;br /&gt;
== Board Information, Schematics and Certifications ==&lt;br /&gt;
[[File:Ox64 ethphy.png|thumb|Pinout for wiring ethernet PHY to EMAC]]&lt;br /&gt;
&lt;br /&gt;
* Baseboard dimensions: 51 mm x 21 mm x 19 mm x 3.5 mm (breadboard friendly)&lt;br /&gt;
* Input power: 5 V, 0.5 A through the microUSB or USB-C ports&lt;br /&gt;
&lt;br /&gt;
Production version schematic:&lt;br /&gt;
&lt;br /&gt;
* [https://files.pine64.org/doc/ox64/PINE64_Ox64-Schematic-202221018.pdf Ox64 Schematic 20221018 v1.1]&lt;br /&gt;
* [https://files.pine64.org/doc/ox64/PINE64_Ox64_PCB_Placement-Top-20221018.pdf Ox64 PCB Component placement(ToP) 20221018 v1.1]&lt;br /&gt;
* [https://files.pine64.org/doc/ox64/PINE64_Ox64_PCB_Placement-Bottom-20221018.pdf Ox64 PCB Component placement(Bottom) 20221018 v1.1]&lt;br /&gt;
&lt;br /&gt;
Prototype (dispatched to developers) schematic:&lt;br /&gt;
* [https://files.pine64.org/doc/ox64/PINE64_Ox64-Schematic-202221007.pdf Ox64 Schematic 20221007 v1.0]&lt;br /&gt;
* [https://files.pine64.org/doc/ox64/PINE64_Ox64_PCB_Placement-Top-20221007.pdf Ox64 PCB Component placement(ToP) 20221007 v1.0]&lt;br /&gt;
* [https://files.pine64.org/doc/ox64/PINE64_Ox64_PCB_Placement-Bottom-20221007.pdf Ox64 PCB Component placement(Bottom) 20221007 v1.0]&lt;br /&gt;
&lt;br /&gt;
Certifications:&lt;br /&gt;
* Disclaimer: Please note that PINE64 SBC is not a &amp;quot;final&amp;quot; product and in general certification is not necessary.&lt;br /&gt;
* Not yet available&lt;br /&gt;
&lt;br /&gt;
== Datasheets for Components and Peripherals ==&lt;br /&gt;
&lt;br /&gt;
Bouffalo BL808 SoC information:&lt;br /&gt;
* [https://raw.githubusercontent.com/bouffalolab/bl_docs/main/BL808_DS/en/BL808_DS_1.2_en.pdf Bouffalo Lab BL808 SoC Datasheet]&lt;br /&gt;
* [https://raw.githubusercontent.com/bouffalolab/bl_docs/main/BL808_RM/en/BL808_RM_en_1.3.pdf Bouffalo Lab BL808 SoC Reference Manual]&lt;br /&gt;
&lt;br /&gt;
SPI NOR Flash information:&lt;br /&gt;
* [https://files.pine64.org/doc/datasheet/ox64/gd25lq16e_rev1.2_20210108.pdf GigaDevice 16Mb XSPI-Flash Datasheet]&lt;br /&gt;
* [https://files.pine64.org/doc/datasheet/star64/gd25lq128e_rev1.0_20210513.pdf GigaDevice 128Mb XSPI-Flash Datasheet]&lt;br /&gt;
* [https://wiki.pine64.org/images/5/5d/W25Q128JW_RevB_11042019-1761358.pdf Winbond 128Mb QSPI-Flash Datasheet] (W25Q128JWSQ)&lt;br /&gt;
&lt;br /&gt;
Power Regulator information:&lt;br /&gt;
* [https://files.pine64.org/doc/datasheet/ox64/IA2014-03.pdf Innovation Analog Tech IA2014 Step_down Converter Datasheet]&lt;br /&gt;
&lt;br /&gt;
MicroSD socket information:&lt;br /&gt;
* [https://files.pine64.org/doc/datasheet/ox64/TF%20PUSH%20type%20socket%20specification.pdf Push type microSD socket specification]&lt;br /&gt;
&lt;br /&gt;
== Compatible UARTs when in bootloader mode ==&lt;br /&gt;
&lt;br /&gt;
When the Ox64 is in bootloader mode, some UARTs are unable to communicate with it. When this is the case, utilities such as BLDevCube are unable to actually program the device. If you see &amp;quot;Shake hand fail&amp;quot; and an empty ack, and your device is in bootloader mode, then it is likely an incompatible UART.&lt;br /&gt;
&lt;br /&gt;
The below devices have been tested and verified as working:&lt;br /&gt;
* Raspberry Pi Pico - running the following [https://github.com/sanjay900/ox64-uart/releases/tag/v1.1 UART firmware] (GP4 and GP5 are used for port 0, GP12 and GP13 for port 1)&lt;br /&gt;
* Compiled binary for Pi Pico and connectivity diagram is [https://github.com/Kris-Sekula/Pine64_Ox64_SBC/tree/main/uart here] &lt;br /&gt;
* ESP32 with CP210x - bridge the EN pin to ground to disable the ESP32 itself, and then connect the TX on the esp32 to 14 on the Ox64 and RX to pin 15. Note that only baud rate 115200 works, and this doesn't seem to work for everyone)&lt;br /&gt;
* Stand-alone CP2102 dongle works at 115200 baud. Brand used was HiLetgo.&lt;br /&gt;
* STM32F401 BlackPill - running the [https://github.com/blackmagic-debug/blackmagic/tree/main/src/platforms/blackpillv2 Black Magic Debug] firmware&lt;br /&gt;
* STM32F103C8T6 BluePill - running Black Magic Debug.&lt;br /&gt;
* Some UART adapters based on the FT232H (note that the FT232RL does not work, and neither does the Pine 64 JTAG)&lt;br /&gt;
* Some CH340G based adapters work and some don't.&lt;br /&gt;
&lt;br /&gt;
== Resources ==&lt;br /&gt;
* [https://lupyuen.codeberg.page/articles/ox64.html Ox64 BL808 RISC-V SBC: Booting Linux and (maybe) Apache NuttX RTOS]&lt;br /&gt;
* A video on how to connect to, flash and boot the Ox64 as at 2023-02 (15min) can be found [https://youtube.com/watch?v=czRtF-UNiEY here].&lt;br /&gt;
* Another video that covers soldering pins, connecting via Pi Pico and flashing Linux (inc u-boot, as of 2023-Mar-3) posted [https://youtu.be/vPAk5sq_Ilc here].&lt;br /&gt;
* A step-by-step tutorial for how to build, flash and run Ox64 [https://wiki.pine64.org/images/5/59/How_to_Run_Ox64.pdf here]&lt;br /&gt;
* [https://gist.github.com/lupyuen/7a0c697b89abccda8e38b33dfe5ebaff First Batch of Ox64 won't appear as USB Serial Port]&lt;br /&gt;
* [https://gist.github.com/lupyuen/2087e9b3fb40aab5e0795bb02a265a3b First Batch of Ox64 tested OK with CH340C/G]&lt;br /&gt;
* [https://www.robertlipe.com/bl808-not-symmetric/ First thoughts on the (a)symmetry of Bouffalo Labs BL808 as in Pine64’s Ox64]&lt;br /&gt;
* [https://thelittleengineerthatcould.blogspot.com/2022/12/the-8-linux-computer-part-2.html The $8 linux computer (with picoprobe-rp2040 programming instructions)]&lt;br /&gt;
* [https://github.com/p4ddy1/pine_ox64/blob/main/build_toolchain_macos.md Building the Xuantie GNU Toolchain for Ox64 on macOS and Apple Silicon]&lt;br /&gt;
* [https://lupyuen.codeberg.page/articles/ox2.html RISC-V Ox64 BL808 SBC: Starting Apache NuttX Real-Time Operating System]&lt;br /&gt;
&lt;br /&gt;
Git repositories:&lt;br /&gt;
* [https://github.com/sfranzyshen/arduino-bl808 Community made Arduino Core specifically for the Bouffalo Labs BL808 RISC-V MCU] (Initial development has been postponed until further notice.)&lt;br /&gt;
&lt;br /&gt;
== Development Efforts ==&lt;br /&gt;
* [https://twitter.com/gamelaster/status/1583916501400068096 Ox64 boots Linux successfully]&lt;br /&gt;
* [https://twitter.com/btashton/status/1586381334439923713?t=w5xRRUR74HGK2O1Zg_aFyw&amp;amp;s=19 Brennan Ashton is porting Apache NuttX RTOS and OpenAMP (Asymmetric Multiprocessing) to BL808]&lt;br /&gt;
* [https://twitter.com/thanos_engine/status/1585153938092761093 Phone Concept for BL808]&lt;br /&gt;
&lt;br /&gt;
== Build==&lt;br /&gt;
&lt;br /&gt;
Open the terminal and create a new directory for the build:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
mkdir buildroot_bouffalo &amp;amp;&amp;amp; cd buildroot_bouffalo&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Clone the primary Buildroot repository and the specific Buildroot Bouffalo repository:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
git clone https://github.com/buildroot/buildroot&lt;br /&gt;
git clone https://github.com/openbouffalo/buildroot_bouffalo&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Define an environment variable for the Buildroot Bouffalo overlay path:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
export BR_BOUFFALO_OVERLAY_PATH=$(pwd)/buildroot_bouffalo&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Change directory into the cloned Buildroot folder:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
cd buildroot&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Apply the default configuration for Pine64 Ox64:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
make BR2_EXTERNAL=$BR_BOUFFALO_OVERLAY_PATH pine64_ox64_defconfig&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Use the &amp;lt;code&amp;gt;menuconfig&amp;lt;/code&amp;gt; tool to adjust build settings:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
make menuconfig&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
'''Note''': Within &amp;lt;code&amp;gt;menuconfig&amp;lt;/code&amp;gt;:&lt;br /&gt;
* Navigate to &amp;lt;code&amp;gt;Target Architecture&amp;lt;/code&amp;gt;&lt;br /&gt;
* Enable &amp;lt;code&amp;gt;Integer Multiplication and Division (M)&amp;lt;/code&amp;gt;&lt;br /&gt;
* Enable &amp;lt;code&amp;gt;Atomic Instructions (A)&amp;lt;/code&amp;gt;&lt;br /&gt;
* Enable &amp;lt;code&amp;gt;Single-precision Floating-point (F)&amp;lt;/code&amp;gt;&lt;br /&gt;
* Enable &amp;lt;code&amp;gt;Double-precision Floating-point (D)&amp;lt;/code&amp;gt;&lt;br /&gt;
* Set &amp;lt;code&amp;gt;Target ABI&amp;lt;/code&amp;gt; to &amp;lt;code&amp;gt;lp64d&amp;lt;/code&amp;gt;&lt;br /&gt;
[[File:target ABI setting.png|thumb|right|200px|target ABI setting]]&lt;br /&gt;
* Under &amp;lt;code&amp;gt;Toolchain&amp;lt;/code&amp;gt;, enable &amp;lt;code&amp;gt;Fortran support&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;OpenMP support&amp;lt;/code&amp;gt;&lt;br /&gt;
[[File:toolchain setting.png|thumb|right|200px|toolchain setting]]&lt;br /&gt;
&lt;br /&gt;
Initiate the build process:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
make&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
'''Note''': Before executing the &amp;lt;code&amp;gt;make&amp;lt;/code&amp;gt; command, ensure your &amp;lt;code&amp;gt;PATH&amp;lt;/code&amp;gt; variable doesn't have spaces.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Flashing Ox64 SBC and SD Card for Newbies==&lt;br /&gt;
This section explains how to flash Ox64 board and the SD card to boot the system. It's very low level for newbies.&lt;br /&gt;
&lt;br /&gt;
[[File:Pine Serial v2.png|thumb|right|200px|Wiring Raspberry Pico Pi to Pine64 Ox64 SBC]]&lt;br /&gt;
&lt;br /&gt;
=== Prepare the Environment === &lt;br /&gt;
You need a Linux machine, a Uart module (i.e Raspberry Pico Pi), the Ox64 board and a SD card.&lt;br /&gt;
&lt;br /&gt;
Start a terminal session and set the working directory&lt;br /&gt;
 cd ~/Downloads&lt;br /&gt;
 mkdir ox64 ox64/devcube183&lt;br /&gt;
 cd ~/Downloads/ox64/devcube183&lt;br /&gt;
&lt;br /&gt;
Get flasher DevCube 1.8.3 from one of mirrored servers and decompress it:&lt;br /&gt;
* https://openbouffalo.org/static-assets/bldevcube/BouffaloLabDevCube-v1.8.3.zip&lt;br /&gt;
* https://hachyderm.io/@mkroman/110787218805897192 &amp;gt; https://pub.rwx.im/~mk/bouffalolab/BouffaloLabDevCube-v1.8.3.zip&lt;br /&gt;
* https://we.tl/t-eJWShQJ4iF&lt;br /&gt;
* https://cdn.discordapp.com/attachments/771032441971802142/1145565853962735639/BouffaloLabDevCube-v1.8.3.zip&lt;br /&gt;
&lt;br /&gt;
''SHA1: 0f2619e87d946f936f63ae97b0efd674357b1166''&lt;br /&gt;
&lt;br /&gt;
''SHA256SUMS: e6e6db316359da40d29971a1889d41c9e97d5b1ff1a8636e9e6960b6ff960913''&lt;br /&gt;
&lt;br /&gt;
 wget https://openbouffalo.org/static-assets/bldevcube/BouffaloLabDevCube-v1.8.3.zip&lt;br /&gt;
 unzip BouffaloLabDevCube-v1.8.3.zip&lt;br /&gt;
 chmod u+x BLDevCube-ubuntu&lt;br /&gt;
&lt;br /&gt;
Download compressed file from https://github.com/openbouffalo/buildroot_bouffalo/releases/ and decompress it.&lt;br /&gt;
&lt;br /&gt;
(You can also get the compressed the file from https://github.com/openbouffalo/buildroot_bouffalo/releases/download/v1.0.1/bl808-linux-pine64_ox64_full_defconfig.tar.gz)&lt;br /&gt;
&lt;br /&gt;
 cd ~/Downloads/ox64&lt;br /&gt;
 mkdir openbouffalo &amp;amp;&amp;amp; cd openbouffalo&lt;br /&gt;
 wget https://github.com/openbouffalo/buildroot_bouffalo/releases/download/v1.0.1/bl808-linux-pine64_ox64_full_defconfig.tar.gz&lt;br /&gt;
 tar -xvzf bl808-linux-pine64_ox64_full_defconfig.tar.gz&lt;br /&gt;
&lt;br /&gt;
 You'll get this structure&lt;br /&gt;
   |_ firmware/&lt;br /&gt;
   |_ firmware/m0_lowload_bl808_m0.bin&lt;br /&gt;
   |_ firmware/bl808-firmware.bin&lt;br /&gt;
   |_ firmware/d0_lowload_bl808_d0.bin&lt;br /&gt;
   |_ firmware/sdcard-pine64_ox64_full_defconfig.img.xz&lt;br /&gt;
&lt;br /&gt;
=== Flash Ox64  === &lt;br /&gt;
Connect the the Uart module (i.e Raspberry Pico Pi) for serial communicate from PC to Ox64&lt;br /&gt;
&lt;br /&gt;
 ls /dev/ttyACM*&lt;br /&gt;
&lt;br /&gt;
There are two new ports to choose from : /dev/ttyACM0  /dev/ttyACM1, use the lower number.&lt;br /&gt;
&lt;br /&gt;
 minicom -b 2000000 -D /dev/ttyACM0&lt;br /&gt;
&lt;br /&gt;
Set ox64 board to programming mode&lt;br /&gt;
&lt;br /&gt;
* Press BOOT button&lt;br /&gt;
* Apply power&lt;br /&gt;
* Release BOOT button&lt;br /&gt;
&lt;br /&gt;
Close minicom. Open a new terminal window to run DevCube flasher&lt;br /&gt;
&lt;br /&gt;
 cd ~/Downloads/ox64/devcube183&lt;br /&gt;
 ./BLDevCube-ubuntu&lt;br /&gt;
&lt;br /&gt;
Select chip [BL808], press Finish and switch to [MCU] tab&lt;br /&gt;
&lt;br /&gt;
 M0 Group[group0] Image Addr [0x58000000] [PATH to m0_lowload_bl808_m0.bin]&lt;br /&gt;
 D0 Group[group0] Image Addr [0x58100000] [PATH to d0_lowload_bl808_d0.bin]&lt;br /&gt;
 Interface: Uart&lt;br /&gt;
 Port/SN: /dev/ttyACM1&lt;br /&gt;
 Uart rate 2000000&lt;br /&gt;
 UART TX is physical pin 1/GPIO 14.&lt;br /&gt;
 UART RX is physical pin 2/GPIO 15.&lt;br /&gt;
 Click 'Create &amp;amp; Download' and wait until it's done&lt;br /&gt;
&lt;br /&gt;
Switch to [IOT] tab&lt;br /&gt;
 Enable 'Single Download', set Address with 0x800000, choose [PATH to bl808-firmware.bin]&lt;br /&gt;
 Click 'Create &amp;amp; Download' again and wait until it's done&lt;br /&gt;
 Close DevCube&lt;br /&gt;
&lt;br /&gt;
=== Alternative: Open-Source Flashing ===&lt;br /&gt;
For those who do not want to use the DevCube, BouffaloLab provide open-source flashing packages &amp;amp;mdash; &amp;lt;code&amp;gt;bflb-iot-tool&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;bflb-mcu-tool&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
: Note: While these packages do contain binaries in addition to the Python source code, those binaries do not appear to be used for UART flashing.&lt;br /&gt;
&lt;br /&gt;
Execute the following commands to flash the BL808. Note that the addresses are different to the ones you would use in the DevCube.&lt;br /&gt;
&lt;br /&gt;
: Reminder: UART TX is physical pin 1/GPIO 14, UART RX is physical pin 2/GPIO 15.&lt;br /&gt;
 pip install bflb-iot-tool # we are *not* using bflb-mcu-tool&lt;br /&gt;
 &lt;br /&gt;
 bflb-iot-tool --chipname bl808 --interface uart --port /dev/ttyACM0 --addr 0x000000 --firmware firmware/m0_lowload_bl808_m0.bin --single&lt;br /&gt;
 bflb-iot-tool --chipname bl808 --interface uart --port /dev/ttyACM0 --addr 0x100000 --firmware firmware/d0_lowload_bl808_d0.bin --single&lt;br /&gt;
 bflb-iot-tool --chipname bl808 --interface uart --port /dev/ttyACM0 --addr 0x800000 --firmware firmware/bl808-firmware.bin --single&lt;br /&gt;
&lt;br /&gt;
=== Flash SD Card ===&lt;br /&gt;
Insert SD card into PC, find address [/dev/sdb], erase initial space and flash sdcard.xxxx.img file.&lt;br /&gt;
&lt;br /&gt;
 cd ~/Downloads/ox64/openbouffalo/firmware&lt;br /&gt;
 xz -v -d -k sdcard-pine64_ox64_full_defconfig.img.xz&lt;br /&gt;
 sudo dd if=/dev/zero of=/dev/sdb count=1 bs=32768 &lt;br /&gt;
 sudo dd if=~/Downloads/ox64/openbouffalo/firmware/sdcard-pine64_ox64_full_defconfig.img of=/dev/sdb bs=1M status=progress conv=fsync&lt;br /&gt;
&lt;br /&gt;
=== First Booting ===&lt;br /&gt;
&lt;br /&gt;
Insert SD card into Ox64 and set a tty connection to Ox64 board&lt;br /&gt;
* Serial Console access:&lt;br /&gt;
* UART TX is physical pin 32/GPIO 16.&lt;br /&gt;
* UART RX is physical pin 31/GPIO 17.&lt;br /&gt;
* Baud 2000000.&lt;br /&gt;
&lt;br /&gt;
 minicom -b 2000000 -D /dev/ttyACM0&lt;br /&gt;
&lt;br /&gt;
Re-Apply power to ox64&lt;br /&gt;
&lt;br /&gt;
Enjoy the boot!&lt;br /&gt;
&lt;br /&gt;
PS. To investigate running services&lt;br /&gt;
 pstree | head -5&lt;br /&gt;
   init-+-dhcpcd---3*[dhcpcd]&lt;br /&gt;
        |-dropbear&lt;br /&gt;
        |-klogd&lt;br /&gt;
        |-login---sh-+-head&lt;br /&gt;
        |            `-pstree&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Category:Ox64]] [[Category:Bouffalo BL808]]&lt;/div&gt;</summary>
		<author><name>Lupyuen</name></author>
	</entry>
	<entry>
		<id>https://wiki.pine64.org/index.php?title=Ox64&amp;diff=21077</id>
		<title>Ox64</title>
		<link rel="alternate" type="text/html" href="https://wiki.pine64.org/index.php?title=Ox64&amp;diff=21077"/>
		<updated>2023-11-04T04:36:43Z</updated>

		<summary type="html">&lt;p&gt;Lupyuen: Add article &amp;quot;Ox64 BL808 RISC-V SBC: Booting Linux and (maybe) Apache NuttX RTOS&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[File:Ox64_board.jpg|thumb|right|The Ox64]]&lt;br /&gt;
[[File:Ox64 pinout.png|thumb|Pinout of the production version]]&lt;br /&gt;
[[File:RISC-V.png|thumb|right|Powered by RISC-V]]&lt;br /&gt;
&lt;br /&gt;
The '''Ox64''' is a RISC-V based single-board computer based on the Bouffalo Lab BL808 RISC-V SoC with C906 64-bit and E907/E902 32-bit CPU cores supported by 64 MB of embedded PSRAM memory, and with built-in WiFi, Bluetooh and Zigbee radio interfaces. The Ox64 comes in a breadboard-friendly form-factor, has a microSD card slot, a USB 2.0 Type-C port, and many other peripheral interfaces for makers to integrate with sensors and other devices.&lt;br /&gt;
&lt;br /&gt;
== Software Releases ==&lt;br /&gt;
&lt;br /&gt;
=== Quick Links to the Source of OS Images Build ===&lt;br /&gt;
&lt;br /&gt;
There is a community effort to bring updated kernels, peripherals and buildroot - Lots of communication happening in the #ox64-nutcracker channel. &lt;br /&gt;
&lt;br /&gt;
* [https://github.com/openbouffalo/buildroot_bouffalo buildroot] bringing all the work below together with a bootable kernel and updated filesystem images for SD cards &lt;br /&gt;
* [https://github.com/smaeul/u-boot/tree/bl808 U-Boot] and [https://github.com/smaeul/opensbi/tree/bl808 OpenSBI] work by Smauel&lt;br /&gt;
* [https://github.com/arm000/linux-bl808/tree/linux-next/mboxic Kernel] IRQChip, SDCard, and (WIP) USB by arm000, Alexander Horner and others&lt;br /&gt;
* [https://github.com/openbouffalo/OBLFR OpenBouffalo Firmware] low_load drivers by Fishwaldo and others&lt;br /&gt;
&lt;br /&gt;
Original Linux Images provided by Bouffalo - Very basic '''alpha build''' which are only fit for board bring up and testing purposes. &lt;br /&gt;
&lt;br /&gt;
* [https://github.com/bouffalolab/bl808_linux Linux for BL808]&lt;br /&gt;
* [https://wiki.pine64.org/wiki/File:Linux_BL808.pdf Installation Instructions for Linux on BL808 (Chinese)]&lt;br /&gt;
* [https://wiki.pine64.org/wiki/File:Linux_BL808_en.pdf Installation Instructions for Linux on BL808 (machine translated to English)]&lt;br /&gt;
&lt;br /&gt;
Toolchain:&lt;br /&gt;
&lt;br /&gt;
* elf_newlib_toolchain/bin/riscv64-unknown-elf-gcc (Xuantie-900 elf newlib gcc Toolchain V2.2.5 B-20220323) 10.2.0&lt;br /&gt;
* linux_toolchain/bin/riscv64-unknown-linux-gnu-gcc (Xuantie-900 linux-5.10.4 glibc gcc Toolchain V2.2.4 B-20211227) 10.2.0&lt;br /&gt;
* cmake version 3.19.3&lt;br /&gt;
&lt;br /&gt;
=== Software Development Kits ===&lt;br /&gt;
* [https://github.com/bouffalolab/bl_mcu_sdk BL808 MCU SDK]&lt;br /&gt;
* [https://dev.bouffalolab.com/download BLDevCube Flashing Tool for Windows, macOS and Ubuntu x64]&lt;br /&gt;
* [https://wiki.pine64.org/wiki/File:Ox64_BL808UART_connect.pdf Ox64 UART Flashing Guide], see the [https://gist.github.com/lupyuen/7a0c697b89abccda8e38b33dfe5ebaff notes]&lt;br /&gt;
* [https://github.com/lupyuen/lupyuen.github.io/releases/download/ox64/bl808_demo_event.bin BL808 Demo Firmware: bl808_demo_event.bin], see the [https://gist.github.com/lupyuen/7a0c697b89abccda8e38b33dfe5ebaff notes]&lt;br /&gt;
* [https://github.com/lupyuen/lupyuen.github.io/releases/download/ox64/whole_flash_data.bin BL808 UART Log Firmware: whole_flash_data.bin], see the [https://gist.github.com/lupyuen/7a0c697b89abccda8e38b33dfe5ebaff notes]&lt;br /&gt;
* [https://github.com/lupyuen/lupyuen.github.io/releases/download/ox64/BL808.DVK.Quick.Start.pdf BL808 DVK Quick Start]&lt;br /&gt;
* [https://github.com/bouffalolab/bl808_linux/tree/main/opensbi-0.6-808 OpenSBI for BL808]&lt;br /&gt;
* [https://github.com/bouffalolab/bl-pac/tree/main/bl808 Rust Peripheral Access Crate (PAC) for BL808]&lt;br /&gt;
* [https://github.com/bouffalolab/bl-pac/blob/main/bl808/bl808.svd System View Description (SVD) for BL808]&lt;br /&gt;
&lt;br /&gt;
== SoC and Memory Specification ==&lt;br /&gt;
&lt;br /&gt;
[[File:Bouffalo_Lab_icon.png|right]]&lt;br /&gt;
&lt;br /&gt;
Based on the [https://en.bouffalolab.com/product/ Bouffalo Lab BL808]&lt;br /&gt;
&lt;br /&gt;
[[File:BL808_Block_Diagram.jpg|500px]]&lt;br /&gt;
&lt;br /&gt;
=== CPU Architecture ===&lt;br /&gt;
&lt;br /&gt;
[[File:T-Head.png|right|200px]]&lt;br /&gt;
&lt;br /&gt;
T-Head C906 480 MHz 64-bit RISC-V CPU:&lt;br /&gt;
&lt;br /&gt;
* Supports RISC-V RV64IMAFCV instruction architecture&lt;br /&gt;
* Five-stage single-issue sequentially executed pipeline&lt;br /&gt;
* Level-1 instruction and data cache of Harvard architecture, with a size of 32 KB and a cache line of 64B&lt;br /&gt;
* Sv39 memory management unit, realizing the conversion of virtual and real addresses and memory management&lt;br /&gt;
* jTLB that supports 128 entries&lt;br /&gt;
* Supports AXI 4.0 128-bit master interface&lt;br /&gt;
* Supports core local interrupt (CLINT) and platform-level interrupt controller (PLIC)&lt;br /&gt;
* With 80 external interrupt sources, 3 bits for configuring interrupt priority&lt;br /&gt;
* Supports BHT (8K) and BTB&lt;br /&gt;
* Compatible with RISC-V PMP, 8 configurable areas&lt;br /&gt;
* Supports hardware performance monitor (HPM) units&lt;br /&gt;
* See [https://www.t-head.cn/product/c906?lang=en here]&lt;br /&gt;
&lt;br /&gt;
T-Head E907 320 MHz 32-bit RISC-V CPU:&lt;br /&gt;
&lt;br /&gt;
* Supports RISC-V RV32IMAFCP instruction set&lt;br /&gt;
* Supports RISC-V 32-bit/16-bit mixed instruction set&lt;br /&gt;
* Supports RISC-V machine mode and user mode&lt;br /&gt;
* Thirty-two 32-bit integer general purpose registers (GPR) and thirty-two 32-bit/64-bit floating-point GPRs&lt;br /&gt;
* Integer (5-stage)/floating-point (7-stage), single-issue, sequentially executed pipeline&lt;br /&gt;
* Supports AXI 4.0 main device interface and AHB 5.0 peripheral interface&lt;br /&gt;
* 32K instruction cache, two-way set associative structure&lt;br /&gt;
* 16K data cache, two-way set associative structure&lt;br /&gt;
* See [https://www.t-head.cn/product/e907?lang=en here]&lt;br /&gt;
&lt;br /&gt;
T-Head E902 150 MHz 32-bit RISC-V CPU:&lt;br /&gt;
&lt;br /&gt;
* See [https://www.t-head.cn/product/e902?lang=en here]&lt;br /&gt;
&lt;br /&gt;
=== System Memory ===&lt;br /&gt;
* Embedded 64MB PSRAM&lt;br /&gt;
&lt;br /&gt;
== Board Features ==&lt;br /&gt;
&lt;br /&gt;
=== Network ===&lt;br /&gt;
* 2.4 GHz 1T1R WiFi 802.11 b/g/n&lt;br /&gt;
* Bluetooth 5.2&lt;br /&gt;
* Zigbee&lt;br /&gt;
* 10/100 Mbit/s Ethernet (optional, on expansion board)&lt;br /&gt;
&lt;br /&gt;
=== Storage ===&lt;br /&gt;
* On-board 16 Mbit (2 MB) or 128 Mbit (16 MB) XSPI NOR flash memory&lt;br /&gt;
* MicroSD, supports SDHC and SDXC (only on the 128 Mbit version)&lt;br /&gt;
&lt;br /&gt;
=== Expansion Ports ===&lt;br /&gt;
* USB 2.0 OTG port&lt;br /&gt;
* 26 GPIO pins, including SPI, I&amp;lt;sup&amp;gt;2&amp;lt;/sup&amp;gt;C and UART functionality, possible I&amp;lt;sup&amp;gt;2&amp;lt;/sup&amp;gt;S and GMII expansion&lt;br /&gt;
* Dual-lane MiPi CSI port, located at USB-C port, for camera module&lt;br /&gt;
&lt;br /&gt;
=== Audio ===&lt;br /&gt;
* Microphone (optional, on the camera module)&lt;br /&gt;
* Speaker (optional, on the camera module)&lt;br /&gt;
&lt;br /&gt;
== Board Information, Schematics and Certifications ==&lt;br /&gt;
[[File:Ox64 ethphy.png|thumb|Pinout for wiring ethernet PHY to EMAC]]&lt;br /&gt;
&lt;br /&gt;
* Baseboard dimensions: 51 mm x 21 mm x 19 mm x 3.5 mm (breadboard friendly)&lt;br /&gt;
* Input power: 5 V, 0.5 A through the microUSB or USB-C ports&lt;br /&gt;
&lt;br /&gt;
Production version schematic:&lt;br /&gt;
&lt;br /&gt;
* [https://files.pine64.org/doc/ox64/PINE64_Ox64-Schematic-202221018.pdf Ox64 Schematic 20221018 v1.1]&lt;br /&gt;
* [https://files.pine64.org/doc/ox64/PINE64_Ox64_PCB_Placement-Top-20221018.pdf Ox64 PCB Component placement(ToP) 20221018 v1.1]&lt;br /&gt;
* [https://files.pine64.org/doc/ox64/PINE64_Ox64_PCB_Placement-Bottom-20221018.pdf Ox64 PCB Component placement(Bottom) 20221018 v1.1]&lt;br /&gt;
&lt;br /&gt;
Prototype (dispatched to developers) schematic:&lt;br /&gt;
* [https://files.pine64.org/doc/ox64/PINE64_Ox64-Schematic-202221007.pdf Ox64 Schematic 20221007 v1.0]&lt;br /&gt;
* [https://files.pine64.org/doc/ox64/PINE64_Ox64_PCB_Placement-Top-20221007.pdf Ox64 PCB Component placement(ToP) 20221007 v1.0]&lt;br /&gt;
* [https://files.pine64.org/doc/ox64/PINE64_Ox64_PCB_Placement-Bottom-20221007.pdf Ox64 PCB Component placement(Bottom) 20221007 v1.0]&lt;br /&gt;
&lt;br /&gt;
Certifications:&lt;br /&gt;
* Disclaimer: Please note that PINE64 SBC is not a &amp;quot;final&amp;quot; product and in general certification is not necessary.&lt;br /&gt;
* Not yet available&lt;br /&gt;
&lt;br /&gt;
== Datasheets for Components and Peripherals ==&lt;br /&gt;
&lt;br /&gt;
Bouffalo BL808 SoC information:&lt;br /&gt;
* [https://raw.githubusercontent.com/bouffalolab/bl_docs/main/BL808_DS/en/BL808_DS_1.2_en.pdf Bouffalo Lab BL808 SoC Datasheet]&lt;br /&gt;
* [https://raw.githubusercontent.com/bouffalolab/bl_docs/main/BL808_RM/en/BL808_RM_en_1.3.pdf Bouffalo Lab BL808 SoC Reference Manual]&lt;br /&gt;
&lt;br /&gt;
SPI NOR Flash information:&lt;br /&gt;
* [https://files.pine64.org/doc/datasheet/ox64/gd25lq16e_rev1.2_20210108.pdf GigaDevice 16Mb XSPI-Flash Datasheet]&lt;br /&gt;
* [https://files.pine64.org/doc/datasheet/star64/gd25lq128e_rev1.0_20210513.pdf GigaDevice 128Mb XSPI-Flash Datasheet]&lt;br /&gt;
* [https://wiki.pine64.org/images/5/5d/W25Q128JW_RevB_11042019-1761358.pdf Winbond 128Mb QSPI-Flash Datasheet] (W25Q128JWSQ)&lt;br /&gt;
&lt;br /&gt;
Power Regulator information:&lt;br /&gt;
* [https://files.pine64.org/doc/datasheet/ox64/IA2014-03.pdf Innovation Analog Tech IA2014 Step_down Converter Datasheet]&lt;br /&gt;
&lt;br /&gt;
MicroSD socket information:&lt;br /&gt;
* [https://files.pine64.org/doc/datasheet/ox64/TF%20PUSH%20type%20socket%20specification.pdf Push type microSD socket specification]&lt;br /&gt;
&lt;br /&gt;
== Compatible UARTs when in bootloader mode ==&lt;br /&gt;
&lt;br /&gt;
When the Ox64 is in bootloader mode, some UARTs are unable to communicate with it. When this is the case, utilities such as BLDevCube are unable to actually program the device. If you see &amp;quot;Shake hand fail&amp;quot; and an empty ack, and your device is in bootloader mode, then it is likely an incompatible UART.&lt;br /&gt;
&lt;br /&gt;
The below devices have been tested and verified as working:&lt;br /&gt;
* Raspberry Pi Pico - running the following [https://github.com/sanjay900/ox64-uart/releases/tag/v1.1 UART firmware] (GP4 and GP5 are used for port 0, GP12 and GP13 for port 1)&lt;br /&gt;
* Compiled binary for Pi Pico and connectivity diagram is [https://github.com/Kris-Sekula/Pine64_Ox64_SBC/tree/main/uart here] &lt;br /&gt;
* ESP32 with CP210x - bridge the EN pin to ground to disable the ESP32 itself, and then connect the TX on the esp32 to 14 on the Ox64 and RX to pin 15. Note that only baud rate 115200 works, and this doesn't seem to work for everyone)&lt;br /&gt;
* Stand-alone CP2102 dongle works at 115200 baud. Brand used was HiLetgo.&lt;br /&gt;
* STM32F401 BlackPill - running the [https://github.com/blackmagic-debug/blackmagic/tree/main/src/platforms/blackpillv2 Black Magic Debug] firmware&lt;br /&gt;
* STM32F103C8T6 BluePill - running Black Magic Debug.&lt;br /&gt;
* Some UART adapters based on the FT232H (note that the FT232RL does not work, and neither does the Pine 64 JTAG)&lt;br /&gt;
* Some CH340G based adapters work and some don't.&lt;br /&gt;
&lt;br /&gt;
== Resources ==&lt;br /&gt;
* [https://lupyuen.codeberg.page/articles/ox64.html Ox64 BL808 RISC-V SBC: Booting Linux and (maybe) Apache NuttX RTOS]&lt;br /&gt;
* A video on how to connect to, flash and boot the Ox64 as at 2023-02 (15min) can be found [https://youtube.com/watch?v=czRtF-UNiEY here].&lt;br /&gt;
* Another video that covers soldering pins, connecting via Pi Pico and flashing Linux (inc u-boot, as of 2023-Mar-3) posted [https://youtu.be/vPAk5sq_Ilc here].&lt;br /&gt;
* A step-by-step tutorial for how to build, flash and run Ox64 [https://wiki.pine64.org/images/5/59/How_to_Run_Ox64.pdf here]&lt;br /&gt;
* [https://gist.github.com/lupyuen/7a0c697b89abccda8e38b33dfe5ebaff First Batch of Ox64 won't appear as USB Serial Port]&lt;br /&gt;
* [https://gist.github.com/lupyuen/2087e9b3fb40aab5e0795bb02a265a3b First Batch of Ox64 tested OK with CH340C/G]&lt;br /&gt;
* [https://www.robertlipe.com/bl808-not-symmetric/ First thoughts on the (a)symmetry of Bouffalo Labs BL808 as in Pine64’s Ox64]&lt;br /&gt;
* [https://thelittleengineerthatcould.blogspot.com/2022/12/the-8-linux-computer-part-2.html The $8 linux computer (with picoprobe-rp2040 programming instructions)]&lt;br /&gt;
* [https://github.com/p4ddy1/pine_ox64/blob/main/build_toolchain_macos.md Building the Xuantie GNU Toolchain for Ox64 on macOS and Apple Silicon]&lt;br /&gt;
&lt;br /&gt;
Git repositories:&lt;br /&gt;
* [https://github.com/sfranzyshen/arduino-bl808 Community made Arduino Core specifically for the Bouffalo Labs BL808 RISC-V MCU] (Initial development has been postponed until further notice.)&lt;br /&gt;
&lt;br /&gt;
== Development Efforts ==&lt;br /&gt;
* [https://twitter.com/gamelaster/status/1583916501400068096 Ox64 boots Linux successfully]&lt;br /&gt;
* [https://twitter.com/btashton/status/1586381334439923713?t=w5xRRUR74HGK2O1Zg_aFyw&amp;amp;s=19 Brennan Ashton is porting Apache NuttX RTOS and OpenAMP (Asymmetric Multiprocessing) to BL808]&lt;br /&gt;
* [https://twitter.com/thanos_engine/status/1585153938092761093 Phone Concept for BL808]&lt;br /&gt;
&lt;br /&gt;
== Build==&lt;br /&gt;
&lt;br /&gt;
Open the terminal and create a new directory for the build:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
mkdir buildroot_bouffalo &amp;amp;&amp;amp; cd buildroot_bouffalo&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Clone the primary Buildroot repository and the specific Buildroot Bouffalo repository:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
git clone https://github.com/buildroot/buildroot&lt;br /&gt;
git clone https://github.com/openbouffalo/buildroot_bouffalo&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Define an environment variable for the Buildroot Bouffalo overlay path:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
export BR_BOUFFALO_OVERLAY_PATH=$(pwd)/buildroot_bouffalo&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Change directory into the cloned Buildroot folder:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
cd buildroot&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Apply the default configuration for Pine64 Ox64:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
make BR2_EXTERNAL=$BR_BOUFFALO_OVERLAY_PATH pine64_ox64_defconfig&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Use the &amp;lt;code&amp;gt;menuconfig&amp;lt;/code&amp;gt; tool to adjust build settings:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
make menuconfig&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
'''Note''': Within &amp;lt;code&amp;gt;menuconfig&amp;lt;/code&amp;gt;:&lt;br /&gt;
* Navigate to &amp;lt;code&amp;gt;Target Architecture&amp;lt;/code&amp;gt;&lt;br /&gt;
* Enable &amp;lt;code&amp;gt;Integer Multiplication and Division (M)&amp;lt;/code&amp;gt;&lt;br /&gt;
* Enable &amp;lt;code&amp;gt;Atomic Instructions (A)&amp;lt;/code&amp;gt;&lt;br /&gt;
* Enable &amp;lt;code&amp;gt;Single-precision Floating-point (F)&amp;lt;/code&amp;gt;&lt;br /&gt;
* Enable &amp;lt;code&amp;gt;Double-precision Floating-point (D)&amp;lt;/code&amp;gt;&lt;br /&gt;
* Set &amp;lt;code&amp;gt;Target ABI&amp;lt;/code&amp;gt; to &amp;lt;code&amp;gt;lp64d&amp;lt;/code&amp;gt;&lt;br /&gt;
[[File:target ABI setting.png|thumb|right|200px|target ABI setting]]&lt;br /&gt;
* Under &amp;lt;code&amp;gt;Toolchain&amp;lt;/code&amp;gt;, enable &amp;lt;code&amp;gt;Fortran support&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;OpenMP support&amp;lt;/code&amp;gt;&lt;br /&gt;
[[File:toolchain setting.png|thumb|right|200px|toolchain setting]]&lt;br /&gt;
&lt;br /&gt;
Initiate the build process:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
make&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
'''Note''': Before executing the &amp;lt;code&amp;gt;make&amp;lt;/code&amp;gt; command, ensure your &amp;lt;code&amp;gt;PATH&amp;lt;/code&amp;gt; variable doesn't have spaces.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Flashing Ox64 SBC and SD Card for Newbies==&lt;br /&gt;
This section explains how to flash Ox64 board and the SD card to boot the system. It's very low level for newbies.&lt;br /&gt;
&lt;br /&gt;
[[File:Pine Serial v2.png|thumb|right|200px|Wiring Raspberry Pico Pi to Pine64 Ox64 SBC]]&lt;br /&gt;
&lt;br /&gt;
=== Prepare the Environment === &lt;br /&gt;
You need a Linux machine, a Uart module (i.e Raspberry Pico Pi), the Ox64 board and a SD card.&lt;br /&gt;
&lt;br /&gt;
Start a terminal session and set the working directory&lt;br /&gt;
 cd ~/Downloads&lt;br /&gt;
 mkdir ox64 ox64/devcube183&lt;br /&gt;
 cd ~/Downloads/ox64/devcube183&lt;br /&gt;
&lt;br /&gt;
Get flasher DevCube 1.8.3 from one of mirrored servers and decompress it:&lt;br /&gt;
* https://openbouffalo.org/static-assets/bldevcube/BouffaloLabDevCube-v1.8.3.zip&lt;br /&gt;
* https://hachyderm.io/@mkroman/110787218805897192 &amp;gt; https://pub.rwx.im/~mk/bouffalolab/BouffaloLabDevCube-v1.8.3.zip&lt;br /&gt;
* https://we.tl/t-eJWShQJ4iF&lt;br /&gt;
* https://cdn.discordapp.com/attachments/771032441971802142/1145565853962735639/BouffaloLabDevCube-v1.8.3.zip&lt;br /&gt;
&lt;br /&gt;
''SHA1: 0f2619e87d946f936f63ae97b0efd674357b1166''&lt;br /&gt;
&lt;br /&gt;
''SHA256SUMS: e6e6db316359da40d29971a1889d41c9e97d5b1ff1a8636e9e6960b6ff960913''&lt;br /&gt;
&lt;br /&gt;
 wget https://openbouffalo.org/static-assets/bldevcube/BouffaloLabDevCube-v1.8.3.zip&lt;br /&gt;
 unzip BouffaloLabDevCube-v1.8.3.zip&lt;br /&gt;
 chmod u+x BLDevCube-ubuntu&lt;br /&gt;
&lt;br /&gt;
Download compressed file from https://github.com/openbouffalo/buildroot_bouffalo/releases/ and decompress it.&lt;br /&gt;
&lt;br /&gt;
(You can also get the compressed the file from https://github.com/openbouffalo/buildroot_bouffalo/releases/download/v1.0.1/bl808-linux-pine64_ox64_full_defconfig.tar.gz)&lt;br /&gt;
&lt;br /&gt;
 cd ~/Downloads/ox64&lt;br /&gt;
 mkdir openbouffalo &amp;amp;&amp;amp; cd openbouffalo&lt;br /&gt;
 wget https://github.com/openbouffalo/buildroot_bouffalo/releases/download/v1.0.1/bl808-linux-pine64_ox64_full_defconfig.tar.gz&lt;br /&gt;
 tar -xvzf bl808-linux-pine64_ox64_full_defconfig.tar.gz&lt;br /&gt;
&lt;br /&gt;
 You'll get this structure&lt;br /&gt;
   |_ firmware/&lt;br /&gt;
   |_ firmware/m0_lowload_bl808_m0.bin&lt;br /&gt;
   |_ firmware/bl808-firmware.bin&lt;br /&gt;
   |_ firmware/d0_lowload_bl808_d0.bin&lt;br /&gt;
   |_ firmware/sdcard-pine64_ox64_full_defconfig.img.xz&lt;br /&gt;
&lt;br /&gt;
=== Flash Ox64  === &lt;br /&gt;
Connect the the Uart module (i.e Raspberry Pico Pi) for serial communicate from PC to Ox64&lt;br /&gt;
&lt;br /&gt;
 ls /dev/ttyACM*&lt;br /&gt;
&lt;br /&gt;
There are two new ports to choose from : /dev/ttyACM0  /dev/ttyACM1, use the lower number.&lt;br /&gt;
&lt;br /&gt;
 minicom -b 2000000 -D /dev/ttyACM0&lt;br /&gt;
&lt;br /&gt;
Set ox64 board to programming mode&lt;br /&gt;
&lt;br /&gt;
* Press BOOT button&lt;br /&gt;
* Apply power&lt;br /&gt;
* Release BOOT button&lt;br /&gt;
&lt;br /&gt;
Close minicom. Open a new terminal window to run DevCube flasher&lt;br /&gt;
&lt;br /&gt;
 cd ~/Downloads/ox64/devcube183&lt;br /&gt;
 ./BLDevCube-ubuntu&lt;br /&gt;
&lt;br /&gt;
Select chip [BL808], press Finish and switch to [MCU] tab&lt;br /&gt;
&lt;br /&gt;
 M0 Group[group0] Image Addr [0x58000000] [PATH to m0_lowload_bl808_m0.bin]&lt;br /&gt;
 D0 Group[group0] Image Addr [0x58100000] [PATH to d0_lowload_bl808_d0.bin]&lt;br /&gt;
 Interface: Uart&lt;br /&gt;
 Port/SN: /dev/ttyACM1&lt;br /&gt;
 Uart rate 2000000&lt;br /&gt;
 UART TX is physical pin 1/GPIO 14.&lt;br /&gt;
 UART RX is physical pin 2/GPIO 15.&lt;br /&gt;
 Click 'Create &amp;amp; Download' and wait until it's done&lt;br /&gt;
&lt;br /&gt;
Switch to [IOT] tab&lt;br /&gt;
 Enable 'Single Download', set Address with 0x800000, choose [PATH to bl808-firmware.bin]&lt;br /&gt;
 Click 'Create &amp;amp; Download' again and wait until it's done&lt;br /&gt;
 Close DevCube&lt;br /&gt;
&lt;br /&gt;
=== Alternative: Open-Source Flashing ===&lt;br /&gt;
For those who do not want to use the DevCube, BouffaloLab provide open-source flashing packages &amp;amp;mdash; &amp;lt;code&amp;gt;bflb-iot-tool&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;bflb-mcu-tool&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
: Note: While these packages do contain binaries in addition to the Python source code, those binaries do not appear to be used for UART flashing.&lt;br /&gt;
&lt;br /&gt;
Execute the following commands to flash the BL808. Note that the addresses are different to the ones you would use in the DevCube.&lt;br /&gt;
&lt;br /&gt;
: Reminder: UART TX is physical pin 1/GPIO 14, UART RX is physical pin 2/GPIO 15.&lt;br /&gt;
 pip install bflb-iot-tool # we are *not* using bflb-mcu-tool&lt;br /&gt;
 &lt;br /&gt;
 bflb-iot-tool --chipname bl808 --interface uart --port /dev/ttyACM0 --addr 0x000000 --firmware firmware/m0_lowload_bl808_m0.bin --single&lt;br /&gt;
 bflb-iot-tool --chipname bl808 --interface uart --port /dev/ttyACM0 --addr 0x100000 --firmware firmware/d0_lowload_bl808_d0.bin --single&lt;br /&gt;
 bflb-iot-tool --chipname bl808 --interface uart --port /dev/ttyACM0 --addr 0x800000 --firmware firmware/bl808-firmware.bin --single&lt;br /&gt;
&lt;br /&gt;
=== Flash SD Card ===&lt;br /&gt;
Insert SD card into PC, find address [/dev/sdb], erase initial space and flash sdcard.xxxx.img file.&lt;br /&gt;
&lt;br /&gt;
 cd ~/Downloads/ox64/openbouffalo/firmware&lt;br /&gt;
 xz -v -d -k sdcard-pine64_ox64_full_defconfig.img.xz&lt;br /&gt;
 sudo dd if=/dev/zero of=/dev/sdb count=1 bs=32768 &lt;br /&gt;
 sudo dd if=~/Downloads/ox64/openbouffalo/firmware/sdcard-pine64_ox64_full_defconfig.img of=/dev/sdb bs=1M status=progress conv=fsync&lt;br /&gt;
&lt;br /&gt;
=== First Booting ===&lt;br /&gt;
&lt;br /&gt;
Insert SD card into Ox64 and set a tty connection to Ox64 board&lt;br /&gt;
* Serial Console access:&lt;br /&gt;
* UART TX is physical pin 32/GPIO 16.&lt;br /&gt;
* UART RX is physical pin 31/GPIO 17.&lt;br /&gt;
* Baud 2000000.&lt;br /&gt;
&lt;br /&gt;
 minicom -b 2000000 -D /dev/ttyACM0&lt;br /&gt;
&lt;br /&gt;
Re-Apply power to ox64&lt;br /&gt;
&lt;br /&gt;
Enjoy the boot!&lt;br /&gt;
&lt;br /&gt;
PS. To investigate running services&lt;br /&gt;
 pstree | head -5&lt;br /&gt;
   init-+-dhcpcd---3*[dhcpcd]&lt;br /&gt;
        |-dropbear&lt;br /&gt;
        |-klogd&lt;br /&gt;
        |-login---sh-+-head&lt;br /&gt;
        |            `-pstree&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Category:Ox64]] [[Category:Bouffalo BL808]]&lt;/div&gt;</summary>
		<author><name>Lupyuen</name></author>
	</entry>
	<entry>
		<id>https://wiki.pine64.org/index.php?title=STAR64&amp;diff=20350</id>
		<title>STAR64</title>
		<link rel="alternate" type="text/html" href="https://wiki.pine64.org/index.php?title=STAR64&amp;diff=20350"/>
		<updated>2023-08-10T03:25:17Z</updated>

		<summary type="html">&lt;p&gt;Lupyuen: Add Apache NuttX RTOS&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[File:Star64.jpg|400px|thumb|right|The STAR64]]&lt;br /&gt;
&lt;br /&gt;
The '''Star64''' is a RISC-V based Single Board Computer powered by StarFive JH7110 Quad-Core SiFive U74 64-Bit CPU, Imagination Technology BX-4-32 GPU and supports up to 8GB 1866MHz LPDDR4 memory. It provides an eMMC module socket, MicroSD Card slot, PCI-e, Pi-2 Bus, USB 3.0, and many other peripheral interfaces for makers to integrate with sensors and other devices.&lt;br /&gt;
&lt;br /&gt;
[[File:RISC-V.png|600px|]]&lt;br /&gt;
&lt;br /&gt;
== Software releases ==&lt;br /&gt;
&lt;br /&gt;
The releases are still in '''alpha''' state and are only fit for testing purposes. &lt;br /&gt;
&lt;br /&gt;
* [https://github.com/Fishwaldo/meta-pine64 A Set of Images built with Yocto for commandline, weston and plasma - Where possible, GPU/VPU acceleration is enabled.]&lt;br /&gt;
* [https://forum.pine64.org/showthread.php?tid=18276 Armbian]&lt;br /&gt;
* [https://github.com/NixOS/nixos-hardware/tree/master/pine64/star64 NixOS] (no GPU)&lt;br /&gt;
** [https://app.cachix.org/api/v1/cache/fgaz/serve/hj72i7znp0rvc4dxs2xslw6b3ik3wifb/sd-image/nixos-sd-image-23.11pre-git-riscv64-linux-pine64-star64.img.zst Sample image] (8GB RAM, user/pw: nixos)&lt;br /&gt;
* [https://www.hackster.io/lupyuen/rtos-on-a-risc-v-sbc-star64-jh7110-apache-nuttx-2a7429 Apache NuttX RTOS]&lt;br /&gt;
&lt;br /&gt;
== SoC and Memory Specification ==&lt;br /&gt;
* Based on [https://www.starfivetech.com/en/site/soc StarFive JH7110]&lt;br /&gt;
&lt;br /&gt;
[[File:StarFive.jpg|right]]&lt;br /&gt;
[[File:JH7110_Block_Diagram.png|800px]]&lt;br /&gt;
&lt;br /&gt;
=== CPU Architecture ===&lt;br /&gt;
* [https://www.sifive.com/cores/u74 Quad-core U74 up to 1.5GHz CPU]&lt;br /&gt;
[[File:SiFive.jpg|right|200px]]&lt;br /&gt;
* Fully compliant with the RISC-V ISA specification&lt;br /&gt;
* 64-bit RISC-V Application Core&lt;br /&gt;
* 32KB L1 I-cache with ECC&lt;br /&gt;
* 32KB L1 D-cache with ECC&lt;br /&gt;
* 8 Region Physical Memory Protection&lt;br /&gt;
* Virtual Memory support with up to 47 Physical Address bits&lt;br /&gt;
* Integrated up to 2MB L2 Cache with ECC&lt;br /&gt;
* includes RV64IMAC S7 monitor core, 16 KB L1 I-Cache with ECC, 8 KB DTIM with ECC&lt;br /&gt;
* 32-bit RISC-V CPU core (E24) for real time control, support RV32IMFC RISC-V ISA&lt;br /&gt;
&lt;br /&gt;
=== GPU Architecture ===&lt;br /&gt;
* [https://www.imaginationtech.com/product/img-bxe-4-32-mc4/ Imagination Technology BXE-4-32 up to 600Mhz GPU]&lt;br /&gt;
[[File:imgtech.png|right|200px]]&lt;br /&gt;
* Support OpenCL 3.0&lt;br /&gt;
* Support OpenGL ES 3.2&lt;br /&gt;
* Support Vulkan 1.2&lt;br /&gt;
* Tile-based deferred rendering architecture for 3D graphics workloads, with concurrent processing of multiple tiles&lt;br /&gt;
* Support for GPU visualization, up to 8 virtual GPUs&lt;br /&gt;
* On fly frame buffer compression and decompression (TFBC) algorithm&lt;br /&gt;
* Performance: 128 FP32 FLOPs/Clock, 256 FP16 FLOPs/Clock&lt;br /&gt;
&lt;br /&gt;
=== System Memory ===&lt;br /&gt;
* LPDDR4 RAM Memory Variants: 2GB, 4GB and 8GB.&lt;br /&gt;
&lt;br /&gt;
== Board Features ==&lt;br /&gt;
&lt;br /&gt;
=== Video ===&lt;br /&gt;
* Digital Video output up to 4K@30Hz&lt;br /&gt;
* 4K HDR @ 60fps&lt;br /&gt;
* H.264/AVC Base/Main/High/High10 profile @ level 5.1; up to 4K&amp;amp;times;2K @ 60fps&lt;br /&gt;
* H.265/HEVC Main/Main10 profile @ level 5.1 High-tier; up to 4K&amp;amp;times;2K @ 60fps&lt;br /&gt;
&lt;br /&gt;
=== Audio ===&lt;br /&gt;
* 3.5mm audio Jack&lt;br /&gt;
&lt;br /&gt;
=== Network ===&lt;br /&gt;
* Single or Dual 10/100/1000Mbps Ethernet &lt;br /&gt;
* 2.4GHz/5Ghz MIMO WiFi 802.11 b/g/n/ac with Bluetooth 5.2&lt;br /&gt;
&lt;br /&gt;
=== Storage ===&lt;br /&gt;
* on-board 128Mbit (16MByte) XSPI NOR flash memory - bootable&lt;br /&gt;
* microSD - bootable, supports SDHC and SDXC and storage up to 256GB&lt;br /&gt;
* eMMC - bootable (optional eMMC Module)&lt;br /&gt;
* 1&amp;amp;times; USB3.0 Dedicated Host port&lt;br /&gt;
* 3&amp;amp;times; USB2.0 Host port&lt;br /&gt;
&lt;br /&gt;
=== Expansion Ports ===&lt;br /&gt;
* PCIe 2.0 &amp;amp;times;1 lane&lt;br /&gt;
* 2&amp;amp;times;20 pins &amp;quot;Pi2&amp;quot; GPIO Header&lt;br /&gt;
** The JH7110 SoC supports full multiplexing of its GPIO pins. This means any non-power/ground pin can be configured to any function outlined in Table 4-2 of the SoC datasheet.&lt;br /&gt;
* 4 lane MiPi DSI port for LCD panel&lt;br /&gt;
* 4 lane MiPi CSI port for camera module&lt;br /&gt;
&lt;br /&gt;
== Board Information, Schematics and Certifications ==&lt;br /&gt;
Model &amp;quot;A&amp;quot; Baseboard Dimensions: 133mm&amp;amp;times;80mm&amp;amp;times;19mm&lt;br /&gt;
&lt;br /&gt;
Input Power: DC 12V @ 3A 5.5mmOD/2.1mmID center-positive Barrel DC Jack connector&lt;br /&gt;
&lt;br /&gt;
Schematic:&lt;br /&gt;
* [https://files.pine64.org/doc/star64/Star64_Schematic_V1.1_20230504.pdf STAR64 Schematic 20230504 v1.1 (Production Released version)]&lt;br /&gt;
* [https://files.pine64.org/doc/star64/Star64_Schematic_V1.0_20220721.pdf STAR64 Schematic 20220721 v1.0 (Prototype Board)]&lt;br /&gt;
&lt;br /&gt;
Certifications:&lt;br /&gt;
* Disclaimer: Please note that PINE64 SBC is not a &amp;quot;final&amp;quot; product and in general certification is not necessary. However, PINE64 still submits the SBC for FCC, CE, and ROHS certifications and obtain the certificates to prove that the SBC board can pass the testing. Please note, a final commercial product needs to perform its own testing and obtain its own certificate.&lt;br /&gt;
* Not yet available&lt;br /&gt;
&lt;br /&gt;
== Datasheets for Components and Peripherals ==&lt;br /&gt;
&lt;br /&gt;
Star64 JH7110 SoC information:&lt;br /&gt;
* [https://doc-en.rvspace.org/JH7110/PDF/JH7110_Product_Brief.pdf StarFive JH7110 SoC Product Brief]&lt;br /&gt;
* [https://doc-en.rvspace.org/JH7110/PDF/JH7110_Datasheet.pdf StarFive JH7110 SoC Datasheet]&lt;br /&gt;
* [https://doc-en.rvspace.org/JH7110/TRM/ StarFive JH7110 SoC Technical Reference Manual]&lt;br /&gt;
&lt;br /&gt;
X-Power PMU information:&lt;br /&gt;
* [https://files.pine64.org/doc/datasheet/star64/AXP15060%20datasheet%20V0.1.pdf X-Power AXP15060 Datasheet V0.1]&lt;br /&gt;
&lt;br /&gt;
LPDDR4 (200 Balls) SDRAM:&lt;br /&gt;
* [https://files.pine64.org/doc/datasheet/rockpro64/SM512M32Z01MD2BNP(200BALL).pdf Micron LPDDR4 Mobile LPDDR4 Datasheet]&lt;br /&gt;
&lt;br /&gt;
eMMC information:&lt;br /&gt;
* [https://files.pine64.org/doc/rock64/PINE64_eMMC_Module_20170719.pdf PINE64 eMMC module schematic]&lt;br /&gt;
* [https://files.pine64.org/doc/rock64/usb%20emmc%20module%20adapter%20v2.pdf PINE64 USB adapter for eMMC module V2 schematic]&lt;br /&gt;
* [https://files.pine64.org/doc/rock64/USB%20adapter%20for%20eMMC%20module%20PCB.tar PINE64 USB adapter for eMMC module PCB in JPEG]&lt;br /&gt;
* [https://files.pine64.org/doc/datasheet/pine64/E-00517%20FORESEE_eMMC_NCEMAM8B-16G%20SPEC.pdf 16GB Foresee eMMC Datasheet]&lt;br /&gt;
* [https://files.pine64.org/doc/datasheet/pine64/SDINADF4-16-128GB-H%20data%20sheet%20v1.13.pdf 32GB/64GB/128GB SanDisk eMMC Datasheet]&lt;br /&gt;
&lt;br /&gt;
SPI NOR Flash information:&lt;br /&gt;
* [https://files.pine64.org/doc/datasheet/star64/gd25lq128e_rev1.0_20210513.pdf GigaDevice 128Mb XSPI-Flash Datasheet]&lt;br /&gt;
&lt;br /&gt;
Ethernet related info:&lt;br /&gt;
* TBA&lt;br /&gt;
&lt;br /&gt;
WiFi/BT module info:&lt;br /&gt;
* [https://files.pine64.org/doc/datasheet/star64/Fn-Link_6252B-UUB_datasheet_V1.1_20220329.pdf Fn-Link 6252B 11AC Dual Band 2T2R WiFi + Bluetooth5.2 Datasheet]&lt;br /&gt;
&lt;br /&gt;
== Bringup Notes ==&lt;br /&gt;
&lt;br /&gt;
# The USB over-current protection is not wired up correctly to the USB ports on Star64. The default Starfive Kernel will disable USB on boot as it belives the ports are overcurrent. This ugly hack works around it: https://github.com/Fishwaldo/Star64_linux/commit/2634a13ecfa1fa5c232ec2b9f6a6b6b0d9d66898&lt;br /&gt;
# The Wifi Chip (RTL8852BU) is not supported in the kernel. There is a Vendor Driver that is imported in the kernel at https://github.com/Fishwaldo/Star64_linux/tree/Star64_devel/drivers/staging/rtl8852bu but it really needs a cleanup. It does BUG_ON at boot, but wifi is confirmed working. &lt;br /&gt;
# HDMI can be finicky. 4K Monitors are known to have a issue. This is also relevant for VisionFive2&lt;br /&gt;
# Some kernels/distributions do not detect the total memory correctly. This is due to the way u-boot is configured. Currently, u-boot reads the memory from the eeprom on the Star64, and updates the dtb file before booting the kernel. Distributions that boot differently may not get the updated dtb file with the correct memory entry. You can work around this by recompiling the DTB with the correct memory for your board&lt;br /&gt;
# VisionFive2 Kernels will only offer limited functionality on the Star64 - Mainly USB, Wifi and PCI will not work.&lt;br /&gt;
# The 4-pin 12 volt JST-XH-4A connector found on the Star64 is incompatible with the dual SATA power adapter intended for the ROCKPro64. The connector on the Star64 is rotated 180 degrees to the one on the ROCKPro64, resulting in the cable receiving +12V where GND is expected and vice versa. The cable's internal circuitry ends up shorting in this configuration.&lt;br /&gt;
# Booting from uSD: Component S1804 is adjacent to the 40pin GPIO Bus; ignore the printed text on S1804 that says &amp;quot;ON&amp;quot; or &amp;quot;ONKE&amp;quot;. Do pay attention to the '1' and '2' printed on S1804. Also pay attention to the 'L' and 'H' text on the board next to S1804. The 'L' stand for '0' and the 'H' stands for '1'. You will need to flip switch '1' (GPIO_1) on S1804 to the 'L' position and switch '2' (GPIO_0) on S1804 to the 'H' position. S1804 maps to the table next to S1804 that has text [ [GPIO_1 | GPIO_0], [0|0] Flash, [0|1] SD, [1|0] EMMC, [1|1] UART ]; Helpful links: https://mrrcode979.github.io/blog/post/star64-guide/, https://www.bortzmeyer.org/star64-first-boot.html&lt;br /&gt;
# TTL use notes: Ground is on pin 6, RXD is on pin 8, and TXD is on pin 10.&lt;br /&gt;
&lt;br /&gt;
== LEDs ==&lt;br /&gt;
&lt;br /&gt;
The LEDs can be configured to stop blinking. Under Linux this can be done using the following command (as root):&lt;br /&gt;
&lt;br /&gt;
 echo &amp;quot;default-on&amp;quot; &amp;gt; /sys/devices/platform/leds/leds/blue-led/trigger&lt;br /&gt;
&lt;br /&gt;
To list possible other triggers for the blue LED:&lt;br /&gt;
&lt;br /&gt;
 cat /sys/devices/platform/leds/leds/blue-led/trigger &lt;br /&gt;
&lt;br /&gt;
An example for a trigger is ''activity'', where the the blue LED reflects the CPU activity.&lt;br /&gt;
&lt;br /&gt;
== Potential Issues ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;onlyinclude&amp;gt;&lt;br /&gt;
If you get the following error in u-boot (or your 8Gb board is only detected as 4Gb) the possible problem is a empty, or corrupt eeprom:&lt;br /&gt;
&lt;br /&gt;
 Not a StarFive EEPROM data format - magic error&lt;br /&gt;
 EEPROM dump: (0x100 bytes)&lt;br /&gt;
 00: FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF &lt;br /&gt;
 10: FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF &lt;br /&gt;
 20: FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF &lt;br /&gt;
 30: FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF &lt;br /&gt;
 40: FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF &lt;br /&gt;
 50: FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF &lt;br /&gt;
 60: FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF &lt;br /&gt;
 70: FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF &lt;br /&gt;
 80: FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF &lt;br /&gt;
 90: FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF &lt;br /&gt;
 A0: FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF &lt;br /&gt;
 B0: FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF &lt;br /&gt;
 C0: FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF &lt;br /&gt;
 D0: FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF &lt;br /&gt;
 E0: FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF &lt;br /&gt;
 F0: FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF &lt;br /&gt;
&lt;br /&gt;
Then from within u-boot execute the following commands:&lt;br /&gt;
&lt;br /&gt;
 mac initilize&lt;br /&gt;
 mac product_id &amp;lt;PRODUCTID&amp;gt;&lt;br /&gt;
 mac write_eeprom&lt;br /&gt;
&lt;br /&gt;
Set ProductID to either:&lt;br /&gt;
* For 8Gb Models: STAR64V1-2310-D008E000-01234567&lt;br /&gt;
* for 4Gb Models: STAR64V1-2310-D004E000-01234567&lt;br /&gt;
&lt;br /&gt;
You can replace the last 8 digits with a random number if you wish.&lt;br /&gt;
If these commands fail, please join the #star64 channel in the Pine64 community for more assistance.&lt;br /&gt;
&amp;lt;/onlyinclude&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Prototype Bringup Notes ==&lt;br /&gt;
&lt;br /&gt;
Note: This section is relevant to the original prototype (v1.0) that a few developers received. &lt;br /&gt;
&lt;br /&gt;
# The [https://files.pine64.org/doc/star64/Star64_Schematic_V1.0_20220721.pdf schematic] has several discrepancies with actual board labels.&lt;br /&gt;
# The serial console can be found with TXD on pin 8 and RXD on pin 10; a convention common to Pi-style boards. Use the 40pin header pinouts in color on page one and not the schematic prose.&lt;br /&gt;
# If you have only a single core running and no PCI card present, it appears to power up via the +5V/GND lines from the USB serial adapter pins.&lt;br /&gt;
# It will not boot from a VisionFive R1 uSD card.&lt;br /&gt;
# The boot device switch labels and the silk screen are inverted. &amp;quot;0&amp;quot; means &amp;quot;On&amp;quot;.&lt;br /&gt;
# 2021.10-00001-gdbdaad919b will attempt to boot from SPI, but it appears blank. If you let it for many minutes, the device will eventually time out and boot OpenSBI v1.0  from (SPI?). This will fail, but only after self-identifying as a VisionFive R2, complete with five cores and 4 GB of RAM, before failing. A &amp;quot;press any key&amp;quot; timeout is offered, but I've been unable to make it stop. It will eventually crash with:&lt;br /&gt;
&lt;br /&gt;
 Loading Environment from SPIFlash... SF: Detected gd25lq128 with page size 256 Bytes, erase size 4 KiB, total 16 MiB&lt;br /&gt;
 *** Warning - bad CRC, using default environment&lt;br /&gt;
 &lt;br /&gt;
 Not a StarFive EEPROM data format - magic error&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Category:STAR64]] [[Category:StarFive JH7110]]&lt;/div&gt;</summary>
		<author><name>Lupyuen</name></author>
	</entry>
	<entry>
		<id>https://wiki.pine64.org/index.php?title=PinePhone_Software_Releases&amp;diff=15265</id>
		<title>PinePhone Software Releases</title>
		<link rel="alternate" type="text/html" href="https://wiki.pine64.org/index.php?title=PinePhone_Software_Releases&amp;diff=15265"/>
		<updated>2023-01-01T03:27:00Z</updated>

		<summary type="html">&lt;p&gt;Lupyuen: Update link for Apache NuttX RTOS&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This page contains a list of all available operating systems for the [[PinePhone]] in alphabetical order, as well as links to other resources.&lt;br /&gt;
&lt;br /&gt;
{{Info|Some releases may not have a good setup for the backlight at low brightness. If configured too low, the backlight shuts down completely, but the screen is still displayed and usable in bright front-light.}}&lt;br /&gt;
&lt;br /&gt;
See [[PinePhone Installation Instructions]] on how to install the operating systems. Please see [[PinePhone Updating Instructions]] for how to update the phone.&lt;br /&gt;
&lt;br /&gt;
== Software Releases ==&lt;br /&gt;
&lt;br /&gt;
=== Arch Linux ARM ===&lt;br /&gt;
[[File:Archlinux-logo.png|right|100px]]&lt;br /&gt;
&lt;br /&gt;
(Unofficial) Arch Linux ARM with choice of Phosh UI, Plasma Mobile, sxmo or barebones.&lt;br /&gt;
Currently being maintained by the [https://danctnix.org/ DanctNIX] community (GitHub: [https://github.com/DanctNIX/danctnix danctnix], [https://github.com/dreemurrs-embedded dreemurrs-embedded]).&lt;br /&gt;
&lt;br /&gt;
==== Download ====&lt;br /&gt;
&lt;br /&gt;
Get both stable and test builds at [https://github.com/dreemurrs-embedded/Pine64-Arch/releases GitHub releases].&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!colspan=&amp;quot;2&amp;quot; style=&amp;quot;background: #a7d7f9;&amp;quot;| Default credentials&lt;br /&gt;
|-&lt;br /&gt;
! Default user&lt;br /&gt;
| &amp;lt;code&amp;gt;alarm/123456&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
! root (barebone only)&lt;br /&gt;
| &amp;lt;code&amp;gt;root/root&amp;lt;/code&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== Notes ====&lt;br /&gt;
&lt;br /&gt;
* There are archmobile chat rooms on Matrix ([https://matrix.to/#/#archmobile:kde.org #archmobile:kde.org]) and Telegram ([https://t.me/archmobile @archmobile]).&lt;br /&gt;
* Feel free to send us [https://github.com/dreemurrs-embedded/Pine64-Arch/pulls pull requests] and reports [https://github.com/dreemurrs-embedded/Pine64-Arch/issues issues] on [https://github.com/dreemurrs-embedded/Pine64-Arch GitHub].&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
=== ExpidusOS ===&lt;br /&gt;
&lt;br /&gt;
A fork of [https://voidlinux.org Void Linux] with a custom fork of XFCE called [https://github.com/ExpidusOS/genesis Gensis] as the default desktop environment, developed by [https://midstall.com/ Midstall Software].&lt;br /&gt;
&lt;br /&gt;
* [https://expidusos.com ExpidusOS official website]&lt;br /&gt;
* [https://wiki.expidusos.com/index.php/Main_Page ExpidusOS Wiki]&lt;br /&gt;
* [https://discord.gg/GVfBF2w Midstall Software Discord server]&lt;br /&gt;
* GitHub: [https://github.com/ExpidusOS ExpidusOS]&lt;br /&gt;
&lt;br /&gt;
==== Download ====&lt;br /&gt;
&lt;br /&gt;
Check the [https://expidusos.com/download download page] for that latest version, or the [https://build.expidusos.com/ image file list] for all versions, look for the filename that starts with &amp;quot;pinephone&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!colspan=&amp;quot;2&amp;quot; style=&amp;quot;background: #a7d7f9;&amp;quot;| Default credentials&lt;br /&gt;
|-&lt;br /&gt;
! Default user&lt;br /&gt;
| &amp;lt;code&amp;gt;expidus/expidus&amp;lt;/code&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== Notes ====&lt;br /&gt;
&lt;br /&gt;
What works, what does not work:&lt;br /&gt;
&lt;br /&gt;
* The ExpidusOS Wiki has a page detailing [https://wiki.expidusos.com/index.php/Device:PinePhone supported features].&lt;br /&gt;
&lt;br /&gt;
How to contribute and report defects:&lt;br /&gt;
&lt;br /&gt;
* Join the [https://discord.gg/GVfBF2w Discord server] or corresponding repo at GitHub ([https://github.com/orgs/ExpidusOS/repositories repo list]).&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
=== Fedora ===&lt;br /&gt;
[[File:Fedora-logo.png|right|100px]]&lt;br /&gt;
&lt;br /&gt;
An (unofficial) vanilla Fedora rawhide build for aarch64 with megi's kernel and [https://copr.fedorainfracloud.org/coprs/njha/mobile/packages/ some additional packages] to tie it all together.&lt;br /&gt;
It aims to eventually be an upstream part of the Fedora project, rather than a phone-specific distribution.&lt;br /&gt;
&lt;br /&gt;
* Forum discussion: [https://forum.pine64.org/showthread.php?tid=9347 Fedora + Phosh for PinePhone]&lt;br /&gt;
* GitHub: [https://github.com/nikhiljha/pp-fedora-sdsetup nikhiljha/pp-fedora-sdsetup]&lt;br /&gt;
&lt;br /&gt;
==== Download ====&lt;br /&gt;
&lt;br /&gt;
* [https://github.com/nikhiljha/pp-fedora-sdsetup/releases Flashable images]&lt;br /&gt;
* [https://github.com/nikhiljha/pp-fedora-sdsetup          Build scripts]&lt;br /&gt;
* [https://copr.fedorainfracloud.org/coprs/njha/mobile/    Packages (Fedora COPR)]&lt;br /&gt;
&lt;br /&gt;
There is also an FTP server with images build every night @ ftp://pine.warpspeed.dk/nightly/pinephone/ (Mount this with something like Nautilus)&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!colspan=&amp;quot;2&amp;quot; style=&amp;quot;background: #a7d7f9;&amp;quot;| Default credentials&lt;br /&gt;
|-&lt;br /&gt;
! GitHub images&lt;br /&gt;
| &amp;lt;code&amp;gt;pine/123456&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
! Nightly images (via FTP)&lt;br /&gt;
| &amp;lt;code&amp;gt;pine/1111&amp;lt;/code&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== Notes ====&lt;br /&gt;
&lt;br /&gt;
WiFi, Bluetooth, SMS, Data, Calls all work! There are still a few bugs though, and [https://xnux.eu/devices/pine64-pinephone.html#toc-feature-driver-support-matrix some features don't have driver support yet] on any PinePhone distribution.&lt;br /&gt;
&lt;br /&gt;
Please send your bug reports to [https://github.com/nikhiljha/pp-fedora-sdsetup/issues the project's issue tracker]. Be sure to include logs if applicable! Send us pull requests on [https://github.com/nikhiljha/pp-fedora-sdsetup/pulls Github].&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
=== Gentoo ===&lt;br /&gt;
[[File:GentooLogo.png|right|100px]]&lt;br /&gt;
&lt;br /&gt;
There are unofficial Gentoo overlays with ebuilds for the PinePhone. There are no images - the image must be built manually, including picking the kernel, bootloader and the desired desktop environment. The ARM64 version of Gentoo has to be selected.&lt;br /&gt;
&lt;br /&gt;
==== Download ====&lt;br /&gt;
&lt;br /&gt;
Overlay locations:&lt;br /&gt;
&lt;br /&gt;
* https://gitlab.com/bingch/gentoo-overlay&lt;br /&gt;
* https://github.com/stealthgun/gjdwebserver-overlay&lt;br /&gt;
&lt;br /&gt;
==== Notes ====&lt;br /&gt;
&lt;br /&gt;
The documentation can be found here:&lt;br /&gt;
&lt;br /&gt;
* https://stealthgun.tweakblogs.net/blog/19336/gentoo-on-a-pinephone&lt;br /&gt;
* https://wiki.gentoo.org/wiki/User:Dr41nU/PinePhone&lt;br /&gt;
* https://wiki.gentoo.org/wiki/PinePhone (incomplete)&lt;br /&gt;
&lt;br /&gt;
{{Info|Please consider cross-compiling the software on the computer. Long compilation times and heat production can lead to a reduced lifespan of the phone.}}&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
=== GloDroid ===&lt;br /&gt;
&lt;br /&gt;
A fully open source port of Android to the PinePhone.&lt;br /&gt;
&lt;br /&gt;
GitHub: [https://github.com/GloDroid/ GloDroid]&lt;br /&gt;
&lt;br /&gt;
==== Download ====&lt;br /&gt;
&lt;br /&gt;
* Stable image: [https://github.com/GloDroid/glodroid_manifest/releases GloDroid]&lt;br /&gt;
&lt;br /&gt;
==== Notes ====&lt;br /&gt;
&lt;br /&gt;
Feature overview:&lt;br /&gt;
&lt;br /&gt;
* Works: WiFi, screen dimming, sound, touchscreen, charging and telephony(partially) works.&lt;br /&gt;
* Doesn't work: Bluetooth and GPS&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
=== Kali Linux ===&lt;br /&gt;
[[File:Kali-logo.png|right|200px]]&lt;br /&gt;
&lt;br /&gt;
The official Kali Nethunter images for PinePhone and PinePhone Pro have been released now. For older/unofficial releases, you can still download from the GitHub releases page. Get [https://github.com/Shubhamvis98/usb-arsenal-pinephone USB Arsenal] for your PinePhone's Kali Linux. Packet Injection is working now, use iwconfig instead of airmon-ng.&lt;br /&gt;
&lt;br /&gt;
==== Download ====&lt;br /&gt;
&lt;br /&gt;
* [https://github.com/Shubhamvis98/kali-pinephone/releases Kali Phosh Unofficial]&lt;br /&gt;
* [https://www.kali.org/get-kali/#kali-mobile Kali Nethunter Pro Official]&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!colspan=&amp;quot;2&amp;quot; style=&amp;quot;background: #a7d7f9;&amp;quot;| Default credentials&lt;br /&gt;
|-&lt;br /&gt;
! Default user for Unofficial Releases&lt;br /&gt;
| &amp;lt;code&amp;gt;kali/8888&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
! Default user for Nethunter Releases&lt;br /&gt;
| &amp;lt;code&amp;gt;kali/1234&amp;lt;/code&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== Notes ====&lt;br /&gt;
&lt;br /&gt;
Installation:&lt;br /&gt;
&lt;br /&gt;
 $ unxz -c Kali-PinePhone-{Release}.img.xz | dd of=/dev/{storage_block} bs=1M status=progress&lt;br /&gt;
 $ growpart /dev/mmcblkX Y&lt;br /&gt;
 $ e2fsck -y -f /dev/mmcblkXpY&lt;br /&gt;
 $ resize2fs /dev/mmcblkXpY&lt;br /&gt;
 # X: Storage Device Y: Partition Number&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
=== LuneOS ===&lt;br /&gt;
[[File:Luneos-logo-256.png|right|100px]]&lt;br /&gt;
&lt;br /&gt;
LuneOS is one of the original multi-tasking OS-es that runs on Linux. Based on HP/Palm's webOS, merged with latest technology stack from LG called webOS OSE (a derivative of what LG uses on their Smart TV's), software such as Qt5 and makes use of the Yocto build system.&lt;br /&gt;
&lt;br /&gt;
* [https://www.webos-ports.org/wiki/Main_Page WebOS Ports Wiki]&lt;br /&gt;
* [https://webos-ports.org/wiki/Pinephone_Info WebOS-Ports Wiki's Pinephone page]&lt;br /&gt;
* GitHub: [https://github.com/webOS-ports WebOS Ports]&lt;br /&gt;
&lt;br /&gt;
==== Download ====&lt;br /&gt;
&lt;br /&gt;
* LuneOS Preview images: [https://github.com/webOS-ports/meta-pine64-luneos/releases Downloads]&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!colspan=&amp;quot;2&amp;quot; style=&amp;quot;background: #a7d7f9;&amp;quot;| Default credentials&lt;br /&gt;
|-&lt;br /&gt;
! Default user&lt;br /&gt;
| &amp;lt;code&amp;gt;root&amp;lt;/code&amp;gt;&lt;br /&gt;
|} &lt;br /&gt;
&lt;br /&gt;
==== Notes ====&lt;br /&gt;
&lt;br /&gt;
In order to connect to the device using SSH/SCP via WiFi: You can simply connect via SSH/SCP via WiFi using the PinePhone's IP address on port 22.&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
=== Maemo Leste ===&lt;br /&gt;
[[File:Maemoleste-logo.png|right|100px]]&lt;br /&gt;
&lt;br /&gt;
[https://en.wikipedia.org/wiki/Maemo Maemo] is a trimmed-down version of Debian for mobile devices,&lt;br /&gt;
originally a collaboration between Nokia and many open source projects (the [http://maemo.org/intro/ Maemo community]) before Nokia abandoned it. The more well-known devices Maemo supports are the OpenMoko and N900. The community now takes full responsibility in developing fully open source Maemo for a variety of mobile devices. You may be interested to learn more about the features in their [https://leste.maemo.org/Leste_FAQ Maemo Leste FAQ].&lt;br /&gt;
&lt;br /&gt;
Maemo 8 &amp;quot;Leste&amp;quot; is an ARM64 port of [https://devuan.org/ Devuan] (Debian without systemd) and runs the mainline Linux kernel.&lt;br /&gt;
The default user interface stack is [https://en.wikipedia.org/wiki/Hildon Hildon], [https://en.wikipedia.org/wiki/X.Org_Server Xorg], [https://en.wikipedia.org/wiki/Matchbox_(window_manager) Matchbox WM], and [https://en.wikipedia.org/wiki/GTK GTK].&lt;br /&gt;
&lt;br /&gt;
==== Download ====&lt;br /&gt;
&lt;br /&gt;
* [http://maedevu.maemo.org/images/pinephone/ Maemo Leste test builds]&lt;br /&gt;
&lt;br /&gt;
There is also an [https://github.com/maemo-leste/image-builder image builder], see the wiki for instructions on how to [https://leste.maemo.org/Image_Builder build a custom image]. For current status and instructions, please read their [https://leste.maemo.org/PinePhone PinePhone wiki page].&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!colspan=&amp;quot;2&amp;quot; style=&amp;quot;background: #a7d7f9;&amp;quot;| Default credentials&lt;br /&gt;
|-&lt;br /&gt;
! root&lt;br /&gt;
| &amp;lt;code&amp;gt;toor&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
! user&lt;br /&gt;
| &amp;lt;code&amp;gt;12345 (lockscreen)&amp;lt;/code&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== Notes ====&lt;br /&gt;
&lt;br /&gt;
Most discussion occurs at  [ircs://irc.libera.chat:6697/#maemo-leste &amp;lt;code&amp;gt;#maemo-leste&amp;lt;/code&amp;gt; on &amp;lt;code&amp;gt;irc.libera.chat&amp;lt;/code&amp;gt;] and [https://talk.maemo.org/showthread.php?t=100192&amp;amp;page=60 this thread].&lt;br /&gt;
&lt;br /&gt;
All other contact information is listed on the [https://leste.maemo.org/Main_Page main page] of the Maemo wiki.&lt;br /&gt;
&lt;br /&gt;
Submit [https://github.com/maemo-leste/bugtracker/issues bug reports] on github.&lt;br /&gt;
To track known issues, you may use these search terms:&lt;br /&gt;
[https://github.com/maemo-leste/bugtracker/issues?utf8=%E2%9C%93&amp;amp;q=is%3Aissue+is%3Aopen+pinephone pinephone],&lt;br /&gt;
[https://github.com/maemo-leste/bugtracker/issues?utf8=%E2%9C%93&amp;amp;q=is%3Aissue+is%3Aopen+pine64 pine64].&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
=== Manjaro ARM ===&lt;br /&gt;
[[File:Manjaro-logo.svg|right|100px]]&lt;br /&gt;
&lt;br /&gt;
Manjaro is a user-friendly Linux distribution based on the independently developed Arch operating system with the Plasma Mobile and Phosh desktop environment.&lt;br /&gt;
&lt;br /&gt;
==== Download ====&lt;br /&gt;
&lt;br /&gt;
* Phosh: [https://github.com/manjaro-pinephone/phosh-dev/releases Dev] and [https://github.com/manjaro-pinephone/phosh/releases Stable]&lt;br /&gt;
* Plasma Mobile: [https://github.com/manjaro-pinephone/plasma-mobile-dev/releases Dev] and [https://github.com/manjaro-pinephone/plasma-mobile/releases Stable]&lt;br /&gt;
* Lomiri: [https://github.com/manjaro-pinephone/lomiri-dev Dev] (unmaintained)&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!colspan=&amp;quot;2&amp;quot; style=&amp;quot;background: #a7d7f9;&amp;quot;| Default credentials (Only Phosh)&lt;br /&gt;
|-&lt;br /&gt;
! Default user&lt;br /&gt;
| &amp;lt;code&amp;gt;manjaro/123456&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
! root&lt;br /&gt;
| &amp;lt;code&amp;gt;root/root&amp;lt;/code&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== Notes ====&lt;br /&gt;
&lt;br /&gt;
The installation of the stable images is strongly suggested. The dev images might break frequently. &lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
=== Mobian ===&lt;br /&gt;
[[File:Debian-logo.png|right|100px]]&lt;br /&gt;
&lt;br /&gt;
An unofficial [https://www.debian.org Debian] build for ARM64 running with Phosh (developed by Purism, uses Wayland instead of Xorg).&lt;br /&gt;
The base system is pure Debian, with only the GUI applications and a few others (ModemManager, WiFi chip firmware) being built from modified sources (as well as the kernel and u-boot).&lt;br /&gt;
Current version is Debian Bookworm.&lt;br /&gt;
&lt;br /&gt;
==== Download ====&lt;br /&gt;
&lt;br /&gt;
* [https://images.mobian.org/pinephone/ Images]&lt;br /&gt;
&lt;br /&gt;
{{Info|Tow-Boot is required to be able to boot the images, see [https://wiki.mobian-project.org/doku.php?id&amp;amp;#61;install-linux here]!}}&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!colspan=&amp;quot;2&amp;quot; style=&amp;quot;background: #a7d7f9;&amp;quot;| Default credentials&lt;br /&gt;
|-&lt;br /&gt;
! Default user&lt;br /&gt;
| &amp;lt;code&amp;gt;mobian/1234&amp;lt;/code&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== Notes ====&lt;br /&gt;
The development is work in progress. See [https://gitlab.com/mobian1/devices/pinephone-support pinephone-support] for further information. The Mobian wiki can be found [https://wiki.mobian-project.org/ here].&lt;br /&gt;
&lt;br /&gt;
In order to connect to the device using SSH/SCP via WiFi, you need to install SSH on the device. You can do this by executing the following in a shell: &amp;quot;sudo apt-get install ssh&amp;quot;, afterwards you can connect via SSH/SCP via WiFi using the PinePhone's IP address on port 22.&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
=== Multi-distro demo image ===&lt;br /&gt;
&lt;br /&gt;
{{Warning | This is a demo image for testing different OSes before installing a regular image. Attempting to use this image productively is highly discouraged. The kernel is shared across the different OSes and is not updated.}}&lt;br /&gt;
&lt;br /&gt;
This image allow users to try many Linux distributions easily, without having to figure out how to flash them individually and juggle with many microSD cards. Also called megi's 15-in-1 multi boot image.&lt;br /&gt;
&lt;br /&gt;
* Main page: https://xnux.eu/p-boot-demo/&lt;br /&gt;
* Git repo: https://megous.com/git/pinephone-multi-boot/&lt;br /&gt;
* Forum discussion: [https://forum.pine64.org/showthread.php?tid=11347 15-distro multi-boot image for Pinephone]&lt;br /&gt;
&lt;br /&gt;
==== Download ====&lt;br /&gt;
&lt;br /&gt;
'''Update 2022-01-26, using megi's kernel 5.16.2'''&lt;br /&gt;
&lt;br /&gt;
DD image to SD card and boot. This image is for 16GiB or larger SD cards, also works if flashed to eMMC.&lt;br /&gt;
&lt;br /&gt;
This is also a good build for charging depleted battery. Just boot up this build with power supply connected, keep the PinePhone charging for 3 hours at power down stage.&lt;br /&gt;
&lt;br /&gt;
For more info on this build, please visit its entry the &amp;quot;News&amp;quot; section of its [https://xnux.eu/p-boot-demo/ web page].&lt;br /&gt;
&lt;br /&gt;
* [https://dl.xnux.eu/p-boot-multi-2022-01-26.torrent Download torrent file from author's website]&lt;br /&gt;
* [http://dl.xnux.eu/p-boot-multi-2022-01-26/ Download img.zst from author's website] (speed limited to 512KiB/s)&lt;br /&gt;
* [http://mirror.uxes.cz/dl.xnux.eu/ Download torrent and img.zst from discord user uxes' mirror]&lt;br /&gt;
** '''File name:''' multi.img.zst&lt;br /&gt;
** '''SHA-256:''' &amp;lt;span style=&amp;quot;word-break: break-all&amp;quot;&amp;gt;39915b9d2aa2f33fd78552ac9a0e665c4aef97dd68a9f9a6c76f9fa2f0ac049e&amp;lt;/span&amp;gt;&lt;br /&gt;
** '''File Size:''' 6.9GiB&lt;br /&gt;
&lt;br /&gt;
Due to its size, download though torrent is suggested by the author on its main page.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!colspan=&amp;quot;2&amp;quot; style=&amp;quot;background: #a7d7f9;&amp;quot;| Default credentials&lt;br /&gt;
|-&lt;br /&gt;
! General&lt;br /&gt;
| &amp;lt;code&amp;gt;1111&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
! sxmo&lt;br /&gt;
| &amp;lt;code&amp;gt;user/1111&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
! Manjaro&lt;br /&gt;
| seems to insist on &amp;lt;code&amp;gt;123456&amp;lt;/code&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== Notes ====&lt;br /&gt;
&lt;br /&gt;
{{Info | Note about zstd) archive file (&amp;lt;code&amp;gt;.zst&amp;lt;/code&amp;gt;):&lt;br /&gt;
&lt;br /&gt;
On Linux, you may install or compile &amp;lt;code&amp;gt;zstd&amp;lt;/code&amp;gt;, then write the image to SD card by piping &amp;lt;code&amp;gt;zstdcat&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;dd&amp;lt;/code&amp;gt;. See the &amp;quot;Installation&amp;quot; section of its [https://xnux.eu/p-boot-demo/ web page] for command examples.&lt;br /&gt;
&lt;br /&gt;
On Windows, instead of the offical [https://github.com/facebook/zstd zstd] command line program, you may use [https://github.com/mcmilk/7-Zip-zstd 7-zip-zstd]. Different installation method is provided in their README. Install 7-Zip-zstd / zstd, extract the disk image file (&amp;lt;code&amp;gt;.img&amp;lt;/code&amp;gt;) from the zstd archive, and flash with tools like [https://sourceforge.net/projects/win32diskimager/ Win32 Disk Imager].}}&lt;br /&gt;
&lt;br /&gt;
Also see [[PinePhone Installation Instructions]].&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
=== Nemo Mobile ===&lt;br /&gt;
[[File:nemo_mobile.png|right|100px]]&lt;br /&gt;
&lt;br /&gt;
Nemo Mobile is the open source build of Sailfish OS with a open source UI called [http://nemomobile.net/glacier-home/ Glacier], [http://nemomobile.net/pages/Hello_manjaro/ based on Manjaro].&lt;br /&gt;
&lt;br /&gt;
==== Download ====&lt;br /&gt;
&lt;br /&gt;
[https://img.nemomobile.net/2022.05/Manjaro-ARM-nemomobile-pinephone-0.9.img.xz Image]&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!colspan=&amp;quot;2&amp;quot; style=&amp;quot;background: #a7d7f9;&amp;quot;| Default credentials&lt;br /&gt;
|-&lt;br /&gt;
! Default user&lt;br /&gt;
| &amp;lt;code&amp;gt;manjaro/123456&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
! root&lt;br /&gt;
| &amp;lt;code&amp;gt;root/root&amp;lt;/code&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== Notes ====&lt;br /&gt;
The website of the Nemo Mobile UX Team can be found [https://nemomobile.net/ here]. Please report bugs regarding the Nemo Mobile UI as [https://github.com/nemomobile-ux/main/issues GitHub issue].&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
=== NixOS ===&lt;br /&gt;
[[File:nixos.png|right|100px]]&lt;br /&gt;
&lt;br /&gt;
NixOS is a Linux distribution built on top of the Nix package manager using declarative configuration to allow reliable system upgrades.&lt;br /&gt;
&lt;br /&gt;
==== Download ====&lt;br /&gt;
There is a guided installer by the [https://mobile.nixos.org/devices/pine64-pinephone.html Mobile NixOS] project available. An installer image that can be flashed to a sdcard can be downloaded from the [https://hydra.nixos.org/job/mobile-nixos/unstable/installer.pine64-pinephone Hydra build instance].&lt;br /&gt;
&lt;br /&gt;
Users that want to build a local image, are expected to follow the instructions in the [https://mobile.nixos.org/getting-started.html Getting Started page],&lt;br /&gt;
and [https://mobile.nixos.org/devices/pine64-pinephone.html Project's device page].&lt;br /&gt;
&lt;br /&gt;
==== Notes ====&lt;br /&gt;
Project home page: [https://mobile.nixos.org/ Mobile NixOS]&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
=== OpenMandriva Lx ===&lt;br /&gt;
[[File:Oma-logo-22042013_300pp.png|right|100px]]&lt;br /&gt;
&lt;br /&gt;
OpenMandriva Lx with Plasma Mobile as UI.&lt;br /&gt;
&lt;br /&gt;
==== Download ====&lt;br /&gt;
&lt;br /&gt;
The official image can be found [https://sourceforge.net/projects/openmandriva/files/release/4.2/RC/Pinephone/ at sourceforge.net].&lt;br /&gt;
See [https://www.openmandriva.org/en/news/article/openmandriva-lx-4-3-rc-available-for-testing here] for the offical announcement.&lt;br /&gt;
&lt;br /&gt;
==== Notes ====&lt;br /&gt;
&lt;br /&gt;
{{Info| This image is solely for testing purposes.}}&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
=== openSUSE ===&lt;br /&gt;
[[File:SLEM-OS-logo.png|right|100px]]&lt;br /&gt;
&lt;br /&gt;
Our images use the same [https://en.opensuse.org/Portal:Tumbleweed openSUSE Tumbleweed] base as our desktop images,&lt;br /&gt;
except what needs to be changed for the PinePhone.&lt;br /&gt;
The images include &amp;lt;i&amp;gt;zypper&amp;lt;/i&amp;gt; (RPM) as the default package manager,&lt;br /&gt;
and have access to virtually the same (open source) software as our desktop repositories,&lt;br /&gt;
thanks to the [https://en.opensuse.org/Portal:Factory Factory] ports.&lt;br /&gt;
Using [https://en.opensuse.org/SDB:DNF dnf] is possible, if preferred.&lt;br /&gt;
&lt;br /&gt;
==== Download ====&lt;br /&gt;
&lt;br /&gt;
* [https://download.opensuse.org/repositories/devel:/ARM:/Factory:/Contrib:/PinePhone/images/openSUSE-Tumbleweed-ARM-PHOSH-pinephone.aarch64.raw.xz Phosh] / [https://download.opensuse.org/repositories/devel:/ARM:/Factory:/Contrib:/PinePhone/images/openSUSE-Tumbleweed-ARM-PHOSH-pinephone.aarch64.raw.xz.sha256 SHA-256] / [https://download.opensuse.org/repositories/devel:/ARM:/Factory:/Contrib:/PinePhone/images/openSUSE-Tumbleweed-ARM-PHOSH-pinephone.aarch64.raw.xz.sha256.asc SHA-256 Signature]&lt;br /&gt;
* [https://download.opensuse.org/repositories/devel:/ARM:/Factory:/Contrib:/PinePhone/images/openSUSE-Tumbleweed-ARM-PLAMO-pinephone.aarch64.raw.xz Plasma Mobile] / [https://download.opensuse.org/repositories/devel:/ARM:/Factory:/Contrib:/PinePhone/images/openSUSE-Tumbleweed-ARM-PLAMO-pinephone.aarch64.raw.xz.sha256 SHA-256] / [https://download.opensuse.org/repositories/devel:/ARM:/Factory:/Contrib:/PinePhone/images/openSUSE-Tumbleweed-ARM-PLAMO-pinephone.aarch64.raw.xz.sha256.asc SHA-256 Signature]&lt;br /&gt;
&lt;br /&gt;
To verify the images you need to import [https://build.opensuse.org/projects/devel:ARM:Factory:Contrib:PinePhone/public_key our GPG key].&lt;br /&gt;
Keep on mind that the first boot may stay on black screen for about a minute - consequent boots should be faster.&lt;br /&gt;
&lt;br /&gt;
You can find install instructions at [https://en.opensuse.org/HCL:PinePhone#Installing_openSUSE_in_a_Pinephone this section] in the openSUSE Wiki.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!colspan=&amp;quot;2&amp;quot; style=&amp;quot;background: #a7d7f9;&amp;quot;| Default credentials&lt;br /&gt;
|-&lt;br /&gt;
! Default user&lt;br /&gt;
| &amp;lt;code&amp;gt;pine/1234&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
! root&lt;br /&gt;
| &amp;lt;code&amp;gt;root/linux&amp;lt;/code&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== Notes ====&lt;br /&gt;
&lt;br /&gt;
You can find all information about the releases of the project [https://gitlab.com/slem.os/slem.os/-/blob/master/CHANGELOG.md here].&lt;br /&gt;
Detailed information, tips and troubleshooting suggestions are also provided at [https://en.opensuse.org/HCL:PinePhone the openSUSE Wiki].&lt;br /&gt;
You will also find information in our wiki on how to report issues (Contributing section).&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
=== postmarketOS ===&lt;br /&gt;
[[File:PostmarketOS-logo.png|right|100px]]&lt;br /&gt;
&lt;br /&gt;
postmarketOS extends [https://www.alpinelinux.org/ Alpine Linux] to run on smartphones and other mobile devices.&lt;br /&gt;
It offers various user interfaces (Phosh, Plasma Mobile, Sxmo, Plasma Desktop, Gnome 3, Kodi, XFCE4, ...).&lt;br /&gt;
&lt;br /&gt;
==== Download ====&lt;br /&gt;
[https://postmarketos.org/download/ Download page]&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!colspan=&amp;quot;2&amp;quot; style=&amp;quot;background: #a7d7f9;&amp;quot;| Default credentials&lt;br /&gt;
|-&lt;br /&gt;
! Test images user&lt;br /&gt;
| &amp;lt;code&amp;gt;user/147147&amp;lt;/code&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== Notes ====&lt;br /&gt;
As of writing, official images are provided with Phosh, Plasma Mobile and Sxmo.&lt;br /&gt;
The official images come in two flavors, either as a test image to try out postmarketOS, or with the installer.&lt;br /&gt;
&lt;br /&gt;
When using the installer images (recommended), it is possible to:&lt;br /&gt;
* encrypt the installation&lt;br /&gt;
* install from the SD card to eMMC&lt;br /&gt;
&lt;br /&gt;
Power users may also create their own image with the distribution's install and development tool &amp;lt;code&amp;gt;pmbootstrap&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
See the [https://wiki.postmarketos.org/wiki/PINE64_PinePhone_(pine64-pinephone) pine64-pinephone] page of the postmarketOS wiki for details.&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
=== Sailfish OS ===&lt;br /&gt;
[[File:Sailfish_logo.png|right|100px]]&lt;br /&gt;
&lt;br /&gt;
[https://sailfishos.org/ Sailfish OS] is a Linux-based operating system based on open source projects such as [https://wiki.merproject.org/wiki/Main_Page Mer], and a closed source UI based on [https://sailfishos.org/wiki/Lipstick Lipstick].&lt;br /&gt;
&lt;br /&gt;
* [https://wiki.merproject.org/wiki/Adaptations/PinePhone64 PinePhone Wiki Page] on Mer Wiki, for both Nemo Mobile and Sailfish OS.&lt;br /&gt;
* [https://gitlab.com/pinephone-sailfish-os/linux-kernel/ Linux kernel config repo]&lt;br /&gt;
* [https://gitlab.com/sailfishos-porters-ci/dont_be_evil-ci/ Sailfish OS repo]&lt;br /&gt;
&lt;br /&gt;
==== Download ====&lt;br /&gt;
&lt;br /&gt;
'''Flashing script'''&lt;br /&gt;
&lt;br /&gt;
The Sailfish OS image is built on Gitlab CI. The latest image can be installed using the [https://raw.githubusercontent.com/sailfish-on-dontbeevil/flash-it/master/flash-it.sh flashing script].&lt;br /&gt;
&lt;br /&gt;
The script downloads the image and bootloader from the CI, extracts everything and burns it onto the SD card.&lt;br /&gt;
Note: The script will format and erase the SD card!&lt;br /&gt;
&lt;br /&gt;
Instructions:&lt;br /&gt;
# Download the flashing script&lt;br /&gt;
# Insert a microSD card in your device&lt;br /&gt;
# Make the script executable: &amp;lt;code&amp;gt;chmod +x flash-it.sh&amp;lt;/code&amp;gt;&lt;br /&gt;
# Verify that you have the &amp;lt;code&amp;gt;bsdtar&amp;lt;/code&amp;gt; package installed&lt;br /&gt;
# Execute it: &amp;lt;code&amp;gt;./flash-it.sh&amp;lt;/code&amp;gt;&lt;br /&gt;
# Follow the instructions. Some commands in the script require root permissions (for example: mounting and flashing the SD card).&lt;br /&gt;
&lt;br /&gt;
* When asked where to flash, type 'raw' and it will build the image on your computer. Otherwise define the path /dev/....  to flash to card or internal emmc. &lt;br /&gt;
&lt;br /&gt;
'''username/password'''&lt;br /&gt;
&lt;br /&gt;
Set PIN on initialization.&lt;br /&gt;
&lt;br /&gt;
==== Notes ====&lt;br /&gt;
&lt;br /&gt;
* Sometimes the first run stalls before the tutorial. Reboot and it will start from setting the security pin.&lt;br /&gt;
* The homescreen may be locked unless you boot with a sim card inserted. An old expired sim will do. '''If you do not have a SIM card on hands, do NOT set a security code on first boot.'''&lt;br /&gt;
* When a screen with a loading circle is displayed, just left/right swipe it away.&lt;br /&gt;
* If you're not familiar with Sailfish OS, pay attention to the tutorial - the interface works great, but is not immediately obvious. If you are familiar with it, you can skip the tutorial by touching all 4 corners starting top left.&lt;br /&gt;
&lt;br /&gt;
'''What works, what does not work'''&lt;br /&gt;
&lt;br /&gt;
See the [https://wiki.merproject.org/wiki/Adaptations/PinePhone64#Hardware_Support Hardware Support section] on the Mer Wiki's PinePhone Page.&lt;br /&gt;
&lt;br /&gt;
There is a limited selection of apps available from the Jolla store, the vast majority are hosted on openrepos.net. If the Storeman app for openrepos is not preinstalled, download the RPM and click to install.&lt;br /&gt;
&lt;br /&gt;
'''How to contribute and report defects'''&lt;br /&gt;
&lt;br /&gt;
See the documentation wiki at [https://github.com/sailfish-on-dontbeevil/documentation/wiki the github project] for help and links.&lt;br /&gt;
&lt;br /&gt;
See the [https://wiki.merproject.org/wiki/Adaptations/PinePhone64#Installation Installation section] on the Mer Wiki's PinePhone Page for compile, build and development.&lt;br /&gt;
&lt;br /&gt;
Git repo links are at the top of this OS section. other repos that may be helpful:&lt;br /&gt;
&lt;br /&gt;
* [https://github.com/sailfish-on-dontbeevil GitHub project page]&lt;br /&gt;
* [https://github.com/sailfish-on-dontbeevil/flash-it the repo of the flash-it.sh flashing script]&lt;br /&gt;
* [https://build.merproject.org/project/show/nemo:devel:hw:pine:dontbeevil Mer Open Build Service page] ([https://forum.sailfishos.org/t/changes-needed-to-merge-the-project-names-to-sailfish-os/1672 Mer is being assimilated into Sailfish OS] and [https://forum.sailfishos.org/t/obs-shut-down-and-next-steps/1814 OBS is shutting down], also see [https://specs.openstack.org/openstack/fuel-specs/specs/7.0/replace-obs.html OpenStack is replacing OBS with another build system based on Jenkins], if it's related, even OBS come back under Sailfish OS, it will be different.)&lt;br /&gt;
&lt;br /&gt;
See the [https://sailfishos.org/wiki/Collaborative_Development#Reporting_issues Sailfish OS wiki] for links to their forum, as well as info required when reporting an issue. See the [https://sailfishos.org/wiki/SailfishOS Sailfish OS wiki main page] for options to contribute to Sailfish OS.&lt;br /&gt;
&lt;br /&gt;
'''Notes'''&lt;br /&gt;
&lt;br /&gt;
OTA is supported: &amp;lt;code&amp;gt;zypper refresh &amp;amp;&amp;amp; zypper update&amp;lt;/code&amp;gt; as root (&amp;lt;code&amp;gt;devel-su&amp;lt;/code&amp;gt; to get root access). Things that need reflash are bootloader specific at the moment. If improvements like [[Crust]] or changes of partition layout are added, then you need to reflash.&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
=== SkiffOS ===&lt;br /&gt;
[[File:SkiffOS-Icon-1.png|right|100px]]&lt;br /&gt;
&lt;br /&gt;
Minimal in-memory cross-compiled OS optimized for hosting multiple in parallel Docker containers. Provides the reliability of firmware with the ease-of-use of package managers.&lt;br /&gt;
&lt;br /&gt;
==== Download ====&lt;br /&gt;
&lt;br /&gt;
The repository and instructions can be found [https://github.com/skiffos/SkiffOS/tree/master/configs/pine64/phone here].&lt;br /&gt;
&lt;br /&gt;
==== Notes ====&lt;br /&gt;
&lt;br /&gt;
Upgrade over-the-air via a simple rsync script, or copying 3 files.&lt;br /&gt;
&lt;br /&gt;
Uses the [http://buildroot.org Buildroot] cross-compilation tool for support for all Pine64 boards.&lt;br /&gt;
&lt;br /&gt;
Use configuration packages to configure distro:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Package !! Distro&lt;br /&gt;
|-&lt;br /&gt;
| core/pinephone_neon    || KDE Neon via Ubuntu repositories&lt;br /&gt;
|-&lt;br /&gt;
| core/pinephone_nixos   || Nixos Mobile&lt;br /&gt;
|-&lt;br /&gt;
| core/pinephone_gentoo  || Gentoo with Link-time Optimization &amp;amp; KDE Mobile or Phosh&lt;br /&gt;
|-&lt;br /&gt;
| core/pinephone_ubports || Ubuntu Ports for PinePhone&lt;br /&gt;
|-&lt;br /&gt;
| core/pinephone_manjaro_kde   || Manjaro for PinePhone: KDE variant&lt;br /&gt;
|-&lt;br /&gt;
| core/pinephone_manjaro_phosh || Manjaro for PinePhone: Phosh variant&lt;br /&gt;
|-&lt;br /&gt;
| core/pinephone_manjaro_lomiri || Manjaro for PinePhone: Lomiri variant&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The boot-up OS is upgraded independently from the containers.&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
=== Slackware ===&lt;br /&gt;
&lt;br /&gt;
[https://arm.slackware.com/ Slackware] is the world's oldest actively developed Linux distribution, providing a modern user land (applications) and Linux Kernel, within a more classic Unix Operating System environment.&lt;br /&gt;
&lt;br /&gt;
==== Download ====&lt;br /&gt;
&lt;br /&gt;
* http://dl.fail.pp.ua/slackware/images/pinephone/&lt;br /&gt;
&lt;br /&gt;
==== Notes ====&lt;br /&gt;
&lt;br /&gt;
Discussion: [https://forum.pine64.org/showthread.php?tid=12181&amp;amp;highlight=slackware+pinephone Thread]&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
=== Ubuntu Touch ===&lt;br /&gt;
[[File:Ubports-logo.png|right|100px]]&lt;br /&gt;
&lt;br /&gt;
A Mobile Version of the Ubuntu Operating System made and maintained by the UBports Community.&lt;br /&gt;
&lt;br /&gt;
Ubuntu touch is a mobile version of Ubuntu developed by the UBports community.&lt;br /&gt;
Installation instructions can be found on&lt;br /&gt;
[https://gitlab.com/ubports/community-ports/pinephone#how-do-i-install-ubuntu-touch-on-my-pinephone the UBports PinePhone project].&lt;br /&gt;
There is also a [https://github.com/goddard/pinephone/ script] to download the latest image and flash to your PinePhone.&lt;br /&gt;
In the future, Ubuntu Touch will be able to be installed onto the PinePhone with the [https://devices.ubuntu-touch.io/installer UBports installer] GUI tool.&lt;br /&gt;
&lt;br /&gt;
==== Download ====&lt;br /&gt;
&lt;br /&gt;
[https://gitlab.com/ubports/community-ports/pinephone#how-do-i-install-ubuntu-touch-on-my-pinephone UBports PinePhone project]&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!colspan=&amp;quot;2&amp;quot; style=&amp;quot;background: #a7d7f9;&amp;quot;| Default credentials&lt;br /&gt;
|-&lt;br /&gt;
! Default user&lt;br /&gt;
| Set during boot&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== Notes ====&lt;br /&gt;
&lt;br /&gt;
Scroll down to the bottom of [https://gitlab.com/ubports/community-ports/pinephone this page], or directly here [https://devices.ubuntu-touch.io/device/pinephone/#deviceOverview] to see which features work.&lt;br /&gt;
&lt;br /&gt;
Contributions and bug reports can be made via. [https://gitlab.com/ubports/community-ports/pinephone UBports gitlab page]. See [https://ubports.com/foundation/sponsors UBports website] for how to donate.&lt;br /&gt;
&lt;br /&gt;
== Tools ==&lt;br /&gt;
&lt;br /&gt;
There are software tools, that can be booted on the PinePhone.&lt;br /&gt;
&lt;br /&gt;
=== JumpDrive ===&lt;br /&gt;
&lt;br /&gt;
JumpDrive can be used to flash the eMMC (and the microSD card), see [[PinePhone Installation Instructions#Using JumpDrive]].&lt;br /&gt;
&lt;br /&gt;
See https://github.com/dreemurrs-embedded/Jumpdrive/releases for the latest image.&lt;br /&gt;
Make sure to download the &amp;quot;PinePhone&amp;quot; image and to unpack the archive before flashing.&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
=== Tow-Boot ===&lt;br /&gt;
Tow-Boot is a more user-friendly distribution of U-Boot. Can also mount internal storage as USB Mass Storage by holding the volume up button at startup before and during the second vibration and the LED will turn blue if done successfully.&lt;br /&gt;
&lt;br /&gt;
See https://github.com/Tow-Boot/Tow-Boot/releases for the latest image.&lt;br /&gt;
Make sure to download the image with pinephoneA64 in the name.&lt;br /&gt;
&lt;br /&gt;
== Factory Test OS ==&lt;br /&gt;
&lt;br /&gt;
On the Braveheart model, there was a postmarketOS based basic Factory Test OS pre-installed on the eMMC.The developer Martijn Braam from postmarketOS has improved the functionality of the image considerably later. Since the 20200501 version, it is able to test all the hardware. It also includes functionality to install a new OS to the eMMC when using with an test image that includes that OS image. The downloadable image just does the hardware tests. Do not flash eMMC to test your device, just dd it to microSD and test from there. New versions are distributed as part of the postmarketOS distribution.&lt;br /&gt;
&lt;br /&gt;
{{Info| The magnetometer test will fail on the new Beta Edition, as the factory image wasn't updated for it yet.}}&lt;br /&gt;
&lt;br /&gt;
Links:&lt;br /&gt;
* [https://images.postmarketos.org/pinephone/ Software Images] (download the latest one named like pine-pinephone-yyyyMMdd-factorytestX.img.xz)&lt;br /&gt;
* [https://gitlab.com/MartijnBraam/factorytest Git repo]&lt;br /&gt;
* [https://gitlab.com/MartijnBraam/factorytest/-/blob/master/README.rst Documentation]&lt;br /&gt;
&lt;br /&gt;
=== Factory-loaded OS builds ===&lt;br /&gt;
&lt;br /&gt;
These are different operating system builds that was preloaded in the factory with testing utility.&lt;br /&gt;
&lt;br /&gt;
Download the build, extract the image and dd it to a 8 GB or larger microSD card, then insert it into the PinePhone.&lt;br /&gt;
After power up or reboot, you may perform and complete the test routine, or apply the build from microSD card to eMMC.&lt;br /&gt;
&lt;br /&gt;
All the download links below are direct download from pine64.org.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;overflow: auto;&amp;quot;&amp;gt;&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;white-space: nowrap&amp;quot;&lt;br /&gt;
! OS&lt;br /&gt;
! Download Link&lt;br /&gt;
! File Size&lt;br /&gt;
! MD5&lt;br /&gt;
|-&lt;br /&gt;
| Beta Edition&lt;br /&gt;
| [https://files.pine64.org/os/PinePhone/BetaEdition/pine64-pinephone-plamo-beta-factorytest.img.xz pine64-pinephone-plamo-beta-factorytest.img.xz]&lt;br /&gt;
| 1.78GB&lt;br /&gt;
| &amp;lt;code&amp;gt;f16bce93504a52217540ac886863a418&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| Mobian&lt;br /&gt;
| [https://files.pine64.org/os/PinePhone/Mobian/pine64-pinephone-20201207-factorytest-mobian.img.xz pine64-pinephone-20201207-factorytest-mobian.img.xz]&lt;br /&gt;
| 1.41GB&lt;br /&gt;
| &amp;lt;code&amp;gt;015be381ff4e650a7fca6d4eaa90d63d&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| KDE&lt;br /&gt;
| [https://files.pine64.org/os/PinePhone/KDE/pine64-pinephone-20201208-factorytest-kde.img.xz pine64-pinephone-20201208-factorytest-kde.img.xz]&lt;br /&gt;
| 2.28GB&lt;br /&gt;
| &amp;lt;code&amp;gt;32979ff17b5ec4d358ce99f1aff0c77c&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| Manjaro&lt;br /&gt;
| [https://files.pine64.org/os/PinePhone/Manjaro/pine64-pinephone-20201013-manjaro-stable-20201018-factory56.img.xz pine64-pinephone-20201013-manjaro-stable-20201018-factory56.img.xz]&lt;br /&gt;
| 1.04GB&lt;br /&gt;
| &amp;lt;code&amp;gt;4edfd4dceaefdd32a3417c1727161c29&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| postmarketOS&lt;br /&gt;
| [https://files.pine64.org/os/PinePhone/PostMarketOS/pine64-pinephone-20200726-phosh-v20.05-factory.img.xz pine64-pinephone-20200726-phosh-v20.05-factory.img.xz]&lt;br /&gt;
| 517MB&lt;br /&gt;
| &amp;lt;code&amp;gt;244093be2f6d728fcbd1d29114607727&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| Ubuntu Touch&lt;br /&gt;
| [https://files.pine64.org/os/PinePhone/UBPorts/PinePhone-flasher-ubuntu-7b.img.gz PinePhone-flasher-ubuntu-7b.img.gz]&lt;br /&gt;
| 1.05GB&lt;br /&gt;
| &amp;lt;code&amp;gt;2d7f5271e7a281db8f1b1219bedbe131&amp;lt;/code&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Installing other ARM64 distributions ==&lt;br /&gt;
&lt;br /&gt;
{{Warning|Distributions not on this page may not even boot after you follow this section. In the best case, they will be barely usable.&lt;br /&gt;
This is more for fun, or if you would like to port a new distribution to the PinePhone.}}&lt;br /&gt;
&lt;br /&gt;
{{Hint|'''Note:''' This section uses megi's kernel releases, and not the official ones from Pine64. While it is possible to use the official (and in the future, mainline) kernel, megi provides binary releases, which makes it very easy.}}&lt;br /&gt;
&lt;br /&gt;
General steps:&lt;br /&gt;
&lt;br /&gt;
# Create a boot partition (from 4 MB to about 252 MB) and a root partition (from the end of boot to the end of the card) filesystem on the SD card.&lt;br /&gt;
# Format the boot partition with vfat, and the root partition with a supported filesystem like ext4 or f2fs.&lt;br /&gt;
# Extract the root filesystem from your distribution's ARM image into the root filesystem on the SD card. Do not copy the partition, copy the files instead (in archive mode, like &amp;lt;code&amp;gt;rsync -ar&amp;lt;/code&amp;gt;).&lt;br /&gt;
# Edit &amp;lt;code&amp;gt;/etc/fstab&amp;lt;/code&amp;gt; to match your partitions.&lt;br /&gt;
# Grab megi's kernel from https://xff.cz/kernels/, Follow the instructions in the [https://xff.cz/kernels/README README], which involves copying the kernel modules into the SD card rootfs, and writing u-boot and the bootloader.&lt;br /&gt;
&lt;br /&gt;
If you would like to see examples or specific commands for how to complete these steps, see:&lt;br /&gt;
* [https://github.com/nikhiljha/pp-fedora-sdsetup     an example for Fedora], current unofficial [#Fedora] release&lt;br /&gt;
* [https://xnux.eu/howtos/install-arch-linux-arm.html an example for Arch Linux] by megi&lt;br /&gt;
&lt;br /&gt;
== Other Resources ==&lt;br /&gt;
&lt;br /&gt;
Community&lt;br /&gt;
* [[Main_Page#Community_and_Support|Links to the community services]]&lt;br /&gt;
&lt;br /&gt;
Hardware information&lt;br /&gt;
* [[PinePhone|General PinePhone hardware info]] in this Pine64 wiki&lt;br /&gt;
* Details specific to the Braveheart Edition: [[PinePhone_v1.1_-_Braveheart|PinePhone 1.1 Braveheart hardware details]]&lt;br /&gt;
* Details specific to the Community Edition: [[PinePhone_v1.2|PinePhone 1.2 hardware details]]&lt;br /&gt;
* The postmarketOS wiki has a detailed page on the PinePhone hardware [https://wiki.postmarketos.org/wiki/PINE64_PinePhone_(pine64-pinephone) here] and the preceding devkit [https://wiki.postmarketos.org/wiki/PINE64_Don%27t_be_evil_devkit_(pine64-dontbeevil) here]&lt;br /&gt;
&lt;br /&gt;
[https://nuttx.apache.org/docs/latest Apache NuttX RTOS] is a Real-Time Operating System that supports PinePhone&lt;br /&gt;
* [https://nuttx.apache.org/docs/latest/platforms/arm/a64/boards/pinephone/index.html Apache NuttX RTOS on PINE64 PinePhone]&lt;br /&gt;
&lt;br /&gt;
Other software information&lt;br /&gt;
* [https://linux-sunxi.org/Main_Page sunxi community wiki]&lt;br /&gt;
* [https://xnux.eu/devices/pine64-pinephone.html megi's feature/driver support matrix]&lt;br /&gt;
* [https://megous.com/dl/tmp/README.bootui megi bootUI notes (for dualbooting/multibooting)] see demonstration [https://www.youtube.com/watch?v=ZL1GREqoqx8 on YouTube]&lt;br /&gt;
* [https://github.com/ayufan-pine64/boot-tools ayufan boot tools]&lt;br /&gt;
&lt;br /&gt;
Other&lt;br /&gt;
* [https://pine64.com/?post_type=product Pine64 shop]&lt;br /&gt;
* [https://www.pine64.org/2020/01/24/setting-the-record-straight-pinephone-misconceptions/ Pine64 blog on blobs]&lt;br /&gt;
* [https://tuxphones.com/yet-another-librem-5-and-pinephone-linux-smartphone-comparison/ Martijn Braam Librem 5 comparison, especially covering openness/blobs]&lt;br /&gt;
* [https://fam-ribbers.com/2019/12/28/State-of-Linux-on-mobile-and-common-misconceptions.html Bart Ribbers blog on Linux distributions and desktop environments on mobile devices]&lt;br /&gt;
* [https://www.jeffgeerling.com/blog/2019/a2-class-microsd-cards-offer-no-better-performance-raspberry-pi Jeff Geerling on testing microSD cards]&lt;br /&gt;
&lt;br /&gt;
[[Category:PinePhone]]&lt;/div&gt;</summary>
		<author><name>Lupyuen</name></author>
	</entry>
	<entry>
		<id>https://wiki.pine64.org/index.php?title=PinePhone_Software_Releases&amp;diff=14784</id>
		<title>PinePhone Software Releases</title>
		<link rel="alternate" type="text/html" href="https://wiki.pine64.org/index.php?title=PinePhone_Software_Releases&amp;diff=14784"/>
		<updated>2022-11-26T01:15:41Z</updated>

		<summary type="html">&lt;p&gt;Lupyuen: Add Apache NuttX RTOS&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This page contains a list of all available operating systems for the [[PinePhone]] in alphabetical order, as well as links to other resources.&lt;br /&gt;
&lt;br /&gt;
{{Info|Some releases may not have a good setup for the backlight at low brightness. If configured too low, the backlight shuts down completely, but the screen is still displayed and usable in bright front-light.}}&lt;br /&gt;
&lt;br /&gt;
See [[PinePhone Installation Instructions]] on how to install the operating systems. Please see [[PinePhone Updating Instructions]] for how to update the phone.&lt;br /&gt;
&lt;br /&gt;
== Software Releases ==&lt;br /&gt;
&lt;br /&gt;
=== Arch Linux ARM ===&lt;br /&gt;
[[File:Archlinux-logo.png|right|100px]]&lt;br /&gt;
&lt;br /&gt;
(Unofficial) Arch Linux ARM with choice of Phosh UI, Plasma Mobile, sxmo or barebones.&lt;br /&gt;
Currently being maintained by the [https://danctnix.org/ DanctNIX] community (GitHub: [https://github.com/DanctNIX/danctnix danctnix], [https://github.com/dreemurrs-embedded dreemurrs-embedded]).&lt;br /&gt;
&lt;br /&gt;
==== Download ====&lt;br /&gt;
&lt;br /&gt;
Get both stable and test builds at [https://github.com/dreemurrs-embedded/Pine64-Arch/releases GitHub releases].&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!colspan=&amp;quot;2&amp;quot; style=&amp;quot;background: #a7d7f9;&amp;quot;| Default credentials&lt;br /&gt;
|-&lt;br /&gt;
! Default user&lt;br /&gt;
| &amp;lt;code&amp;gt;alarm/123456&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
! root (barebone only)&lt;br /&gt;
| &amp;lt;code&amp;gt;root/root&amp;lt;/code&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== Notes ====&lt;br /&gt;
&lt;br /&gt;
* There are archmobile chat rooms on Matrix ([https://matrix.to/#/#archmobile:kde.org #archmobile:kde.org]) and Telegram ([https://t.me/archmobile @archmobile]).&lt;br /&gt;
* Feel free to send us [https://github.com/dreemurrs-embedded/Pine64-Arch/pulls pull requests] and reports [https://github.com/dreemurrs-embedded/Pine64-Arch/issues issues] on [https://github.com/dreemurrs-embedded/Pine64-Arch GitHub].&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
=== ExpidusOS ===&lt;br /&gt;
&lt;br /&gt;
A fork of [https://voidlinux.org Void Linux] with a custom fork of XFCE called [https://github.com/ExpidusOS/genesis Gensis] as the default desktop environment, developed by [https://midstall.com/ Midstall Software].&lt;br /&gt;
&lt;br /&gt;
* [https://expidusos.com ExpidusOS official website]&lt;br /&gt;
* [https://wiki.expidusos.com/index.php/Main_Page ExpidusOS Wiki]&lt;br /&gt;
* [https://discord.gg/GVfBF2w Midstall Software Discord server]&lt;br /&gt;
* GitHub: [https://github.com/ExpidusOS ExpidusOS]&lt;br /&gt;
&lt;br /&gt;
==== Download ====&lt;br /&gt;
&lt;br /&gt;
Check the [https://expidusos.com/download download page] for that latest version, or the [https://build.expidusos.com/ image file list] for all versions, look for the filename that starts with &amp;quot;pinephone&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!colspan=&amp;quot;2&amp;quot; style=&amp;quot;background: #a7d7f9;&amp;quot;| Default credentials&lt;br /&gt;
|-&lt;br /&gt;
! Default user&lt;br /&gt;
| &amp;lt;code&amp;gt;expidus/expidus&amp;lt;/code&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== Notes ====&lt;br /&gt;
&lt;br /&gt;
What works, what does not work:&lt;br /&gt;
&lt;br /&gt;
* The ExpidusOS Wiki has a page detailing [https://wiki.expidusos.com/index.php/Device:PinePhone supported features].&lt;br /&gt;
&lt;br /&gt;
How to contribute and report defects:&lt;br /&gt;
&lt;br /&gt;
* Join the [https://discord.gg/GVfBF2w Discord server] or corresponding repo at GitHub ([https://github.com/orgs/ExpidusOS/repositories repo list]).&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
=== Fedora ===&lt;br /&gt;
[[File:Fedora-logo.png|right|100px]]&lt;br /&gt;
&lt;br /&gt;
An (unofficial) vanilla Fedora rawhide build for aarch64 with megi's kernel and [https://copr.fedorainfracloud.org/coprs/njha/mobile/packages/ some additional packages] to tie it all together.&lt;br /&gt;
It aims to eventually be an upstream part of the Fedora project, rather than a phone-specific distribution.&lt;br /&gt;
&lt;br /&gt;
* Forum discussion: [https://forum.pine64.org/showthread.php?tid=9347 Fedora + Phosh for PinePhone]&lt;br /&gt;
* GitHub: [https://github.com/nikhiljha/pp-fedora-sdsetup nikhiljha/pp-fedora-sdsetup]&lt;br /&gt;
&lt;br /&gt;
==== Download ====&lt;br /&gt;
&lt;br /&gt;
* [https://github.com/nikhiljha/pp-fedora-sdsetup/releases Flashable images]&lt;br /&gt;
* [https://github.com/nikhiljha/pp-fedora-sdsetup          Build scripts]&lt;br /&gt;
* [https://copr.fedorainfracloud.org/coprs/njha/mobile/    Packages (Fedora COPR)]&lt;br /&gt;
&lt;br /&gt;
There is also an FTP server with images build every night @ ftp://pine.warpspeed.dk/nightly/pinephone/ (Mount this with something like Nautilus)&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!colspan=&amp;quot;2&amp;quot; style=&amp;quot;background: #a7d7f9;&amp;quot;| Default credentials&lt;br /&gt;
|-&lt;br /&gt;
! GitHub images&lt;br /&gt;
| &amp;lt;code&amp;gt;pine/123456&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
! Nightly images (via FTP)&lt;br /&gt;
| &amp;lt;code&amp;gt;pine/1111&amp;lt;/code&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== Notes ====&lt;br /&gt;
&lt;br /&gt;
WiFi, Bluetooth, SMS, Data, Calls all work! There are still a few bugs though, and [https://xnux.eu/devices/pine64-pinephone.html#toc-feature-driver-support-matrix some features don't have driver support yet] on any PinePhone distribution.&lt;br /&gt;
&lt;br /&gt;
Please send your bug reports to [https://github.com/nikhiljha/pp-fedora-sdsetup/issues the project's issue tracker]. Be sure to include logs if applicable! Send us pull requests on [https://github.com/nikhiljha/pp-fedora-sdsetup/pulls Github].&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
=== Gentoo ===&lt;br /&gt;
[[File:GentooLogo.png|right|100px]]&lt;br /&gt;
&lt;br /&gt;
There are unofficial Gentoo overlays with ebuilds for the PinePhone. There are no images - the image must be built manually, including picking the kernel, bootloader and the desired desktop environment. The ARM64 version of Gentoo has to be selected.&lt;br /&gt;
&lt;br /&gt;
==== Download ====&lt;br /&gt;
&lt;br /&gt;
Overlay locations:&lt;br /&gt;
&lt;br /&gt;
* https://gitlab.com/bingch/gentoo-overlay&lt;br /&gt;
* https://github.com/stealthgun/gjdwebserver-overlay&lt;br /&gt;
&lt;br /&gt;
==== Notes ====&lt;br /&gt;
&lt;br /&gt;
The documentation can be found here:&lt;br /&gt;
&lt;br /&gt;
* https://stealthgun.tweakblogs.net/blog/19336/gentoo-on-a-pinephone&lt;br /&gt;
* https://wiki.gentoo.org/wiki/User:Dr41nU/PinePhone&lt;br /&gt;
* https://wiki.gentoo.org/wiki/PinePhone (incomplete)&lt;br /&gt;
&lt;br /&gt;
{{Info|Please consider cross-compiling the software on the computer. Long compilation times and heat production can lead to a reduced lifespan of the phone.}}&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
=== GloDroid ===&lt;br /&gt;
&lt;br /&gt;
A fully open source port of Android to the PinePhone.&lt;br /&gt;
&lt;br /&gt;
GitHub: [https://github.com/GloDroid/ GloDroid]&lt;br /&gt;
&lt;br /&gt;
==== Download ====&lt;br /&gt;
&lt;br /&gt;
* Stable image: [https://github.com/GloDroid/glodroid_manifest/releases GloDroid]&lt;br /&gt;
&lt;br /&gt;
==== Notes ====&lt;br /&gt;
&lt;br /&gt;
Feature overview:&lt;br /&gt;
&lt;br /&gt;
* Works: WiFi, screen dimming, sound, touchscreen, charging and telephony(partially) works.&lt;br /&gt;
* Doesn't work: Bluetooth and GPS&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
=== Kali Linux ===&lt;br /&gt;
[[File:Kali-logo.png|right|200px]]&lt;br /&gt;
&lt;br /&gt;
An unofficial [https://www.kali.org Kali Linux] build for PinePhone running with Phosh.&lt;br /&gt;
This Kali Linux Phosh build contains only the Phosh GUI and a few other packages (ModemManager, WiFi chip firmware).&lt;br /&gt;
Now, Totally depends on The Kali repository. Get [https://github.com/Shubhamvis98/usb-arsenal-pinephone USB Arsenal] for your PinePhone's Kali Linux. Packet Injection is working now, use iwconfig instead of airmon-ng.&lt;br /&gt;
&lt;br /&gt;
==== Download ====&lt;br /&gt;
&lt;br /&gt;
* [https://github.com/Shubhamvis98/kali-pinephone/releases Kali Phosh]&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!colspan=&amp;quot;2&amp;quot; style=&amp;quot;background: #a7d7f9;&amp;quot;| Default credentials&lt;br /&gt;
|-&lt;br /&gt;
! Default user&lt;br /&gt;
| &amp;lt;code&amp;gt;kali/8888&amp;lt;/code&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== Notes ====&lt;br /&gt;
&lt;br /&gt;
Installation:&lt;br /&gt;
&lt;br /&gt;
 $ unxz -c Kali-PinePhone-{Release}.img.xz | dd of=/dev/{storage_block} bs=1M status=progress&lt;br /&gt;
 $ growpart /dev/mmcblkX Y&lt;br /&gt;
 $ e2fsck -y -f /dev/mmcblkXpY&lt;br /&gt;
 $ resize2fs /dev/mmcblkXpY&lt;br /&gt;
 # X: Storage Device Y: Partition Number&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
=== LuneOS ===&lt;br /&gt;
[[File:Luneos-logo-256.png|right|100px]]&lt;br /&gt;
&lt;br /&gt;
LuneOS is one of the original multi-tasking OS-es that runs on Linux. Based on HP/Palm's webOS, merged with latest technology stack from LG called webOS OSE (a derivative of what LG uses on their Smart TV's), software such as Qt5 and makes use of the Yocto build system.&lt;br /&gt;
&lt;br /&gt;
* [https://www.webos-ports.org/wiki/Main_Page WebOS Ports Wiki]&lt;br /&gt;
* [https://webos-ports.org/wiki/Pinephone_Info WebOS-Ports Wiki's Pinephone page]&lt;br /&gt;
* GitHub: [https://github.com/webOS-ports WebOS Ports]&lt;br /&gt;
&lt;br /&gt;
==== Download ====&lt;br /&gt;
&lt;br /&gt;
* LuneOS Preview images: [https://github.com/webOS-ports/meta-pine64-luneos/releases Downloads]&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!colspan=&amp;quot;2&amp;quot; style=&amp;quot;background: #a7d7f9;&amp;quot;| Default credentials&lt;br /&gt;
|-&lt;br /&gt;
! Default user&lt;br /&gt;
| &amp;lt;code&amp;gt;root&amp;lt;/code&amp;gt;&lt;br /&gt;
|} &lt;br /&gt;
&lt;br /&gt;
==== Notes ====&lt;br /&gt;
&lt;br /&gt;
In order to connect to the device using SSH/SCP via WiFi: You can simply connect via SSH/SCP via WiFi using the PinePhone's IP address on port 22.&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
=== Maemo Leste ===&lt;br /&gt;
[[File:Maemoleste-logo.png|right|100px]]&lt;br /&gt;
&lt;br /&gt;
[https://en.wikipedia.org/wiki/Maemo Maemo] is a trimmed-down version of Debian for mobile devices,&lt;br /&gt;
originally a collaboration between Nokia and many open source projects (the [http://maemo.org/intro/ Maemo community]) before Nokia abandoned it. The more well-known devices Maemo supports are the OpenMoko and N900. The community now takes full responsibility in developing fully open source Maemo for a variety of mobile devices. You may be interested to learn more about the features in their [https://leste.maemo.org/Leste_FAQ Maemo Leste FAQ].&lt;br /&gt;
&lt;br /&gt;
Maemo 8 &amp;quot;Leste&amp;quot; is an ARM64 port of [https://devuan.org/ Devuan] (Debian without systemd) and runs the mainline Linux kernel.&lt;br /&gt;
The default user interface stack is [https://en.wikipedia.org/wiki/Hildon Hildon], [https://en.wikipedia.org/wiki/X.Org_Server Xorg], [https://en.wikipedia.org/wiki/Matchbox_(window_manager) Matchbox WM], and [https://en.wikipedia.org/wiki/GTK GTK].&lt;br /&gt;
&lt;br /&gt;
==== Download ====&lt;br /&gt;
&lt;br /&gt;
* [http://maedevu.maemo.org/images/pinephone/ Maemo Leste test builds]&lt;br /&gt;
&lt;br /&gt;
There is also an [https://github.com/maemo-leste/image-builder image builder], see the wiki for instructions on how to [https://leste.maemo.org/Image_Builder build a custom image]. For current status and instructions, please read their [https://leste.maemo.org/PinePhone PinePhone wiki page].&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!colspan=&amp;quot;2&amp;quot; style=&amp;quot;background: #a7d7f9;&amp;quot;| Default credentials&lt;br /&gt;
|-&lt;br /&gt;
! root&lt;br /&gt;
| &amp;lt;code&amp;gt;toor&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
! user&lt;br /&gt;
| &amp;lt;code&amp;gt;12345 (lockscreen)&amp;lt;/code&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== Notes ====&lt;br /&gt;
&lt;br /&gt;
Most discussion occurs at  [ircs://irc.libera.chat:6697/#maemo-leste &amp;lt;code&amp;gt;#maemo-leste&amp;lt;/code&amp;gt; on &amp;lt;code&amp;gt;irc.libera.chat&amp;lt;/code&amp;gt;] and [https://talk.maemo.org/showthread.php?t=100192&amp;amp;page=60 this thread].&lt;br /&gt;
&lt;br /&gt;
All other contact information is listed on the [https://leste.maemo.org/Main_Page main page] of the Maemo wiki.&lt;br /&gt;
&lt;br /&gt;
Submit [https://github.com/maemo-leste/bugtracker/issues bug reports] on github.&lt;br /&gt;
To track known issues, you may use these search terms:&lt;br /&gt;
[https://github.com/maemo-leste/bugtracker/issues?utf8=%E2%9C%93&amp;amp;q=is%3Aissue+is%3Aopen+pinephone pinephone],&lt;br /&gt;
[https://github.com/maemo-leste/bugtracker/issues?utf8=%E2%9C%93&amp;amp;q=is%3Aissue+is%3Aopen+pine64 pine64].&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
=== Manjaro ARM ===&lt;br /&gt;
[[File:Manjaro-logo.svg|right|100px]]&lt;br /&gt;
&lt;br /&gt;
Manjaro is a user-friendly Linux distribution based on the independently developed Arch operating system with the Plasma Mobile and Phosh desktop environment.&lt;br /&gt;
&lt;br /&gt;
==== Download ====&lt;br /&gt;
&lt;br /&gt;
* Phosh: [https://github.com/manjaro-pinephone/phosh-dev/releases Dev] and [https://github.com/manjaro-pinephone/phosh/releases Stable]&lt;br /&gt;
* Plasma Mobile: [https://github.com/manjaro-pinephone/plasma-mobile-dev/releases Dev] and [https://github.com/manjaro-pinephone/plasma-mobile/releases Stable]&lt;br /&gt;
* Lomiri: [https://github.com/manjaro-pinephone/lomiri-dev Dev] (unmaintained)&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!colspan=&amp;quot;2&amp;quot; style=&amp;quot;background: #a7d7f9;&amp;quot;| Default credentials (Only Phosh)&lt;br /&gt;
|-&lt;br /&gt;
! Default user&lt;br /&gt;
| &amp;lt;code&amp;gt;manjaro/123456&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
! root&lt;br /&gt;
| &amp;lt;code&amp;gt;root/root&amp;lt;/code&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== Notes ====&lt;br /&gt;
&lt;br /&gt;
The installation of the stable images is strongly suggested. The dev images might break frequently. &lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
=== Mobian ===&lt;br /&gt;
[[File:Debian-logo.png|right|100px]]&lt;br /&gt;
&lt;br /&gt;
An unofficial [https://www.debian.org Debian] build for ARM64 running with Phosh (developed by Purism, uses Wayland instead of Xorg).&lt;br /&gt;
The base system is pure Debian, with only the GUI applications and a few others (ModemManager, WiFi chip firmware) being built from modified sources (as well as the kernel and u-boot).&lt;br /&gt;
Current version is Debian Bookworm.&lt;br /&gt;
&lt;br /&gt;
==== Download ====&lt;br /&gt;
&lt;br /&gt;
* [https://images.mobian.org/pinephone/ Images]&lt;br /&gt;
&lt;br /&gt;
{{Info|Tow-Boot is required to be able to boot the images, see [https://wiki.mobian-project.org/doku.php?id&amp;amp;#61;install-linux here]!}}&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!colspan=&amp;quot;2&amp;quot; style=&amp;quot;background: #a7d7f9;&amp;quot;| Default credentials&lt;br /&gt;
|-&lt;br /&gt;
! Default user&lt;br /&gt;
| &amp;lt;code&amp;gt;mobian/1234&amp;lt;/code&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== Notes ====&lt;br /&gt;
The development is work in progress. See [https://gitlab.com/mobian1/devices/pinephone-support pinephone-support] for further information. The Mobian wiki can be found [https://wiki.mobian-project.org/ here].&lt;br /&gt;
&lt;br /&gt;
In order to connect to the device using SSH/SCP via WiFi, you need to install SSH on the device. You can do this by executing the following in a shell: &amp;quot;sudo apt-get install ssh&amp;quot;, afterwards you can connect via SSH/SCP via WiFi using the PinePhone's IP address on port 22.&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
=== Multi-distro demo image ===&lt;br /&gt;
&lt;br /&gt;
{{Warning | This is a demo image for testing different OSes before installing a regular image. Attempting to use this image productively is highly discouraged. The kernel is shared across the different OSes and is not updated.}}&lt;br /&gt;
&lt;br /&gt;
This image allow users to try many Linux distributions easily, without having to figure out how to flash them individually and juggle with many microSD cards. Also called megi's 15-in-1 multi boot image.&lt;br /&gt;
&lt;br /&gt;
* Main page: https://xnux.eu/p-boot-demo/&lt;br /&gt;
* Git repo: https://megous.com/git/pinephone-multi-boot/&lt;br /&gt;
* Forum discussion: [https://forum.pine64.org/showthread.php?tid=11347 15-distro multi-boot image for Pinephone]&lt;br /&gt;
&lt;br /&gt;
==== Download ====&lt;br /&gt;
&lt;br /&gt;
'''Update 2022-01-26, using megi's kernel 5.16.2'''&lt;br /&gt;
&lt;br /&gt;
DD image to SD card and boot. This image is for 16GiB or larger SD cards, also works if flashed to eMMC.&lt;br /&gt;
&lt;br /&gt;
This is also a good build for charging depleted battery. Just boot up this build with power supply connected, keep the PinePhone charging for 3 hours at power down stage.&lt;br /&gt;
&lt;br /&gt;
For more info on this build, please visit its entry the &amp;quot;News&amp;quot; section of its [https://xnux.eu/p-boot-demo/ web page].&lt;br /&gt;
&lt;br /&gt;
* [https://dl.xnux.eu/p-boot-multi-2022-01-26.torrent Download torrent file from author's website]&lt;br /&gt;
* [http://dl.xnux.eu/p-boot-multi-2022-01-26/ Download img.zst from author's website] (speed limited to 512KiB/s)&lt;br /&gt;
* [http://mirror.uxes.cz/dl.xnux.eu/ Download torrent and img.zst from discord user uxes' mirror]&lt;br /&gt;
** '''File name:''' multi.img.zst&lt;br /&gt;
** '''SHA-256:''' &amp;lt;span style=&amp;quot;word-break: break-all&amp;quot;&amp;gt;39915b9d2aa2f33fd78552ac9a0e665c4aef97dd68a9f9a6c76f9fa2f0ac049e&amp;lt;/span&amp;gt;&lt;br /&gt;
** '''File Size:''' 6.9GiB&lt;br /&gt;
&lt;br /&gt;
Due to its size, download though torrent is suggested by the author on its main page.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!colspan=&amp;quot;2&amp;quot; style=&amp;quot;background: #a7d7f9;&amp;quot;| Default credentials&lt;br /&gt;
|-&lt;br /&gt;
! General&lt;br /&gt;
| &amp;lt;code&amp;gt;1111&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
! sxmo&lt;br /&gt;
| &amp;lt;code&amp;gt;user/1111&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
! Manjaro&lt;br /&gt;
| seems to insist on &amp;lt;code&amp;gt;123456&amp;lt;/code&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== Notes ====&lt;br /&gt;
&lt;br /&gt;
{{Info | Note about zstd) archive file (&amp;lt;code&amp;gt;.zst&amp;lt;/code&amp;gt;):&lt;br /&gt;
&lt;br /&gt;
On Linux, you may install or compile &amp;lt;code&amp;gt;zstd&amp;lt;/code&amp;gt;, then write the image to SD card by piping &amp;lt;code&amp;gt;zstdcat&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;dd&amp;lt;/code&amp;gt;. See the &amp;quot;Installation&amp;quot; section of its [https://xnux.eu/p-boot-demo/ web page] for command examples.&lt;br /&gt;
&lt;br /&gt;
On Windows, instead of the offical [https://github.com/facebook/zstd zstd] command line program, you may use [https://github.com/mcmilk/7-Zip-zstd 7-zip-zstd]. Different installation method is provided in their README. Install 7-Zip-zstd / zstd, extract the disk image file (&amp;lt;code&amp;gt;.img&amp;lt;/code&amp;gt;) from the zstd archive, and flash with tools like [https://sourceforge.net/projects/win32diskimager/ Win32 Disk Imager].}}&lt;br /&gt;
&lt;br /&gt;
Also see [[PinePhone Installation Instructions]].&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
=== Nemo Mobile ===&lt;br /&gt;
[[File:nemo_mobile.png|right|100px]]&lt;br /&gt;
&lt;br /&gt;
Nemo Mobile is the open source build of Sailfish OS with a open source UI called [http://nemomobile.net/glacier-home/ Glacier], [http://nemomobile.net/pages/Hello_manjaro/ based on Manjaro].&lt;br /&gt;
&lt;br /&gt;
==== Download ====&lt;br /&gt;
&lt;br /&gt;
[https://img.nemomobile.net/2022.05/Manjaro-ARM-nemomobile-pinephone-0.9.img.xz Image]&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!colspan=&amp;quot;2&amp;quot; style=&amp;quot;background: #a7d7f9;&amp;quot;| Default credentials&lt;br /&gt;
|-&lt;br /&gt;
! Default user&lt;br /&gt;
| &amp;lt;code&amp;gt;manjaro/123456&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
! root&lt;br /&gt;
| &amp;lt;code&amp;gt;root/root&amp;lt;/code&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== Notes ====&lt;br /&gt;
The website of the Nemo Mobile UX Team can be found [https://nemomobile.net/ here]. Please report bugs regarding the Nemo Mobile UI as [https://github.com/nemomobile-ux/main/issues GitHub issue].&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
=== NixOS ===&lt;br /&gt;
[[File:nixos.png|right|100px]]&lt;br /&gt;
&lt;br /&gt;
NixOS is a Linux distribution built on top of the Nix package manager using declarative configuration to allow reliable system upgrades.&lt;br /&gt;
&lt;br /&gt;
==== Download ====&lt;br /&gt;
There is a guided installer by the [https://mobile.nixos.org/devices/pine64-pinephone.html Mobile NixOS] project available. An installer image that can be flashed to a sdcard can be downloaded from the [https://hydra.nixos.org/job/mobile-nixos/unstable/installer.pine64-pinephone Hydra build instance].&lt;br /&gt;
&lt;br /&gt;
Users that want to build a local image, are expected to follow the instructions in the [https://mobile.nixos.org/getting-started.html Getting Started page],&lt;br /&gt;
and [https://mobile.nixos.org/devices/pine64-pinephone.html Project's device page].&lt;br /&gt;
&lt;br /&gt;
==== Notes ====&lt;br /&gt;
Project home page: [https://mobile.nixos.org/ Mobile NixOS]&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
=== OpenMandriva Lx ===&lt;br /&gt;
[[File:Oma-logo-22042013_300pp.png|right|100px]]&lt;br /&gt;
&lt;br /&gt;
OpenMandriva Lx with Plasma Mobile as UI.&lt;br /&gt;
&lt;br /&gt;
==== Download ====&lt;br /&gt;
&lt;br /&gt;
The official image can be found [https://sourceforge.net/projects/openmandriva/files/release/4.2/RC/Pinephone/ at sourceforge.net].&lt;br /&gt;
See [https://www.openmandriva.org/en/news/article/openmandriva-lx-4-3-rc-available-for-testing here] for the offical announcement.&lt;br /&gt;
&lt;br /&gt;
==== Notes ====&lt;br /&gt;
&lt;br /&gt;
{{Info| This image is solely for testing purposes.}}&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
=== openSUSE ===&lt;br /&gt;
[[File:SLEM-OS-logo.png|right|100px]]&lt;br /&gt;
&lt;br /&gt;
Our images use the same [https://en.opensuse.org/Portal:Tumbleweed openSUSE Tumbleweed] base as our desktop images,&lt;br /&gt;
except what needs to be changed for the PinePhone.&lt;br /&gt;
The images include &amp;lt;i&amp;gt;zypper&amp;lt;/i&amp;gt; (RPM) as the default package manager,&lt;br /&gt;
and have access to virtually the same (open source) software as our desktop repositories,&lt;br /&gt;
thanks to the [https://en.opensuse.org/Portal:Factory Factory] ports.&lt;br /&gt;
Using [https://en.opensuse.org/SDB:DNF dnf] is possible, if preferred.&lt;br /&gt;
&lt;br /&gt;
==== Download ====&lt;br /&gt;
&lt;br /&gt;
* [https://download.opensuse.org/repositories/devel:/ARM:/Factory:/Contrib:/PinePhone/images/openSUSE-Tumbleweed-ARM-PHOSH-pinephone.aarch64.raw.xz Phosh] / [https://download.opensuse.org/repositories/devel:/ARM:/Factory:/Contrib:/PinePhone/images/openSUSE-Tumbleweed-ARM-PHOSH-pinephone.aarch64.raw.xz.sha256 SHA-256] / [https://download.opensuse.org/repositories/devel:/ARM:/Factory:/Contrib:/PinePhone/images/openSUSE-Tumbleweed-ARM-PHOSH-pinephone.aarch64.raw.xz.sha256.asc SHA-256 Signature]&lt;br /&gt;
* [https://download.opensuse.org/repositories/devel:/ARM:/Factory:/Contrib:/PinePhone/images/openSUSE-Tumbleweed-ARM-PLAMO-pinephone.aarch64.raw.xz Plasma Mobile] / [https://download.opensuse.org/repositories/devel:/ARM:/Factory:/Contrib:/PinePhone/images/openSUSE-Tumbleweed-ARM-PLAMO-pinephone.aarch64.raw.xz.sha256 SHA-256] / [https://download.opensuse.org/repositories/devel:/ARM:/Factory:/Contrib:/PinePhone/images/openSUSE-Tumbleweed-ARM-PLAMO-pinephone.aarch64.raw.xz.sha256.asc SHA-256 Signature]&lt;br /&gt;
&lt;br /&gt;
To verify the images you need to import [https://build.opensuse.org/projects/devel:ARM:Factory:Contrib:PinePhone/public_key our GPG key].&lt;br /&gt;
Keep on mind that the first boot may stay on black screen for about a minute - consequent boots should be faster.&lt;br /&gt;
&lt;br /&gt;
You can find install instructions at [https://en.opensuse.org/HCL:PinePhone#Installing_openSUSE_in_a_Pinephone this section] in the openSUSE Wiki.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!colspan=&amp;quot;2&amp;quot; style=&amp;quot;background: #a7d7f9;&amp;quot;| Default credentials&lt;br /&gt;
|-&lt;br /&gt;
! Default user&lt;br /&gt;
| &amp;lt;code&amp;gt;pine/1234&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
! root&lt;br /&gt;
| &amp;lt;code&amp;gt;root/linux&amp;lt;/code&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== Notes ====&lt;br /&gt;
&lt;br /&gt;
You can find all information about the releases of the project [https://gitlab.com/slem.os/slem.os/-/blob/master/CHANGELOG.md here].&lt;br /&gt;
Detailed information, tips and troubleshooting suggestions are also provided at [https://en.opensuse.org/HCL:PinePhone the openSUSE Wiki].&lt;br /&gt;
You will also find information in our wiki on how to report issues (Contributing section).&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
=== postmarketOS ===&lt;br /&gt;
[[File:PostmarketOS-logo.png|right|100px]]&lt;br /&gt;
&lt;br /&gt;
postmarketOS extends [https://www.alpinelinux.org/ Alpine Linux] to run on smartphones and other mobile devices.&lt;br /&gt;
It offers various user interfaces (Phosh, Plasma Mobile, Sxmo, Plasma Desktop, Gnome 3, Kodi, XFCE4, ...).&lt;br /&gt;
&lt;br /&gt;
==== Download ====&lt;br /&gt;
[https://postmarketos.org/download/ Download page]&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!colspan=&amp;quot;2&amp;quot; style=&amp;quot;background: #a7d7f9;&amp;quot;| Default credentials&lt;br /&gt;
|-&lt;br /&gt;
! Test images user&lt;br /&gt;
| &amp;lt;code&amp;gt;user/147147&amp;lt;/code&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== Notes ====&lt;br /&gt;
As of writing, official images are provided with Phosh, Plasma Mobile and Sxmo.&lt;br /&gt;
The official images come in two flavors, either as a test image to try out postmarketOS, or with the installer.&lt;br /&gt;
&lt;br /&gt;
When using the installer images (recommended), it is possible to:&lt;br /&gt;
* encrypt the installation&lt;br /&gt;
* install from the SD card to eMMC&lt;br /&gt;
&lt;br /&gt;
Power users may also create their own image with the distribution's install and development tool &amp;lt;code&amp;gt;pmbootstrap&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
See the [https://wiki.postmarketos.org/wiki/PINE64_PinePhone_(pine64-pinephone) pine64-pinephone] page of the postmarketOS wiki for details.&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
=== Sailfish OS ===&lt;br /&gt;
[[File:Sailfish_logo.png|right|100px]]&lt;br /&gt;
&lt;br /&gt;
[https://sailfishos.org/ Sailfish OS] is a Linux-based operating system based on open source projects such as [https://wiki.merproject.org/wiki/Main_Page Mer], and a closed source UI based on [https://sailfishos.org/wiki/Lipstick Lipstick].&lt;br /&gt;
&lt;br /&gt;
* [https://wiki.merproject.org/wiki/Adaptations/PinePhone64 PinePhone Wiki Page] on Mer Wiki, for both Nemo Mobile and Sailfish OS.&lt;br /&gt;
* [https://gitlab.com/pinephone-sailfish-os/linux-kernel/ Linux kernel config repo]&lt;br /&gt;
* [https://gitlab.com/sailfishos-porters-ci/dont_be_evil-ci/ Sailfish OS repo]&lt;br /&gt;
&lt;br /&gt;
==== Download ====&lt;br /&gt;
&lt;br /&gt;
'''Flashing script'''&lt;br /&gt;
&lt;br /&gt;
The Sailfish OS image is built on Gitlab CI. The latest image can be installed using the [https://raw.githubusercontent.com/sailfish-on-dontbeevil/flash-it/master/flash-it.sh flashing script].&lt;br /&gt;
&lt;br /&gt;
The script downloads the image and bootloader from the CI, extracts everything and burns it onto the SD card.&lt;br /&gt;
Note: The script will format and erase the SD card!&lt;br /&gt;
&lt;br /&gt;
Instructions:&lt;br /&gt;
# Download the flashing script&lt;br /&gt;
# Insert a microSD card in your device&lt;br /&gt;
# Make the script executable: &amp;lt;code&amp;gt;chmod +x flash-it.sh&amp;lt;/code&amp;gt;&lt;br /&gt;
# Verify that you have the &amp;lt;code&amp;gt;bsdtar&amp;lt;/code&amp;gt; package installed&lt;br /&gt;
# Execute it: &amp;lt;code&amp;gt;./flash-it.sh&amp;lt;/code&amp;gt;&lt;br /&gt;
# Follow the instructions. Some commands in the script require root permissions (for example: mounting and flashing the SD card).&lt;br /&gt;
&lt;br /&gt;
* When asked where to flash, type 'raw' and it will build the image on your computer. Otherwise define the path /dev/....  to flash to card or internal emmc. &lt;br /&gt;
&lt;br /&gt;
'''username/password'''&lt;br /&gt;
&lt;br /&gt;
Set PIN on initialization.&lt;br /&gt;
&lt;br /&gt;
==== Notes ====&lt;br /&gt;
&lt;br /&gt;
* Sometimes the first run stalls before the tutorial. Reboot and it will start from setting the security pin.&lt;br /&gt;
* The homescreen may be locked unless you boot with a sim card inserted. An old expired sim will do. '''If you do not have a SIM card on hands, do NOT set a security code on first boot.'''&lt;br /&gt;
* When a screen with a loading circle is displayed, just left/right swipe it away.&lt;br /&gt;
* If you're not familiar with Sailfish OS, pay attention to the tutorial - the interface works great, but is not immediately obvious. If you are familiar with it, you can skip the tutorial by touching all 4 corners starting top left.&lt;br /&gt;
&lt;br /&gt;
'''What works, what does not work'''&lt;br /&gt;
&lt;br /&gt;
See the [https://wiki.merproject.org/wiki/Adaptations/PinePhone64#Hardware_Support Hardware Support section] on the Mer Wiki's PinePhone Page.&lt;br /&gt;
&lt;br /&gt;
There is a limited selection of apps available from the Jolla store, the vast majority are hosted on openrepos.net. If the Storeman app for openrepos is not preinstalled, download the RPM and click to install.&lt;br /&gt;
&lt;br /&gt;
'''How to contribute and report defects'''&lt;br /&gt;
&lt;br /&gt;
See the [https://wiki.merproject.org/wiki/Adaptations/PinePhone64#Installation Installation section] on the Mer Wiki's PinePhone Page for compile, build and development.&lt;br /&gt;
&lt;br /&gt;
Git repo links are at the top of this OS section. other repos that may be helpful:&lt;br /&gt;
&lt;br /&gt;
* [https://github.com/sailfish-on-dontbeevil GitHub project page]&lt;br /&gt;
* [https://github.com/sailfish-on-dontbeevil/flash-it the repo of the flash-it.sh flashing script]&lt;br /&gt;
* [https://build.merproject.org/project/show/nemo:devel:hw:pine:dontbeevil Mer Open Build Service page] ([https://forum.sailfishos.org/t/changes-needed-to-merge-the-project-names-to-sailfish-os/1672 Mer is being assimilated into Sailfish OS] and [https://forum.sailfishos.org/t/obs-shut-down-and-next-steps/1814 OBS is shutting down], also see [https://specs.openstack.org/openstack/fuel-specs/specs/7.0/replace-obs.html OpenStack is replacing OBS with another build system based on Jenkins], if it's related, even OBS come back under Sailfish OS, it will be different.)&lt;br /&gt;
&lt;br /&gt;
See the [https://sailfishos.org/wiki/Collaborative_Development#Reporting_issues Sailfish OS wiki] for links to their forum, as well as info required when reporting an issue. See the [https://sailfishos.org/wiki/SailfishOS Sailfish OS wiki main page] for options to contribute to Sailfish OS.&lt;br /&gt;
&lt;br /&gt;
'''Notes'''&lt;br /&gt;
&lt;br /&gt;
OTA is supported: &amp;lt;code&amp;gt;zypper refresh &amp;amp;&amp;amp; zypper update&amp;lt;/code&amp;gt; as root (&amp;lt;code&amp;gt;devel-su&amp;lt;/code&amp;gt; to get root access). Things that need reflash are bootloader specific at the moment. If improvements like [[Crust]] or changes of partition layout are added, then you need to reflash.&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
=== SkiffOS ===&lt;br /&gt;
[[File:SkiffOS-Icon-1.png|right|100px]]&lt;br /&gt;
&lt;br /&gt;
Minimal in-memory cross-compiled OS optimized for hosting multiple in parallel Docker containers. Provides the reliability of firmware with the ease-of-use of package managers.&lt;br /&gt;
&lt;br /&gt;
==== Download ====&lt;br /&gt;
&lt;br /&gt;
The repository and instructions can be found [https://github.com/skiffos/SkiffOS/tree/master/configs/pine64/phone here].&lt;br /&gt;
&lt;br /&gt;
==== Notes ====&lt;br /&gt;
&lt;br /&gt;
Upgrade over-the-air via a simple rsync script, or copying 3 files.&lt;br /&gt;
&lt;br /&gt;
Uses the [http://buildroot.org Buildroot] cross-compilation tool for support for all Pine64 boards.&lt;br /&gt;
&lt;br /&gt;
Use configuration packages to configure distro:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Package !! Distro&lt;br /&gt;
|-&lt;br /&gt;
| core/pinephone_neon    || KDE Neon via Ubuntu repositories&lt;br /&gt;
|-&lt;br /&gt;
| core/pinephone_nixos   || Nixos Mobile&lt;br /&gt;
|-&lt;br /&gt;
| core/pinephone_gentoo  || Gentoo with Link-time Optimization &amp;amp; KDE Mobile or Phosh&lt;br /&gt;
|-&lt;br /&gt;
| core/pinephone_ubports || Ubuntu Ports for PinePhone&lt;br /&gt;
|-&lt;br /&gt;
| core/pinephone_manjaro_kde   || Manjaro for PinePhone: KDE variant&lt;br /&gt;
|-&lt;br /&gt;
| core/pinephone_manjaro_phosh || Manjaro for PinePhone: Phosh variant&lt;br /&gt;
|-&lt;br /&gt;
| core/pinephone_manjaro_lomiri || Manjaro for PinePhone: Lomiri variant&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The boot-up OS is upgraded independently from the containers.&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
=== Slackware ===&lt;br /&gt;
&lt;br /&gt;
[https://arm.slackware.com/ Slackware] is the world's oldest actively developed Linux distribution, providing a modern user land (applications) and Linux Kernel, within a more classic Unix Operating System environment.&lt;br /&gt;
&lt;br /&gt;
==== Download ====&lt;br /&gt;
&lt;br /&gt;
* http://dl.fail.pp.ua/slackware/images/pinephone/&lt;br /&gt;
&lt;br /&gt;
==== Notes ====&lt;br /&gt;
&lt;br /&gt;
Discussion: [https://forum.pine64.org/showthread.php?tid=12181&amp;amp;highlight=slackware+pinephone Thread]&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
=== Ubuntu Touch ===&lt;br /&gt;
[[File:Ubports-logo.png|right|100px]]&lt;br /&gt;
&lt;br /&gt;
A Mobile Version of the Ubuntu Operating System made and maintained by the UBports Community.&lt;br /&gt;
&lt;br /&gt;
Ubuntu touch is a mobile version of Ubuntu developed by the UBports community.&lt;br /&gt;
Installation instructions can be found on&lt;br /&gt;
[https://gitlab.com/ubports/community-ports/pinephone#how-do-i-install-ubuntu-touch-on-my-pinephone the UBports PinePhone project].&lt;br /&gt;
There is also a [https://github.com/goddard/pinephone/ script] to download the latest image and flash to your PinePhone.&lt;br /&gt;
In the future, Ubuntu Touch will be able to be installed onto the PinePhone with the [https://devices.ubuntu-touch.io/installer UBports installer] GUI tool.&lt;br /&gt;
&lt;br /&gt;
==== Download ====&lt;br /&gt;
&lt;br /&gt;
[https://gitlab.com/ubports/community-ports/pinephone#how-do-i-install-ubuntu-touch-on-my-pinephone UBports PinePhone project]&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!colspan=&amp;quot;2&amp;quot; style=&amp;quot;background: #a7d7f9;&amp;quot;| Default credentials&lt;br /&gt;
|-&lt;br /&gt;
! Default user&lt;br /&gt;
| Set during boot&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== Notes ====&lt;br /&gt;
&lt;br /&gt;
Scroll down to the bottom of [https://gitlab.com/ubports/community-ports/pinephone this page], or directly here [https://devices.ubuntu-touch.io/device/pinephone/#deviceOverview] to see which features work.&lt;br /&gt;
&lt;br /&gt;
Contributions and bug reports can be made via. [https://gitlab.com/ubports/community-ports/pinephone UBports gitlab page]. See [https://ubports.com/foundation/sponsors UBports website] for how to donate.&lt;br /&gt;
&lt;br /&gt;
== Tools ==&lt;br /&gt;
&lt;br /&gt;
There are software tools, that can be booted on the PinePhone.&lt;br /&gt;
&lt;br /&gt;
=== JumpDrive ===&lt;br /&gt;
&lt;br /&gt;
JumpDrive can be used to flash the eMMC (and the microSD card), see [[PinePhone Installation Instructions#Using JumpDrive]].&lt;br /&gt;
&lt;br /&gt;
See https://github.com/dreemurrs-embedded/Jumpdrive/releases for the latest image.&lt;br /&gt;
Make sure to download the &amp;quot;PinePhone&amp;quot; image and to unpack the archive before flashing.&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
=== Tow-Boot ===&lt;br /&gt;
Tow-Boot is a more user-friendly distribution of U-Boot. Can also mount internal storage as USB Mass Storage by holding the volume up button at startup before and during the second vibration and the LED will turn blue if done successfully.&lt;br /&gt;
&lt;br /&gt;
See https://github.com/Tow-Boot/Tow-Boot/releases for the latest image.&lt;br /&gt;
Make sure to download the image with pinephoneA64 in the name.&lt;br /&gt;
&lt;br /&gt;
== Factory Test OS ==&lt;br /&gt;
&lt;br /&gt;
On the Braveheart model, there was a postmarketOS based basic Factory Test OS pre-installed on the eMMC.The developer Martijn Braam from postmarketOS has improved the functionality of the image considerably later. Since the 20200501 version, it is able to test all the hardware. It also includes functionality to install a new OS to the eMMC when using with an test image that includes that OS image. The downloadable image just does the hardware tests. Do not flash eMMC to test your device, just dd it to microSD and test from there. New versions are distributed as part of the postmarketOS distribution.&lt;br /&gt;
&lt;br /&gt;
{{Info| The magnetometer test will fail on the new Beta Edition, as the factory image wasn't updated for it yet.}}&lt;br /&gt;
&lt;br /&gt;
Links:&lt;br /&gt;
* [https://images.postmarketos.org/pinephone/ Software Images] (download the latest one named like pine-pinephone-yyyyMMdd-factorytestX.img.xz)&lt;br /&gt;
* [https://gitlab.com/MartijnBraam/factorytest Git repo]&lt;br /&gt;
* [https://gitlab.com/MartijnBraam/factorytest/-/blob/master/README.rst Documentation]&lt;br /&gt;
&lt;br /&gt;
=== Factory-loaded OS builds ===&lt;br /&gt;
&lt;br /&gt;
These are different operating system builds that was preloaded in the factory with testing utility.&lt;br /&gt;
&lt;br /&gt;
Download the build, extract the image and dd it to a 8 GB or larger microSD card, then insert it into the PinePhone.&lt;br /&gt;
After power up or reboot, you may perform and complete the test routine, or apply the build from microSD card to eMMC.&lt;br /&gt;
&lt;br /&gt;
All the download links below are direct download from pine64.org.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;overflow: auto;&amp;quot;&amp;gt;&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;white-space: nowrap&amp;quot;&lt;br /&gt;
! OS&lt;br /&gt;
! Download Link&lt;br /&gt;
! File Size&lt;br /&gt;
! MD5&lt;br /&gt;
|-&lt;br /&gt;
| Beta Edition&lt;br /&gt;
| [https://files.pine64.org/os/PinePhone/BetaEdition/pine64-pinephone-plamo-beta-factorytest.img.xz pine64-pinephone-plamo-beta-factorytest.img.xz]&lt;br /&gt;
| 1.78GB&lt;br /&gt;
| &amp;lt;code&amp;gt;f16bce93504a52217540ac886863a418&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| Mobian&lt;br /&gt;
| [https://files.pine64.org/os/PinePhone/Mobian/pine64-pinephone-20201207-factorytest-mobian.img.xz pine64-pinephone-20201207-factorytest-mobian.img.xz]&lt;br /&gt;
| 1.41GB&lt;br /&gt;
| &amp;lt;code&amp;gt;015be381ff4e650a7fca6d4eaa90d63d&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| KDE&lt;br /&gt;
| [https://files.pine64.org/os/PinePhone/KDE/pine64-pinephone-20201208-factorytest-kde.img.xz pine64-pinephone-20201208-factorytest-kde.img.xz]&lt;br /&gt;
| 2.28GB&lt;br /&gt;
| &amp;lt;code&amp;gt;32979ff17b5ec4d358ce99f1aff0c77c&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| Manjaro&lt;br /&gt;
| [https://files.pine64.org/os/PinePhone/Manjaro/pine64-pinephone-20201013-manjaro-stable-20201018-factory56.img.xz pine64-pinephone-20201013-manjaro-stable-20201018-factory56.img.xz]&lt;br /&gt;
| 1.04GB&lt;br /&gt;
| &amp;lt;code&amp;gt;4edfd4dceaefdd32a3417c1727161c29&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| postmarketOS&lt;br /&gt;
| [https://files.pine64.org/os/PinePhone/PostMarketOS/pine64-pinephone-20200726-phosh-v20.05-factory.img.xz pine64-pinephone-20200726-phosh-v20.05-factory.img.xz]&lt;br /&gt;
| 517MB&lt;br /&gt;
| &amp;lt;code&amp;gt;244093be2f6d728fcbd1d29114607727&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| Ubuntu Touch&lt;br /&gt;
| [https://files.pine64.org/os/PinePhone/UBPorts/PinePhone-flasher-ubuntu-7b.img.gz PinePhone-flasher-ubuntu-7b.img.gz]&lt;br /&gt;
| 1.05GB&lt;br /&gt;
| &amp;lt;code&amp;gt;2d7f5271e7a281db8f1b1219bedbe131&amp;lt;/code&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Installing other ARM64 distributions ==&lt;br /&gt;
&lt;br /&gt;
{{Warning|Distributions not on this page may not even boot after you follow this section. In the best case, they will be barely usable.&lt;br /&gt;
This is more for fun, or if you would like to port a new distribution to the PinePhone.}}&lt;br /&gt;
&lt;br /&gt;
{{Hint|'''Note:''' This section uses megi's kernel releases, and not the official ones from Pine64. While it is possible to use the official (and in the future, mainline) kernel, megi provides binary releases, which makes it very easy.}}&lt;br /&gt;
&lt;br /&gt;
General steps:&lt;br /&gt;
&lt;br /&gt;
# Create a boot partition (from 4 MB to about 252 MB) and a root partition (from the end of boot to the end of the card) filesystem on the SD card.&lt;br /&gt;
# Format the boot partition with vfat, and the root partition with a supported filesystem like ext4 or f2fs.&lt;br /&gt;
# Extract the root filesystem from your distribution's ARM image into the root filesystem on the SD card. Do not copy the partition, copy the files instead (in archive mode, like &amp;lt;code&amp;gt;rsync -ar&amp;lt;/code&amp;gt;).&lt;br /&gt;
# Edit &amp;lt;code&amp;gt;/etc/fstab&amp;lt;/code&amp;gt; to match your partitions.&lt;br /&gt;
# Grab megi's kernel from https://xff.cz/kernels/, Follow the instructions in the [https://xff.cz/kernels/README README], which involves copying the kernel modules into the SD card rootfs, and writing u-boot and the bootloader.&lt;br /&gt;
&lt;br /&gt;
If you would like to see examples or specific commands for how to complete these steps, see:&lt;br /&gt;
* [https://github.com/nikhiljha/pp-fedora-sdsetup     an example for Fedora], current unofficial [#Fedora] release&lt;br /&gt;
* [https://xnux.eu/howtos/install-arch-linux-arm.html an example for Arch Linux] by megi&lt;br /&gt;
&lt;br /&gt;
== Other Resources ==&lt;br /&gt;
&lt;br /&gt;
Community&lt;br /&gt;
* [[Main_Page#Community_and_Support|Links to the community services]]&lt;br /&gt;
&lt;br /&gt;
Hardware information&lt;br /&gt;
* [[PinePhone|General PinePhone hardware info]] in this Pine64 wiki&lt;br /&gt;
* Details specific to the Braveheart Edition: [[PinePhone_v1.1_-_Braveheart|PinePhone 1.1 Braveheart hardware details]]&lt;br /&gt;
* Details specific to the Community Edition: [[PinePhone_v1.2|PinePhone 1.2 hardware details]]&lt;br /&gt;
* The postmarketOS wiki has a detailed page on the PinePhone hardware [https://wiki.postmarketos.org/wiki/PINE64_PinePhone_(pine64-pinephone) here] and the preceding devkit [https://wiki.postmarketos.org/wiki/PINE64_Don%27t_be_evil_devkit_(pine64-dontbeevil) here]&lt;br /&gt;
&lt;br /&gt;
[https://nuttx.apache.org/docs/latest Apache NuttX RTOS] is a Real-Time Operating System that supports PinePhone&lt;br /&gt;
* [https://github.com/apache/nuttx/blob/master/Documentation/platforms/arm/a64/boards/pinephone/index.rst Apache NuttX RTOS on PINE64 PinePhone]&lt;br /&gt;
* [https://nuttx.apache.org/docs/latest/quickstart/install.html#prerequisites Installing the NuttX prerequisites]&lt;br /&gt;
* [https://nuttx.apache.org/docs/latest/quickstart/install.html#download-nuttx Cloning the NuttX repositories]&lt;br /&gt;
&lt;br /&gt;
Other software information&lt;br /&gt;
* [https://linux-sunxi.org/Main_Page sunxi community wiki]&lt;br /&gt;
* [https://xnux.eu/devices/pine64-pinephone.html megi's feature/driver support matrix]&lt;br /&gt;
* [https://megous.com/dl/tmp/README.bootui megi bootUI notes (for dualbooting/multibooting)] see demonstration [https://www.youtube.com/watch?v=ZL1GREqoqx8 on YouTube]&lt;br /&gt;
* [https://github.com/ayufan-pine64/boot-tools ayufan boot tools]&lt;br /&gt;
&lt;br /&gt;
Other&lt;br /&gt;
* [https://pine64.com/?post_type=product Pine64 shop]&lt;br /&gt;
* [https://www.pine64.org/2020/01/24/setting-the-record-straight-pinephone-misconceptions/ Pine64 blog on blobs]&lt;br /&gt;
* [https://tuxphones.com/yet-another-librem-5-and-pinephone-linux-smartphone-comparison/ Martijn Braam Librem 5 comparison, especially covering openness/blobs]&lt;br /&gt;
* [https://fam-ribbers.com/2019/12/28/State-of-Linux-on-mobile-and-common-misconceptions.html Bart Ribbers blog on Linux distributions and desktop environments on mobile devices]&lt;br /&gt;
* [https://www.jeffgeerling.com/blog/2019/a2-class-microsd-cards-offer-no-better-performance-raspberry-pi Jeff Geerling on testing microSD cards]&lt;br /&gt;
&lt;br /&gt;
[[Category:PinePhone]]&lt;/div&gt;</summary>
		<author><name>Lupyuen</name></author>
	</entry>
	<entry>
		<id>https://wiki.pine64.org/index.php?title=Ox64&amp;diff=14584</id>
		<title>Ox64</title>
		<link rel="alternate" type="text/html" href="https://wiki.pine64.org/index.php?title=Ox64&amp;diff=14584"/>
		<updated>2022-10-31T02:02:30Z</updated>

		<summary type="html">&lt;p&gt;Lupyuen: Update NuttX and OpenAMP&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[File:Ox64_board.jpg|400px|thumb|right|The Ox64]]&lt;br /&gt;
&lt;br /&gt;
The '''Ox64''' is a RISC-V based Single Board Computer powered by Bouffalo Lab BL808 C906 64-Bit RISC-V CPU, 32-Bit CPU, embedded 64MB PSRAM memory and build-on 3 radio RF (Wifi, BT, Zigbee). It provides breadboard friendly form factor, MicroSD Card slot, USB 2.0, and many other peripheral interfaces for makers to integrate with sensors and other devices.&lt;br /&gt;
&lt;br /&gt;
[[File:RISC-V.png|600px|]]&lt;br /&gt;
&lt;br /&gt;
== Software Releases ==&lt;br /&gt;
&lt;br /&gt;
=== Quick Links to the Source of OS Images Build ===&lt;br /&gt;
&lt;br /&gt;
OS images are still in '''alpha build''' which are only fit for board bring up and testing purposes. &lt;br /&gt;
&lt;br /&gt;
* [https://github.com/bouffalolab/bl808_linux Linux for BL808]&lt;br /&gt;
* [https://wiki.pine64.org/wiki/File:Linux_BL808.pdf Installation Instructions for Linux on BL808 (Chinese)]&lt;br /&gt;
* [https://wiki.pine64.org/wiki/File:Linux_BL808_en.pdf Installation Instructions for Linux on BL808 (English Auto-Translation)]&lt;br /&gt;
* Toolchain:&lt;br /&gt;
** elf_newlib_toolchain/bin/riscv64-unknown-elf-gcc (Xuantie-900 elf newlib gcc Toolchain V2.2.5 B-20220323) 10.2.0&lt;br /&gt;
** linux_toolchain/bin/riscv64-unknown-linux-gnu-gcc (Xuantie-900 linux-5.10.4 glibc gcc Toolchain V2.2.4 B-20211227) 10.2.0&lt;br /&gt;
** cmake version 3.19.3&lt;br /&gt;
&lt;br /&gt;
=== Software Development Kits ===&lt;br /&gt;
* [https://github.com/bouffalolab/bl_mcu_sdk BL808 MCU SDK]&lt;br /&gt;
* [https://app.box.com/s/aeqkvd6ddtixf4vb2lyuslpu0vu3498y BLDevCube Flashing Tool for Windows, macOS and Ubuntu x64]&lt;br /&gt;
* [https://wiki.pine64.org/wiki/File:Ox64_BL808UART_connect.pdf Ox64 UART Flashing Guide] [https://gist.github.com/lupyuen/7a0c697b89abccda8e38b33dfe5ebaff (Notes)]&lt;br /&gt;
* [https://github.com/lupyuen/lupyuen.github.io/releases/download/ox64/bl808_demo_event.bin BL808 Demo Firmware: bl808_demo_event.bin] [https://gist.github.com/lupyuen/7a0c697b89abccda8e38b33dfe5ebaff (Notes)]&lt;br /&gt;
* [https://github.com/lupyuen/lupyuen.github.io/releases/download/ox64/whole_flash_data.bin BL808 UART Log Firmware: whole_flash_data.bin] [https://gist.github.com/lupyuen/7a0c697b89abccda8e38b33dfe5ebaff (Notes)]&lt;br /&gt;
* [https://github.com/lupyuen/lupyuen.github.io/releases/download/ox64/BL808.DVK.Quick.Start.pdf BL808 DVK Quick Start]&lt;br /&gt;
* [https://github.com/bouffalolab/bl808_linux/tree/main/opensbi-0.6-808 OpenSBI for BL808]&lt;br /&gt;
* [https://github.com/bouffalolab/bl808-pac Rust Peripheral Access Crate (PAC) for BL808]&lt;br /&gt;
* [https://github.com/bouffalolab/bl808-pac/blob/main/bl808.svd System View Description (SVD) for BL808]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== SoC and Memory Specification ==&lt;br /&gt;
* Based on [https://en.bouffalolab.com/product/ Bouffalo Lab BL808]&lt;br /&gt;
[[File:Bouffalo_Lab_icon.png|right]]&lt;br /&gt;
[[File:BL808_Block_Diagram.jpg|600px]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== CPU Architecture ===&lt;br /&gt;
* [https://www.t-head.cn/product/c906?lang=en T_head C906 480MHz 64-bit RISC-V CPU]&lt;br /&gt;
[[File:T-Head.png|right|200px]]&lt;br /&gt;
** Supports RISC-V RV64IMAFCV instruction architecture&lt;br /&gt;
** Five-stage single-issue sequentially executed pipeline&lt;br /&gt;
** Level-1 instruction and data cache of Harvard architecture, with a size of 32 KB and a cache line of 64B&lt;br /&gt;
** Sv39 memory management unit, realizing the conversion of virtual and real addresses and memory management&lt;br /&gt;
** jTLB that supports 128 entries&lt;br /&gt;
** Supports AXI 4.0 128-bit master interface&lt;br /&gt;
** Supports core local interrupt (CLINT) and platform-level interrupt controller (PLIC)&lt;br /&gt;
** With 80 external interrupt sources, 3 bits for configuring interrupt priority&lt;br /&gt;
** Supports BHT (8K) and BTB&lt;br /&gt;
** Compatible with RISC-V PMP, 8 configurable areas&lt;br /&gt;
** Supports hardware performance monitor (HPM) units&lt;br /&gt;
&lt;br /&gt;
* [https://www.t-head.cn/product/e907?lang=en T_head E907 320MHz 32-bit RISC-V CPU]&lt;br /&gt;
** Supports RISC-V RV32IMAFCP instruction set&lt;br /&gt;
** Supports RISC-V 32-bit/16-bit mixed instruction set&lt;br /&gt;
** Supports RISC-V machine mode and user mode&lt;br /&gt;
** Thirty-two 32-bit integer general purpose registers (GPR) and thirty-two 32-bit/64-bit floating-point GPRs&lt;br /&gt;
** Integer (5-stage)/floating-point (7-stage), single-issue, sequentially executed pipeline&lt;br /&gt;
** Supports AXI 4.0 main device interface and AHB 5.0 peripheral interface&lt;br /&gt;
** 32K instruction cache, two-way set associative structure&lt;br /&gt;
** 16K data cache, two-way set associative structure&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== System Memory ===&lt;br /&gt;
* Embedded 64MB PSRAM&lt;br /&gt;
&lt;br /&gt;
== Board Features ==&lt;br /&gt;
&lt;br /&gt;
=== Network ===&lt;br /&gt;
* 2.4GHz 1T1R WiFi 802.11 b/g/n&lt;br /&gt;
* Bluetooth 5.2&lt;br /&gt;
* Zigbee&lt;br /&gt;
* 10/100Mbps Ethernet (optional, on expansion board)&lt;br /&gt;
&lt;br /&gt;
=== Storage ===&lt;br /&gt;
* on-board 16Mb (2MB) or 128Mb (16MB) XSPI NOR flash memory&lt;br /&gt;
* microSD - supports SDHC and SDXC&lt;br /&gt;
&lt;br /&gt;
=== Expansion Ports ===&lt;br /&gt;
* USB 2.0 OTG port&lt;br /&gt;
* 26 GPIO Pins, including SPI, I2C and UART functionality. Possible I2S and GMII expansion&lt;br /&gt;
* Dual lane MiPi CSI port, located at USB-C port, for camera module&lt;br /&gt;
&lt;br /&gt;
=== Audio ===&lt;br /&gt;
* mic (optional, on camera module)&lt;br /&gt;
* speaker (optional, on camera module)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Board Information, Schematics and Certifications ==&lt;br /&gt;
* Baseboard Dimensions: 51mm x 21mm x 19mm x 3.5mm (Breadboard friendly)&lt;br /&gt;
* Input Power: 5V 0.5A microSD or USB-C port&lt;br /&gt;
* Schematic:&lt;br /&gt;
** [https://files.pine64.org/doc/ox64/PINE64_Ox64-Schematic-202221007.pdf Ox64 Schematic 20221007 v1.0]&lt;br /&gt;
** [https://files.pine64.org/doc/ox64/PINE64_Ox64_PCB_Placement-Top-20221007.pdf Ox64 PCB Component placement(ToP) 20221007 v1.0]&lt;br /&gt;
** [https://files.pine64.org/doc/ox64/PINE64_Ox64_PCB_Placement-Bottom-20221007.pdf Ox64 PCB Component placement(Bottom) 20221007 v1.0]&lt;br /&gt;
* Certifications:&lt;br /&gt;
** Disclaimer: Please note that PINE64 SBC is not a &amp;quot;final&amp;quot; product and in general certification is not necessary. However, PINE64 still submits the SBC for FCC, CE, and ROHS certifications and obtain the certificates to prove that the SBC board can pass the testing. Please note, a final commercial product needs to perform its own testing and obtain its own certificate.&lt;br /&gt;
** Not yet available&lt;br /&gt;
&lt;br /&gt;
== Datasheets for Components and Peripherals ==&lt;br /&gt;
* Bouffalo BL808 SoC information:&lt;br /&gt;
** [https://files.pine64.org/doc/datasheet/ox64/BL808_DS_en_1.1(open).pdf Bouffalo Lab BL808 SoC Datasheet]&lt;br /&gt;
** [https://files.pine64.org/doc/datasheet/ox64/BL808_RM_en_1.0(open).pdf Bouffalo Lab BL808 SoC Reference Manual]&lt;br /&gt;
* SPI NOR Flash information:&lt;br /&gt;
** [https://files.pine64.org/doc/datasheet/ox64/gd25lq16e_rev1.2_20210108.pdf GigaDevice 16Mb XSPI-Flash Datasheet]&lt;br /&gt;
** [https://files.pine64.org/doc/datasheet/star64/gd25lq128e_rev1.0_20210513.pdf GigaDevice 128Mb XSPI-Flash Datasheet]&lt;br /&gt;
* Power Regulator information:&lt;br /&gt;
** [https://files.pine64.org/doc/datasheet/ox64/IA2014-03.pdf Innovation Analog Tech IA2014 Step_down Converter Datasheet]&lt;br /&gt;
&lt;br /&gt;
== Articles and Blogs ==&lt;br /&gt;
* [https://gist.github.com/lupyuen/7a0c697b89abccda8e38b33dfe5ebaff First Batch of Ox64 won't appear as USB Serial Port]&lt;br /&gt;
* [https://gist.github.com/lupyuen/2087e9b3fb40aab5e0795bb02a265a3b First Batch of Ox64 tested OK with CH340C/G]&lt;br /&gt;
* [https://www.robertlipe.com/bl808-not-symmetric/ First thoughts on the (a)symmetery of Bouffalo Labs BL808 as in Pine64’s Ox64]&lt;br /&gt;
&lt;br /&gt;
== Development Efforts ==&lt;br /&gt;
* [https://twitter.com/gamelaster/status/1583916501400068096 Ox64 boots Linux successfully]&lt;br /&gt;
* [https://twitter.com/btashton/status/1586381334439923713?t=w5xRRUR74HGK2O1Zg_aFyw&amp;amp;s=19 Brennan Ashton is porting Apache NuttX RTOS and OpenAMP (Asymmetric Multiprocessing) to BL808]&lt;br /&gt;
* [https://twitter.com/thanos_engine/status/1585153938092761093 Phone Concept for BL808]&lt;br /&gt;
&lt;br /&gt;
[[Category:Ox64]] [[Category:Bouffalo BL808]]&lt;/div&gt;</summary>
		<author><name>Lupyuen</name></author>
	</entry>
	<entry>
		<id>https://wiki.pine64.org/index.php?title=Ox64&amp;diff=14574</id>
		<title>Ox64</title>
		<link rel="alternate" type="text/html" href="https://wiki.pine64.org/index.php?title=Ox64&amp;diff=14574"/>
		<updated>2022-10-27T00:27:11Z</updated>

		<summary type="html">&lt;p&gt;Lupyuen: Add BL808 Phone Concept&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[File:Ox64_board.jpg|400px|thumb|right|The Ox64]]&lt;br /&gt;
&lt;br /&gt;
The '''Ox64''' is a RISC-V based Single Board Computer powered by Bouffalo Lab BL808 C906 64-Bit RISC-V CPU, 32-Bit CPU, embedded 64MB PSRAM memory and build-on 3 radio RF (Wifi, BT, Zigbee). It provides breadboard friendly form factor, MicroSD Card slot, USB 2.0, and many other peripheral interfaces for makers to integrate with sensors and other devices.&lt;br /&gt;
&lt;br /&gt;
[[File:RISC-V.png|600px|]]&lt;br /&gt;
&lt;br /&gt;
== Software Releases ==&lt;br /&gt;
&lt;br /&gt;
=== Quick Links to the Source of OS Images Build ===&lt;br /&gt;
&lt;br /&gt;
OS images are still in '''alpha build''' which are only fit for board bring up and testing purposes. &lt;br /&gt;
&lt;br /&gt;
* [https://github.com/bouffalolab/bl808_linux Linux for BL808]&lt;br /&gt;
* [https://wiki.pine64.org/wiki/File:Linux_BL808.pdf Installation Instructions for Linux on BL808 (Chinese)]&lt;br /&gt;
* [https://wiki.pine64.org/wiki/File:Linux_BL808_en.pdf Installation Instructions for Linux on BL808 (English Auto-Translation)]&lt;br /&gt;
* Toolchain:&lt;br /&gt;
** elf_newlib_toolchain/bin/riscv64-unknown-elf-gcc (Xuantie-900 elf newlib gcc Toolchain V2.2.5 B-20220323) 10.2.0&lt;br /&gt;
** linux_toolchain/bin/riscv64-unknown-linux-gnu-gcc (Xuantie-900 linux-5.10.4 glibc gcc Toolchain V2.2.4 B-20211227) 10.2.0&lt;br /&gt;
** cmake version 3.19.3&lt;br /&gt;
&lt;br /&gt;
=== Software Development Kits ===&lt;br /&gt;
* [https://github.com/bouffalolab/bl_mcu_sdk BL808 MCU SDK]&lt;br /&gt;
* [https://app.box.com/s/aeqkvd6ddtixf4vb2lyuslpu0vu3498y BLDevCube Flashing Tool for Windows, macOS and Ubuntu x64]&lt;br /&gt;
* [https://wiki.pine64.org/wiki/File:Ox64_BL808UART_connect.pdf Ox64 UART Flashing Guide] [https://gist.github.com/lupyuen/7a0c697b89abccda8e38b33dfe5ebaff (Notes)]&lt;br /&gt;
* [https://github.com/lupyuen/lupyuen.github.io/releases/download/ox64/bl808_demo_event.bin BL808 Demo Firmware: bl808_demo_event.bin] [https://gist.github.com/lupyuen/7a0c697b89abccda8e38b33dfe5ebaff (Notes)]&lt;br /&gt;
* [https://github.com/lupyuen/lupyuen.github.io/releases/download/ox64/whole_flash_data.bin BL808 UART Log Firmware: whole_flash_data.bin] [https://gist.github.com/lupyuen/7a0c697b89abccda8e38b33dfe5ebaff (Notes)]&lt;br /&gt;
* [https://github.com/lupyuen/lupyuen.github.io/releases/download/ox64/BL808.DVK.Quick.Start.pdf BL808 DVK Quick Start]&lt;br /&gt;
* [https://github.com/bouffalolab/bl808_linux/tree/main/opensbi-0.6-808 OpenSBI for BL808]&lt;br /&gt;
* [https://github.com/bouffalolab/bl808-pac Rust Peripheral Access Crate (PAC) for BL808]&lt;br /&gt;
* [https://github.com/bouffalolab/bl808-pac/blob/main/bl808.svd System View Description (SVD) for BL808]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== SoC and Memory Specification ==&lt;br /&gt;
* Based on [https://en.bouffalolab.com/product/ Bouffalo Lab BL808]&lt;br /&gt;
[[File:Bouffalo_Lab_icon.png|right]]&lt;br /&gt;
[[File:BL808_Block_Diagram.jpg|600px]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== CPU Architecture ===&lt;br /&gt;
* [https://www.t-head.cn/product/c906?lang=en T_head C906 480MHz 64-bit RISC-V CPU]&lt;br /&gt;
[[File:T-Head.png|right|200px]]&lt;br /&gt;
** Supports RISC-V RV64IMAFCV instruction architecture&lt;br /&gt;
** Five-stage single-issue sequentially executed pipeline&lt;br /&gt;
** Level-1 instruction and data cache of Harvard architecture, with a size of 32 KB and a cache line of 64B&lt;br /&gt;
** Sv39 memory management unit, realizing the conversion of virtual and real addresses and memory management&lt;br /&gt;
** jTLB that supports 128 entries&lt;br /&gt;
** Supports AXI 4.0 128-bit master interface&lt;br /&gt;
** Supports core local interrupt (CLINT) and platform-level interrupt controller (PLIC)&lt;br /&gt;
** With 80 external interrupt sources, 3 bits for configuring interrupt priority&lt;br /&gt;
** Supports BHT (8K) and BTB&lt;br /&gt;
** Compatible with RISC-V PMP, 8 configurable areas&lt;br /&gt;
** Supports hardware performance monitor (HPM) units&lt;br /&gt;
&lt;br /&gt;
* [https://www.t-head.cn/product/e907?lang=en T_head E907 320MHz 32-bit RISC-V CPU]&lt;br /&gt;
** Supports RISC-V RV32IMAFCP instruction set&lt;br /&gt;
** Supports RISC-V 32-bit/16-bit mixed instruction set&lt;br /&gt;
** Supports RISC-V machine mode and user mode&lt;br /&gt;
** Thirty-two 32-bit integer general purpose registers (GPR) and thirty-two 32-bit/64-bit floating-point GPRs&lt;br /&gt;
** Integer (5-stage)/floating-point (7-stage), single-issue, sequentially executed pipeline&lt;br /&gt;
** Supports AXI 4.0 main device interface and AHB 5.0 peripheral interface&lt;br /&gt;
** 32K instruction cache, two-way set associative structure&lt;br /&gt;
** 16K data cache, two-way set associative structure&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== System Memory ===&lt;br /&gt;
* Embedded 64MB PSRAM&lt;br /&gt;
&lt;br /&gt;
== Board Features ==&lt;br /&gt;
&lt;br /&gt;
=== Network ===&lt;br /&gt;
* 2.4GHz 1T1R WiFi 802.11 b/g/n&lt;br /&gt;
* Bluetooth 5.2&lt;br /&gt;
* Zigbee&lt;br /&gt;
* 10/100Mbps Ethernet (optional, on expansion board)&lt;br /&gt;
&lt;br /&gt;
=== Storage ===&lt;br /&gt;
* on-board 16Mb (2MB) or 128Mb (16MB) XSPI NOR flash memory&lt;br /&gt;
* microSD - supports SDHC and SDXC&lt;br /&gt;
&lt;br /&gt;
=== Expansion Ports ===&lt;br /&gt;
* USB 2.0 OTG port&lt;br /&gt;
* 26 GPIO Pins, including SPI, I2C and UART functionality. Possible I2S and GMII expansion&lt;br /&gt;
* Dual lane MiPi CSI port, located at USB-C port, for camera module&lt;br /&gt;
&lt;br /&gt;
=== Audio ===&lt;br /&gt;
* mic (optional, on camera module)&lt;br /&gt;
* speaker (optional, on camera module)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Board Information, Schematics and Certifications ==&lt;br /&gt;
* Baseboard Dimensions: 51mm x 21mm x 19mm x 3.5mm (Breadboard friendly)&lt;br /&gt;
* Input Power: 5V 0.5A microSD or USB-C port&lt;br /&gt;
* Schematic:&lt;br /&gt;
** [https://files.pine64.org/doc/ox64/PINE64_Ox64-Schematic-202221007.pdf Ox64 Schematic 20221007 v1.0]&lt;br /&gt;
** [https://files.pine64.org/doc/ox64/PINE64_Ox64_PCB_Placement-Top-20221007.pdf Ox64 PCB Component placement(ToP) 20221007 v1.0]&lt;br /&gt;
** [https://files.pine64.org/doc/ox64/PINE64_Ox64_PCB_Placement-Bottom-20221007.pdf Ox64 PCB Component placement(Bottom) 20221007 v1.0]&lt;br /&gt;
* Certifications:&lt;br /&gt;
** Disclaimer: Please note that PINE64 SBC is not a &amp;quot;final&amp;quot; product and in general certification is not necessary. However, PINE64 still submits the SBC for FCC, CE, and ROHS certifications and obtain the certificates to prove that the SBC board can pass the testing. Please note, a final commercial product needs to perform its own testing and obtain its own certificate.&lt;br /&gt;
** Not yet available&lt;br /&gt;
&lt;br /&gt;
== Datasheets for Components and Peripherals ==&lt;br /&gt;
* Bouffalo BL808 SoC information:&lt;br /&gt;
** [https://files.pine64.org/doc/datasheet/ox64/BL808_DS_en_1.1(open).pdf Bouffalo Lab BL808 SoC Datasheet]&lt;br /&gt;
** [https://files.pine64.org/doc/datasheet/ox64/BL808_RM_en_1.0(open).pdf Bouffalo Lab BL808 SoC Reference Manual]&lt;br /&gt;
* SPI NOR Flash information:&lt;br /&gt;
** [https://files.pine64.org/doc/datasheet/ox64/gd25lq16e_rev1.2_20210108.pdf GigaDevice 16Mb XSPI-Flash Datasheet]&lt;br /&gt;
** [https://files.pine64.org/doc/datasheet/star64/gd25lq128e_rev1.0_20210513.pdf GigaDevice 128Mb XSPI-Flash Datasheet]&lt;br /&gt;
* Power Regulator information:&lt;br /&gt;
** [https://files.pine64.org/doc/datasheet/ox64/IA2014-03.pdf Innovation Analog Tech IA2014 Step_down Converter Datasheet]&lt;br /&gt;
&lt;br /&gt;
== Articles and Blogs ==&lt;br /&gt;
* [https://gist.github.com/lupyuen/7a0c697b89abccda8e38b33dfe5ebaff First Batch of Ox64 won't appear as USB Serial Port]&lt;br /&gt;
* [https://gist.github.com/lupyuen/2087e9b3fb40aab5e0795bb02a265a3b First Batch of Ox64 tested OK with CH340C/G]&lt;br /&gt;
* [https://www.robertlipe.com/bl808-not-symmetric/ First thoughts on the (a)symmetery of Bouffalo Labs BL808 as in Pine64’s Ox64]&lt;br /&gt;
&lt;br /&gt;
== Development Efforts ==&lt;br /&gt;
* [https://twitter.com/gamelaster/status/1583916501400068096 Ox64 boots Linux successfully]&lt;br /&gt;
* [https://twitter.com/btashton/status/1579670569842536449?s=20&amp;amp;t=0aStWRwcXNQS7JWDd1UJcg Brennan Ashton is exploring Apache NuttX RTOS and OpenAMP (Asymmetric Multiprocessing) on BL808]&lt;br /&gt;
* [https://twitter.com/thanos_engine/status/1585153938092761093 Phone Concept for BL808]&lt;br /&gt;
&lt;br /&gt;
[[Category:Ox64]] [[Category:Bouffalo BL808]]&lt;/div&gt;</summary>
		<author><name>Lupyuen</name></author>
	</entry>
	<entry>
		<id>https://wiki.pine64.org/index.php?title=Ox64&amp;diff=14554</id>
		<title>Ox64</title>
		<link rel="alternate" type="text/html" href="https://wiki.pine64.org/index.php?title=Ox64&amp;diff=14554"/>
		<updated>2022-10-24T04:48:56Z</updated>

		<summary type="html">&lt;p&gt;Lupyuen: Ox64 boots Linux successfully&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[File:Ox64_board.jpg|400px|thumb|right|The Ox64]]&lt;br /&gt;
&lt;br /&gt;
The '''Ox64''' is a RISC-V based Single Board Computer powered by Bouffalo Lab BL808 C906 64-Bit RISC-V CPU, 32-Bit CPU, embedded 64MB PSRAM memory and build-on 3 radio RF (Wifi, BT, Zigbee). It provides breadboard friendly form factor, MicroSD Card slot, USB 2.0, and many other peripheral interfaces for makers to integrate with sensors and other devices.&lt;br /&gt;
&lt;br /&gt;
[[File:RISC-V.png|600px|]]&lt;br /&gt;
&lt;br /&gt;
== Software Releases ==&lt;br /&gt;
&lt;br /&gt;
=== Quick Links to the Source of OS Images Build ===&lt;br /&gt;
&lt;br /&gt;
OS images are still in '''alpha build''' which are only fit for board bring up and testing purposes. &lt;br /&gt;
&lt;br /&gt;
* [https://github.com/bouffalolab/bl808_linux Linux for BL808]&lt;br /&gt;
* [https://wiki.pine64.org/wiki/File:Linux_BL808.pdf Installation Instructions for Linux on BL808 (Chinese)]&lt;br /&gt;
* [https://wiki.pine64.org/wiki/File:Linux_BL808_en.pdf Installation Instructions for Linux on BL808 (English Auto-Translation)]&lt;br /&gt;
* Toolchain:&lt;br /&gt;
** elf_newlib_toolchain/bin/riscv64-unknown-elf-gcc (Xuantie-900 elf newlib gcc Toolchain V2.2.5 B-20220323) 10.2.0&lt;br /&gt;
** linux_toolchain/bin/riscv64-unknown-linux-gnu-gcc (Xuantie-900 linux-5.10.4 glibc gcc Toolchain V2.2.4 B-20211227) 10.2.0&lt;br /&gt;
** cmake version 3.19.3&lt;br /&gt;
&lt;br /&gt;
=== Software Development Kits ===&lt;br /&gt;
* [https://github.com/bouffalolab/bl_mcu_sdk BL808 MCU SDK]&lt;br /&gt;
* [https://app.box.com/s/aeqkvd6ddtixf4vb2lyuslpu0vu3498y BLDevCube Flashing Tool for Windows, macOS and Ubuntu x64]&lt;br /&gt;
* [https://wiki.pine64.org/wiki/File:Ox64_BL808UART_connect.pdf Ox64 UART Flashing Guide] [https://gist.github.com/lupyuen/7a0c697b89abccda8e38b33dfe5ebaff (Notes)]&lt;br /&gt;
* [https://github.com/lupyuen/lupyuen.github.io/releases/download/ox64/bl808_demo_event.bin BL808 Demo Firmware: bl808_demo_event.bin] [https://gist.github.com/lupyuen/7a0c697b89abccda8e38b33dfe5ebaff (Notes)]&lt;br /&gt;
* [https://github.com/lupyuen/lupyuen.github.io/releases/download/ox64/whole_flash_data.bin BL808 UART Log Firmware: whole_flash_data.bin] [https://gist.github.com/lupyuen/7a0c697b89abccda8e38b33dfe5ebaff (Notes)]&lt;br /&gt;
* [https://github.com/lupyuen/lupyuen.github.io/releases/download/ox64/BL808.DVK.Quick.Start.pdf BL808 DVK Quick Start]&lt;br /&gt;
* [https://github.com/bouffalolab/bl808_linux/tree/main/opensbi-0.6-808 OpenSBI for BL808]&lt;br /&gt;
* [https://github.com/bouffalolab/bl808-pac Rust Peripheral Access Crate (PAC) for BL808]&lt;br /&gt;
* [https://github.com/bouffalolab/bl808-pac/blob/main/bl808.svd System View Description (SVD) for BL808]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== SoC and Memory Specification ==&lt;br /&gt;
* Based on [https://en.bouffalolab.com/product/ Bouffalo Lab BL808]&lt;br /&gt;
[[File:Bouffalo_Lab_icon.png|right]]&lt;br /&gt;
[[File:BL808_Block_Diagram.jpg|600px]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== CPU Architecture ===&lt;br /&gt;
* [https://www.t-head.cn/product/c906?lang=en T_head C906 480MHz 64-bit RISC-V CPU]&lt;br /&gt;
[[File:T-Head.png|right|200px]]&lt;br /&gt;
** Supports RISC-V RV64IMAFCV instruction architecture&lt;br /&gt;
** Five-stage single-issue sequentially executed pipeline&lt;br /&gt;
** Level-1 instruction and data cache of Harvard architecture, with a size of 32 KB and a cache line of 64B&lt;br /&gt;
** Sv39 memory management unit, realizing the conversion of virtual and real addresses and memory management&lt;br /&gt;
** jTLB that supports 128 entries&lt;br /&gt;
** Supports AXI 4.0 128-bit master interface&lt;br /&gt;
** Supports core local interrupt (CLINT) and platform-level interrupt controller (PLIC)&lt;br /&gt;
** With 80 external interrupt sources, 3 bits for configuring interrupt priority&lt;br /&gt;
** Supports BHT (8K) and BTB&lt;br /&gt;
** Compatible with RISC-V PMP, 8 configurable areas&lt;br /&gt;
** Supports hardware performance monitor (HPM) units&lt;br /&gt;
&lt;br /&gt;
* [https://www.t-head.cn/product/e907?lang=en T_head E907 320MHz 32-bit RISC-V CPU]&lt;br /&gt;
** Supports RISC-V RV32IMAFCP instruction set&lt;br /&gt;
** Supports RISC-V 32-bit/16-bit mixed instruction set&lt;br /&gt;
** Supports RISC-V machine mode and user mode&lt;br /&gt;
** Thirty-two 32-bit integer general purpose registers (GPR) and thirty-two 32-bit/64-bit floating-point GPRs&lt;br /&gt;
** Integer (5-stage)/floating-point (7-stage), single-issue, sequentially executed pipeline&lt;br /&gt;
** Supports AXI 4.0 main device interface and AHB 5.0 peripheral interface&lt;br /&gt;
** 32K instruction cache, two-way set associative structure&lt;br /&gt;
** 16K data cache, two-way set associative structure&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== System Memory ===&lt;br /&gt;
* Embedded 64MB PSRAM&lt;br /&gt;
&lt;br /&gt;
== Board Features ==&lt;br /&gt;
&lt;br /&gt;
=== Network ===&lt;br /&gt;
* 2.4GHz 1T1R WiFi 802.11 b/g/n&lt;br /&gt;
* Bluetooth 5.2&lt;br /&gt;
* Zigbee&lt;br /&gt;
* 10/100Mbps Ethernet (optional, on expansion board)&lt;br /&gt;
&lt;br /&gt;
=== Storage ===&lt;br /&gt;
* on-board 16Mb (2MB) or 128Mb (16MB) XSPI NOR flash memory&lt;br /&gt;
* microSD - supports SDHC and SDXC&lt;br /&gt;
&lt;br /&gt;
=== Expansion Ports ===&lt;br /&gt;
* USB 2.0 OTG port&lt;br /&gt;
* 26 GPIO Pins, including SPI, I2C and UART functionality. Possible I2S and GMII expansion&lt;br /&gt;
* Dual lane MiPi CSI port, located at USB-C port, for camera module&lt;br /&gt;
&lt;br /&gt;
=== Audio ===&lt;br /&gt;
* mic (optional, on camera module)&lt;br /&gt;
* speaker (optional, on camera module)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Board Information, Schematics and Certifications ==&lt;br /&gt;
* Baseboard Dimensions: 51mm x 21mm x 19mm x 3.5mm (Breadboard friendly)&lt;br /&gt;
* Input Power: 5V 0.5A microSD or USB-C port&lt;br /&gt;
* Schematic:&lt;br /&gt;
** [https://files.pine64.org/doc/ox64/PINE64_Ox64-Schematic-202221007.pdf Ox64 Schematic 20221007 v1.0]&lt;br /&gt;
** [https://files.pine64.org/doc/ox64/PINE64_Ox64_PCB_Placement-Top-20221007.pdf Ox64 PCB Component placement(ToP) 20221007 v1.0]&lt;br /&gt;
** [https://files.pine64.org/doc/ox64/PINE64_Ox64_PCB_Placement-Bottom-20221007.pdf Ox64 PCB Component placement(Bottom) 20221007 v1.0]&lt;br /&gt;
* Certifications:&lt;br /&gt;
** Disclaimer: Please note that PINE64 SBC is not a &amp;quot;final&amp;quot; product and in general certification is not necessary. However, PINE64 still submits the SBC for FCC, CE, and ROHS certifications and obtain the certificates to prove that the SBC board can pass the testing. Please note, a final commercial product needs to perform its own testing and obtain its own certificate.&lt;br /&gt;
** Not yet available&lt;br /&gt;
&lt;br /&gt;
== Datasheets for Components and Peripherals ==&lt;br /&gt;
* Bouffalo BL808 SoC information:&lt;br /&gt;
** [https://files.pine64.org/doc/datasheet/ox64/BL808_DS_en_1.1(open).pdf Bouffalo Lab BL808 SoC Datasheet]&lt;br /&gt;
** [https://files.pine64.org/doc/datasheet/ox64/BL808_RM_en_1.0(open).pdf Bouffalo Lab BL808 SoC Reference Manual]&lt;br /&gt;
* SPI NOR Flash information:&lt;br /&gt;
** [https://files.pine64.org/doc/datasheet/ox64/gd25lq16e_rev1.2_20210108.pdf GigaDevice 16Mb XSPI-Flash Datasheet]&lt;br /&gt;
** [https://files.pine64.org/doc/datasheet/star64/gd25lq128e_rev1.0_20210513.pdf GigaDevice 128Mb XSPI-Flash Datasheet]&lt;br /&gt;
* Power Regulator information:&lt;br /&gt;
** [https://files.pine64.org/doc/datasheet/ox64/IA2014-03.pdf Innovation Analog Tech IA2014 Step_down Converter Datasheet]&lt;br /&gt;
&lt;br /&gt;
== Articles and Blogs ==&lt;br /&gt;
* [https://gist.github.com/lupyuen/7a0c697b89abccda8e38b33dfe5ebaff First Batch of Ox64 won't appear as USB Serial Port]&lt;br /&gt;
* [https://gist.github.com/lupyuen/2087e9b3fb40aab5e0795bb02a265a3b First Batch of Ox64 tested OK with CH340C/G]&lt;br /&gt;
* [https://www.robertlipe.com/bl808-not-symmetric/ First thoughts on the (a)symmetery of Bouffalo Labs BL808 as in Pine64’s Ox64]&lt;br /&gt;
&lt;br /&gt;
== Development Efforts ==&lt;br /&gt;
* [https://twitter.com/gamelaster/status/1583916501400068096 Ox64 boots Linux successfully]&lt;br /&gt;
* [https://twitter.com/btashton/status/1579670569842536449?s=20&amp;amp;t=0aStWRwcXNQS7JWDd1UJcg Brennan Ashton is exploring Apache NuttX RTOS and OpenAMP (Asymmetric Multiprocessing) on BL808]&lt;br /&gt;
&lt;br /&gt;
[[Category:Ox64]] [[Category:Bouffalo BL808]]&lt;/div&gt;</summary>
		<author><name>Lupyuen</name></author>
	</entry>
	<entry>
		<id>https://wiki.pine64.org/index.php?title=Ox64&amp;diff=14542</id>
		<title>Ox64</title>
		<link rel="alternate" type="text/html" href="https://wiki.pine64.org/index.php?title=Ox64&amp;diff=14542"/>
		<updated>2022-10-21T10:03:57Z</updated>

		<summary type="html">&lt;p&gt;Lupyuen: Ox64 boots firmware successfully&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[File:Ox64_board.jpg|400px|thumb|right|The Ox64]]&lt;br /&gt;
&lt;br /&gt;
The '''Ox64''' is a RISC-V based Single Board Computer powered by Bouffalo Lab BL808 C906 64-Bit RISC-V CPU, 32-Bit CPU, embedded 64MB PSRAM memory and build-on 3 radio RF (Wifi, BT, Zigbee). It provides breadboard friendly form factor, MicroSD Card slot, USB 2.0, and many other peripheral interfaces for makers to integrate with sensors and other devices.&lt;br /&gt;
&lt;br /&gt;
[[File:RISC-V.png|600px|]]&lt;br /&gt;
&lt;br /&gt;
== Software Releases ==&lt;br /&gt;
&lt;br /&gt;
=== Quick Links to the Source of OS Images Build ===&lt;br /&gt;
&lt;br /&gt;
OS images are still in '''alpha build''' which are only fit for board bring up and testing purposes. &lt;br /&gt;
&lt;br /&gt;
* [https://github.com/bouffalolab/bl808_linux Linux for BL808]&lt;br /&gt;
* [https://wiki.pine64.org/wiki/File:Linux_BL808.pdf Installation Instructions for Linux on BL808 (Chinese)]&lt;br /&gt;
* [https://wiki.pine64.org/wiki/File:Linux_BL808_en.pdf Installation Instructions for Linux on BL808 (English Auto-Translation)]&lt;br /&gt;
* Toolchain:&lt;br /&gt;
** elf_newlib_toolchain/bin/riscv64-unknown-elf-gcc (Xuantie-900 elf newlib gcc Toolchain V2.2.5 B-20220323) 10.2.0&lt;br /&gt;
** linux_toolchain/bin/riscv64-unknown-linux-gnu-gcc (Xuantie-900 linux-5.10.4 glibc gcc Toolchain V2.2.4 B-20211227) 10.2.0&lt;br /&gt;
** cmake version 3.19.3&lt;br /&gt;
&lt;br /&gt;
=== Software Development Kits ===&lt;br /&gt;
* [https://github.com/bouffalolab/bl_mcu_sdk BL808 MCU SDK]&lt;br /&gt;
* [https://app.box.com/s/aeqkvd6ddtixf4vb2lyuslpu0vu3498y BLDevCube Flashing Tool for Windows, macOS and Ubuntu x64]&lt;br /&gt;
* [https://wiki.pine64.org/wiki/File:Ox64_BL808UART_connect.pdf Ox64 UART Flashing Guide] [https://gist.github.com/lupyuen/7a0c697b89abccda8e38b33dfe5ebaff (Notes)]&lt;br /&gt;
* [https://github.com/lupyuen/lupyuen.github.io/releases/download/ox64/bl808_demo_event.bin BL808 Demo Firmware: bl808_demo_event.bin] [https://gist.github.com/lupyuen/7a0c697b89abccda8e38b33dfe5ebaff (Notes)]&lt;br /&gt;
* [https://github.com/lupyuen/lupyuen.github.io/releases/download/ox64/whole_flash_data.bin BL808 UART Log Firmware: whole_flash_data.bin] [https://gist.github.com/lupyuen/7a0c697b89abccda8e38b33dfe5ebaff (Notes)]&lt;br /&gt;
* [https://github.com/lupyuen/lupyuen.github.io/releases/download/ox64/BL808.DVK.Quick.Start.pdf BL808 DVK Quick Start]&lt;br /&gt;
* [https://github.com/bouffalolab/bl808_linux/tree/main/opensbi-0.6-808 OpenSBI for BL808]&lt;br /&gt;
* [https://github.com/bouffalolab/bl808-pac Rust Peripheral Access Crate (PAC) for BL808]&lt;br /&gt;
* [https://github.com/bouffalolab/bl808-pac/blob/main/bl808.svd System View Description (SVD) for BL808]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== SoC and Memory Specification ==&lt;br /&gt;
* Based on [https://en.bouffalolab.com/product/ Bouffalo Lab BL808]&lt;br /&gt;
[[File:Bouffalo_Lab_icon.png|right]]&lt;br /&gt;
[[File:BL808_Block_Diagram.jpg|600px]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== CPU Architecture ===&lt;br /&gt;
* [https://www.t-head.cn/product/c906?lang=en T_head C906 480MHz 64-bit RISC-V CPU]&lt;br /&gt;
[[File:T-Head.png|right|200px]]&lt;br /&gt;
** Supports RISC-V RV64IMAFCV instruction architecture&lt;br /&gt;
** Five-stage single-issue sequentially executed pipeline&lt;br /&gt;
** Level-1 instruction and data cache of Harvard architecture, with a size of 32 KB and a cache line of 64B&lt;br /&gt;
** Sv39 memory management unit, realizing the conversion of virtual and real addresses and memory management&lt;br /&gt;
** jTLB that supports 128 entries&lt;br /&gt;
** Supports AXI 4.0 128-bit master interface&lt;br /&gt;
** Supports core local interrupt (CLINT) and platform-level interrupt controller (PLIC)&lt;br /&gt;
** With 80 external interrupt sources, 3 bits for configuring interrupt priority&lt;br /&gt;
** Supports BHT (8K) and BTB&lt;br /&gt;
** Compatible with RISC-V PMP, 8 configurable areas&lt;br /&gt;
** Supports hardware performance monitor (HPM) units&lt;br /&gt;
&lt;br /&gt;
* [https://www.t-head.cn/product/e907?lang=en T_head E907 320MHz 32-bit RISC-V CPU]&lt;br /&gt;
** Supports RISC-V RV32IMAFCP instruction set&lt;br /&gt;
** Supports RISC-V 32-bit/16-bit mixed instruction set&lt;br /&gt;
** Supports RISC-V machine mode and user mode&lt;br /&gt;
** Thirty-two 32-bit integer general purpose registers (GPR) and thirty-two 32-bit/64-bit floating-point GPRs&lt;br /&gt;
** Integer (5-stage)/floating-point (7-stage), single-issue, sequentially executed pipeline&lt;br /&gt;
** Supports AXI 4.0 main device interface and AHB 5.0 peripheral interface&lt;br /&gt;
** 32K instruction cache, two-way set associative structure&lt;br /&gt;
** 16K data cache, two-way set associative structure&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== System Memory ===&lt;br /&gt;
* Embedded 64MB PSRAM&lt;br /&gt;
&lt;br /&gt;
== Board Features ==&lt;br /&gt;
&lt;br /&gt;
=== Network ===&lt;br /&gt;
* 2.4GHz 1T1R WiFi 802.11 b/g/n&lt;br /&gt;
* Bluetooth 5.2&lt;br /&gt;
* Zigbee&lt;br /&gt;
* 10/100Mbps Ethernet (optional, on expansion board)&lt;br /&gt;
&lt;br /&gt;
=== Storage ===&lt;br /&gt;
* on-board 16Mb (2MB) or 128Mb (16MB) XSPI NOR flash memory&lt;br /&gt;
* microSD - supports SDHC and SDXC&lt;br /&gt;
&lt;br /&gt;
=== Expansion Ports ===&lt;br /&gt;
* USB 2.0 OTG port&lt;br /&gt;
* 26 GPIO Pins, including SPI, I2C and UART functionality. Possible I2S and GMII expansion&lt;br /&gt;
* Dual lane MiPi CSI port, located at USB-C port, for camera module&lt;br /&gt;
&lt;br /&gt;
=== Audio ===&lt;br /&gt;
* mic (optional, on camera module)&lt;br /&gt;
* speaker (optional, on camera module)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Board Information, Schematics and Certifications ==&lt;br /&gt;
* Baseboard Dimensions: 51mm x 21mm x 19mm x 3.5mm (Breadboard friendly)&lt;br /&gt;
* Input Power: 5V 0.5A microSD or USB-C port&lt;br /&gt;
* Schematic:&lt;br /&gt;
** [https://files.pine64.org/doc/ox64/PINE64_Ox64-Schematic-202221007.pdf Ox64 Schematic 20221007 v1.0]&lt;br /&gt;
** [https://files.pine64.org/doc/ox64/PINE64_Ox64_PCB_Placement-Top-20221007.pdf Ox64 PCB Component placement(ToP) 20221007 v1.0]&lt;br /&gt;
** [https://files.pine64.org/doc/ox64/PINE64_Ox64_PCB_Placement-Bottom-20221007.pdf Ox64 PCB Component placement(Bottom) 20221007 v1.0]&lt;br /&gt;
* Certifications:&lt;br /&gt;
** Disclaimer: Please note that PINE64 SBC is not a &amp;quot;final&amp;quot; product and in general certification is not necessary. However, PINE64 still submits the SBC for FCC, CE, and ROHS certifications and obtain the certificates to prove that the SBC board can pass the testing. Please note, a final commercial product needs to perform its own testing and obtain its own certificate.&lt;br /&gt;
** Not yet available&lt;br /&gt;
&lt;br /&gt;
== Datasheets for Components and Peripherals ==&lt;br /&gt;
* Bouffalo BL808 SoC information:&lt;br /&gt;
** [https://files.pine64.org/doc/datasheet/ox64/BL808_DS_en_1.1(open).pdf Bouffalo Lab BL808 SoC Datasheet]&lt;br /&gt;
** [https://files.pine64.org/doc/datasheet/ox64/BL808_RM_en_1.0(open).pdf Bouffalo Lab BL808 SoC Reference Manual]&lt;br /&gt;
* SPI NOR Flash information:&lt;br /&gt;
** [https://files.pine64.org/doc/datasheet/ox64/gd25lq16e_rev1.2_20210108.pdf GigaDevice 16Mb XSPI-Flash Datasheet]&lt;br /&gt;
** [https://files.pine64.org/doc/datasheet/star64/gd25lq128e_rev1.0_20210513.pdf GigaDevice 128Mb XSPI-Flash Datasheet]&lt;br /&gt;
* Power Regulator information:&lt;br /&gt;
** [https://files.pine64.org/doc/datasheet/ox64/IA2014-03.pdf Innovation Analog Tech IA2014 Step_down Converter Datasheet]&lt;br /&gt;
&lt;br /&gt;
== Articles and Blogs ==&lt;br /&gt;
* [https://gist.github.com/lupyuen/7a0c697b89abccda8e38b33dfe5ebaff First Batch of Ox64 won't appear as USB Serial Port]&lt;br /&gt;
* [https://gist.github.com/lupyuen/2087e9b3fb40aab5e0795bb02a265a3b First Batch of Ox64 tested OK with CH340C/G]&lt;br /&gt;
* [https://www.robertlipe.com/bl808-not-symmetric/ First thoughts on the (a)symmetery of Bouffalo Labs BL808 as in Pine64’s Ox64]&lt;br /&gt;
&lt;br /&gt;
== Development Efforts ==&lt;br /&gt;
* [https://twitter.com/gamelaster/status/1583356655223263232 Ox64 boots firmware successfully]&lt;br /&gt;
* [https://twitter.com/btashton/status/1579670569842536449?s=20&amp;amp;t=0aStWRwcXNQS7JWDd1UJcg Brennan Ashton is exploring Apache NuttX RTOS and OpenAMP (Asymmetric Multiprocessing) on BL808]&lt;br /&gt;
&lt;br /&gt;
[[Category:Ox64]] [[Category:Bouffalo BL808]]&lt;/div&gt;</summary>
		<author><name>Lupyuen</name></author>
	</entry>
	<entry>
		<id>https://wiki.pine64.org/index.php?title=Ox64&amp;diff=14541</id>
		<title>Ox64</title>
		<link rel="alternate" type="text/html" href="https://wiki.pine64.org/index.php?title=Ox64&amp;diff=14541"/>
		<updated>2022-10-21T08:40:45Z</updated>

		<summary type="html">&lt;p&gt;Lupyuen: Ox64 UART Flashing Guide&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[File:Ox64_board.jpg|400px|thumb|right|The Ox64]]&lt;br /&gt;
&lt;br /&gt;
The '''Ox64''' is a RISC-V based Single Board Computer powered by Bouffalo Lab BL808 C906 64-Bit RISC-V CPU, 32-Bit CPU, embedded 64MB PSRAM memory and build-on 3 radio RF (Wifi, BT, Zigbee). It provides breadboard friendly form factor, MicroSD Card slot, USB 2.0, and many other peripheral interfaces for makers to integrate with sensors and other devices.&lt;br /&gt;
&lt;br /&gt;
[[File:RISC-V.png|600px|]]&lt;br /&gt;
&lt;br /&gt;
== Software Releases ==&lt;br /&gt;
&lt;br /&gt;
=== Quick Links to the Source of OS Images Build ===&lt;br /&gt;
&lt;br /&gt;
OS images are still in '''alpha build''' which are only fit for board bring up and testing purposes. &lt;br /&gt;
&lt;br /&gt;
* [https://github.com/bouffalolab/bl808_linux Linux for BL808]&lt;br /&gt;
* [https://wiki.pine64.org/wiki/File:Linux_BL808.pdf Installation Instructions for Linux on BL808 (Chinese)]&lt;br /&gt;
* [https://wiki.pine64.org/wiki/File:Linux_BL808_en.pdf Installation Instructions for Linux on BL808 (English Auto-Translation)]&lt;br /&gt;
* Toolchain:&lt;br /&gt;
** elf_newlib_toolchain/bin/riscv64-unknown-elf-gcc (Xuantie-900 elf newlib gcc Toolchain V2.2.5 B-20220323) 10.2.0&lt;br /&gt;
** linux_toolchain/bin/riscv64-unknown-linux-gnu-gcc (Xuantie-900 linux-5.10.4 glibc gcc Toolchain V2.2.4 B-20211227) 10.2.0&lt;br /&gt;
** cmake version 3.19.3&lt;br /&gt;
&lt;br /&gt;
=== Software Development Kits ===&lt;br /&gt;
* [https://github.com/bouffalolab/bl_mcu_sdk BL808 MCU SDK]&lt;br /&gt;
* [https://app.box.com/s/aeqkvd6ddtixf4vb2lyuslpu0vu3498y BLDevCube Flashing Tool for Windows, macOS and Ubuntu x64]&lt;br /&gt;
* [https://wiki.pine64.org/wiki/File:Ox64_BL808UART_connect.pdf Ox64 UART Flashing Guide] [https://gist.github.com/lupyuen/7a0c697b89abccda8e38b33dfe5ebaff (Notes)]&lt;br /&gt;
* [https://github.com/lupyuen/lupyuen.github.io/releases/download/ox64/bl808_demo_event.bin BL808 Demo Firmware: bl808_demo_event.bin] [https://gist.github.com/lupyuen/7a0c697b89abccda8e38b33dfe5ebaff (Notes)]&lt;br /&gt;
* [https://github.com/lupyuen/lupyuen.github.io/releases/download/ox64/whole_flash_data.bin BL808 UART Log Firmware: whole_flash_data.bin] [https://gist.github.com/lupyuen/7a0c697b89abccda8e38b33dfe5ebaff (Notes)]&lt;br /&gt;
* [https://github.com/lupyuen/lupyuen.github.io/releases/download/ox64/BL808.DVK.Quick.Start.pdf BL808 DVK Quick Start]&lt;br /&gt;
* [https://github.com/bouffalolab/bl808_linux/tree/main/opensbi-0.6-808 OpenSBI for BL808]&lt;br /&gt;
* [https://github.com/bouffalolab/bl808-pac Rust Peripheral Access Crate (PAC) for BL808]&lt;br /&gt;
* [https://github.com/bouffalolab/bl808-pac/blob/main/bl808.svd System View Description (SVD) for BL808]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== SoC and Memory Specification ==&lt;br /&gt;
* Based on [https://en.bouffalolab.com/product/ Bouffalo Lab BL808]&lt;br /&gt;
[[File:Bouffalo_Lab_icon.png|right]]&lt;br /&gt;
[[File:BL808_Block_Diagram.jpg|600px]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== CPU Architecture ===&lt;br /&gt;
* [https://www.t-head.cn/product/c906?lang=en T_head C906 480MHz 64-bit RISC-V CPU]&lt;br /&gt;
[[File:T-Head.png|right|200px]]&lt;br /&gt;
** Supports RISC-V RV64IMAFCV instruction architecture&lt;br /&gt;
** Five-stage single-issue sequentially executed pipeline&lt;br /&gt;
** Level-1 instruction and data cache of Harvard architecture, with a size of 32 KB and a cache line of 64B&lt;br /&gt;
** Sv39 memory management unit, realizing the conversion of virtual and real addresses and memory management&lt;br /&gt;
** jTLB that supports 128 entries&lt;br /&gt;
** Supports AXI 4.0 128-bit master interface&lt;br /&gt;
** Supports core local interrupt (CLINT) and platform-level interrupt controller (PLIC)&lt;br /&gt;
** With 80 external interrupt sources, 3 bits for configuring interrupt priority&lt;br /&gt;
** Supports BHT (8K) and BTB&lt;br /&gt;
** Compatible with RISC-V PMP, 8 configurable areas&lt;br /&gt;
** Supports hardware performance monitor (HPM) units&lt;br /&gt;
&lt;br /&gt;
* [https://www.t-head.cn/product/e907?lang=en T_head E907 320MHz 32-bit RISC-V CPU]&lt;br /&gt;
** Supports RISC-V RV32IMAFCP instruction set&lt;br /&gt;
** Supports RISC-V 32-bit/16-bit mixed instruction set&lt;br /&gt;
** Supports RISC-V machine mode and user mode&lt;br /&gt;
** Thirty-two 32-bit integer general purpose registers (GPR) and thirty-two 32-bit/64-bit floating-point GPRs&lt;br /&gt;
** Integer (5-stage)/floating-point (7-stage), single-issue, sequentially executed pipeline&lt;br /&gt;
** Supports AXI 4.0 main device interface and AHB 5.0 peripheral interface&lt;br /&gt;
** 32K instruction cache, two-way set associative structure&lt;br /&gt;
** 16K data cache, two-way set associative structure&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== System Memory ===&lt;br /&gt;
* Embedded 64MB PSRAM&lt;br /&gt;
&lt;br /&gt;
== Board Features ==&lt;br /&gt;
&lt;br /&gt;
=== Network ===&lt;br /&gt;
* 2.4GHz 1T1R WiFi 802.11 b/g/n&lt;br /&gt;
* Bluetooth 5.2&lt;br /&gt;
* Zigbee&lt;br /&gt;
* 10/100Mbps Ethernet (optional, on expansion board)&lt;br /&gt;
&lt;br /&gt;
=== Storage ===&lt;br /&gt;
* on-board 16Mb (2MB) or 128Mb (16MB) XSPI NOR flash memory&lt;br /&gt;
* microSD - supports SDHC and SDXC&lt;br /&gt;
&lt;br /&gt;
=== Expansion Ports ===&lt;br /&gt;
* USB 2.0 OTG port&lt;br /&gt;
* 26 GPIO Pins, including SPI, I2C and UART functionality. Possible I2S and GMII expansion&lt;br /&gt;
* Dual lane MiPi CSI port, located at USB-C port, for camera module&lt;br /&gt;
&lt;br /&gt;
=== Audio ===&lt;br /&gt;
* mic (optional, on camera module)&lt;br /&gt;
* speaker (optional, on camera module)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Board Information, Schematics and Certifications ==&lt;br /&gt;
* Baseboard Dimensions: 51mm x 21mm x 19mm x 3.5mm (Breadboard friendly)&lt;br /&gt;
* Input Power: 5V 0.5A microSD or USB-C port&lt;br /&gt;
* Schematic:&lt;br /&gt;
** [https://files.pine64.org/doc/ox64/PINE64_Ox64-Schematic-202221007.pdf Ox64 Schematic 20221007 v1.0]&lt;br /&gt;
** [https://files.pine64.org/doc/ox64/PINE64_Ox64_PCB_Placement-Top-20221007.pdf Ox64 PCB Component placement(ToP) 20221007 v1.0]&lt;br /&gt;
** [https://files.pine64.org/doc/ox64/PINE64_Ox64_PCB_Placement-Bottom-20221007.pdf Ox64 PCB Component placement(Bottom) 20221007 v1.0]&lt;br /&gt;
* Certifications:&lt;br /&gt;
** Disclaimer: Please note that PINE64 SBC is not a &amp;quot;final&amp;quot; product and in general certification is not necessary. However, PINE64 still submits the SBC for FCC, CE, and ROHS certifications and obtain the certificates to prove that the SBC board can pass the testing. Please note, a final commercial product needs to perform its own testing and obtain its own certificate.&lt;br /&gt;
** Not yet available&lt;br /&gt;
&lt;br /&gt;
== Datasheets for Components and Peripherals ==&lt;br /&gt;
* Bouffalo BL808 SoC information:&lt;br /&gt;
** [https://files.pine64.org/doc/datasheet/ox64/BL808_DS_en_1.1(open).pdf Bouffalo Lab BL808 SoC Datasheet]&lt;br /&gt;
** [https://files.pine64.org/doc/datasheet/ox64/BL808_RM_en_1.0(open).pdf Bouffalo Lab BL808 SoC Reference Manual]&lt;br /&gt;
* SPI NOR Flash information:&lt;br /&gt;
** [https://files.pine64.org/doc/datasheet/ox64/gd25lq16e_rev1.2_20210108.pdf GigaDevice 16Mb XSPI-Flash Datasheet]&lt;br /&gt;
** [https://files.pine64.org/doc/datasheet/star64/gd25lq128e_rev1.0_20210513.pdf GigaDevice 128Mb XSPI-Flash Datasheet]&lt;br /&gt;
* Power Regulator information:&lt;br /&gt;
** [https://files.pine64.org/doc/datasheet/ox64/IA2014-03.pdf Innovation Analog Tech IA2014 Step_down Converter Datasheet]&lt;br /&gt;
&lt;br /&gt;
== Articles and Blogs ==&lt;br /&gt;
* [https://gist.github.com/lupyuen/7a0c697b89abccda8e38b33dfe5ebaff First Batch of Ox64 won't appear as USB Serial Port]&lt;br /&gt;
* [https://gist.github.com/lupyuen/2087e9b3fb40aab5e0795bb02a265a3b First Batch of Ox64 tested OK with CH340C/G]&lt;br /&gt;
* [https://www.robertlipe.com/bl808-not-symmetric/ First thoughts on the (a)symmetery of Bouffalo Labs BL808 as in Pine64’s Ox64]&lt;br /&gt;
&lt;br /&gt;
== Development Efforts ==&lt;br /&gt;
* [https://twitter.com/btashton/status/1579670569842536449?s=20&amp;amp;t=0aStWRwcXNQS7JWDd1UJcg Brennan Ashton is exploring Apache NuttX RTOS and OpenAMP (Asymmetric Multiprocessing) on BL808]&lt;br /&gt;
&lt;br /&gt;
[[Category:Ox64]] [[Category:Bouffalo BL808]]&lt;/div&gt;</summary>
		<author><name>Lupyuen</name></author>
	</entry>
	<entry>
		<id>https://wiki.pine64.org/index.php?title=Ox64&amp;diff=14540</id>
		<title>Ox64</title>
		<link rel="alternate" type="text/html" href="https://wiki.pine64.org/index.php?title=Ox64&amp;diff=14540"/>
		<updated>2022-10-21T08:35:30Z</updated>

		<summary type="html">&lt;p&gt;Lupyuen: First Batch of Ox64 won't appear as USB Serial Port&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[File:Ox64_board.jpg|400px|thumb|right|The Ox64]]&lt;br /&gt;
&lt;br /&gt;
The '''Ox64''' is a RISC-V based Single Board Computer powered by Bouffalo Lab BL808 C906 64-Bit RISC-V CPU, 32-Bit CPU, embedded 64MB PSRAM memory and build-on 3 radio RF (Wifi, BT, Zigbee). It provides breadboard friendly form factor, MicroSD Card slot, USB 2.0, and many other peripheral interfaces for makers to integrate with sensors and other devices.&lt;br /&gt;
&lt;br /&gt;
[[File:RISC-V.png|600px|]]&lt;br /&gt;
&lt;br /&gt;
== Software Releases ==&lt;br /&gt;
&lt;br /&gt;
=== Quick Links to the Source of OS Images Build ===&lt;br /&gt;
&lt;br /&gt;
OS images are still in '''alpha build''' which are only fit for board bring up and testing purposes. &lt;br /&gt;
&lt;br /&gt;
* [https://github.com/bouffalolab/bl808_linux Linux for BL808]&lt;br /&gt;
* [https://wiki.pine64.org/wiki/File:Linux_BL808.pdf Installation Instructions for Linux on BL808 (Chinese)]&lt;br /&gt;
* [https://wiki.pine64.org/wiki/File:Linux_BL808_en.pdf Installation Instructions for Linux on BL808 (English Auto-Translation)]&lt;br /&gt;
* Toolchain:&lt;br /&gt;
** elf_newlib_toolchain/bin/riscv64-unknown-elf-gcc (Xuantie-900 elf newlib gcc Toolchain V2.2.5 B-20220323) 10.2.0&lt;br /&gt;
** linux_toolchain/bin/riscv64-unknown-linux-gnu-gcc (Xuantie-900 linux-5.10.4 glibc gcc Toolchain V2.2.4 B-20211227) 10.2.0&lt;br /&gt;
** cmake version 3.19.3&lt;br /&gt;
&lt;br /&gt;
=== Software Development Kits ===&lt;br /&gt;
* [https://github.com/bouffalolab/bl_mcu_sdk BL808 MCU SDK]&lt;br /&gt;
* [https://app.box.com/s/aeqkvd6ddtixf4vb2lyuslpu0vu3498y BLDevCube Flashing Tool for Windows, macOS and Ubuntu x64]&lt;br /&gt;
* [https://wiki.pine64.org/wiki/File:Ox64_BL808UART_connect.pdf Ox64 UART Connection Guide] [https://gist.github.com/lupyuen/7a0c697b89abccda8e38b33dfe5ebaff (Notes)]&lt;br /&gt;
* [https://github.com/lupyuen/lupyuen.github.io/releases/download/ox64/bl808_demo_event.bin BL808 Demo Firmware: bl808_demo_event.bin] [https://gist.github.com/lupyuen/7a0c697b89abccda8e38b33dfe5ebaff (Notes)]&lt;br /&gt;
* [https://github.com/lupyuen/lupyuen.github.io/releases/download/ox64/whole_flash_data.bin BL808 UART Log Firmware: whole_flash_data.bin] [https://gist.github.com/lupyuen/7a0c697b89abccda8e38b33dfe5ebaff (Notes)]&lt;br /&gt;
* [https://github.com/lupyuen/lupyuen.github.io/releases/download/ox64/BL808.DVK.Quick.Start.pdf BL808 DVK Quick Start]&lt;br /&gt;
* [https://github.com/bouffalolab/bl808_linux/tree/main/opensbi-0.6-808 OpenSBI for BL808]&lt;br /&gt;
* [https://github.com/bouffalolab/bl808-pac Rust Peripheral Access Crate (PAC) for BL808]&lt;br /&gt;
* [https://github.com/bouffalolab/bl808-pac/blob/main/bl808.svd System View Description (SVD) for BL808]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== SoC and Memory Specification ==&lt;br /&gt;
* Based on [https://en.bouffalolab.com/product/ Bouffalo Lab BL808]&lt;br /&gt;
[[File:Bouffalo_Lab_icon.png|right]]&lt;br /&gt;
[[File:BL808_Block_Diagram.jpg|600px]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== CPU Architecture ===&lt;br /&gt;
* [https://www.t-head.cn/product/c906?lang=en T_head C906 480MHz 64-bit RISC-V CPU]&lt;br /&gt;
[[File:T-Head.png|right|200px]]&lt;br /&gt;
** Supports RISC-V RV64IMAFCV instruction architecture&lt;br /&gt;
** Five-stage single-issue sequentially executed pipeline&lt;br /&gt;
** Level-1 instruction and data cache of Harvard architecture, with a size of 32 KB and a cache line of 64B&lt;br /&gt;
** Sv39 memory management unit, realizing the conversion of virtual and real addresses and memory management&lt;br /&gt;
** jTLB that supports 128 entries&lt;br /&gt;
** Supports AXI 4.0 128-bit master interface&lt;br /&gt;
** Supports core local interrupt (CLINT) and platform-level interrupt controller (PLIC)&lt;br /&gt;
** With 80 external interrupt sources, 3 bits for configuring interrupt priority&lt;br /&gt;
** Supports BHT (8K) and BTB&lt;br /&gt;
** Compatible with RISC-V PMP, 8 configurable areas&lt;br /&gt;
** Supports hardware performance monitor (HPM) units&lt;br /&gt;
&lt;br /&gt;
* [https://www.t-head.cn/product/e907?lang=en T_head E907 320MHz 32-bit RISC-V CPU]&lt;br /&gt;
** Supports RISC-V RV32IMAFCP instruction set&lt;br /&gt;
** Supports RISC-V 32-bit/16-bit mixed instruction set&lt;br /&gt;
** Supports RISC-V machine mode and user mode&lt;br /&gt;
** Thirty-two 32-bit integer general purpose registers (GPR) and thirty-two 32-bit/64-bit floating-point GPRs&lt;br /&gt;
** Integer (5-stage)/floating-point (7-stage), single-issue, sequentially executed pipeline&lt;br /&gt;
** Supports AXI 4.0 main device interface and AHB 5.0 peripheral interface&lt;br /&gt;
** 32K instruction cache, two-way set associative structure&lt;br /&gt;
** 16K data cache, two-way set associative structure&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== System Memory ===&lt;br /&gt;
* Embedded 64MB PSRAM&lt;br /&gt;
&lt;br /&gt;
== Board Features ==&lt;br /&gt;
&lt;br /&gt;
=== Network ===&lt;br /&gt;
* 2.4GHz 1T1R WiFi 802.11 b/g/n&lt;br /&gt;
* Bluetooth 5.2&lt;br /&gt;
* Zigbee&lt;br /&gt;
* 10/100Mbps Ethernet (optional, on expansion board)&lt;br /&gt;
&lt;br /&gt;
=== Storage ===&lt;br /&gt;
* on-board 16Mb (2MB) or 128Mb (16MB) XSPI NOR flash memory&lt;br /&gt;
* microSD - supports SDHC and SDXC&lt;br /&gt;
&lt;br /&gt;
=== Expansion Ports ===&lt;br /&gt;
* USB 2.0 OTG port&lt;br /&gt;
* 26 GPIO Pins, including SPI, I2C and UART functionality. Possible I2S and GMII expansion&lt;br /&gt;
* Dual lane MiPi CSI port, located at USB-C port, for camera module&lt;br /&gt;
&lt;br /&gt;
=== Audio ===&lt;br /&gt;
* mic (optional, on camera module)&lt;br /&gt;
* speaker (optional, on camera module)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Board Information, Schematics and Certifications ==&lt;br /&gt;
* Baseboard Dimensions: 51mm x 21mm x 19mm x 3.5mm (Breadboard friendly)&lt;br /&gt;
* Input Power: 5V 0.5A microSD or USB-C port&lt;br /&gt;
* Schematic:&lt;br /&gt;
** [https://files.pine64.org/doc/ox64/PINE64_Ox64-Schematic-202221007.pdf Ox64 Schematic 20221007 v1.0]&lt;br /&gt;
** [https://files.pine64.org/doc/ox64/PINE64_Ox64_PCB_Placement-Top-20221007.pdf Ox64 PCB Component placement(ToP) 20221007 v1.0]&lt;br /&gt;
** [https://files.pine64.org/doc/ox64/PINE64_Ox64_PCB_Placement-Bottom-20221007.pdf Ox64 PCB Component placement(Bottom) 20221007 v1.0]&lt;br /&gt;
* Certifications:&lt;br /&gt;
** Disclaimer: Please note that PINE64 SBC is not a &amp;quot;final&amp;quot; product and in general certification is not necessary. However, PINE64 still submits the SBC for FCC, CE, and ROHS certifications and obtain the certificates to prove that the SBC board can pass the testing. Please note, a final commercial product needs to perform its own testing and obtain its own certificate.&lt;br /&gt;
** Not yet available&lt;br /&gt;
&lt;br /&gt;
== Datasheets for Components and Peripherals ==&lt;br /&gt;
* Bouffalo BL808 SoC information:&lt;br /&gt;
** [https://files.pine64.org/doc/datasheet/ox64/BL808_DS_en_1.1(open).pdf Bouffalo Lab BL808 SoC Datasheet]&lt;br /&gt;
** [https://files.pine64.org/doc/datasheet/ox64/BL808_RM_en_1.0(open).pdf Bouffalo Lab BL808 SoC Reference Manual]&lt;br /&gt;
* SPI NOR Flash information:&lt;br /&gt;
** [https://files.pine64.org/doc/datasheet/ox64/gd25lq16e_rev1.2_20210108.pdf GigaDevice 16Mb XSPI-Flash Datasheet]&lt;br /&gt;
** [https://files.pine64.org/doc/datasheet/star64/gd25lq128e_rev1.0_20210513.pdf GigaDevice 128Mb XSPI-Flash Datasheet]&lt;br /&gt;
* Power Regulator information:&lt;br /&gt;
** [https://files.pine64.org/doc/datasheet/ox64/IA2014-03.pdf Innovation Analog Tech IA2014 Step_down Converter Datasheet]&lt;br /&gt;
&lt;br /&gt;
== Articles and Blogs ==&lt;br /&gt;
* [https://gist.github.com/lupyuen/7a0c697b89abccda8e38b33dfe5ebaff First Batch of Ox64 won't appear as USB Serial Port]&lt;br /&gt;
* [https://gist.github.com/lupyuen/2087e9b3fb40aab5e0795bb02a265a3b First Batch of Ox64 tested OK with CH340C/G]&lt;br /&gt;
* [https://www.robertlipe.com/bl808-not-symmetric/ First thoughts on the (a)symmetery of Bouffalo Labs BL808 as in Pine64’s Ox64]&lt;br /&gt;
&lt;br /&gt;
== Development Efforts ==&lt;br /&gt;
* [https://twitter.com/btashton/status/1579670569842536449?s=20&amp;amp;t=0aStWRwcXNQS7JWDd1UJcg Brennan Ashton is exploring Apache NuttX RTOS and OpenAMP (Asymmetric Multiprocessing) on BL808]&lt;br /&gt;
&lt;br /&gt;
[[Category:Ox64]] [[Category:Bouffalo BL808]]&lt;/div&gt;</summary>
		<author><name>Lupyuen</name></author>
	</entry>
	<entry>
		<id>https://wiki.pine64.org/index.php?title=Ox64&amp;diff=14535</id>
		<title>Ox64</title>
		<link rel="alternate" type="text/html" href="https://wiki.pine64.org/index.php?title=Ox64&amp;diff=14535"/>
		<updated>2022-10-21T05:46:59Z</updated>

		<summary type="html">&lt;p&gt;Lupyuen: Add Ox64 Notes by TL&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[File:Ox64_board.jpg|400px|thumb|right|The Ox64]]&lt;br /&gt;
&lt;br /&gt;
The '''Ox64''' is a RISC-V based Single Board Computer powered by Bouffalo Lab BL808 C906 64-Bit RISC-V CPU, 32-Bit CPU, embedded 64MB PSRAM memory and build-on 3 radio RF (Wifi, BT, Zigbee). It provides breadboard friendly form factor, MicroSD Card slot, USB 2.0, and many other peripheral interfaces for makers to integrate with sensors and other devices.&lt;br /&gt;
&lt;br /&gt;
[[File:RISC-V.png|600px|]]&lt;br /&gt;
&lt;br /&gt;
== Software Releases ==&lt;br /&gt;
&lt;br /&gt;
=== Quick Links to the Source of OS Images Build ===&lt;br /&gt;
&lt;br /&gt;
OS images are still in '''alpha build''' which are only fit for board bring up and testing purposes. &lt;br /&gt;
&lt;br /&gt;
* [https://github.com/bouffalolab/bl808_linux Linux for BL808]&lt;br /&gt;
* [https://wiki.pine64.org/wiki/File:Linux_BL808.pdf Installation Instructions for Linux on BL808 (Chinese)]&lt;br /&gt;
* [https://wiki.pine64.org/wiki/File:Linux_BL808_en.pdf Installation Instructions for Linux on BL808 (English Auto-Translation)]&lt;br /&gt;
* Toolchain:&lt;br /&gt;
** elf_newlib_toolchain/bin/riscv64-unknown-elf-gcc (Xuantie-900 elf newlib gcc Toolchain V2.2.5 B-20220323) 10.2.0&lt;br /&gt;
** linux_toolchain/bin/riscv64-unknown-linux-gnu-gcc (Xuantie-900 linux-5.10.4 glibc gcc Toolchain V2.2.4 B-20211227) 10.2.0&lt;br /&gt;
** cmake version 3.19.3&lt;br /&gt;
&lt;br /&gt;
=== Software Development Kits ===&lt;br /&gt;
* [https://github.com/bouffalolab/bl_mcu_sdk BL808 MCU SDK]&lt;br /&gt;
* [https://app.box.com/s/aeqkvd6ddtixf4vb2lyuslpu0vu3498y BLDevCube Flashing Tool for Windows, macOS and Ubuntu x64]&lt;br /&gt;
* [https://wiki.pine64.org/wiki/File:Ox64_BL808UART_connect.pdf Ox64 UART Connection Guide] [https://gist.github.com/lupyuen/7a0c697b89abccda8e38b33dfe5ebaff (Notes)]&lt;br /&gt;
* [https://github.com/lupyuen/lupyuen.github.io/releases/download/ox64/bl808_demo_event.bin BL808 Demo Firmware: bl808_demo_event.bin] [https://gist.github.com/lupyuen/7a0c697b89abccda8e38b33dfe5ebaff (Notes)]&lt;br /&gt;
* [https://github.com/lupyuen/lupyuen.github.io/releases/download/ox64/whole_flash_data.bin BL808 UART Log Firmware: whole_flash_data.bin] [https://gist.github.com/lupyuen/7a0c697b89abccda8e38b33dfe5ebaff (Notes)]&lt;br /&gt;
* [https://github.com/lupyuen/lupyuen.github.io/releases/download/ox64/BL808.DVK.Quick.Start.pdf BL808 DVK Quick Start]&lt;br /&gt;
* [https://github.com/bouffalolab/bl808_linux/tree/main/opensbi-0.6-808 OpenSBI for BL808]&lt;br /&gt;
* [https://github.com/bouffalolab/bl808-pac Rust Peripheral Access Crate (PAC) for BL808]&lt;br /&gt;
* [https://github.com/bouffalolab/bl808-pac/blob/main/bl808.svd System View Description (SVD) for BL808]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== SoC and Memory Specification ==&lt;br /&gt;
* Based on [https://en.bouffalolab.com/product/ Bouffalo Lab BL808]&lt;br /&gt;
[[File:Bouffalo_Lab_icon.png|right]]&lt;br /&gt;
[[File:BL808_Block_Diagram.jpg|600px]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== CPU Architecture ===&lt;br /&gt;
* [https://www.t-head.cn/product/c906?lang=en T_head C906 480MHz 64-bit RISC-V CPU]&lt;br /&gt;
[[File:T-Head.png|right|200px]]&lt;br /&gt;
** Supports RISC-V RV64IMAFCV instruction architecture&lt;br /&gt;
** Five-stage single-issue sequentially executed pipeline&lt;br /&gt;
** Level-1 instruction and data cache of Harvard architecture, with a size of 32 KB and a cache line of 64B&lt;br /&gt;
** Sv39 memory management unit, realizing the conversion of virtual and real addresses and memory management&lt;br /&gt;
** jTLB that supports 128 entries&lt;br /&gt;
** Supports AXI 4.0 128-bit master interface&lt;br /&gt;
** Supports core local interrupt (CLINT) and platform-level interrupt controller (PLIC)&lt;br /&gt;
** With 80 external interrupt sources, 3 bits for configuring interrupt priority&lt;br /&gt;
** Supports BHT (8K) and BTB&lt;br /&gt;
** Compatible with RISC-V PMP, 8 configurable areas&lt;br /&gt;
** Supports hardware performance monitor (HPM) units&lt;br /&gt;
&lt;br /&gt;
* [https://www.t-head.cn/product/e907?lang=en T_head E907 320MHz 32-bit RISC-V CPU]&lt;br /&gt;
** Supports RISC-V RV32IMAFCP instruction set&lt;br /&gt;
** Supports RISC-V 32-bit/16-bit mixed instruction set&lt;br /&gt;
** Supports RISC-V machine mode and user mode&lt;br /&gt;
** Thirty-two 32-bit integer general purpose registers (GPR) and thirty-two 32-bit/64-bit floating-point GPRs&lt;br /&gt;
** Integer (5-stage)/floating-point (7-stage), single-issue, sequentially executed pipeline&lt;br /&gt;
** Supports AXI 4.0 main device interface and AHB 5.0 peripheral interface&lt;br /&gt;
** 32K instruction cache, two-way set associative structure&lt;br /&gt;
** 16K data cache, two-way set associative structure&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== System Memory ===&lt;br /&gt;
* Embedded 64MB PSRAM&lt;br /&gt;
&lt;br /&gt;
== Board Features ==&lt;br /&gt;
&lt;br /&gt;
=== Network ===&lt;br /&gt;
* 2.4GHz 1T1R WiFi 802.11 b/g/n&lt;br /&gt;
* Bluetooth 5.2&lt;br /&gt;
* Zigbee&lt;br /&gt;
* 10/100Mbps Ethernet (optional, on expansion board)&lt;br /&gt;
&lt;br /&gt;
=== Storage ===&lt;br /&gt;
* on-board 16Mb (2MB) or 128Mb (16MB) XSPI NOR flash memory&lt;br /&gt;
* microSD - supports SDHC and SDXC&lt;br /&gt;
&lt;br /&gt;
=== Expansion Ports ===&lt;br /&gt;
* USB 2.0 OTG port&lt;br /&gt;
* 26 GPIO Pins, including SPI, I2C and UART functionality. Possible I2S and GMII expansion&lt;br /&gt;
* Dual lane MiPi CSI port, located at USB-C port, for camera module&lt;br /&gt;
&lt;br /&gt;
=== Audio ===&lt;br /&gt;
* mic (optional, on camera module)&lt;br /&gt;
* speaker (optional, on camera module)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Board Information, Schematics and Certifications ==&lt;br /&gt;
* Baseboard Dimensions: 51mm x 21mm x 19mm x 3.5mm (Breadboard friendly)&lt;br /&gt;
* Input Power: 5V 0.5A microSD or USB-C port&lt;br /&gt;
* Schematic:&lt;br /&gt;
** [https://files.pine64.org/doc/ox64/PINE64_Ox64-Schematic-202221007.pdf Ox64 Schematic 20221007 v1.0]&lt;br /&gt;
** [https://files.pine64.org/doc/ox64/PINE64_Ox64_PCB_Placement-Top-20221007.pdf Ox64 PCB Component placement(ToP) 20221007 v1.0]&lt;br /&gt;
** [https://files.pine64.org/doc/ox64/PINE64_Ox64_PCB_Placement-Bottom-20221007.pdf Ox64 PCB Component placement(Bottom) 20221007 v1.0]&lt;br /&gt;
* Certifications:&lt;br /&gt;
** Disclaimer: Please note that PINE64 SBC is not a &amp;quot;final&amp;quot; product and in general certification is not necessary. However, PINE64 still submits the SBC for FCC, CE, and ROHS certifications and obtain the certificates to prove that the SBC board can pass the testing. Please note, a final commercial product needs to perform its own testing and obtain its own certificate.&lt;br /&gt;
** Not yet available&lt;br /&gt;
&lt;br /&gt;
== Datasheets for Components and Peripherals ==&lt;br /&gt;
* Bouffalo BL808 SoC information:&lt;br /&gt;
** [https://files.pine64.org/doc/datasheet/ox64/BL808_DS_en_1.1(open).pdf Bouffalo Lab BL808 SoC Datasheet]&lt;br /&gt;
** [https://files.pine64.org/doc/datasheet/ox64/BL808_RM_en_1.0(open).pdf Bouffalo Lab BL808 SoC Reference Manual]&lt;br /&gt;
* SPI NOR Flash information:&lt;br /&gt;
** [https://files.pine64.org/doc/datasheet/ox64/gd25lq16e_rev1.2_20210108.pdf GigaDevice 16Mb XSPI-Flash Datasheet]&lt;br /&gt;
** [https://files.pine64.org/doc/datasheet/star64/gd25lq128e_rev1.0_20210513.pdf GigaDevice 128Mb XSPI-Flash Datasheet]&lt;br /&gt;
* Power Regulator information:&lt;br /&gt;
** [https://files.pine64.org/doc/datasheet/ox64/IA2014-03.pdf Innovation Analog Tech IA2014 Step_down Converter Datasheet]&lt;br /&gt;
&lt;br /&gt;
== Articles and Blogs ==&lt;br /&gt;
* [https://gist.github.com/lupyuen/7a0c697b89abccda8e38b33dfe5ebaff Ox64 Notes by TL Lim]&lt;br /&gt;
* [https://gist.github.com/lupyuen/2087e9b3fb40aab5e0795bb02a265a3b Ox64 Notes by Marek &amp;quot;gamiee&amp;quot; Kraus]&lt;br /&gt;
* [https://www.robertlipe.com/bl808-not-symmetric/ First thoughts on the (a)symmetery of Bouffalo Labs BL808 as in Pine64’s Ox64]&lt;br /&gt;
&lt;br /&gt;
== Development Efforts ==&lt;br /&gt;
* [https://twitter.com/btashton/status/1579670569842536449?s=20&amp;amp;t=0aStWRwcXNQS7JWDd1UJcg Brennan Ashton is exploring Apache NuttX RTOS and OpenAMP (Asymmetric Multiprocessing) on BL808]&lt;br /&gt;
&lt;br /&gt;
[[Category:Ox64]] [[Category:Bouffalo BL808]]&lt;/div&gt;</summary>
		<author><name>Lupyuen</name></author>
	</entry>
	<entry>
		<id>https://wiki.pine64.org/index.php?title=Ox64&amp;diff=14534</id>
		<title>Ox64</title>
		<link rel="alternate" type="text/html" href="https://wiki.pine64.org/index.php?title=Ox64&amp;diff=14534"/>
		<updated>2022-10-21T05:27:38Z</updated>

		<summary type="html">&lt;p&gt;Lupyuen: Add BL808 DVK Quick Start and Firmware&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[File:Ox64_board.jpg|400px|thumb|right|The Ox64]]&lt;br /&gt;
&lt;br /&gt;
The '''Ox64''' is a RISC-V based Single Board Computer powered by Bouffalo Lab BL808 C906 64-Bit RISC-V CPU, 32-Bit CPU, embedded 64MB PSRAM memory and build-on 3 radio RF (Wifi, BT, Zigbee). It provides breadboard friendly form factor, MicroSD Card slot, USB 2.0, and many other peripheral interfaces for makers to integrate with sensors and other devices.&lt;br /&gt;
&lt;br /&gt;
[[File:RISC-V.png|600px|]]&lt;br /&gt;
&lt;br /&gt;
== Software Releases ==&lt;br /&gt;
&lt;br /&gt;
=== Quick Links to the Source of OS Images Build ===&lt;br /&gt;
&lt;br /&gt;
OS images are still in '''alpha build''' which are only fit for board bring up and testing purposes. &lt;br /&gt;
&lt;br /&gt;
* [https://github.com/bouffalolab/bl808_linux Linux for BL808]&lt;br /&gt;
* [https://wiki.pine64.org/wiki/File:Linux_BL808.pdf Installation Instructions for Linux on BL808 (Chinese)]&lt;br /&gt;
* [https://wiki.pine64.org/wiki/File:Linux_BL808_en.pdf Installation Instructions for Linux on BL808 (English Auto-Translation)]&lt;br /&gt;
* Toolchain:&lt;br /&gt;
** elf_newlib_toolchain/bin/riscv64-unknown-elf-gcc (Xuantie-900 elf newlib gcc Toolchain V2.2.5 B-20220323) 10.2.0&lt;br /&gt;
** linux_toolchain/bin/riscv64-unknown-linux-gnu-gcc (Xuantie-900 linux-5.10.4 glibc gcc Toolchain V2.2.4 B-20211227) 10.2.0&lt;br /&gt;
** cmake version 3.19.3&lt;br /&gt;
&lt;br /&gt;
=== Software Development Kits ===&lt;br /&gt;
* [https://github.com/bouffalolab/bl_mcu_sdk BL808 MCU SDK]&lt;br /&gt;
* [https://app.box.com/s/aeqkvd6ddtixf4vb2lyuslpu0vu3498y BLDevCube Flashing Tool for Windows, macOS and Ubuntu x64]&lt;br /&gt;
* [https://wiki.pine64.org/wiki/File:Ox64_BL808UART_connect.pdf Ox64 UART Connection Guide]&lt;br /&gt;
* [https://github.com/lupyuen/lupyuen.github.io/releases/download/ox64/bl808_demo_event.bin BL808 Firmware: bl808_demo_event.bin]&lt;br /&gt;
* [https://github.com/lupyuen/lupyuen.github.io/releases/download/ox64/whole_flash_data.bin BL808 Firmware: whole_flash_data.bin]&lt;br /&gt;
* [https://github.com/lupyuen/lupyuen.github.io/releases/download/ox64/BL808.DVK.Quick.Start.pdf BL808 DVK Quick Start]&lt;br /&gt;
* [https://github.com/bouffalolab/bl808_linux/tree/main/opensbi-0.6-808 OpenSBI for BL808]&lt;br /&gt;
* [https://github.com/bouffalolab/bl808-pac Rust Peripheral Access Crate (PAC) for BL808]&lt;br /&gt;
* [https://github.com/bouffalolab/bl808-pac/blob/main/bl808.svd System View Description (SVD) for BL808]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== SoC and Memory Specification ==&lt;br /&gt;
* Based on [https://en.bouffalolab.com/product/ Bouffalo Lab BL808]&lt;br /&gt;
[[File:Bouffalo_Lab_icon.png|right]]&lt;br /&gt;
[[File:BL808_Block_Diagram.jpg|600px]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== CPU Architecture ===&lt;br /&gt;
* [https://www.t-head.cn/product/c906?lang=en T_head C906 480MHz 64-bit RISC-V CPU]&lt;br /&gt;
[[File:T-Head.png|right|200px]]&lt;br /&gt;
** Supports RISC-V RV64IMAFCV instruction architecture&lt;br /&gt;
** Five-stage single-issue sequentially executed pipeline&lt;br /&gt;
** Level-1 instruction and data cache of Harvard architecture, with a size of 32 KB and a cache line of 64B&lt;br /&gt;
** Sv39 memory management unit, realizing the conversion of virtual and real addresses and memory management&lt;br /&gt;
** jTLB that supports 128 entries&lt;br /&gt;
** Supports AXI 4.0 128-bit master interface&lt;br /&gt;
** Supports core local interrupt (CLINT) and platform-level interrupt controller (PLIC)&lt;br /&gt;
** With 80 external interrupt sources, 3 bits for configuring interrupt priority&lt;br /&gt;
** Supports BHT (8K) and BTB&lt;br /&gt;
** Compatible with RISC-V PMP, 8 configurable areas&lt;br /&gt;
** Supports hardware performance monitor (HPM) units&lt;br /&gt;
&lt;br /&gt;
* [https://www.t-head.cn/product/e907?lang=en T_head E907 320MHz 32-bit RISC-V CPU]&lt;br /&gt;
** Supports RISC-V RV32IMAFCP instruction set&lt;br /&gt;
** Supports RISC-V 32-bit/16-bit mixed instruction set&lt;br /&gt;
** Supports RISC-V machine mode and user mode&lt;br /&gt;
** Thirty-two 32-bit integer general purpose registers (GPR) and thirty-two 32-bit/64-bit floating-point GPRs&lt;br /&gt;
** Integer (5-stage)/floating-point (7-stage), single-issue, sequentially executed pipeline&lt;br /&gt;
** Supports AXI 4.0 main device interface and AHB 5.0 peripheral interface&lt;br /&gt;
** 32K instruction cache, two-way set associative structure&lt;br /&gt;
** 16K data cache, two-way set associative structure&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== System Memory ===&lt;br /&gt;
* Embedded 64MB PSRAM&lt;br /&gt;
&lt;br /&gt;
== Board Features ==&lt;br /&gt;
&lt;br /&gt;
=== Network ===&lt;br /&gt;
* 2.4GHz 1T1R WiFi 802.11 b/g/n&lt;br /&gt;
* Bluetooth 5.2&lt;br /&gt;
* Zigbee&lt;br /&gt;
* 10/100Mbps Ethernet (optional, on expansion board)&lt;br /&gt;
&lt;br /&gt;
=== Storage ===&lt;br /&gt;
* on-board 16Mb (2MB) or 128Mb (16MB) XSPI NOR flash memory&lt;br /&gt;
* microSD - supports SDHC and SDXC&lt;br /&gt;
&lt;br /&gt;
=== Expansion Ports ===&lt;br /&gt;
* USB 2.0 OTG port&lt;br /&gt;
* 26 GPIO Pins, including SPI, I2C and UART functionality. Possible I2S and GMII expansion&lt;br /&gt;
* Dual lane MiPi CSI port, located at USB-C port, for camera module&lt;br /&gt;
&lt;br /&gt;
=== Audio ===&lt;br /&gt;
* mic (optional, on camera module)&lt;br /&gt;
* speaker (optional, on camera module)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Board Information, Schematics and Certifications ==&lt;br /&gt;
* Baseboard Dimensions: 51mm x 21mm x 19mm x 3.5mm (Breadboard friendly)&lt;br /&gt;
* Input Power: 5V 0.5A microSD or USB-C port&lt;br /&gt;
* Schematic:&lt;br /&gt;
** [https://files.pine64.org/doc/ox64/PINE64_Ox64-Schematic-202221007.pdf Ox64 Schematic 20221007 v1.0]&lt;br /&gt;
** [https://files.pine64.org/doc/ox64/PINE64_Ox64_PCB_Placement-Top-20221007.pdf Ox64 PCB Component placement(ToP) 20221007 v1.0]&lt;br /&gt;
** [https://files.pine64.org/doc/ox64/PINE64_Ox64_PCB_Placement-Bottom-20221007.pdf Ox64 PCB Component placement(Bottom) 20221007 v1.0]&lt;br /&gt;
* Certifications:&lt;br /&gt;
** Disclaimer: Please note that PINE64 SBC is not a &amp;quot;final&amp;quot; product and in general certification is not necessary. However, PINE64 still submits the SBC for FCC, CE, and ROHS certifications and obtain the certificates to prove that the SBC board can pass the testing. Please note, a final commercial product needs to perform its own testing and obtain its own certificate.&lt;br /&gt;
** Not yet available&lt;br /&gt;
&lt;br /&gt;
== Datasheets for Components and Peripherals ==&lt;br /&gt;
* Bouffalo BL808 SoC information:&lt;br /&gt;
** [https://files.pine64.org/doc/datasheet/ox64/BL808_DS_en_1.1(open).pdf Bouffalo Lab BL808 SoC Datasheet]&lt;br /&gt;
** [https://files.pine64.org/doc/datasheet/ox64/BL808_RM_en_1.0(open).pdf Bouffalo Lab BL808 SoC Reference Manual]&lt;br /&gt;
* SPI NOR Flash information:&lt;br /&gt;
** [https://files.pine64.org/doc/datasheet/ox64/gd25lq16e_rev1.2_20210108.pdf GigaDevice 16Mb XSPI-Flash Datasheet]&lt;br /&gt;
** [https://files.pine64.org/doc/datasheet/star64/gd25lq128e_rev1.0_20210513.pdf GigaDevice 128Mb XSPI-Flash Datasheet]&lt;br /&gt;
* Power Regulator information:&lt;br /&gt;
** [https://files.pine64.org/doc/datasheet/ox64/IA2014-03.pdf Innovation Analog Tech IA2014 Step_down Converter Datasheet]&lt;br /&gt;
&lt;br /&gt;
== Articles and Blogs ==&lt;br /&gt;
* [https://www.robertlipe.com/bl808-not-symmetric/ First thoughts on the (a)symmetery of Bouffalo Labs BL808 as in Pine64’s Ox64]&lt;br /&gt;
* [https://gist.github.com/lupyuen/2087e9b3fb40aab5e0795bb02a265a3b Ox64 BL808 Notes by Marek &amp;quot;gamiee&amp;quot; Kraus]&lt;br /&gt;
&lt;br /&gt;
== Development Efforts ==&lt;br /&gt;
* [https://twitter.com/btashton/status/1579670569842536449?s=20&amp;amp;t=0aStWRwcXNQS7JWDd1UJcg Brennan Ashton is exploring Apache NuttX RTOS and OpenAMP (Asymmetric Multiprocessing) on BL808]&lt;br /&gt;
&lt;br /&gt;
[[Category:Ox64]] [[Category:Bouffalo BL808]]&lt;/div&gt;</summary>
		<author><name>Lupyuen</name></author>
	</entry>
	<entry>
		<id>https://wiki.pine64.org/index.php?title=Ox64&amp;diff=14533</id>
		<title>Ox64</title>
		<link rel="alternate" type="text/html" href="https://wiki.pine64.org/index.php?title=Ox64&amp;diff=14533"/>
		<updated>2022-10-21T05:22:10Z</updated>

		<summary type="html">&lt;p&gt;Lupyuen: Add Ox64 UART Connection Guide&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[File:Ox64_board.jpg|400px|thumb|right|The Ox64]]&lt;br /&gt;
&lt;br /&gt;
The '''Ox64''' is a RISC-V based Single Board Computer powered by Bouffalo Lab BL808 C906 64-Bit RISC-V CPU, 32-Bit CPU, embedded 64MB PSRAM memory and build-on 3 radio RF (Wifi, BT, Zigbee). It provides breadboard friendly form factor, MicroSD Card slot, USB 2.0, and many other peripheral interfaces for makers to integrate with sensors and other devices.&lt;br /&gt;
&lt;br /&gt;
[[File:RISC-V.png|600px|]]&lt;br /&gt;
&lt;br /&gt;
== Software Releases ==&lt;br /&gt;
&lt;br /&gt;
=== Quick Links to the Source of OS Images Build ===&lt;br /&gt;
&lt;br /&gt;
OS images are still in '''alpha build''' which are only fit for board bring up and testing purposes. &lt;br /&gt;
&lt;br /&gt;
* [https://github.com/bouffalolab/bl808_linux Linux for BL808]&lt;br /&gt;
* [https://wiki.pine64.org/wiki/File:Linux_BL808.pdf Installation Instructions for Linux on BL808 (Chinese)]&lt;br /&gt;
* [https://wiki.pine64.org/wiki/File:Linux_BL808_en.pdf Installation Instructions for Linux on BL808 (English Auto-Translation)]&lt;br /&gt;
* Toolchain:&lt;br /&gt;
** elf_newlib_toolchain/bin/riscv64-unknown-elf-gcc (Xuantie-900 elf newlib gcc Toolchain V2.2.5 B-20220323) 10.2.0&lt;br /&gt;
** linux_toolchain/bin/riscv64-unknown-linux-gnu-gcc (Xuantie-900 linux-5.10.4 glibc gcc Toolchain V2.2.4 B-20211227) 10.2.0&lt;br /&gt;
** cmake version 3.19.3&lt;br /&gt;
&lt;br /&gt;
=== Software Development Kits ===&lt;br /&gt;
* [https://github.com/bouffalolab/bl_mcu_sdk BL808 MCU SDK]&lt;br /&gt;
* [https://app.box.com/s/aeqkvd6ddtixf4vb2lyuslpu0vu3498y BLDevCube Flashing Tool for Windows, macOS and Ubuntu x64]&lt;br /&gt;
* [https://wiki.pine64.org/wiki/File:Ox64_BL808UART_connect.pdf Ox64 UART Connection Guide]&lt;br /&gt;
* [https://github.com/bouffalolab/bl808_linux/tree/main/opensbi-0.6-808 OpenSBI for BL808]&lt;br /&gt;
* [https://github.com/bouffalolab/bl808-pac Rust Peripheral Access Crate (PAC) for BL808]&lt;br /&gt;
* [https://github.com/bouffalolab/bl808-pac/blob/main/bl808.svd System View Description (SVD) for BL808]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== SoC and Memory Specification ==&lt;br /&gt;
* Based on [https://en.bouffalolab.com/product/ Bouffalo Lab BL808]&lt;br /&gt;
[[File:Bouffalo_Lab_icon.png|right]]&lt;br /&gt;
[[File:BL808_Block_Diagram.jpg|600px]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== CPU Architecture ===&lt;br /&gt;
* [https://www.t-head.cn/product/c906?lang=en T_head C906 480MHz 64-bit RISC-V CPU]&lt;br /&gt;
[[File:T-Head.png|right|200px]]&lt;br /&gt;
** Supports RISC-V RV64IMAFCV instruction architecture&lt;br /&gt;
** Five-stage single-issue sequentially executed pipeline&lt;br /&gt;
** Level-1 instruction and data cache of Harvard architecture, with a size of 32 KB and a cache line of 64B&lt;br /&gt;
** Sv39 memory management unit, realizing the conversion of virtual and real addresses and memory management&lt;br /&gt;
** jTLB that supports 128 entries&lt;br /&gt;
** Supports AXI 4.0 128-bit master interface&lt;br /&gt;
** Supports core local interrupt (CLINT) and platform-level interrupt controller (PLIC)&lt;br /&gt;
** With 80 external interrupt sources, 3 bits for configuring interrupt priority&lt;br /&gt;
** Supports BHT (8K) and BTB&lt;br /&gt;
** Compatible with RISC-V PMP, 8 configurable areas&lt;br /&gt;
** Supports hardware performance monitor (HPM) units&lt;br /&gt;
&lt;br /&gt;
* [https://www.t-head.cn/product/e907?lang=en T_head E907 320MHz 32-bit RISC-V CPU]&lt;br /&gt;
** Supports RISC-V RV32IMAFCP instruction set&lt;br /&gt;
** Supports RISC-V 32-bit/16-bit mixed instruction set&lt;br /&gt;
** Supports RISC-V machine mode and user mode&lt;br /&gt;
** Thirty-two 32-bit integer general purpose registers (GPR) and thirty-two 32-bit/64-bit floating-point GPRs&lt;br /&gt;
** Integer (5-stage)/floating-point (7-stage), single-issue, sequentially executed pipeline&lt;br /&gt;
** Supports AXI 4.0 main device interface and AHB 5.0 peripheral interface&lt;br /&gt;
** 32K instruction cache, two-way set associative structure&lt;br /&gt;
** 16K data cache, two-way set associative structure&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== System Memory ===&lt;br /&gt;
* Embedded 64MB PSRAM&lt;br /&gt;
&lt;br /&gt;
== Board Features ==&lt;br /&gt;
&lt;br /&gt;
=== Network ===&lt;br /&gt;
* 2.4GHz 1T1R WiFi 802.11 b/g/n&lt;br /&gt;
* Bluetooth 5.2&lt;br /&gt;
* Zigbee&lt;br /&gt;
* 10/100Mbps Ethernet (optional, on expansion board)&lt;br /&gt;
&lt;br /&gt;
=== Storage ===&lt;br /&gt;
* on-board 16Mb (2MB) or 128Mb (16MB) XSPI NOR flash memory&lt;br /&gt;
* microSD - supports SDHC and SDXC&lt;br /&gt;
&lt;br /&gt;
=== Expansion Ports ===&lt;br /&gt;
* USB 2.0 OTG port&lt;br /&gt;
* 26 GPIO Pins, including SPI, I2C and UART functionality. Possible I2S and GMII expansion&lt;br /&gt;
* Dual lane MiPi CSI port, located at USB-C port, for camera module&lt;br /&gt;
&lt;br /&gt;
=== Audio ===&lt;br /&gt;
* mic (optional, on camera module)&lt;br /&gt;
* speaker (optional, on camera module)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Board Information, Schematics and Certifications ==&lt;br /&gt;
* Baseboard Dimensions: 51mm x 21mm x 19mm x 3.5mm (Breadboard friendly)&lt;br /&gt;
* Input Power: 5V 0.5A microSD or USB-C port&lt;br /&gt;
* Schematic:&lt;br /&gt;
** [https://files.pine64.org/doc/ox64/PINE64_Ox64-Schematic-202221007.pdf Ox64 Schematic 20221007 v1.0]&lt;br /&gt;
** [https://files.pine64.org/doc/ox64/PINE64_Ox64_PCB_Placement-Top-20221007.pdf Ox64 PCB Component placement(ToP) 20221007 v1.0]&lt;br /&gt;
** [https://files.pine64.org/doc/ox64/PINE64_Ox64_PCB_Placement-Bottom-20221007.pdf Ox64 PCB Component placement(Bottom) 20221007 v1.0]&lt;br /&gt;
* Certifications:&lt;br /&gt;
** Disclaimer: Please note that PINE64 SBC is not a &amp;quot;final&amp;quot; product and in general certification is not necessary. However, PINE64 still submits the SBC for FCC, CE, and ROHS certifications and obtain the certificates to prove that the SBC board can pass the testing. Please note, a final commercial product needs to perform its own testing and obtain its own certificate.&lt;br /&gt;
** Not yet available&lt;br /&gt;
&lt;br /&gt;
== Datasheets for Components and Peripherals ==&lt;br /&gt;
* Bouffalo BL808 SoC information:&lt;br /&gt;
** [https://files.pine64.org/doc/datasheet/ox64/BL808_DS_en_1.1(open).pdf Bouffalo Lab BL808 SoC Datasheet]&lt;br /&gt;
** [https://files.pine64.org/doc/datasheet/ox64/BL808_RM_en_1.0(open).pdf Bouffalo Lab BL808 SoC Reference Manual]&lt;br /&gt;
* SPI NOR Flash information:&lt;br /&gt;
** [https://files.pine64.org/doc/datasheet/ox64/gd25lq16e_rev1.2_20210108.pdf GigaDevice 16Mb XSPI-Flash Datasheet]&lt;br /&gt;
** [https://files.pine64.org/doc/datasheet/star64/gd25lq128e_rev1.0_20210513.pdf GigaDevice 128Mb XSPI-Flash Datasheet]&lt;br /&gt;
* Power Regulator information:&lt;br /&gt;
** [https://files.pine64.org/doc/datasheet/ox64/IA2014-03.pdf Innovation Analog Tech IA2014 Step_down Converter Datasheet]&lt;br /&gt;
&lt;br /&gt;
== Articles and Blogs ==&lt;br /&gt;
* [https://www.robertlipe.com/bl808-not-symmetric/ First thoughts on the (a)symmetery of Bouffalo Labs BL808 as in Pine64’s Ox64]&lt;br /&gt;
* [https://gist.github.com/lupyuen/2087e9b3fb40aab5e0795bb02a265a3b Ox64 BL808 Notes by Marek &amp;quot;gamiee&amp;quot; Kraus]&lt;br /&gt;
&lt;br /&gt;
== Development Efforts ==&lt;br /&gt;
* [https://twitter.com/btashton/status/1579670569842536449?s=20&amp;amp;t=0aStWRwcXNQS7JWDd1UJcg Brennan Ashton is exploring Apache NuttX RTOS and OpenAMP (Asymmetric Multiprocessing) on BL808]&lt;br /&gt;
&lt;br /&gt;
[[Category:Ox64]] [[Category:Bouffalo BL808]]&lt;/div&gt;</summary>
		<author><name>Lupyuen</name></author>
	</entry>
	<entry>
		<id>https://wiki.pine64.org/index.php?title=File:Ox64_BL808UART_connect.pdf&amp;diff=14532</id>
		<title>File:Ox64 BL808UART connect.pdf</title>
		<link rel="alternate" type="text/html" href="https://wiki.pine64.org/index.php?title=File:Ox64_BL808UART_connect.pdf&amp;diff=14532"/>
		<updated>2022-10-21T05:18:28Z</updated>

		<summary type="html">&lt;p&gt;Lupyuen: Ox64 BL808 UART Connect Guide. Provided by TL.&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Summary ==&lt;br /&gt;
Ox64 BL808 UART Connect Guide. Provided by TL.&lt;/div&gt;</summary>
		<author><name>Lupyuen</name></author>
	</entry>
	<entry>
		<id>https://wiki.pine64.org/index.php?title=Ox64&amp;diff=14531</id>
		<title>Ox64</title>
		<link rel="alternate" type="text/html" href="https://wiki.pine64.org/index.php?title=Ox64&amp;diff=14531"/>
		<updated>2022-10-21T05:06:13Z</updated>

		<summary type="html">&lt;p&gt;Lupyuen: Add BLDevCube Flashing Tool&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[File:Ox64_board.jpg|400px|thumb|right|The Ox64]]&lt;br /&gt;
&lt;br /&gt;
The '''Ox64''' is a RISC-V based Single Board Computer powered by Bouffalo Lab BL808 C906 64-Bit RISC-V CPU, 32-Bit CPU, embedded 64MB PSRAM memory and build-on 3 radio RF (Wifi, BT, Zigbee). It provides breadboard friendly form factor, MicroSD Card slot, USB 2.0, and many other peripheral interfaces for makers to integrate with sensors and other devices.&lt;br /&gt;
&lt;br /&gt;
[[File:RISC-V.png|600px|]]&lt;br /&gt;
&lt;br /&gt;
== Software Releases ==&lt;br /&gt;
&lt;br /&gt;
=== Quick Links to the Source of OS Images Build ===&lt;br /&gt;
&lt;br /&gt;
OS images are still in '''alpha build''' which are only fit for board bring up and testing purposes. &lt;br /&gt;
&lt;br /&gt;
* [https://github.com/bouffalolab/bl808_linux Linux for BL808]&lt;br /&gt;
* [https://wiki.pine64.org/wiki/File:Linux_BL808.pdf Installation Instructions for Linux on BL808 (Chinese)]&lt;br /&gt;
* [https://wiki.pine64.org/wiki/File:Linux_BL808_en.pdf Installation Instructions for Linux on BL808 (English Auto-Translation)]&lt;br /&gt;
* Toolchain:&lt;br /&gt;
** elf_newlib_toolchain/bin/riscv64-unknown-elf-gcc (Xuantie-900 elf newlib gcc Toolchain V2.2.5 B-20220323) 10.2.0&lt;br /&gt;
** linux_toolchain/bin/riscv64-unknown-linux-gnu-gcc (Xuantie-900 linux-5.10.4 glibc gcc Toolchain V2.2.4 B-20211227) 10.2.0&lt;br /&gt;
** cmake version 3.19.3&lt;br /&gt;
&lt;br /&gt;
=== Software Development Kits ===&lt;br /&gt;
* [https://github.com/bouffalolab/bl_mcu_sdk BL808 MCU SDK]&lt;br /&gt;
* [https://app.box.com/s/aeqkvd6ddtixf4vb2lyuslpu0vu3498y BLDevCube Flashing Tool for Windows, macOS and Ubuntu x64]&lt;br /&gt;
* [https://github.com/bouffalolab/bl808_linux/tree/main/opensbi-0.6-808 OpenSBI for BL808]&lt;br /&gt;
* [https://github.com/bouffalolab/bl808-pac Rust Peripheral Access Crate (PAC) for BL808]&lt;br /&gt;
* [https://github.com/bouffalolab/bl808-pac/blob/main/bl808.svd System View Description (SVD) for BL808]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== SoC and Memory Specification ==&lt;br /&gt;
* Based on [https://en.bouffalolab.com/product/ Bouffalo Lab BL808]&lt;br /&gt;
[[File:Bouffalo_Lab_icon.png|right]]&lt;br /&gt;
[[File:BL808_Block_Diagram.jpg|600px]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== CPU Architecture ===&lt;br /&gt;
* [https://www.t-head.cn/product/c906?lang=en T_head C906 480MHz 64-bit RISC-V CPU]&lt;br /&gt;
[[File:T-Head.png|right|200px]]&lt;br /&gt;
** Supports RISC-V RV64IMAFCV instruction architecture&lt;br /&gt;
** Five-stage single-issue sequentially executed pipeline&lt;br /&gt;
** Level-1 instruction and data cache of Harvard architecture, with a size of 32 KB and a cache line of 64B&lt;br /&gt;
** Sv39 memory management unit, realizing the conversion of virtual and real addresses and memory management&lt;br /&gt;
** jTLB that supports 128 entries&lt;br /&gt;
** Supports AXI 4.0 128-bit master interface&lt;br /&gt;
** Supports core local interrupt (CLINT) and platform-level interrupt controller (PLIC)&lt;br /&gt;
** With 80 external interrupt sources, 3 bits for configuring interrupt priority&lt;br /&gt;
** Supports BHT (8K) and BTB&lt;br /&gt;
** Compatible with RISC-V PMP, 8 configurable areas&lt;br /&gt;
** Supports hardware performance monitor (HPM) units&lt;br /&gt;
&lt;br /&gt;
* [https://www.t-head.cn/product/e907?lang=en T_head E907 320MHz 32-bit RISC-V CPU]&lt;br /&gt;
** Supports RISC-V RV32IMAFCP instruction set&lt;br /&gt;
** Supports RISC-V 32-bit/16-bit mixed instruction set&lt;br /&gt;
** Supports RISC-V machine mode and user mode&lt;br /&gt;
** Thirty-two 32-bit integer general purpose registers (GPR) and thirty-two 32-bit/64-bit floating-point GPRs&lt;br /&gt;
** Integer (5-stage)/floating-point (7-stage), single-issue, sequentially executed pipeline&lt;br /&gt;
** Supports AXI 4.0 main device interface and AHB 5.0 peripheral interface&lt;br /&gt;
** 32K instruction cache, two-way set associative structure&lt;br /&gt;
** 16K data cache, two-way set associative structure&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== System Memory ===&lt;br /&gt;
* Embedded 64MB PSRAM&lt;br /&gt;
&lt;br /&gt;
== Board Features ==&lt;br /&gt;
&lt;br /&gt;
=== Network ===&lt;br /&gt;
* 2.4GHz 1T1R WiFi 802.11 b/g/n&lt;br /&gt;
* Bluetooth 5.2&lt;br /&gt;
* Zigbee&lt;br /&gt;
* 10/100Mbps Ethernet (optional, on expansion board)&lt;br /&gt;
&lt;br /&gt;
=== Storage ===&lt;br /&gt;
* on-board 16Mb (2MB) or 128Mb (16MB) XSPI NOR flash memory&lt;br /&gt;
* microSD - supports SDHC and SDXC&lt;br /&gt;
&lt;br /&gt;
=== Expansion Ports ===&lt;br /&gt;
* USB 2.0 OTG port&lt;br /&gt;
* 26 GPIO Pins, including SPI, I2C and UART functionality. Possible I2S and GMII expansion&lt;br /&gt;
* Dual lane MiPi CSI port, located at USB-C port, for camera module&lt;br /&gt;
&lt;br /&gt;
=== Audio ===&lt;br /&gt;
* mic (optional, on camera module)&lt;br /&gt;
* speaker (optional, on camera module)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Board Information, Schematics and Certifications ==&lt;br /&gt;
* Baseboard Dimensions: 51mm x 21mm x 19mm x 3.5mm (Breadboard friendly)&lt;br /&gt;
* Input Power: 5V 0.5A microSD or USB-C port&lt;br /&gt;
* Schematic:&lt;br /&gt;
** [https://files.pine64.org/doc/ox64/PINE64_Ox64-Schematic-202221007.pdf Ox64 Schematic 20221007 v1.0]&lt;br /&gt;
** [https://files.pine64.org/doc/ox64/PINE64_Ox64_PCB_Placement-Top-20221007.pdf Ox64 PCB Component placement(ToP) 20221007 v1.0]&lt;br /&gt;
** [https://files.pine64.org/doc/ox64/PINE64_Ox64_PCB_Placement-Bottom-20221007.pdf Ox64 PCB Component placement(Bottom) 20221007 v1.0]&lt;br /&gt;
* Certifications:&lt;br /&gt;
** Disclaimer: Please note that PINE64 SBC is not a &amp;quot;final&amp;quot; product and in general certification is not necessary. However, PINE64 still submits the SBC for FCC, CE, and ROHS certifications and obtain the certificates to prove that the SBC board can pass the testing. Please note, a final commercial product needs to perform its own testing and obtain its own certificate.&lt;br /&gt;
** Not yet available&lt;br /&gt;
&lt;br /&gt;
== Datasheets for Components and Peripherals ==&lt;br /&gt;
* Bouffalo BL808 SoC information:&lt;br /&gt;
** [https://files.pine64.org/doc/datasheet/ox64/BL808_DS_en_1.1(open).pdf Bouffalo Lab BL808 SoC Datasheet]&lt;br /&gt;
** [https://files.pine64.org/doc/datasheet/ox64/BL808_RM_en_1.0(open).pdf Bouffalo Lab BL808 SoC Reference Manual]&lt;br /&gt;
* SPI NOR Flash information:&lt;br /&gt;
** [https://files.pine64.org/doc/datasheet/ox64/gd25lq16e_rev1.2_20210108.pdf GigaDevice 16Mb XSPI-Flash Datasheet]&lt;br /&gt;
** [https://files.pine64.org/doc/datasheet/star64/gd25lq128e_rev1.0_20210513.pdf GigaDevice 128Mb XSPI-Flash Datasheet]&lt;br /&gt;
* Power Regulator information:&lt;br /&gt;
** [https://files.pine64.org/doc/datasheet/ox64/IA2014-03.pdf Innovation Analog Tech IA2014 Step_down Converter Datasheet]&lt;br /&gt;
&lt;br /&gt;
== Articles and Blogs ==&lt;br /&gt;
* [https://www.robertlipe.com/bl808-not-symmetric/ First thoughts on the (a)symmetery of Bouffalo Labs BL808 as in Pine64’s Ox64]&lt;br /&gt;
* [https://gist.github.com/lupyuen/2087e9b3fb40aab5e0795bb02a265a3b Ox64 BL808 Notes by Marek &amp;quot;gamiee&amp;quot; Kraus]&lt;br /&gt;
&lt;br /&gt;
== Development Efforts ==&lt;br /&gt;
* [https://twitter.com/btashton/status/1579670569842536449?s=20&amp;amp;t=0aStWRwcXNQS7JWDd1UJcg Brennan Ashton is exploring Apache NuttX RTOS and OpenAMP (Asymmetric Multiprocessing) on BL808]&lt;br /&gt;
&lt;br /&gt;
[[Category:Ox64]] [[Category:Bouffalo BL808]]&lt;/div&gt;</summary>
		<author><name>Lupyuen</name></author>
	</entry>
	<entry>
		<id>https://wiki.pine64.org/index.php?title=Ox64&amp;diff=14530</id>
		<title>Ox64</title>
		<link rel="alternate" type="text/html" href="https://wiki.pine64.org/index.php?title=Ox64&amp;diff=14530"/>
		<updated>2022-10-21T05:00:52Z</updated>

		<summary type="html">&lt;p&gt;Lupyuen: Fix title of Ox64 BL808 Notes&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[File:Ox64_board.jpg|400px|thumb|right|The Ox64]]&lt;br /&gt;
&lt;br /&gt;
The '''Ox64''' is a RISC-V based Single Board Computer powered by Bouffalo Lab BL808 C906 64-Bit RISC-V CPU, 32-Bit CPU, embedded 64MB PSRAM memory and build-on 3 radio RF (Wifi, BT, Zigbee). It provides breadboard friendly form factor, MicroSD Card slot, USB 2.0, and many other peripheral interfaces for makers to integrate with sensors and other devices.&lt;br /&gt;
&lt;br /&gt;
[[File:RISC-V.png|600px|]]&lt;br /&gt;
&lt;br /&gt;
== Software Releases ==&lt;br /&gt;
&lt;br /&gt;
=== Quick Links to the Source of OS Images Build ===&lt;br /&gt;
&lt;br /&gt;
OS images are still in '''alpha build''' which are only fit for board bring up and testing purposes. &lt;br /&gt;
&lt;br /&gt;
* [https://github.com/bouffalolab/bl808_linux Linux for BL808]&lt;br /&gt;
* [https://wiki.pine64.org/wiki/File:Linux_BL808.pdf Installation Instructions for Linux on BL808 (Chinese)]&lt;br /&gt;
* [https://wiki.pine64.org/wiki/File:Linux_BL808_en.pdf Installation Instructions for Linux on BL808 (English Auto-Translation)]&lt;br /&gt;
* Toolchain:&lt;br /&gt;
** elf_newlib_toolchain/bin/riscv64-unknown-elf-gcc (Xuantie-900 elf newlib gcc Toolchain V2.2.5 B-20220323) 10.2.0&lt;br /&gt;
** linux_toolchain/bin/riscv64-unknown-linux-gnu-gcc (Xuantie-900 linux-5.10.4 glibc gcc Toolchain V2.2.4 B-20211227) 10.2.0&lt;br /&gt;
** cmake version 3.19.3&lt;br /&gt;
&lt;br /&gt;
=== Software Development Kits ===&lt;br /&gt;
* [https://github.com/bouffalolab/bl_mcu_sdk BL808 MCU SDK]&lt;br /&gt;
* [https://github.com/bouffalolab/bl808_linux/tree/main/opensbi-0.6-808 OpenSBI for BL808]&lt;br /&gt;
* [https://github.com/bouffalolab/bl808-pac Rust Peripheral Access Crate (PAC) for BL808]&lt;br /&gt;
* [https://github.com/bouffalolab/bl808-pac/blob/main/bl808.svd System View Description (SVD) for BL808]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== SoC and Memory Specification ==&lt;br /&gt;
* Based on [https://en.bouffalolab.com/product/ Bouffalo Lab BL808]&lt;br /&gt;
[[File:Bouffalo_Lab_icon.png|right]]&lt;br /&gt;
[[File:BL808_Block_Diagram.jpg|600px]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== CPU Architecture ===&lt;br /&gt;
* [https://www.t-head.cn/product/c906?lang=en T_head C906 480MHz 64-bit RISC-V CPU]&lt;br /&gt;
[[File:T-Head.png|right|200px]]&lt;br /&gt;
** Supports RISC-V RV64IMAFCV instruction architecture&lt;br /&gt;
** Five-stage single-issue sequentially executed pipeline&lt;br /&gt;
** Level-1 instruction and data cache of Harvard architecture, with a size of 32 KB and a cache line of 64B&lt;br /&gt;
** Sv39 memory management unit, realizing the conversion of virtual and real addresses and memory management&lt;br /&gt;
** jTLB that supports 128 entries&lt;br /&gt;
** Supports AXI 4.0 128-bit master interface&lt;br /&gt;
** Supports core local interrupt (CLINT) and platform-level interrupt controller (PLIC)&lt;br /&gt;
** With 80 external interrupt sources, 3 bits for configuring interrupt priority&lt;br /&gt;
** Supports BHT (8K) and BTB&lt;br /&gt;
** Compatible with RISC-V PMP, 8 configurable areas&lt;br /&gt;
** Supports hardware performance monitor (HPM) units&lt;br /&gt;
&lt;br /&gt;
* [https://www.t-head.cn/product/e907?lang=en T_head E907 320MHz 32-bit RISC-V CPU]&lt;br /&gt;
** Supports RISC-V RV32IMAFCP instruction set&lt;br /&gt;
** Supports RISC-V 32-bit/16-bit mixed instruction set&lt;br /&gt;
** Supports RISC-V machine mode and user mode&lt;br /&gt;
** Thirty-two 32-bit integer general purpose registers (GPR) and thirty-two 32-bit/64-bit floating-point GPRs&lt;br /&gt;
** Integer (5-stage)/floating-point (7-stage), single-issue, sequentially executed pipeline&lt;br /&gt;
** Supports AXI 4.0 main device interface and AHB 5.0 peripheral interface&lt;br /&gt;
** 32K instruction cache, two-way set associative structure&lt;br /&gt;
** 16K data cache, two-way set associative structure&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== System Memory ===&lt;br /&gt;
* Embedded 64MB PSRAM&lt;br /&gt;
&lt;br /&gt;
== Board Features ==&lt;br /&gt;
&lt;br /&gt;
=== Network ===&lt;br /&gt;
* 2.4GHz 1T1R WiFi 802.11 b/g/n&lt;br /&gt;
* Bluetooth 5.2&lt;br /&gt;
* Zigbee&lt;br /&gt;
* 10/100Mbps Ethernet (optional, on expansion board)&lt;br /&gt;
&lt;br /&gt;
=== Storage ===&lt;br /&gt;
* on-board 16Mb (2MB) or 128Mb (16MB) XSPI NOR flash memory&lt;br /&gt;
* microSD - supports SDHC and SDXC&lt;br /&gt;
&lt;br /&gt;
=== Expansion Ports ===&lt;br /&gt;
* USB 2.0 OTG port&lt;br /&gt;
* 26 GPIO Pins, including SPI, I2C and UART functionality. Possible I2S and GMII expansion&lt;br /&gt;
* Dual lane MiPi CSI port, located at USB-C port, for camera module&lt;br /&gt;
&lt;br /&gt;
=== Audio ===&lt;br /&gt;
* mic (optional, on camera module)&lt;br /&gt;
* speaker (optional, on camera module)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Board Information, Schematics and Certifications ==&lt;br /&gt;
* Baseboard Dimensions: 51mm x 21mm x 19mm x 3.5mm (Breadboard friendly)&lt;br /&gt;
* Input Power: 5V 0.5A microSD or USB-C port&lt;br /&gt;
* Schematic:&lt;br /&gt;
** [https://files.pine64.org/doc/ox64/PINE64_Ox64-Schematic-202221007.pdf Ox64 Schematic 20221007 v1.0]&lt;br /&gt;
** [https://files.pine64.org/doc/ox64/PINE64_Ox64_PCB_Placement-Top-20221007.pdf Ox64 PCB Component placement(ToP) 20221007 v1.0]&lt;br /&gt;
** [https://files.pine64.org/doc/ox64/PINE64_Ox64_PCB_Placement-Bottom-20221007.pdf Ox64 PCB Component placement(Bottom) 20221007 v1.0]&lt;br /&gt;
* Certifications:&lt;br /&gt;
** Disclaimer: Please note that PINE64 SBC is not a &amp;quot;final&amp;quot; product and in general certification is not necessary. However, PINE64 still submits the SBC for FCC, CE, and ROHS certifications and obtain the certificates to prove that the SBC board can pass the testing. Please note, a final commercial product needs to perform its own testing and obtain its own certificate.&lt;br /&gt;
** Not yet available&lt;br /&gt;
&lt;br /&gt;
== Datasheets for Components and Peripherals ==&lt;br /&gt;
* Bouffalo BL808 SoC information:&lt;br /&gt;
** [https://files.pine64.org/doc/datasheet/ox64/BL808_DS_en_1.1(open).pdf Bouffalo Lab BL808 SoC Datasheet]&lt;br /&gt;
** [https://files.pine64.org/doc/datasheet/ox64/BL808_RM_en_1.0(open).pdf Bouffalo Lab BL808 SoC Reference Manual]&lt;br /&gt;
* SPI NOR Flash information:&lt;br /&gt;
** [https://files.pine64.org/doc/datasheet/ox64/gd25lq16e_rev1.2_20210108.pdf GigaDevice 16Mb XSPI-Flash Datasheet]&lt;br /&gt;
** [https://files.pine64.org/doc/datasheet/star64/gd25lq128e_rev1.0_20210513.pdf GigaDevice 128Mb XSPI-Flash Datasheet]&lt;br /&gt;
* Power Regulator information:&lt;br /&gt;
** [https://files.pine64.org/doc/datasheet/ox64/IA2014-03.pdf Innovation Analog Tech IA2014 Step_down Converter Datasheet]&lt;br /&gt;
&lt;br /&gt;
== Articles and Blogs ==&lt;br /&gt;
* [https://www.robertlipe.com/bl808-not-symmetric/ First thoughts on the (a)symmetery of Bouffalo Labs BL808 as in Pine64’s Ox64]&lt;br /&gt;
* [https://gist.github.com/lupyuen/2087e9b3fb40aab5e0795bb02a265a3b Ox64 BL808 Notes by Marek &amp;quot;gamiee&amp;quot; Kraus]&lt;br /&gt;
&lt;br /&gt;
== Development Efforts ==&lt;br /&gt;
* [https://twitter.com/btashton/status/1579670569842536449?s=20&amp;amp;t=0aStWRwcXNQS7JWDd1UJcg Brennan Ashton is exploring Apache NuttX RTOS and OpenAMP (Asymmetric Multiprocessing) on BL808]&lt;br /&gt;
&lt;br /&gt;
[[Category:Ox64]] [[Category:Bouffalo BL808]]&lt;/div&gt;</summary>
		<author><name>Lupyuen</name></author>
	</entry>
	<entry>
		<id>https://wiki.pine64.org/index.php?title=Ox64&amp;diff=14529</id>
		<title>Ox64</title>
		<link rel="alternate" type="text/html" href="https://wiki.pine64.org/index.php?title=Ox64&amp;diff=14529"/>
		<updated>2022-10-21T04:58:32Z</updated>

		<summary type="html">&lt;p&gt;Lupyuen: Add BL808 Notes by Marek &amp;quot;gamiee&amp;quot; Kraus&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[File:Ox64_board.jpg|400px|thumb|right|The Ox64]]&lt;br /&gt;
&lt;br /&gt;
The '''Ox64''' is a RISC-V based Single Board Computer powered by Bouffalo Lab BL808 C906 64-Bit RISC-V CPU, 32-Bit CPU, embedded 64MB PSRAM memory and build-on 3 radio RF (Wifi, BT, Zigbee). It provides breadboard friendly form factor, MicroSD Card slot, USB 2.0, and many other peripheral interfaces for makers to integrate with sensors and other devices.&lt;br /&gt;
&lt;br /&gt;
[[File:RISC-V.png|600px|]]&lt;br /&gt;
&lt;br /&gt;
== Software Releases ==&lt;br /&gt;
&lt;br /&gt;
=== Quick Links to the Source of OS Images Build ===&lt;br /&gt;
&lt;br /&gt;
OS images are still in '''alpha build''' which are only fit for board bring up and testing purposes. &lt;br /&gt;
&lt;br /&gt;
* [https://github.com/bouffalolab/bl808_linux Linux for BL808]&lt;br /&gt;
* [https://wiki.pine64.org/wiki/File:Linux_BL808.pdf Installation Instructions for Linux on BL808 (Chinese)]&lt;br /&gt;
* [https://wiki.pine64.org/wiki/File:Linux_BL808_en.pdf Installation Instructions for Linux on BL808 (English Auto-Translation)]&lt;br /&gt;
* Toolchain:&lt;br /&gt;
** elf_newlib_toolchain/bin/riscv64-unknown-elf-gcc (Xuantie-900 elf newlib gcc Toolchain V2.2.5 B-20220323) 10.2.0&lt;br /&gt;
** linux_toolchain/bin/riscv64-unknown-linux-gnu-gcc (Xuantie-900 linux-5.10.4 glibc gcc Toolchain V2.2.4 B-20211227) 10.2.0&lt;br /&gt;
** cmake version 3.19.3&lt;br /&gt;
&lt;br /&gt;
=== Software Development Kits ===&lt;br /&gt;
* [https://github.com/bouffalolab/bl_mcu_sdk BL808 MCU SDK]&lt;br /&gt;
* [https://github.com/bouffalolab/bl808_linux/tree/main/opensbi-0.6-808 OpenSBI for BL808]&lt;br /&gt;
* [https://github.com/bouffalolab/bl808-pac Rust Peripheral Access Crate (PAC) for BL808]&lt;br /&gt;
* [https://github.com/bouffalolab/bl808-pac/blob/main/bl808.svd System View Description (SVD) for BL808]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== SoC and Memory Specification ==&lt;br /&gt;
* Based on [https://en.bouffalolab.com/product/ Bouffalo Lab BL808]&lt;br /&gt;
[[File:Bouffalo_Lab_icon.png|right]]&lt;br /&gt;
[[File:BL808_Block_Diagram.jpg|600px]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== CPU Architecture ===&lt;br /&gt;
* [https://www.t-head.cn/product/c906?lang=en T_head C906 480MHz 64-bit RISC-V CPU]&lt;br /&gt;
[[File:T-Head.png|right|200px]]&lt;br /&gt;
** Supports RISC-V RV64IMAFCV instruction architecture&lt;br /&gt;
** Five-stage single-issue sequentially executed pipeline&lt;br /&gt;
** Level-1 instruction and data cache of Harvard architecture, with a size of 32 KB and a cache line of 64B&lt;br /&gt;
** Sv39 memory management unit, realizing the conversion of virtual and real addresses and memory management&lt;br /&gt;
** jTLB that supports 128 entries&lt;br /&gt;
** Supports AXI 4.0 128-bit master interface&lt;br /&gt;
** Supports core local interrupt (CLINT) and platform-level interrupt controller (PLIC)&lt;br /&gt;
** With 80 external interrupt sources, 3 bits for configuring interrupt priority&lt;br /&gt;
** Supports BHT (8K) and BTB&lt;br /&gt;
** Compatible with RISC-V PMP, 8 configurable areas&lt;br /&gt;
** Supports hardware performance monitor (HPM) units&lt;br /&gt;
&lt;br /&gt;
* [https://www.t-head.cn/product/e907?lang=en T_head E907 320MHz 32-bit RISC-V CPU]&lt;br /&gt;
** Supports RISC-V RV32IMAFCP instruction set&lt;br /&gt;
** Supports RISC-V 32-bit/16-bit mixed instruction set&lt;br /&gt;
** Supports RISC-V machine mode and user mode&lt;br /&gt;
** Thirty-two 32-bit integer general purpose registers (GPR) and thirty-two 32-bit/64-bit floating-point GPRs&lt;br /&gt;
** Integer (5-stage)/floating-point (7-stage), single-issue, sequentially executed pipeline&lt;br /&gt;
** Supports AXI 4.0 main device interface and AHB 5.0 peripheral interface&lt;br /&gt;
** 32K instruction cache, two-way set associative structure&lt;br /&gt;
** 16K data cache, two-way set associative structure&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== System Memory ===&lt;br /&gt;
* Embedded 64MB PSRAM&lt;br /&gt;
&lt;br /&gt;
== Board Features ==&lt;br /&gt;
&lt;br /&gt;
=== Network ===&lt;br /&gt;
* 2.4GHz 1T1R WiFi 802.11 b/g/n&lt;br /&gt;
* Bluetooth 5.2&lt;br /&gt;
* Zigbee&lt;br /&gt;
* 10/100Mbps Ethernet (optional, on expansion board)&lt;br /&gt;
&lt;br /&gt;
=== Storage ===&lt;br /&gt;
* on-board 16Mb (2MB) or 128Mb (16MB) XSPI NOR flash memory&lt;br /&gt;
* microSD - supports SDHC and SDXC&lt;br /&gt;
&lt;br /&gt;
=== Expansion Ports ===&lt;br /&gt;
* USB 2.0 OTG port&lt;br /&gt;
* 26 GPIO Pins, including SPI, I2C and UART functionality. Possible I2S and GMII expansion&lt;br /&gt;
* Dual lane MiPi CSI port, located at USB-C port, for camera module&lt;br /&gt;
&lt;br /&gt;
=== Audio ===&lt;br /&gt;
* mic (optional, on camera module)&lt;br /&gt;
* speaker (optional, on camera module)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Board Information, Schematics and Certifications ==&lt;br /&gt;
* Baseboard Dimensions: 51mm x 21mm x 19mm x 3.5mm (Breadboard friendly)&lt;br /&gt;
* Input Power: 5V 0.5A microSD or USB-C port&lt;br /&gt;
* Schematic:&lt;br /&gt;
** [https://files.pine64.org/doc/ox64/PINE64_Ox64-Schematic-202221007.pdf Ox64 Schematic 20221007 v1.0]&lt;br /&gt;
** [https://files.pine64.org/doc/ox64/PINE64_Ox64_PCB_Placement-Top-20221007.pdf Ox64 PCB Component placement(ToP) 20221007 v1.0]&lt;br /&gt;
** [https://files.pine64.org/doc/ox64/PINE64_Ox64_PCB_Placement-Bottom-20221007.pdf Ox64 PCB Component placement(Bottom) 20221007 v1.0]&lt;br /&gt;
* Certifications:&lt;br /&gt;
** Disclaimer: Please note that PINE64 SBC is not a &amp;quot;final&amp;quot; product and in general certification is not necessary. However, PINE64 still submits the SBC for FCC, CE, and ROHS certifications and obtain the certificates to prove that the SBC board can pass the testing. Please note, a final commercial product needs to perform its own testing and obtain its own certificate.&lt;br /&gt;
** Not yet available&lt;br /&gt;
&lt;br /&gt;
== Datasheets for Components and Peripherals ==&lt;br /&gt;
* Bouffalo BL808 SoC information:&lt;br /&gt;
** [https://files.pine64.org/doc/datasheet/ox64/BL808_DS_en_1.1(open).pdf Bouffalo Lab BL808 SoC Datasheet]&lt;br /&gt;
** [https://files.pine64.org/doc/datasheet/ox64/BL808_RM_en_1.0(open).pdf Bouffalo Lab BL808 SoC Reference Manual]&lt;br /&gt;
* SPI NOR Flash information:&lt;br /&gt;
** [https://files.pine64.org/doc/datasheet/ox64/gd25lq16e_rev1.2_20210108.pdf GigaDevice 16Mb XSPI-Flash Datasheet]&lt;br /&gt;
** [https://files.pine64.org/doc/datasheet/star64/gd25lq128e_rev1.0_20210513.pdf GigaDevice 128Mb XSPI-Flash Datasheet]&lt;br /&gt;
* Power Regulator information:&lt;br /&gt;
** [https://files.pine64.org/doc/datasheet/ox64/IA2014-03.pdf Innovation Analog Tech IA2014 Step_down Converter Datasheet]&lt;br /&gt;
&lt;br /&gt;
== Articles and Blogs ==&lt;br /&gt;
* [https://www.robertlipe.com/bl808-not-symmetric/ First thoughts on the (a)symmetery of Bouffalo Labs BL808 as in Pine64’s Ox64]&lt;br /&gt;
* [https://gist.github.com/lupyuen/2087e9b3fb40aab5e0795bb02a265a3b BL808 Notes by Marek &amp;quot;gamiee&amp;quot; Kraus]&lt;br /&gt;
&lt;br /&gt;
== Development Efforts ==&lt;br /&gt;
* [https://twitter.com/btashton/status/1579670569842536449?s=20&amp;amp;t=0aStWRwcXNQS7JWDd1UJcg Brennan Ashton is exploring Apache NuttX RTOS and OpenAMP (Asymmetric Multiprocessing) on BL808]&lt;br /&gt;
&lt;br /&gt;
[[Category:Ox64]] [[Category:Bouffalo BL808]]&lt;/div&gt;</summary>
		<author><name>Lupyuen</name></author>
	</entry>
	<entry>
		<id>https://wiki.pine64.org/index.php?title=Ox64&amp;diff=14528</id>
		<title>Ox64</title>
		<link rel="alternate" type="text/html" href="https://wiki.pine64.org/index.php?title=Ox64&amp;diff=14528"/>
		<updated>2022-10-21T04:51:02Z</updated>

		<summary type="html">&lt;p&gt;Lupyuen: Update BL808 MCU SDK&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[File:Ox64_board.jpg|400px|thumb|right|The Ox64]]&lt;br /&gt;
&lt;br /&gt;
The '''Ox64''' is a RISC-V based Single Board Computer powered by Bouffalo Lab BL808 C906 64-Bit RISC-V CPU, 32-Bit CPU, embedded 64MB PSRAM memory and build-on 3 radio RF (Wifi, BT, Zigbee). It provides breadboard friendly form factor, MicroSD Card slot, USB 2.0, and many other peripheral interfaces for makers to integrate with sensors and other devices.&lt;br /&gt;
&lt;br /&gt;
[[File:RISC-V.png|600px|]]&lt;br /&gt;
&lt;br /&gt;
== Software Releases ==&lt;br /&gt;
&lt;br /&gt;
=== Quick Links to the Source of OS Images Build ===&lt;br /&gt;
&lt;br /&gt;
OS images are still in '''alpha build''' which are only fit for board bring up and testing purposes. &lt;br /&gt;
&lt;br /&gt;
* [https://github.com/bouffalolab/bl808_linux Linux for BL808]&lt;br /&gt;
* [https://wiki.pine64.org/wiki/File:Linux_BL808.pdf Installation Instructions for Linux on BL808 (Chinese)]&lt;br /&gt;
* [https://wiki.pine64.org/wiki/File:Linux_BL808_en.pdf Installation Instructions for Linux on BL808 (English Auto-Translation)]&lt;br /&gt;
* Toolchain:&lt;br /&gt;
** elf_newlib_toolchain/bin/riscv64-unknown-elf-gcc (Xuantie-900 elf newlib gcc Toolchain V2.2.5 B-20220323) 10.2.0&lt;br /&gt;
** linux_toolchain/bin/riscv64-unknown-linux-gnu-gcc (Xuantie-900 linux-5.10.4 glibc gcc Toolchain V2.2.4 B-20211227) 10.2.0&lt;br /&gt;
** cmake version 3.19.3&lt;br /&gt;
&lt;br /&gt;
=== Software Development Kits ===&lt;br /&gt;
* [https://github.com/bouffalolab/bl_mcu_sdk BL808 MCU SDK]&lt;br /&gt;
* [https://github.com/bouffalolab/bl808_linux/tree/main/opensbi-0.6-808 OpenSBI for BL808]&lt;br /&gt;
* [https://github.com/bouffalolab/bl808-pac Rust Peripheral Access Crate (PAC) for BL808]&lt;br /&gt;
* [https://github.com/bouffalolab/bl808-pac/blob/main/bl808.svd System View Description (SVD) for BL808]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== SoC and Memory Specification ==&lt;br /&gt;
* Based on [https://en.bouffalolab.com/product/ Bouffalo Lab BL808]&lt;br /&gt;
[[File:Bouffalo_Lab_icon.png|right]]&lt;br /&gt;
[[File:BL808_Block_Diagram.jpg|600px]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== CPU Architecture ===&lt;br /&gt;
* [https://www.t-head.cn/product/c906?lang=en T_head C906 480MHz 64-bit RISC-V CPU]&lt;br /&gt;
[[File:T-Head.png|right|200px]]&lt;br /&gt;
** Supports RISC-V RV64IMAFCV instruction architecture&lt;br /&gt;
** Five-stage single-issue sequentially executed pipeline&lt;br /&gt;
** Level-1 instruction and data cache of Harvard architecture, with a size of 32 KB and a cache line of 64B&lt;br /&gt;
** Sv39 memory management unit, realizing the conversion of virtual and real addresses and memory management&lt;br /&gt;
** jTLB that supports 128 entries&lt;br /&gt;
** Supports AXI 4.0 128-bit master interface&lt;br /&gt;
** Supports core local interrupt (CLINT) and platform-level interrupt controller (PLIC)&lt;br /&gt;
** With 80 external interrupt sources, 3 bits for configuring interrupt priority&lt;br /&gt;
** Supports BHT (8K) and BTB&lt;br /&gt;
** Compatible with RISC-V PMP, 8 configurable areas&lt;br /&gt;
** Supports hardware performance monitor (HPM) units&lt;br /&gt;
&lt;br /&gt;
* [https://www.t-head.cn/product/e907?lang=en T_head E907 320MHz 32-bit RISC-V CPU]&lt;br /&gt;
** Supports RISC-V RV32IMAFCP instruction set&lt;br /&gt;
** Supports RISC-V 32-bit/16-bit mixed instruction set&lt;br /&gt;
** Supports RISC-V machine mode and user mode&lt;br /&gt;
** Thirty-two 32-bit integer general purpose registers (GPR) and thirty-two 32-bit/64-bit floating-point GPRs&lt;br /&gt;
** Integer (5-stage)/floating-point (7-stage), single-issue, sequentially executed pipeline&lt;br /&gt;
** Supports AXI 4.0 main device interface and AHB 5.0 peripheral interface&lt;br /&gt;
** 32K instruction cache, two-way set associative structure&lt;br /&gt;
** 16K data cache, two-way set associative structure&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== System Memory ===&lt;br /&gt;
* Embedded 64MB PSRAM&lt;br /&gt;
&lt;br /&gt;
== Board Features ==&lt;br /&gt;
&lt;br /&gt;
=== Network ===&lt;br /&gt;
* 2.4GHz 1T1R WiFi 802.11 b/g/n&lt;br /&gt;
* Bluetooth 5.2&lt;br /&gt;
* Zigbee&lt;br /&gt;
* 10/100Mbps Ethernet (optional, on expansion board)&lt;br /&gt;
&lt;br /&gt;
=== Storage ===&lt;br /&gt;
* on-board 16Mb (2MB) or 128Mb (16MB) XSPI NOR flash memory&lt;br /&gt;
* microSD - supports SDHC and SDXC&lt;br /&gt;
&lt;br /&gt;
=== Expansion Ports ===&lt;br /&gt;
* USB 2.0 OTG port&lt;br /&gt;
* 26 GPIO Pins, including SPI, I2C and UART functionality. Possible I2S and GMII expansion&lt;br /&gt;
* Dual lane MiPi CSI port, located at USB-C port, for camera module&lt;br /&gt;
&lt;br /&gt;
=== Audio ===&lt;br /&gt;
* mic (optional, on camera module)&lt;br /&gt;
* speaker (optional, on camera module)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Board Information, Schematics and Certifications ==&lt;br /&gt;
* Baseboard Dimensions: 51mm x 21mm x 19mm x 3.5mm (Breadboard friendly)&lt;br /&gt;
* Input Power: 5V 0.5A microSD or USB-C port&lt;br /&gt;
* Schematic:&lt;br /&gt;
** [https://files.pine64.org/doc/ox64/PINE64_Ox64-Schematic-202221007.pdf Ox64 Schematic 20221007 v1.0]&lt;br /&gt;
** [https://files.pine64.org/doc/ox64/PINE64_Ox64_PCB_Placement-Top-20221007.pdf Ox64 PCB Component placement(ToP) 20221007 v1.0]&lt;br /&gt;
** [https://files.pine64.org/doc/ox64/PINE64_Ox64_PCB_Placement-Bottom-20221007.pdf Ox64 PCB Component placement(Bottom) 20221007 v1.0]&lt;br /&gt;
* Certifications:&lt;br /&gt;
** Disclaimer: Please note that PINE64 SBC is not a &amp;quot;final&amp;quot; product and in general certification is not necessary. However, PINE64 still submits the SBC for FCC, CE, and ROHS certifications and obtain the certificates to prove that the SBC board can pass the testing. Please note, a final commercial product needs to perform its own testing and obtain its own certificate.&lt;br /&gt;
** Not yet available&lt;br /&gt;
&lt;br /&gt;
== Datasheets for Components and Peripherals ==&lt;br /&gt;
* Bouffalo BL808 SoC information:&lt;br /&gt;
** [https://files.pine64.org/doc/datasheet/ox64/BL808_DS_en_1.1(open).pdf Bouffalo Lab BL808 SoC Datasheet]&lt;br /&gt;
** [https://files.pine64.org/doc/datasheet/ox64/BL808_RM_en_1.0(open).pdf Bouffalo Lab BL808 SoC Reference Manual]&lt;br /&gt;
* SPI NOR Flash information:&lt;br /&gt;
** [https://files.pine64.org/doc/datasheet/ox64/gd25lq16e_rev1.2_20210108.pdf GigaDevice 16Mb XSPI-Flash Datasheet]&lt;br /&gt;
** [https://files.pine64.org/doc/datasheet/star64/gd25lq128e_rev1.0_20210513.pdf GigaDevice 128Mb XSPI-Flash Datasheet]&lt;br /&gt;
* Power Regulator information:&lt;br /&gt;
** [https://files.pine64.org/doc/datasheet/ox64/IA2014-03.pdf Innovation Analog Tech IA2014 Step_down Converter Datasheet]&lt;br /&gt;
&lt;br /&gt;
== Articles and Blogs ==&lt;br /&gt;
* [https://www.robertlipe.com/bl808-not-symmetric/ First thoughts on the (a)symmetery of Bouffalo Labs BL808 as in Pine64’s Ox64]&lt;br /&gt;
&lt;br /&gt;
== Development Efforts ==&lt;br /&gt;
* [https://twitter.com/btashton/status/1579670569842536449?s=20&amp;amp;t=0aStWRwcXNQS7JWDd1UJcg Brennan Ashton is exploring Apache NuttX RTOS and OpenAMP (Asymmetric Multiprocessing) on BL808]&lt;br /&gt;
&lt;br /&gt;
[[Category:Ox64]] [[Category:Bouffalo BL808]]&lt;/div&gt;</summary>
		<author><name>Lupyuen</name></author>
	</entry>
	<entry>
		<id>https://wiki.pine64.org/index.php?title=Ox64&amp;diff=14500</id>
		<title>Ox64</title>
		<link rel="alternate" type="text/html" href="https://wiki.pine64.org/index.php?title=Ox64&amp;diff=14500"/>
		<updated>2022-10-17T00:07:11Z</updated>

		<summary type="html">&lt;p&gt;Lupyuen: Add NuttX and OpenAMP&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[File:Ox64_board.jpg|400px|thumb|right|The Ox64]]&lt;br /&gt;
&lt;br /&gt;
The '''Ox64''' is a RISC-V based Single Board Computer powered by Bouffalo Lab BL808 C906 64-Bit RISC-V CPU, 32-Bit CPU, embedded 64MB PSRAM memory and build-on 3 radio RF (Wifi, BT, Zigbee). It provides breadboard friendly form factor, MicroSD Card slot, USB 2.0, and many other peripheral interfaces for makers to integrate with sensors and other devices.&lt;br /&gt;
&lt;br /&gt;
[[File:RISC-V.png|600px|]]&lt;br /&gt;
&lt;br /&gt;
== Software Releases ==&lt;br /&gt;
&lt;br /&gt;
=== Quick Links to the Source of OS Images Build ===&lt;br /&gt;
&lt;br /&gt;
OS images are still in '''alpha build''' which are only fit for board bring up and testing purposes. &lt;br /&gt;
&lt;br /&gt;
* [https://github.com/bouffalolab/bl808_linux Linux for BL808]&lt;br /&gt;
* [https://wiki.pine64.org/wiki/File:Linux_BL808.pdf Installation Instructions for Linux on BL808 (Chinese)]&lt;br /&gt;
* [https://wiki.pine64.org/wiki/File:Linux_BL808_en.pdf Installation Instructions for Linux on BL808 (English Auto-Translation)]&lt;br /&gt;
* Toolchain:&lt;br /&gt;
** elf_newlib_toolchain/bin/riscv64-unknown-elf-gcc (Xuantie-900 elf newlib gcc Toolchain V2.2.5 B-20220323) 10.2.0&lt;br /&gt;
** linux_toolchain/bin/riscv64-unknown-linux-gnu-gcc (Xuantie-900 linux-5.10.4 glibc gcc Toolchain V2.2.4 B-20211227) 10.2.0&lt;br /&gt;
** cmake version 3.19.3&lt;br /&gt;
&lt;br /&gt;
=== Software Development Kits ===&lt;br /&gt;
* [https://github.com/bouffalolab/bl808_linux/tree/main/bl_mcu_sdk_bl808 BL808 MCU SDK]&lt;br /&gt;
* [https://github.com/bouffalolab/bl808_linux/tree/main/opensbi-0.6-808 OpenSBI for BL808]&lt;br /&gt;
* [https://github.com/bouffalolab/bl808-pac Rust Peripheral Access Crate (PAC) for BL808]&lt;br /&gt;
* [https://github.com/bouffalolab/bl808-pac/blob/main/bl808.svd System View Description (SVD) for BL808]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== SoC and Memory Specification ==&lt;br /&gt;
* Based on [https://en.bouffalolab.com/product/ Bouffalo Lab BL808]&lt;br /&gt;
[[File:Bouffalo_Lab_icon.png|right]]&lt;br /&gt;
[[File:BL808_Block_Diagram.jpg|600px]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== CPU Architecture ===&lt;br /&gt;
* [https://www.t-head.cn/product/c906?lang=en T_head C906 480MHz 64-bit RISC-V CPU]&lt;br /&gt;
[[File:T-Head.png|right|200px]]&lt;br /&gt;
** Supports RISC-V RV64IMAFCV instruction architecture&lt;br /&gt;
** Five-stage single-issue sequentially executed pipeline&lt;br /&gt;
** Level-1 instruction and data cache of Harvard architecture, with a size of 32 KB and a cache line of 64B&lt;br /&gt;
** Sv39 memory management unit, realizing the conversion of virtual and real addresses and memory management&lt;br /&gt;
** jTLB that supports 128 entries&lt;br /&gt;
** Supports AXI 4.0 128-bit master interface&lt;br /&gt;
** Supports core local interrupt (CLINT) and platform-level interrupt controller (PLIC)&lt;br /&gt;
** With 80 external interrupt sources, 3 bits for configuring interrupt priority&lt;br /&gt;
** Supports BHT (8K) and BTB&lt;br /&gt;
** Compatible with RISC-V PMP, 8 configurable areas&lt;br /&gt;
** Supports hardware performance monitor (HPM) units&lt;br /&gt;
&lt;br /&gt;
* [https://www.t-head.cn/product/e907?lang=en T_head E907 320MHz 32-bit RISC-V CPU]&lt;br /&gt;
** Supports RISC-V RV32IMAFCP instruction set&lt;br /&gt;
** Supports RISC-V 32-bit/16-bit mixed instruction set&lt;br /&gt;
** Supports RISC-V machine mode and user mode&lt;br /&gt;
** Thirty-two 32-bit integer general purpose registers (GPR) and thirty-two 32-bit/64-bit floating-point GPRs&lt;br /&gt;
** Integer (5-stage)/floating-point (7-stage), single-issue, sequentially executed pipeline&lt;br /&gt;
** Supports AXI 4.0 main device interface and AHB 5.0 peripheral interface&lt;br /&gt;
** 32K instruction cache, two-way set associative structure&lt;br /&gt;
** 16K data cache, two-way set associative structure&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== System Memory ===&lt;br /&gt;
* Embedded 64MB PSRAM&lt;br /&gt;
&lt;br /&gt;
== Board Features ==&lt;br /&gt;
&lt;br /&gt;
=== Network ===&lt;br /&gt;
* 2.4GHz 1T1R WiFi 802.11 b/g/n&lt;br /&gt;
* Bluetooth 5.2&lt;br /&gt;
* Zigbee&lt;br /&gt;
* 10/100Mbps Ethernet (optional, on expansion board)&lt;br /&gt;
&lt;br /&gt;
=== Storage ===&lt;br /&gt;
* on-board 16Mb (2MB) or 128Mb (16MB) XSPI NOR flash memory&lt;br /&gt;
* microSD - supports SDHC and SDXC&lt;br /&gt;
&lt;br /&gt;
=== Expansion Ports ===&lt;br /&gt;
* USB 2.0 OTG port&lt;br /&gt;
* 26 GPIO Pins, including SPI, I2C and UART functionality. Possible I2S and GMII expansion&lt;br /&gt;
* Dual lane MiPi CSI port, located at USB-C port, for camera module&lt;br /&gt;
&lt;br /&gt;
=== Audio ===&lt;br /&gt;
* mic (optional, on camera module)&lt;br /&gt;
* speaker (optional, on camera module)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Board Information, Schematics and Certifications ==&lt;br /&gt;
* Baseboard Dimensions: 51mm x 21mm x 19mm x 3.5mm (Breadboard friendly)&lt;br /&gt;
* Input Power: 5V 0.5A microSD or USB-C port&lt;br /&gt;
* Schematic:&lt;br /&gt;
** [https://files.pine64.org/doc/ox64/PINE64_Ox64-Schematic-202221007.pdf Ox64 Schematic 20221007 v1.0]&lt;br /&gt;
** [https://files.pine64.org/doc/ox64/PINE64_Ox64_PCB_Placement-Top-20221007.pdf Ox64 PCB Component placement(ToP) 20221007 v1.0]&lt;br /&gt;
** [https://files.pine64.org/doc/ox64/PINE64_Ox64_PCB_Placement-Bottom-20221007.pdf Ox64 PCB Component placement(Bottom) 20221007 v1.0]&lt;br /&gt;
* Certifications:&lt;br /&gt;
** Disclaimer: Please note that PINE64 SBC is not a &amp;quot;final&amp;quot; product and in general certification is not necessary. However, PINE64 still submits the SBC for FCC, CE, and ROHS certifications and obtain the certificates to prove that the SBC board can pass the testing. Please note, a final commercial product needs to perform its own testing and obtain its own certificate.&lt;br /&gt;
** Not yet available&lt;br /&gt;
&lt;br /&gt;
== Datasheets for Components and Peripherals ==&lt;br /&gt;
* Bouffalo BL808 SoC information:&lt;br /&gt;
** [https://files.pine64.org/doc/datasheet/ox64/BL808_DS_en_1.1(open).pdf Bouffalo Lab BL808 SoC Datasheet]&lt;br /&gt;
** [https://files.pine64.org/doc/datasheet/ox64/BL808_RM_en_1.0(open).pdf Bouffalo Lab BL808 SoC Reference Manual]&lt;br /&gt;
* SPI NOR Flash information:&lt;br /&gt;
** [https://files.pine64.org/doc/datasheet/ox64/gd25lq16e_rev1.2_20210108.pdf GigaDevice 16Mb XSPI-Flash Datasheet]&lt;br /&gt;
** [https://files.pine64.org/doc/datasheet/star64/gd25lq128e_rev1.0_20210513.pdf GigaDevice 128Mb XSPI-Flash Datasheet]&lt;br /&gt;
* Power Regulator information:&lt;br /&gt;
** [https://files.pine64.org/doc/datasheet/ox64/IA2014-03.pdf Innovation Analog Tech IA2014 Step_down Converter Datasheet]&lt;br /&gt;
&lt;br /&gt;
== Articles and Blogs ==&lt;br /&gt;
* [https://www.robertlipe.com/bl808-not-symmetric/ First thoughts on the (a)symmetery of Bouffalo Labs BL808 as in Pine64’s Ox64]&lt;br /&gt;
&lt;br /&gt;
== Development Efforts ==&lt;br /&gt;
* [https://twitter.com/btashton/status/1579670569842536449?s=20&amp;amp;t=0aStWRwcXNQS7JWDd1UJcg Brennan Ashton is exploring Apache NuttX RTOS and OpenAMP (Asymmetric Multiprocessing) on BL808]&lt;br /&gt;
&lt;br /&gt;
[[Category:Ox64]] [[Category:Bouffalo BL808]]&lt;/div&gt;</summary>
		<author><name>Lupyuen</name></author>
	</entry>
	<entry>
		<id>https://wiki.pine64.org/index.php?title=Ox64&amp;diff=14490</id>
		<title>Ox64</title>
		<link rel="alternate" type="text/html" href="https://wiki.pine64.org/index.php?title=Ox64&amp;diff=14490"/>
		<updated>2022-10-16T04:05:57Z</updated>

		<summary type="html">&lt;p&gt;Lupyuen: Add English Auto-Translation of Linux on BL808 doc&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[File:Ox64_board.jpg|400px|thumb|right|The Ox64]]&lt;br /&gt;
&lt;br /&gt;
The '''Ox64''' is a RISC-V based Single Board Computer powered by Bouffalo Lab BL808 C906 64-Bit RISC-V CPU, 32-Bit CPU, embedded 64MB PSRAM memory and build-on 3 radio RF (Wifi, BT, Zigbee). It provides breadboard friendly form factor, MicroSD Card slot, USB 2.0, and many other peripheral interfaces for makers to integrate with sensors and other devices.&lt;br /&gt;
&lt;br /&gt;
[[File:RISC-V.png|600px|]]&lt;br /&gt;
&lt;br /&gt;
== Software Releases ==&lt;br /&gt;
&lt;br /&gt;
=== Quick Links to the Source of OS Images Build ===&lt;br /&gt;
&lt;br /&gt;
OS images are still in '''alpha build''' which are only fit for board bring up and testing purposes. &lt;br /&gt;
&lt;br /&gt;
* [https://github.com/bouffalolab/bl808_linux Linux for BL808]&lt;br /&gt;
* [https://wiki.pine64.org/wiki/File:Linux_BL808.pdf Installation Instructions for Linux on BL808 (Chinese)]&lt;br /&gt;
* [https://wiki.pine64.org/wiki/File:Linux_BL808_en.pdf Installation Instructions for Linux on BL808 (English Auto-Translation)]&lt;br /&gt;
* Toolchain:&lt;br /&gt;
** elf_newlib_toolchain/bin/riscv64-unknown-elf-gcc (Xuantie-900 elf newlib gcc Toolchain V2.2.5 B-20220323) 10.2.0&lt;br /&gt;
** linux_toolchain/bin/riscv64-unknown-linux-gnu-gcc (Xuantie-900 linux-5.10.4 glibc gcc Toolchain V2.2.4 B-20211227) 10.2.0&lt;br /&gt;
** cmake version 3.19.3&lt;br /&gt;
&lt;br /&gt;
=== Software Development Kits ===&lt;br /&gt;
* [https://github.com/bouffalolab/bl808_linux/tree/main/bl_mcu_sdk_bl808 BL808 MCU SDK]&lt;br /&gt;
* [https://github.com/bouffalolab/bl808_linux/tree/main/opensbi-0.6-808 OpenSBI for BL808]&lt;br /&gt;
* [https://github.com/bouffalolab/bl808-pac Rust Peripheral Access Crate (PAC) for BL808]&lt;br /&gt;
* [https://github.com/bouffalolab/bl808-pac/blob/main/bl808.svd System View Description (SVD) for BL808]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== SoC and Memory Specification ==&lt;br /&gt;
* Based on [https://en.bouffalolab.com/product/ Bouffalo Lab BL808]&lt;br /&gt;
[[File:Bouffalo_Lab_icon.png|right]]&lt;br /&gt;
[[File:BL808_Block_Diagram.jpg|600px]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== CPU Architecture ===&lt;br /&gt;
* [https://www.t-head.cn/product/c906?lang=en T_head C906 480MHz 64-bit RISC-V CPU]&lt;br /&gt;
[[File:T-Head.png|right|200px]]&lt;br /&gt;
** Supports RISC-V RV64IMAFCV instruction architecture&lt;br /&gt;
** Five-stage single-issue sequentially executed pipeline&lt;br /&gt;
** Level-1 instruction and data cache of Harvard architecture, with a size of 32 KB and a cache line of 64B&lt;br /&gt;
** Sv39 memory management unit, realizing the conversion of virtual and real addresses and memory management&lt;br /&gt;
** jTLB that supports 128 entries&lt;br /&gt;
** Supports AXI 4.0 128-bit master interface&lt;br /&gt;
** Supports core local interrupt (CLINT) and platform-level interrupt controller (PLIC)&lt;br /&gt;
** With 80 external interrupt sources, 3 bits for configuring interrupt priority&lt;br /&gt;
** Supports BHT (8K) and BTB&lt;br /&gt;
** Compatible with RISC-V PMP, 8 configurable areas&lt;br /&gt;
** Supports hardware performance monitor (HPM) units&lt;br /&gt;
&lt;br /&gt;
* [https://www.t-head.cn/product/e907?lang=en T_head E907 320MHz 32-bit RISC-V CPU]&lt;br /&gt;
** Supports RISC-V RV32IMAFCP instruction set&lt;br /&gt;
** Supports RISC-V 32-bit/16-bit mixed instruction set&lt;br /&gt;
** Supports RISC-V machine mode and user mode&lt;br /&gt;
** Thirty-two 32-bit integer general purpose registers (GPR) and thirty-two 32-bit/64-bit floating-point GPRs&lt;br /&gt;
** Integer (5-stage)/floating-point (7-stage), single-issue, sequentially executed pipeline&lt;br /&gt;
** Supports AXI 4.0 main device interface and AHB 5.0 peripheral interface&lt;br /&gt;
** 32K instruction cache, two-way set associative structure&lt;br /&gt;
** 16K data cache, two-way set associative structure&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== System Memory ===&lt;br /&gt;
* Embedded 64MB PSRAM&lt;br /&gt;
&lt;br /&gt;
== Board Features ==&lt;br /&gt;
&lt;br /&gt;
=== Network ===&lt;br /&gt;
* 2.4GHz 1T1R WiFi 802.11 b/g/n&lt;br /&gt;
* Bluetooth 5.2&lt;br /&gt;
* Zigbee&lt;br /&gt;
* 10/100Mbps Ethernet (optional, on expansion board)&lt;br /&gt;
&lt;br /&gt;
=== Storage ===&lt;br /&gt;
* on-board 16Mb (2MB) or 128Mb (16MB) XSPI NOR flash memory&lt;br /&gt;
* microSD - supports SDHC and SDXC&lt;br /&gt;
&lt;br /&gt;
=== Expansion Ports ===&lt;br /&gt;
* USB 2.0 OTG port&lt;br /&gt;
* 26 GPIO Pins, including SPI, I2C and UART functionality. Possible I2S and GMII expansion&lt;br /&gt;
* Dual lane MiPi CSI port, located at USB-C port, for camera module&lt;br /&gt;
&lt;br /&gt;
=== Audio ===&lt;br /&gt;
* mic (optional, on camera module)&lt;br /&gt;
* speaker (optional, on camera module)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Board Information, Schematics and Certifications ==&lt;br /&gt;
* Baseboard Dimensions: 51mm x 21mm x 19mm x 3.5mm (Breadboard friendly)&lt;br /&gt;
* Input Power: 5V 0.5A microSD or USB-C port&lt;br /&gt;
* Schematic:&lt;br /&gt;
** [https://files.pine64.org/doc/ox64/PINE64_Ox64-Schematic-202221007.pdf Ox64 Schematic 20221007 v1.0]&lt;br /&gt;
** [https://files.pine64.org/doc/ox64/PINE64_Ox64_PCB_Placement-Top-20221007.pdf Ox64 PCB Component placement(ToP) 20221007 v1.0]&lt;br /&gt;
** [https://files.pine64.org/doc/ox64/PINE64_Ox64_PCB_Placement-Bottom-20221007.pdf Ox64 PCB Component placement(Bottom) 20221007 v1.0]&lt;br /&gt;
* Certifications:&lt;br /&gt;
** Disclaimer: Please note that PINE64 SBC is not a &amp;quot;final&amp;quot; product and in general certification is not necessary. However, PINE64 still submits the SBC for FCC, CE, and ROHS certifications and obtain the certificates to prove that the SBC board can pass the testing. Please note, a final commercial product needs to perform its own testing and obtain its own certificate.&lt;br /&gt;
** Not yet available&lt;br /&gt;
&lt;br /&gt;
== Datasheets for Components and Peripherals ==&lt;br /&gt;
* Bouffalo BL808 SoC information:&lt;br /&gt;
** [https://files.pine64.org/doc/datasheet/ox64/BL808_DS_en_1.1(open).pdf Bouffalo Lab BL808 SoC Datasheet]&lt;br /&gt;
** [https://files.pine64.org/doc/datasheet/ox64/BL808_RM_en_1.0(open).pdf Bouffalo Lab BL808 SoC Reference Manual]&lt;br /&gt;
* SPI NOR Flash information:&lt;br /&gt;
** [https://files.pine64.org/doc/datasheet/ox64/gd25lq16e_rev1.2_20210108.pdf GigaDevice 16Mb XSPI-Flash Datasheet]&lt;br /&gt;
** [https://files.pine64.org/doc/datasheet/star64/gd25lq128e_rev1.0_20210513.pdf GigaDevice 128Mb XSPI-Flash Datasheet]&lt;br /&gt;
* Power Regulator information:&lt;br /&gt;
** [https://files.pine64.org/doc/datasheet/ox64/IA2014-03.pdf Innovation Analog Tech IA2014 Step_down Converter Datasheet]&lt;br /&gt;
&lt;br /&gt;
== Articles and Blogs ==&lt;br /&gt;
* [https://www.robertlipe.com/bl808-not-symmetric/ First thoughts on the (a)symmetery of Bouffalo Labs BL808 as in Pine64’s Ox64]&lt;br /&gt;
&lt;br /&gt;
[[Category:Ox64]] [[Category:Bouffalo BL808]]&lt;/div&gt;</summary>
		<author><name>Lupyuen</name></author>
	</entry>
	<entry>
		<id>https://wiki.pine64.org/index.php?title=File:Linux_BL808_en.pdf&amp;diff=14489</id>
		<title>File:Linux BL808 en.pdf</title>
		<link rel="alternate" type="text/html" href="https://wiki.pine64.org/index.php?title=File:Linux_BL808_en.pdf&amp;diff=14489"/>
		<updated>2022-10-16T04:03:06Z</updated>

		<summary type="html">&lt;p&gt;Lupyuen: Installation Instructions for Linux on BL808, auto-translated by DeepL. Provided by JF&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Summary ==&lt;br /&gt;
Installation Instructions for Linux on BL808, auto-translated by DeepL. Provided by JF&lt;/div&gt;</summary>
		<author><name>Lupyuen</name></author>
	</entry>
	<entry>
		<id>https://wiki.pine64.org/index.php?title=Ox64&amp;diff=14475</id>
		<title>Ox64</title>
		<link rel="alternate" type="text/html" href="https://wiki.pine64.org/index.php?title=Ox64&amp;diff=14475"/>
		<updated>2022-10-15T00:33:24Z</updated>

		<summary type="html">&lt;p&gt;Lupyuen: Fix typo in GigaDevice&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[File:Ox64_board.jpg|400px|thumb|right|The Ox64]]&lt;br /&gt;
&lt;br /&gt;
The '''Ox64''' is a RISC-V based Single Board Computer powered by Bouffalo Lab BL808 C906 64-Bit RISC-V CPU, 32-Bit CPU, embedded 64MB PSRAM memory and build-on 3 radio RF (Wifi, BT, Zigbee). It provides breadboard friendly form factor, MicroSD Card slot, USB 2.0, and many other peripheral interfaces for makers to integrate with sensors and other devices.&lt;br /&gt;
&lt;br /&gt;
[[File:RISC-V.png|600px|]]&lt;br /&gt;
&lt;br /&gt;
== Software Releases ==&lt;br /&gt;
&lt;br /&gt;
=== Quick Links to the Source of OS Images Build ===&lt;br /&gt;
&lt;br /&gt;
OS images are still in '''alpha build''' which are only fit for board bring up and testing purposes. &lt;br /&gt;
&lt;br /&gt;
* [https://github.com/bouffalolab/bl808_linux Linux for BL808]&lt;br /&gt;
* [https://wiki.pine64.org/wiki/File:Linux_BL808.pdf Installation Instructions for Linux on BL808 (Chinese)]&lt;br /&gt;
* Toolchain:&lt;br /&gt;
** elf_newlib_toolchain/bin/riscv64-unknown-elf-gcc (Xuantie-900 elf newlib gcc Toolchain V2.2.5 B-20220323) 10.2.0&lt;br /&gt;
** linux_toolchain/bin/riscv64-unknown-linux-gnu-gcc (Xuantie-900 linux-5.10.4 glibc gcc Toolchain V2.2.4 B-20211227) 10.2.0&lt;br /&gt;
** cmake version 3.19.3&lt;br /&gt;
&lt;br /&gt;
=== Software Development Kits ===&lt;br /&gt;
* [https://github.com/bouffalolab/bl808_linux/tree/main/bl_mcu_sdk_bl808 BL808 MCU SDK]&lt;br /&gt;
* [https://github.com/bouffalolab/bl808_linux/tree/main/opensbi-0.6-808 OpenSBI for BL808]&lt;br /&gt;
* [https://github.com/bouffalolab/bl808-pac Rust Peripheral Access Crate (PAC) for BL808]&lt;br /&gt;
* [https://github.com/bouffalolab/bl808-pac/blob/main/bl808.svd System View Description (SVD) for BL808]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== SoC and Memory Specification ==&lt;br /&gt;
* Based on [https://en.bouffalolab.com/product/ Bouffalo Lab BL808]&lt;br /&gt;
[[File:Bouffalo_Lab_icon.png|right]]&lt;br /&gt;
[[File:BL808_Block_Diagram.jpg|600px]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== CPU Architecture ===&lt;br /&gt;
* [https://www.t-head.cn/product/c906?lang=en T_head C906 480MHz 64-bit RISC-V CPU]&lt;br /&gt;
[[File:T-Head.png|right|200px]]&lt;br /&gt;
** Supports RISC-V RV64IMAFCV instruction architecture&lt;br /&gt;
** Five-stage single-issue sequentially executed pipeline&lt;br /&gt;
** Level-1 instruction and data cache of Harvard architecture, with a size of 32 KB and a cache line of 64B&lt;br /&gt;
** Sv39 memory management unit, realizing the conversion of virtual and real addresses and memory management&lt;br /&gt;
** jTLB that supports 128 entries&lt;br /&gt;
** Supports AXI 4.0 128-bit master interface&lt;br /&gt;
** Supports core local interrupt (CLINT) and platform-level interrupt controller (PLIC)&lt;br /&gt;
** With 80 external interrupt sources, 3 bits for configuring interrupt priority&lt;br /&gt;
** Supports BHT (8K) and BTB&lt;br /&gt;
** Compatible with RISC-V PMP, 8 configurable areas&lt;br /&gt;
** Supports hardware performance monitor (HPM) units&lt;br /&gt;
&lt;br /&gt;
* [https://www.t-head.cn/product/e907?lang=en T_head E907 320MHz 32-bit RISC-V CPU]&lt;br /&gt;
** Supports RISC-V RV32IMAFCP instruction set&lt;br /&gt;
** Supports RISC-V 32-bit/16-bit mixed instruction set&lt;br /&gt;
** Supports RISC-V machine mode and user mode&lt;br /&gt;
** Thirty-two 32-bit integer general purpose registers (GPR) and thirty-two 32-bit/64-bit floating-point GPRs&lt;br /&gt;
** Integer (5-stage)/floating-point (7-stage), single-issue, sequentially executed pipeline&lt;br /&gt;
** Supports AXI 4.0 main device interface and AHB 5.0 peripheral interface&lt;br /&gt;
** 32K instruction cache, two-way set associative structure&lt;br /&gt;
** 16K data cache, two-way set associative structure&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== System Memory ===&lt;br /&gt;
* Embedded 64MB PSRAM&lt;br /&gt;
&lt;br /&gt;
== Board Features ==&lt;br /&gt;
&lt;br /&gt;
=== Network ===&lt;br /&gt;
* 2.4GHz 1T1R WiFi 802.11 b/g/n&lt;br /&gt;
* Bluetooth 5.2&lt;br /&gt;
* Zigbee&lt;br /&gt;
* 10/100Mbps Ethernet (optional, on expansion board)&lt;br /&gt;
&lt;br /&gt;
=== Storage ===&lt;br /&gt;
* on-board 16Mb (2MB) or 128Mb (16MB) XSPI NOR flash memory&lt;br /&gt;
* microSD - supports SDHC and SDXC&lt;br /&gt;
&lt;br /&gt;
=== Expansion Ports ===&lt;br /&gt;
* USB 2.0 OTG port&lt;br /&gt;
* 26 GPIO Pins, including SPI, I2C and UART functionality. Possible I2S and GMII expansion&lt;br /&gt;
* Dual lane MiPi CSI port, located at USB-C port, for camera module&lt;br /&gt;
&lt;br /&gt;
=== Audio ===&lt;br /&gt;
* mic (optional, on camera module)&lt;br /&gt;
* speaker (optional, on camera module)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Board Information, Schematics and Certifications ==&lt;br /&gt;
* Baseboard Dimensions: 51mm x 21mm x 19mm x 3.5mm (Breadboard friendly)&lt;br /&gt;
* Input Power: 5V 0.5A microSD or USB-C port&lt;br /&gt;
* Schematic:&lt;br /&gt;
** [https://files.pine64.org/doc/ox64/PINE64_Ox64-Schematic-202221007.pdf Ox64 Schematic 20221007 v1.0]&lt;br /&gt;
** [https://files.pine64.org/doc/ox64/PINE64_Ox64_PCB_Placement-Top-20221007.pdf Ox64 PCB Component placement(ToP) 20221007 v1.0]&lt;br /&gt;
** [https://files.pine64.org/doc/ox64/PINE64_Ox64_PCB_Placement-Bottom-20221007.pdf Ox64 PCB Component placement(Bottom) 20221007 v1.0]&lt;br /&gt;
* Certifications:&lt;br /&gt;
** Disclaimer: Please note that PINE64 SBC is not a &amp;quot;final&amp;quot; product and in general certification is not necessary. However, PINE64 still submits the SBC for FCC, CE, and ROHS certifications and obtain the certificates to prove that the SBC board can pass the testing. Please note, a final commercial product needs to perform its own testing and obtain its own certificate.&lt;br /&gt;
** Not yet available&lt;br /&gt;
&lt;br /&gt;
== Datasheets for Components and Peripherals ==&lt;br /&gt;
* Bouffalo BL808 SoC information:&lt;br /&gt;
** [https://files.pine64.org/doc/datasheet/ox64/BL808_DS_en_1.1(open).pdf Bouffalo Lab BL808 SoC Datasheet]&lt;br /&gt;
** [https://files.pine64.org/doc/datasheet/ox64/BL808_RM_en_1.0(open).pdf Bouffalo Lab BL808 SoC Reference Manual]&lt;br /&gt;
* SPI NOR Flash information:&lt;br /&gt;
** [https://files.pine64.org/doc/datasheet/ox64/gd25lq16e_rev1.2_20210108.pdf GigaDevice 16Mb XSPI-Flash Datasheet]&lt;br /&gt;
** [https://files.pine64.org/doc/datasheet/star64/gd25lq128e_rev1.0_20210513.pdf GigaDevice 128Mb XSPI-Flash Datasheet]&lt;br /&gt;
* Power Regulator information:&lt;br /&gt;
** [https://files.pine64.org/doc/datasheet/ox64/IA2014-03.pdf Innovation Analog Tech IA2014 Step_down Converter Datasheet]&lt;br /&gt;
&lt;br /&gt;
== Articles and Blogs ==&lt;br /&gt;
* [https://www.robertlipe.com/bl808-not-symmetric/ First thoughts on the (a)symmetery of Bouffalo Labs BL808 as in Pine64’s Ox64]&lt;br /&gt;
&lt;br /&gt;
[[Category:Ox64]] [[Category:Bouffalo BL808]]&lt;/div&gt;</summary>
		<author><name>Lupyuen</name></author>
	</entry>
	<entry>
		<id>https://wiki.pine64.org/index.php?title=Ox64&amp;diff=14474</id>
		<title>Ox64</title>
		<link rel="alternate" type="text/html" href="https://wiki.pine64.org/index.php?title=Ox64&amp;diff=14474"/>
		<updated>2022-10-15T00:19:39Z</updated>

		<summary type="html">&lt;p&gt;Lupyuen: Add BL808 Toolchain&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[File:Ox64_board.jpg|400px|thumb|right|The Ox64]]&lt;br /&gt;
&lt;br /&gt;
The '''Ox64''' is a RISC-V based Single Board Computer powered by Bouffalo Lab BL808 C906 64-Bit RISC-V CPU, 32-Bit CPU, embedded 64MB PSRAM memory and build-on 3 radio RF (Wifi, BT, Zigbee). It provides breadboard friendly form factor, MicroSD Card slot, USB 2.0, and many other peripheral interfaces for makers to integrate with sensors and other devices.&lt;br /&gt;
&lt;br /&gt;
[[File:RISC-V.png|600px|]]&lt;br /&gt;
&lt;br /&gt;
== Software Releases ==&lt;br /&gt;
&lt;br /&gt;
=== Quick Links to the Source of OS Images Build ===&lt;br /&gt;
&lt;br /&gt;
OS images are still in '''alpha build''' which are only fit for board bring up and testing purposes. &lt;br /&gt;
&lt;br /&gt;
* [https://github.com/bouffalolab/bl808_linux Linux for BL808]&lt;br /&gt;
* [https://wiki.pine64.org/wiki/File:Linux_BL808.pdf Installation Instructions for Linux on BL808 (Chinese)]&lt;br /&gt;
* Toolchain:&lt;br /&gt;
** elf_newlib_toolchain/bin/riscv64-unknown-elf-gcc (Xuantie-900 elf newlib gcc Toolchain V2.2.5 B-20220323) 10.2.0&lt;br /&gt;
** linux_toolchain/bin/riscv64-unknown-linux-gnu-gcc (Xuantie-900 linux-5.10.4 glibc gcc Toolchain V2.2.4 B-20211227) 10.2.0&lt;br /&gt;
** cmake version 3.19.3&lt;br /&gt;
&lt;br /&gt;
=== Software Development Kits ===&lt;br /&gt;
* [https://github.com/bouffalolab/bl808_linux/tree/main/bl_mcu_sdk_bl808 BL808 MCU SDK]&lt;br /&gt;
* [https://github.com/bouffalolab/bl808_linux/tree/main/opensbi-0.6-808 OpenSBI for BL808]&lt;br /&gt;
* [https://github.com/bouffalolab/bl808-pac Rust Peripheral Access Crate (PAC) for BL808]&lt;br /&gt;
* [https://github.com/bouffalolab/bl808-pac/blob/main/bl808.svd System View Description (SVD) for BL808]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== SoC and Memory Specification ==&lt;br /&gt;
* Based on [https://en.bouffalolab.com/product/ Bouffalo Lab BL808]&lt;br /&gt;
[[File:Bouffalo_Lab_icon.png|right]]&lt;br /&gt;
[[File:BL808_Block_Diagram.jpg|600px]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== CPU Architecture ===&lt;br /&gt;
* [https://www.t-head.cn/product/c906?lang=en T_head C906 480MHz 64-bit RISC-V CPU]&lt;br /&gt;
[[File:T-Head.png|right|200px]]&lt;br /&gt;
** Supports RISC-V RV64IMAFCV instruction architecture&lt;br /&gt;
** Five-stage single-issue sequentially executed pipeline&lt;br /&gt;
** Level-1 instruction and data cache of Harvard architecture, with a size of 32 KB and a cache line of 64B&lt;br /&gt;
** Sv39 memory management unit, realizing the conversion of virtual and real addresses and memory management&lt;br /&gt;
** jTLB that supports 128 entries&lt;br /&gt;
** Supports AXI 4.0 128-bit master interface&lt;br /&gt;
** Supports core local interrupt (CLINT) and platform-level interrupt controller (PLIC)&lt;br /&gt;
** With 80 external interrupt sources, 3 bits for configuring interrupt priority&lt;br /&gt;
** Supports BHT (8K) and BTB&lt;br /&gt;
** Compatible with RISC-V PMP, 8 configurable areas&lt;br /&gt;
** Supports hardware performance monitor (HPM) units&lt;br /&gt;
&lt;br /&gt;
* [https://www.t-head.cn/product/e907?lang=en T_head E907 320MHz 32-bit RISC-V CPU]&lt;br /&gt;
** Supports RISC-V RV32IMAFCP instruction set&lt;br /&gt;
** Supports RISC-V 32-bit/16-bit mixed instruction set&lt;br /&gt;
** Supports RISC-V machine mode and user mode&lt;br /&gt;
** Thirty-two 32-bit integer general purpose registers (GPR) and thirty-two 32-bit/64-bit floating-point GPRs&lt;br /&gt;
** Integer (5-stage)/floating-point (7-stage), single-issue, sequentially executed pipeline&lt;br /&gt;
** Supports AXI 4.0 main device interface and AHB 5.0 peripheral interface&lt;br /&gt;
** 32K instruction cache, two-way set associative structure&lt;br /&gt;
** 16K data cache, two-way set associative structure&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== System Memory ===&lt;br /&gt;
* Embedded 64MB PSRAM&lt;br /&gt;
&lt;br /&gt;
== Board Features ==&lt;br /&gt;
&lt;br /&gt;
=== Network ===&lt;br /&gt;
* 2.4GHz 1T1R WiFi 802.11 b/g/n&lt;br /&gt;
* Bluetooth 5.2&lt;br /&gt;
* Zigbee&lt;br /&gt;
* 10/100Mbps Ethernet (optional, on expansion board)&lt;br /&gt;
&lt;br /&gt;
=== Storage ===&lt;br /&gt;
* on-board 16Mb (2MB) or 128Mb (16MB) XSPI NOR flash memory&lt;br /&gt;
* microSD - supports SDHC and SDXC&lt;br /&gt;
&lt;br /&gt;
=== Expansion Ports ===&lt;br /&gt;
* USB 2.0 OTG port&lt;br /&gt;
* 26 GPIO Pins, including SPI, I2C and UART functionality. Possible I2S and GMII expansion&lt;br /&gt;
* Dual lane MiPi CSI port, located at USB-C port, for camera module&lt;br /&gt;
&lt;br /&gt;
=== Audio ===&lt;br /&gt;
* mic (optional, on camera module)&lt;br /&gt;
* speaker (optional, on camera module)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Board Information, Schematics and Certifications ==&lt;br /&gt;
* Baseboard Dimensions: 51mm x 21mm x 19mm x 3.5mm (Breadboard friendly)&lt;br /&gt;
* Input Power: 5V 0.5A microSD or USB-C port&lt;br /&gt;
* Schematic:&lt;br /&gt;
** [https://files.pine64.org/doc/ox64/PINE64_Ox64-Schematic-202221007.pdf Ox64 Schematic 20221007 v1.0]&lt;br /&gt;
** [https://files.pine64.org/doc/ox64/PINE64_Ox64_PCB_Placement-Top-20221007.pdf Ox64 PCB Component placement(ToP) 20221007 v1.0]&lt;br /&gt;
** [https://files.pine64.org/doc/ox64/PINE64_Ox64_PCB_Placement-Bottom-20221007.pdf Ox64 PCB Component placement(Bottom) 20221007 v1.0]&lt;br /&gt;
* Certifications:&lt;br /&gt;
** Disclaimer: Please note that PINE64 SBC is not a &amp;quot;final&amp;quot; product and in general certification is not necessary. However, PINE64 still submits the SBC for FCC, CE, and ROHS certifications and obtain the certificates to prove that the SBC board can pass the testing. Please note, a final commercial product needs to perform its own testing and obtain its own certificate.&lt;br /&gt;
** Not yet available&lt;br /&gt;
&lt;br /&gt;
== Datasheets for Components and Peripherals ==&lt;br /&gt;
* Bouffalo BL808 SoC information:&lt;br /&gt;
** [https://files.pine64.org/doc/datasheet/ox64/BL808_DS_en_1.1(open).pdf Bouffalo Lab BL808 SoC Datasheet]&lt;br /&gt;
** [https://files.pine64.org/doc/datasheet/ox64/BL808_RM_en_1.0(open).pdf Bouffalo Lab BL808 SoC Reference Manual]&lt;br /&gt;
* SPI NOR Flash information:&lt;br /&gt;
** [https://files.pine64.org/doc/datasheet/ox64/gd25lq16e_rev1.2_20210108.pdf GigaDevive 16Mb XSPI-Flash Datasheet]&lt;br /&gt;
** [https://files.pine64.org/doc/datasheet/star64/gd25lq128e_rev1.0_20210513.pdf GigaDevive 128Mb XSPI-Flash Datasheet]&lt;br /&gt;
* Power Regulator information:&lt;br /&gt;
** [https://files.pine64.org/doc/datasheet/ox64/IA2014-03.pdf Innovation Analog Tech IA2014 Step_down Converter Datasheet]&lt;br /&gt;
&lt;br /&gt;
== Articles and Blogs ==&lt;br /&gt;
* [https://www.robertlipe.com/bl808-not-symmetric/ First thoughts on the (a)symmetery of Bouffalo Labs BL808 as in Pine64’s Ox64]&lt;br /&gt;
&lt;br /&gt;
[[Category:Ox64]] [[Category:Bouffalo BL808]]&lt;/div&gt;</summary>
		<author><name>Lupyuen</name></author>
	</entry>
	<entry>
		<id>https://wiki.pine64.org/index.php?title=Ox64&amp;diff=14473</id>
		<title>Ox64</title>
		<link rel="alternate" type="text/html" href="https://wiki.pine64.org/index.php?title=Ox64&amp;diff=14473"/>
		<updated>2022-10-15T00:04:36Z</updated>

		<summary type="html">&lt;p&gt;Lupyuen: Add BL808 MCU SDK and OpenSBI&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[File:Ox64_board.jpg|400px|thumb|right|The Ox64]]&lt;br /&gt;
&lt;br /&gt;
The '''Ox64''' is a RISC-V based Single Board Computer powered by Bouffalo Lab BL808 C906 64-Bit RISC-V CPU, 32-Bit CPU, embedded 64MB PSRAM memory and build-on 3 radio RF (Wifi, BT, Zigbee). It provides breadboard friendly form factor, MicroSD Card slot, USB 2.0, and many other peripheral interfaces for makers to integrate with sensors and other devices.&lt;br /&gt;
&lt;br /&gt;
[[File:RISC-V.png|600px|]]&lt;br /&gt;
&lt;br /&gt;
== Software Releases ==&lt;br /&gt;
&lt;br /&gt;
=== Quick Links to the Source of OS Images Build ===&lt;br /&gt;
&lt;br /&gt;
OS images are still in '''alpha build''' which are only fit for board bring up and testing purposes. &lt;br /&gt;
&lt;br /&gt;
* [https://github.com/bouffalolab/bl808_linux Linux for BL808]&lt;br /&gt;
* [https://wiki.pine64.org/wiki/File:Linux_BL808.pdf Installation Instructions for Linux on BL808 (Chinese)]&lt;br /&gt;
&lt;br /&gt;
=== Software Development Kits ===&lt;br /&gt;
* [https://github.com/bouffalolab/bl808_linux/tree/main/bl_mcu_sdk_bl808 BL808 MCU SDK]&lt;br /&gt;
* [https://github.com/bouffalolab/bl808_linux/tree/main/opensbi-0.6-808 OpenSBI for BL808]&lt;br /&gt;
* [https://github.com/bouffalolab/bl808-pac Rust Peripheral Access Crate (PAC) for BL808]&lt;br /&gt;
* [https://github.com/bouffalolab/bl808-pac/blob/main/bl808.svd System View Description (SVD) for BL808]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== SoC and Memory Specification ==&lt;br /&gt;
* Based on [https://en.bouffalolab.com/product/ Bouffalo Lab BL808]&lt;br /&gt;
[[File:Bouffalo_Lab_icon.png|right]]&lt;br /&gt;
[[File:BL808_Block_Diagram.jpg|600px]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== CPU Architecture ===&lt;br /&gt;
* [https://www.t-head.cn/product/c906?lang=en T_head C906 480MHz 64-bit RISC-V CPU]&lt;br /&gt;
[[File:T-Head.png|right|200px]]&lt;br /&gt;
** Supports RISC-V RV64IMAFCV instruction architecture&lt;br /&gt;
** Five-stage single-issue sequentially executed pipeline&lt;br /&gt;
** Level-1 instruction and data cache of Harvard architecture, with a size of 32 KB and a cache line of 64B&lt;br /&gt;
** Sv39 memory management unit, realizing the conversion of virtual and real addresses and memory management&lt;br /&gt;
** jTLB that supports 128 entries&lt;br /&gt;
** Supports AXI 4.0 128-bit master interface&lt;br /&gt;
** Supports core local interrupt (CLINT) and platform-level interrupt controller (PLIC)&lt;br /&gt;
** With 80 external interrupt sources, 3 bits for configuring interrupt priority&lt;br /&gt;
** Supports BHT (8K) and BTB&lt;br /&gt;
** Compatible with RISC-V PMP, 8 configurable areas&lt;br /&gt;
** Supports hardware performance monitor (HPM) units&lt;br /&gt;
&lt;br /&gt;
* [https://www.t-head.cn/product/e907?lang=en T_head E907 320MHz 32-bit RISC-V CPU]&lt;br /&gt;
** Supports RISC-V RV32IMAFCP instruction set&lt;br /&gt;
** Supports RISC-V 32-bit/16-bit mixed instruction set&lt;br /&gt;
** Supports RISC-V machine mode and user mode&lt;br /&gt;
** Thirty-two 32-bit integer general purpose registers (GPR) and thirty-two 32-bit/64-bit floating-point GPRs&lt;br /&gt;
** Integer (5-stage)/floating-point (7-stage), single-issue, sequentially executed pipeline&lt;br /&gt;
** Supports AXI 4.0 main device interface and AHB 5.0 peripheral interface&lt;br /&gt;
** 32K instruction cache, two-way set associative structure&lt;br /&gt;
** 16K data cache, two-way set associative structure&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== System Memory ===&lt;br /&gt;
* Embedded 64MB PSRAM&lt;br /&gt;
&lt;br /&gt;
== Board Features ==&lt;br /&gt;
&lt;br /&gt;
=== Network ===&lt;br /&gt;
* 2.4GHz 1T1R WiFi 802.11 b/g/n&lt;br /&gt;
* Bluetooth 5.2&lt;br /&gt;
* Zigbee&lt;br /&gt;
* 10/100Mbps Ethernet (optional, on expansion board)&lt;br /&gt;
&lt;br /&gt;
=== Storage ===&lt;br /&gt;
* on-board 16Mb (2MB) or 128Mb (16MB) XSPI NOR flash memory&lt;br /&gt;
* microSD - supports SDHC and SDXC&lt;br /&gt;
&lt;br /&gt;
=== Expansion Ports ===&lt;br /&gt;
* USB 2.0 OTG port&lt;br /&gt;
* 26 GPIO Pins, including SPI, I2C and UART functionality. Possible I2S and GMII expansion&lt;br /&gt;
* Dual lane MiPi CSI port, located at USB-C port, for camera module&lt;br /&gt;
&lt;br /&gt;
=== Audio ===&lt;br /&gt;
* mic (optional, on camera module)&lt;br /&gt;
* speaker (optional, on camera module)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Board Information, Schematics and Certifications ==&lt;br /&gt;
* Baseboard Dimensions: 51mm x 21mm x 19mm x 3.5mm (Breadboard friendly)&lt;br /&gt;
* Input Power: 5V 0.5A microSD or USB-C port&lt;br /&gt;
* Schematic:&lt;br /&gt;
** [https://files.pine64.org/doc/ox64/PINE64_Ox64-Schematic-202221007.pdf Ox64 Schematic 20221007 v1.0]&lt;br /&gt;
** [https://files.pine64.org/doc/ox64/PINE64_Ox64_PCB_Placement-Top-20221007.pdf Ox64 PCB Component placement(ToP) 20221007 v1.0]&lt;br /&gt;
** [https://files.pine64.org/doc/ox64/PINE64_Ox64_PCB_Placement-Bottom-20221007.pdf Ox64 PCB Component placement(Bottom) 20221007 v1.0]&lt;br /&gt;
* Certifications:&lt;br /&gt;
** Disclaimer: Please note that PINE64 SBC is not a &amp;quot;final&amp;quot; product and in general certification is not necessary. However, PINE64 still submits the SBC for FCC, CE, and ROHS certifications and obtain the certificates to prove that the SBC board can pass the testing. Please note, a final commercial product needs to perform its own testing and obtain its own certificate.&lt;br /&gt;
** Not yet available&lt;br /&gt;
&lt;br /&gt;
== Datasheets for Components and Peripherals ==&lt;br /&gt;
* Bouffalo BL808 SoC information:&lt;br /&gt;
** [https://files.pine64.org/doc/datasheet/ox64/BL808_DS_en_1.1(open).pdf Bouffalo Lab BL808 SoC Datasheet]&lt;br /&gt;
** [https://files.pine64.org/doc/datasheet/ox64/BL808_RM_en_1.0(open).pdf Bouffalo Lab BL808 SoC Reference Manual]&lt;br /&gt;
* SPI NOR Flash information:&lt;br /&gt;
** [https://files.pine64.org/doc/datasheet/ox64/gd25lq16e_rev1.2_20210108.pdf GigaDevive 16Mb XSPI-Flash Datasheet]&lt;br /&gt;
** [https://files.pine64.org/doc/datasheet/star64/gd25lq128e_rev1.0_20210513.pdf GigaDevive 128Mb XSPI-Flash Datasheet]&lt;br /&gt;
* Power Regulator information:&lt;br /&gt;
** [https://files.pine64.org/doc/datasheet/ox64/IA2014-03.pdf Innovation Analog Tech IA2014 Step_down Converter Datasheet]&lt;br /&gt;
&lt;br /&gt;
== Articles and Blogs ==&lt;br /&gt;
* [https://www.robertlipe.com/bl808-not-symmetric/ First thoughts on the (a)symmetery of Bouffalo Labs BL808 as in Pine64’s Ox64]&lt;br /&gt;
&lt;br /&gt;
[[Category:Ox64]] [[Category:Bouffalo BL808]]&lt;/div&gt;</summary>
		<author><name>Lupyuen</name></author>
	</entry>
	<entry>
		<id>https://wiki.pine64.org/index.php?title=Ox64&amp;diff=14472</id>
		<title>Ox64</title>
		<link rel="alternate" type="text/html" href="https://wiki.pine64.org/index.php?title=Ox64&amp;diff=14472"/>
		<updated>2022-10-14T23:58:29Z</updated>

		<summary type="html">&lt;p&gt;Lupyuen: Add Linux for BL808&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[File:Ox64_board.jpg|400px|thumb|right|The Ox64]]&lt;br /&gt;
&lt;br /&gt;
The '''Ox64''' is a RISC-V based Single Board Computer powered by Bouffalo Lab BL808 C906 64-Bit RISC-V CPU, 32-Bit CPU, embedded 64MB PSRAM memory and build-on 3 radio RF (Wifi, BT, Zigbee). It provides breadboard friendly form factor, MicroSD Card slot, USB 2.0, and many other peripheral interfaces for makers to integrate with sensors and other devices.&lt;br /&gt;
&lt;br /&gt;
[[File:RISC-V.png|600px|]]&lt;br /&gt;
&lt;br /&gt;
== Software Releases ==&lt;br /&gt;
&lt;br /&gt;
=== Quick Links to the Source of OS Images Build ===&lt;br /&gt;
&lt;br /&gt;
OS images are still in '''alpha build''' which are only fit for board bring up and testing purposes. &lt;br /&gt;
&lt;br /&gt;
* [https://github.com/bouffalolab/bl808_linux Linux for BL808]&lt;br /&gt;
&lt;br /&gt;
* [https://wiki.pine64.org/wiki/File:Linux_BL808.pdf Installation Instructions for Linux on BL808 (Chinese)]&lt;br /&gt;
&lt;br /&gt;
=== Software Development Kits ===&lt;br /&gt;
* [https://github.com/bouffalolab/bl808-pac Rust Peripheral Access Crate (PAC) for BL808]&lt;br /&gt;
* [https://github.com/bouffalolab/bl808-pac/blob/main/bl808.svd System View Description (SVD) for BL808]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== SoC and Memory Specification ==&lt;br /&gt;
* Based on [https://en.bouffalolab.com/product/ Bouffalo Lab BL808]&lt;br /&gt;
[[File:Bouffalo_Lab_icon.png|right]]&lt;br /&gt;
[[File:BL808_Block_Diagram.jpg|600px]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== CPU Architecture ===&lt;br /&gt;
* [https://www.t-head.cn/product/c906?lang=en T_head C906 480MHz 64-bit RISC-V CPU]&lt;br /&gt;
[[File:T-Head.png|right|200px]]&lt;br /&gt;
** Supports RISC-V RV64IMAFCV instruction architecture&lt;br /&gt;
** Five-stage single-issue sequentially executed pipeline&lt;br /&gt;
** Level-1 instruction and data cache of Harvard architecture, with a size of 32 KB and a cache line of 64B&lt;br /&gt;
** Sv39 memory management unit, realizing the conversion of virtual and real addresses and memory management&lt;br /&gt;
** jTLB that supports 128 entries&lt;br /&gt;
** Supports AXI 4.0 128-bit master interface&lt;br /&gt;
** Supports core local interrupt (CLINT) and platform-level interrupt controller (PLIC)&lt;br /&gt;
** With 80 external interrupt sources, 3 bits for configuring interrupt priority&lt;br /&gt;
** Supports BHT (8K) and BTB&lt;br /&gt;
** Compatible with RISC-V PMP, 8 configurable areas&lt;br /&gt;
** Supports hardware performance monitor (HPM) units&lt;br /&gt;
&lt;br /&gt;
* [https://www.t-head.cn/product/e907?lang=en T_head E907 320MHz 32-bit RISC-V CPU]&lt;br /&gt;
** Supports RISC-V RV32IMAFCP instruction set&lt;br /&gt;
** Supports RISC-V 32-bit/16-bit mixed instruction set&lt;br /&gt;
** Supports RISC-V machine mode and user mode&lt;br /&gt;
** Thirty-two 32-bit integer general purpose registers (GPR) and thirty-two 32-bit/64-bit floating-point GPRs&lt;br /&gt;
** Integer (5-stage)/floating-point (7-stage), single-issue, sequentially executed pipeline&lt;br /&gt;
** Supports AXI 4.0 main device interface and AHB 5.0 peripheral interface&lt;br /&gt;
** 32K instruction cache, two-way set associative structure&lt;br /&gt;
** 16K data cache, two-way set associative structure&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== System Memory ===&lt;br /&gt;
* Embedded 64MB PSRAM&lt;br /&gt;
&lt;br /&gt;
== Board Features ==&lt;br /&gt;
&lt;br /&gt;
=== Network ===&lt;br /&gt;
* 2.4GHz 1T1R WiFi 802.11 b/g/n&lt;br /&gt;
* Bluetooth 5.2&lt;br /&gt;
* Zigbee&lt;br /&gt;
* 10/100Mbps Ethernet (optional, on expansion board)&lt;br /&gt;
&lt;br /&gt;
=== Storage ===&lt;br /&gt;
* on-board 16Mb (2MB) or 128Mb (16MB) XSPI NOR flash memory&lt;br /&gt;
* microSD - supports SDHC and SDXC&lt;br /&gt;
&lt;br /&gt;
=== Expansion Ports ===&lt;br /&gt;
* USB 2.0 OTG port&lt;br /&gt;
* 26 GPIO Pins, including SPI, I2C and UART functionality. Possible I2S and GMII expansion&lt;br /&gt;
* Dual lane MiPi CSI port, located at USB-C port, for camera module&lt;br /&gt;
&lt;br /&gt;
=== Audio ===&lt;br /&gt;
* mic (optional, on camera module)&lt;br /&gt;
* speaker (optional, on camera module)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Board Information, Schematics and Certifications ==&lt;br /&gt;
* Baseboard Dimensions: 51mm x 21mm x 19mm x 3.5mm (Breadboard friendly)&lt;br /&gt;
* Input Power: 5V 0.5A microSD or USB-C port&lt;br /&gt;
* Schematic:&lt;br /&gt;
** [https://files.pine64.org/doc/ox64/PINE64_Ox64-Schematic-202221007.pdf Ox64 Schematic 20221007 v1.0]&lt;br /&gt;
** [https://files.pine64.org/doc/ox64/PINE64_Ox64_PCB_Placement-Top-20221007.pdf Ox64 PCB Component placement(ToP) 20221007 v1.0]&lt;br /&gt;
** [https://files.pine64.org/doc/ox64/PINE64_Ox64_PCB_Placement-Bottom-20221007.pdf Ox64 PCB Component placement(Bottom) 20221007 v1.0]&lt;br /&gt;
* Certifications:&lt;br /&gt;
** Disclaimer: Please note that PINE64 SBC is not a &amp;quot;final&amp;quot; product and in general certification is not necessary. However, PINE64 still submits the SBC for FCC, CE, and ROHS certifications and obtain the certificates to prove that the SBC board can pass the testing. Please note, a final commercial product needs to perform its own testing and obtain its own certificate.&lt;br /&gt;
** Not yet available&lt;br /&gt;
&lt;br /&gt;
== Datasheets for Components and Peripherals ==&lt;br /&gt;
* Bouffalo BL808 SoC information:&lt;br /&gt;
** [https://files.pine64.org/doc/datasheet/ox64/BL808_DS_en_1.1(open).pdf Bouffalo Lab BL808 SoC Datasheet]&lt;br /&gt;
** [https://files.pine64.org/doc/datasheet/ox64/BL808_RM_en_1.0(open).pdf Bouffalo Lab BL808 SoC Reference Manual]&lt;br /&gt;
* SPI NOR Flash information:&lt;br /&gt;
** [https://files.pine64.org/doc/datasheet/ox64/gd25lq16e_rev1.2_20210108.pdf GigaDevive 16Mb XSPI-Flash Datasheet]&lt;br /&gt;
** [https://files.pine64.org/doc/datasheet/star64/gd25lq128e_rev1.0_20210513.pdf GigaDevive 128Mb XSPI-Flash Datasheet]&lt;br /&gt;
* Power Regulator information:&lt;br /&gt;
** [https://files.pine64.org/doc/datasheet/ox64/IA2014-03.pdf Innovation Analog Tech IA2014 Step_down Converter Datasheet]&lt;br /&gt;
&lt;br /&gt;
== Articles and Blogs ==&lt;br /&gt;
* [https://www.robertlipe.com/bl808-not-symmetric/ First thoughts on the (a)symmetery of Bouffalo Labs BL808 as in Pine64’s Ox64]&lt;br /&gt;
&lt;br /&gt;
[[Category:Ox64]] [[Category:Bouffalo BL808]]&lt;/div&gt;</summary>
		<author><name>Lupyuen</name></author>
	</entry>
	<entry>
		<id>https://wiki.pine64.org/index.php?title=File:Linux_BL808.pdf&amp;diff=14471</id>
		<title>File:Linux BL808.pdf</title>
		<link rel="alternate" type="text/html" href="https://wiki.pine64.org/index.php?title=File:Linux_BL808.pdf&amp;diff=14471"/>
		<updated>2022-10-14T23:51:03Z</updated>

		<summary type="html">&lt;p&gt;Lupyuen: Installation Instructions for Linux on Bouffalo Lab BL808. Provided by Bouffalo Lab.&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Summary ==&lt;br /&gt;
Installation Instructions for Linux on Bouffalo Lab BL808. Provided by Bouffalo Lab.&lt;/div&gt;</summary>
		<author><name>Lupyuen</name></author>
	</entry>
	<entry>
		<id>https://wiki.pine64.org/index.php?title=Ox64&amp;diff=14470</id>
		<title>Ox64</title>
		<link rel="alternate" type="text/html" href="https://wiki.pine64.org/index.php?title=Ox64&amp;diff=14470"/>
		<updated>2022-10-14T23:48:37Z</updated>

		<summary type="html">&lt;p&gt;Lupyuen: Add SDK section&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[File:Ox64_board.jpg|400px|thumb|right|The Ox64]]&lt;br /&gt;
&lt;br /&gt;
The '''Ox64''' is a RISC-V based Single Board Computer powered by Bouffalo Lab BL808 C906 64-Bit RISC-V CPU, 32-Bit CPU, embedded 64MB PSRAM memory and build-on 3 radio RF (Wifi, BT, Zigbee). It provides breadboard friendly form factor, MicroSD Card slot, USB 2.0, and many other peripheral interfaces for makers to integrate with sensors and other devices.&lt;br /&gt;
&lt;br /&gt;
[[File:RISC-V.png|600px|]]&lt;br /&gt;
&lt;br /&gt;
== Software Releases ==&lt;br /&gt;
&lt;br /&gt;
=== Quick Links to the Source of OS Images Build ===&lt;br /&gt;
&lt;br /&gt;
OS images are still in '''alpha build''' which are only fit for board bring up and testing purposes. &lt;br /&gt;
&lt;br /&gt;
=== Software Development Kits ===&lt;br /&gt;
* [https://github.com/bouffalolab/bl808-pac Rust Peripheral Access Crate (PAC) for BL808]&lt;br /&gt;
* [https://github.com/bouffalolab/bl808-pac/blob/main/bl808.svd System View Description (SVD) for BL808]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== SoC and Memory Specification ==&lt;br /&gt;
* Based on [https://en.bouffalolab.com/product/ Bouffalo Lab BL808]&lt;br /&gt;
[[File:Bouffalo_Lab_icon.png|right]]&lt;br /&gt;
[[File:BL808_Block_Diagram.jpg|600px]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== CPU Architecture ===&lt;br /&gt;
* [https://www.t-head.cn/product/c906?lang=en T_head C906 480MHz 64-bit RISC-V CPU]&lt;br /&gt;
[[File:T-Head.png|right|200px]]&lt;br /&gt;
** Supports RISC-V RV64IMAFCV instruction architecture&lt;br /&gt;
** Five-stage single-issue sequentially executed pipeline&lt;br /&gt;
** Level-1 instruction and data cache of Harvard architecture, with a size of 32 KB and a cache line of 64B&lt;br /&gt;
** Sv39 memory management unit, realizing the conversion of virtual and real addresses and memory management&lt;br /&gt;
** jTLB that supports 128 entries&lt;br /&gt;
** Supports AXI 4.0 128-bit master interface&lt;br /&gt;
** Supports core local interrupt (CLINT) and platform-level interrupt controller (PLIC)&lt;br /&gt;
** With 80 external interrupt sources, 3 bits for configuring interrupt priority&lt;br /&gt;
** Supports BHT (8K) and BTB&lt;br /&gt;
** Compatible with RISC-V PMP, 8 configurable areas&lt;br /&gt;
** Supports hardware performance monitor (HPM) units&lt;br /&gt;
&lt;br /&gt;
* [https://www.t-head.cn/product/e907?lang=en T_head E907 320MHz 32-bit RISC-V CPU]&lt;br /&gt;
** Supports RISC-V RV32IMAFCP instruction set&lt;br /&gt;
** Supports RISC-V 32-bit/16-bit mixed instruction set&lt;br /&gt;
** Supports RISC-V machine mode and user mode&lt;br /&gt;
** Thirty-two 32-bit integer general purpose registers (GPR) and thirty-two 32-bit/64-bit floating-point GPRs&lt;br /&gt;
** Integer (5-stage)/floating-point (7-stage), single-issue, sequentially executed pipeline&lt;br /&gt;
** Supports AXI 4.0 main device interface and AHB 5.0 peripheral interface&lt;br /&gt;
** 32K instruction cache, two-way set associative structure&lt;br /&gt;
** 16K data cache, two-way set associative structure&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== System Memory ===&lt;br /&gt;
* Embedded 64MB PSRAM&lt;br /&gt;
&lt;br /&gt;
== Board Features ==&lt;br /&gt;
&lt;br /&gt;
=== Network ===&lt;br /&gt;
* 2.4GHz 1T1R WiFi 802.11 b/g/n&lt;br /&gt;
* Bluetooth 5.2&lt;br /&gt;
* Zigbee&lt;br /&gt;
* 10/100Mbps Ethernet (optional, on expansion board)&lt;br /&gt;
&lt;br /&gt;
=== Storage ===&lt;br /&gt;
* on-board 16Mb (2MB) or 128Mb (16MB) XSPI NOR flash memory&lt;br /&gt;
* microSD - supports SDHC and SDXC&lt;br /&gt;
&lt;br /&gt;
=== Expansion Ports ===&lt;br /&gt;
* USB 2.0 OTG port&lt;br /&gt;
* 26 GPIO Pins, including SPI, I2C and UART functionality. Possible I2S and GMII expansion&lt;br /&gt;
* Dual lane MiPi CSI port, located at USB-C port, for camera module&lt;br /&gt;
&lt;br /&gt;
=== Audio ===&lt;br /&gt;
* mic (optional, on camera module)&lt;br /&gt;
* speaker (optional, on camera module)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Board Information, Schematics and Certifications ==&lt;br /&gt;
* Baseboard Dimensions: 51mm x 21mm x 19mm x 3.5mm (Breadboard friendly)&lt;br /&gt;
* Input Power: 5V 0.5A microSD or USB-C port&lt;br /&gt;
* Schematic:&lt;br /&gt;
** [https://files.pine64.org/doc/ox64/PINE64_Ox64-Schematic-202221007.pdf Ox64 Schematic 20221007 v1.0]&lt;br /&gt;
** [https://files.pine64.org/doc/ox64/PINE64_Ox64_PCB_Placement-Top-20221007.pdf Ox64 PCB Component placement(ToP) 20221007 v1.0]&lt;br /&gt;
** [https://files.pine64.org/doc/ox64/PINE64_Ox64_PCB_Placement-Bottom-20221007.pdf Ox64 PCB Component placement(Bottom) 20221007 v1.0]&lt;br /&gt;
* Certifications:&lt;br /&gt;
** Disclaimer: Please note that PINE64 SBC is not a &amp;quot;final&amp;quot; product and in general certification is not necessary. However, PINE64 still submits the SBC for FCC, CE, and ROHS certifications and obtain the certificates to prove that the SBC board can pass the testing. Please note, a final commercial product needs to perform its own testing and obtain its own certificate.&lt;br /&gt;
** Not yet available&lt;br /&gt;
&lt;br /&gt;
== Datasheets for Components and Peripherals ==&lt;br /&gt;
* Bouffalo BL808 SoC information:&lt;br /&gt;
** [https://files.pine64.org/doc/datasheet/ox64/BL808_DS_en_1.1(open).pdf Bouffalo Lab BL808 SoC Datasheet]&lt;br /&gt;
** [https://files.pine64.org/doc/datasheet/ox64/BL808_RM_en_1.0(open).pdf Bouffalo Lab BL808 SoC Reference Manual]&lt;br /&gt;
* SPI NOR Flash information:&lt;br /&gt;
** [https://files.pine64.org/doc/datasheet/ox64/gd25lq16e_rev1.2_20210108.pdf GigaDevive 16Mb XSPI-Flash Datasheet]&lt;br /&gt;
** [https://files.pine64.org/doc/datasheet/star64/gd25lq128e_rev1.0_20210513.pdf GigaDevive 128Mb XSPI-Flash Datasheet]&lt;br /&gt;
* Power Regulator information:&lt;br /&gt;
** [https://files.pine64.org/doc/datasheet/ox64/IA2014-03.pdf Innovation Analog Tech IA2014 Step_down Converter Datasheet]&lt;br /&gt;
&lt;br /&gt;
== Articles and Blogs ==&lt;br /&gt;
* [https://www.robertlipe.com/bl808-not-symmetric/ First thoughts on the (a)symmetery of Bouffalo Labs BL808 as in Pine64’s Ox64]&lt;br /&gt;
&lt;br /&gt;
[[Category:Ox64]] [[Category:Bouffalo BL808]]&lt;/div&gt;</summary>
		<author><name>Lupyuen</name></author>
	</entry>
	<entry>
		<id>https://wiki.pine64.org/index.php?title=Ox64&amp;diff=14454</id>
		<title>Ox64</title>
		<link rel="alternate" type="text/html" href="https://wiki.pine64.org/index.php?title=Ox64&amp;diff=14454"/>
		<updated>2022-10-14T04:27:24Z</updated>

		<summary type="html">&lt;p&gt;Lupyuen: Add article &amp;quot;First thoughts on the (a)symmetery of Bouffalo Labs BL808 as in Pine64’s Ox64&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[File:Ox64_board.jpg|400px|thumb|right|The Ox64]]&lt;br /&gt;
&lt;br /&gt;
The '''Ox64''' is a RISC-V based Single Board Computer powered by Bouffalo Lab BL808 C906 64-Bit RISC-V CPU, 32-Bit CPU, embedded 64MB PSRAM memory and build-on 3 radio RF (Wifi, BT, Zigbee). It provides breadboard friendly form factor, MicroSD Card slot, USB 2.0, and many other peripheral interfaces for makers to integrate with sensors and other devices.&lt;br /&gt;
&lt;br /&gt;
[[File:RISC-V.png|600px|]]&lt;br /&gt;
&lt;br /&gt;
== Software releases ==&lt;br /&gt;
&lt;br /&gt;
=== Quick Links to the Source of OS Images Build ===&lt;br /&gt;
&lt;br /&gt;
OS images are still in '''alpha build''' which are only fit for board bring up and testing purposes. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== SoC and Memory Specification ==&lt;br /&gt;
* Based on [https://en.bouffalolab.com/product/ Bouffalo Lab BL808]&lt;br /&gt;
[[File:Bouffalo_Lab_icon.png|right]]&lt;br /&gt;
[[File:BL808_Block_Diagram.jpg|600px]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== CPU Architecture ===&lt;br /&gt;
* [https://www.t-head.cn/product/c906?lang=en T_head C906 480MHz 64-bit RISC-V CPU]&lt;br /&gt;
[[File:T-Head.png|right|200px]]&lt;br /&gt;
** Supports RISC-V RV64IMAFCV instruction architecture&lt;br /&gt;
** Five-stage single-issue sequentially executed pipeline&lt;br /&gt;
** Level-1 instruction and data cache of Harvard architecture, with a size of 32 KB and a cache line of 64B&lt;br /&gt;
** Sv39 memory management unit, realizing the conversion of virtual and real addresses and memory management&lt;br /&gt;
** jTLB that supports 128 entries&lt;br /&gt;
** Supports AXI 4.0 128-bit master interface&lt;br /&gt;
** Supports core local interrupt (CLINT) and platform-level interrupt controller (PLIC)&lt;br /&gt;
** With 80 external interrupt sources, 3 bits for configuring interrupt priority&lt;br /&gt;
** Supports BHT (8K) and BTB&lt;br /&gt;
** Compatible with RISC-V PMP, 8 configurable areas&lt;br /&gt;
** Supports hardware performance monitor (HPM) units&lt;br /&gt;
&lt;br /&gt;
* [https://www.t-head.cn/product/e907?lang=en T_head E907 320MHz 32-bit RISC-V CPU]&lt;br /&gt;
** Supports RISC-V RV32IMAFCP instruction set&lt;br /&gt;
** Supports RISC-V 32-bit/16-bit mixed instruction set&lt;br /&gt;
** Supports RISC-V machine mode and user mode&lt;br /&gt;
** Thirty-two 32-bit integer general purpose registers (GPR) and thirty-two 32-bit/64-bit floating-point GPRs&lt;br /&gt;
** Integer (5-stage)/floating-point (7-stage), single-issue, sequentially executed pipeline&lt;br /&gt;
** Supports AXI 4.0 main device interface and AHB 5.0 peripheral interface&lt;br /&gt;
** 32K instruction cache, two-way set associative structure&lt;br /&gt;
** 16K data cache, two-way set associative structure&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== System Memory ===&lt;br /&gt;
* Embedded 64MB PSRAM&lt;br /&gt;
&lt;br /&gt;
== Board Features ==&lt;br /&gt;
&lt;br /&gt;
=== Network ===&lt;br /&gt;
* 2.4GHz 1T1R WiFi 802.11 b/g/n&lt;br /&gt;
* Bluetooth 5.2&lt;br /&gt;
* Zigbee&lt;br /&gt;
* 10/100Mbps Ethernet (optional, on expansion board)&lt;br /&gt;
&lt;br /&gt;
=== Storage ===&lt;br /&gt;
* on-board 16Mb (2MB) or 128Mb (16MB) XSPI NOR flash memory&lt;br /&gt;
* microSD - supports SDHC and SDXC&lt;br /&gt;
&lt;br /&gt;
=== Expansion Ports ===&lt;br /&gt;
* USB 2.0 OTG port&lt;br /&gt;
* 26 GPIO Pins, including SPI, I2C and UART functionality. Possible I2S and GMII expansion&lt;br /&gt;
* Dual lane MiPi CSI port, located at USB-C port, for camera module&lt;br /&gt;
&lt;br /&gt;
=== Audio ===&lt;br /&gt;
* mic (optional, on camera module)&lt;br /&gt;
* speaker (optional, on camera module)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Board Information, Schematics and Certifications ==&lt;br /&gt;
* Baseboard Dimensions: 51mm x 21mm x 19mm x 3.5mm (Breadboard friendly)&lt;br /&gt;
* Input Power: 5V 0.5A microSD or USB-C port&lt;br /&gt;
* Schematic:&lt;br /&gt;
** [https://files.pine64.org/doc/ox64/PINE64_Ox64-Schematic-202221007.pdf Ox64 Schematic 20221007 v1.0]&lt;br /&gt;
** [https://files.pine64.org/doc/ox64/PINE64_Ox64_PCB_Placement-Top-20221007.pdf Ox64 PCB Component placement(ToP) 20221007 v1.0]&lt;br /&gt;
** [https://files.pine64.org/doc/ox64/PINE64_Ox64_PCB_Placement-Bottom-20221007.pdf Ox64 PCB Component placement(Bottom) 20221007 v1.0]&lt;br /&gt;
* Certifications:&lt;br /&gt;
** Disclaimer: Please note that PINE64 SBC is not a &amp;quot;final&amp;quot; product and in general certification is not necessary. However, PINE64 still submits the SBC for FCC, CE, and ROHS certifications and obtain the certificates to prove that the SBC board can pass the testing. Please note, a final commercial product needs to perform its own testing and obtain its own certificate.&lt;br /&gt;
** Not yet available&lt;br /&gt;
&lt;br /&gt;
== Datasheets for Components and Peripherals ==&lt;br /&gt;
* Bouffalo BL808 SoC information:&lt;br /&gt;
** [https://files.pine64.org/doc/datasheet/ox64/BL808_DS_en_1.1(open).pdf Bouffalo Lab BL808 SoC Datasheet]&lt;br /&gt;
** [https://files.pine64.org/doc/datasheet/ox64/BL808_RM_en_1.0(open).pdf Bouffalo Lab BL808 SoC Reference Manual]&lt;br /&gt;
* SPI NOR Flash information:&lt;br /&gt;
** [https://files.pine64.org/doc/datasheet/ox64/gd25lq16e_rev1.2_20210108.pdf GigaDevive 16Mb XSPI-Flash Datasheet]&lt;br /&gt;
** [https://files.pine64.org/doc/datasheet/star64/gd25lq128e_rev1.0_20210513.pdf GigaDevive 128Mb XSPI-Flash Datasheet]&lt;br /&gt;
* Power Regulator information:&lt;br /&gt;
** [https://files.pine64.org/doc/datasheet/ox64/IA2014-03.pdf Innovation Analog Tech IA2014 Step_down Converter Datasheet]&lt;br /&gt;
&lt;br /&gt;
== Development efforts ==&lt;br /&gt;
* [https://github.com/bouffalolab/bl808-pac Rust Peripheral Access Crate (PAC) for BL808]&lt;br /&gt;
* [https://github.com/bouffalolab/bl808-pac/blob/main/bl808.svd System View Description (SVD) for BL808]&lt;br /&gt;
&lt;br /&gt;
== Articles and Blogs ==&lt;br /&gt;
* [https://www.robertlipe.com/bl808-not-symmetric/ First thoughts on the (a)symmetery of Bouffalo Labs BL808 as in Pine64’s Ox64]&lt;br /&gt;
&lt;br /&gt;
[[Category:Ox64]] [[Category:Bouffalo BL808]]&lt;/div&gt;</summary>
		<author><name>Lupyuen</name></author>
	</entry>
	<entry>
		<id>https://wiki.pine64.org/index.php?title=PineCone&amp;diff=14453</id>
		<title>PineCone</title>
		<link rel="alternate" type="text/html" href="https://wiki.pine64.org/index.php?title=PineCone&amp;diff=14453"/>
		<updated>2022-10-14T01:50:39Z</updated>

		<summary type="html">&lt;p&gt;Lupyuen: Add &amp;quot;Visual Programming with Zig and Apache NuttX Sensors (Video)&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[File:Pine64_BL602_EVB_photo-3-small.jpg|thumb|PineCone BL602 EVB (Evaluation Board)]]&lt;br /&gt;
&lt;br /&gt;
The '''PineCone''' is a BL602 evaluation board, which was developed with the goal to challenge the open source community to achieve blob-free and free and open source WiFi and Bluetooth, see the [https://www.pine64.org/2020/10/28/nutcracker-challenge-blob-free-wifi-ble/ Nutcracker Challenge].&lt;br /&gt;
&lt;br /&gt;
== BL602 Specifications ==&lt;br /&gt;
* '''CPU:''' 32-bit RV32IMAFC RISC-V “SiFive E24 Core”&lt;br /&gt;
** [https://www.sifive.com/cores/e24 SiFive E24 Core information]&lt;br /&gt;
* '''Memory:'''&lt;br /&gt;
** 128KB ROM&lt;br /&gt;
** 276KB SRAM&lt;br /&gt;
** 1Kb eFuse&lt;br /&gt;
** 2MB Embedded Flash&lt;br /&gt;
* '''Security:'''&lt;br /&gt;
** Secure boot&lt;br /&gt;
** Secure debug&lt;br /&gt;
** AES 128/192/256&lt;br /&gt;
** SHA-1/224/256&lt;br /&gt;
** TRNG (True Random Number Generator)&lt;br /&gt;
** PKA (Public Key Accelerator)&lt;br /&gt;
* '''Wireless:'''&lt;br /&gt;
** Wi-Fi 802.11 b/g/n&lt;br /&gt;
** Bluetooth® Low Energy 5.0&lt;br /&gt;
** Wi-Fi Fast connection with BLE assistance&lt;br /&gt;
** Wi-Fi and BLE coexistence&lt;br /&gt;
** Wi-Fi Security WPS/WEP/WPA/WPA2/WPA3&lt;br /&gt;
** STA, SoftAP and sniffer modes&lt;br /&gt;
** Multi-Cloud connectivity&lt;br /&gt;
** 2.4 GHz RF transceiver&lt;br /&gt;
** Integrated RF balun, PA/LNA&lt;br /&gt;
* '''Package Type:'''&lt;br /&gt;
** 32 pin QFN 4mm x 4mm&lt;br /&gt;
* JTAG support (See below for BL602 impact)&lt;br /&gt;
&lt;br /&gt;
[[File:BL602_Block_Diagram.jpg|600px]]&lt;br /&gt;
&lt;br /&gt;
== JTAG ==&lt;br /&gt;
{| class=&amp;quot;wikitable floatright&amp;quot;&lt;br /&gt;
|+ Default JTAG pins&lt;br /&gt;
|-&lt;br /&gt;
| GPIO Pin || JTAG Pin&lt;br /&gt;
|-&lt;br /&gt;
| GPIO17 || TDI&lt;br /&gt;
|-&lt;br /&gt;
| GPIO11 || TDO&lt;br /&gt;
|-&lt;br /&gt;
| GPIO12 || TMS&lt;br /&gt;
|-&lt;br /&gt;
| GPIO14 || TCK&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
BL602 multiplexes four GPIO pins to provide the familiar JTAG lines. See the accompanying table for the default pin mappings.&lt;br /&gt;
&lt;br /&gt;
These are the default JTAG pins in use after a cold boot. However, many pieces of software, including the demo that's installed by default on new PineCones, remap these pins to other functions. You cannot use the default wiring for JTAG while such software is running. This issue is especially prevalent on the PineCone because three of the default JTAG pins are connected to the onboard RGB LED. Nothing about the LED itself interferes with JTAG, but any program that uses the LED will necessarily remap some of the default JTAG pins to be GPIO.&lt;br /&gt;
&lt;br /&gt;
The MaskROM download mode that the BL602 enters when you tie GPIO8 high does '''not''' remap the default JTAG pins, and so you can and should use that mode while checking basic functionality of your JTAG adapter.&lt;br /&gt;
&lt;br /&gt;
Note that, just as software can remap the default JTAG pins to be something else, it can also remap other pins to be JTAG. Control over this is quite granular, with 5-6 candidate pins for each individual JTAG signal that can be mapped independently of one another. LEE Lup Yuen has written some [https://lupyuen.github.io/articles/openocd#free-the-led-from-jtag-port sample code] showing how to remap the JTAG pins so that your software can use the LED without giving up support for debugging.&lt;br /&gt;
&lt;br /&gt;
== Pine64 USB JTAG Adapter information and schematics ==&lt;br /&gt;
* [https://files.pine64.org/doc/Pinenut/PINE64%20USB%20JTAG%20Adapter%20Schematic-20201215.pdf PINE64 USB JTAG Adapter Schematic-20201215.pdf (pine64_ft232hl_board-2020-12-14)] &lt;br /&gt;
* [[:File:PINE64_USB_JTAG_Adapter_Schematic_ver_1.0a-20210109.pdf|PINE64 USB JTAG Adapter schematic 20210109 1.0a]]&lt;br /&gt;
&lt;br /&gt;
== PineCone BL602 EVB information and schematics ==&lt;br /&gt;
* Approximate dimensions: 26mm x 43mm&lt;br /&gt;
* Board layout:&lt;br /&gt;
[[File:PADI-II_EVB.png]]&lt;br /&gt;
* [https://files.pine64.org/doc/Pinenut/Pine64%20BL602%20EVB%20Schematic%20ver%201.1.pdf PineCone BL602 EVB schematic ver 1.1]&lt;br /&gt;
** Note: In PineCone revision 1.1 (&amp;quot;BL62B_EVB V1.1&amp;quot; silkscreened on back of board), CC1 and CC2 share one 5.1KΩ resistor. This means the board will fail to power when you use an e-marked USB-C cable like the one that comes with Apple chargers. See [https://medium.com/@leung.benson/how-to-design-a-proper-usb-c-power-sink-hint-not-the-way-raspberry-pi-4-did-it-f470d7a5910 this article] for details of why this happens. The next schematic design will give each line its own 5.1KΩ resistor as per the USB-C specification.&lt;br /&gt;
* The board uses a CH340 Serial/USB adapter. This chip is commonly used in Arduino-class development boards. It is a full speed (12Mbps) USB interface and has vendor ID 0x1a86 with product ID 0x7523.&lt;br /&gt;
* The GPIO pins (11, 12, 14, 17) plus the nearby RESET, POWER, and GND pins are all located on one side of the board, on J1 to provide JTAG connection.&lt;br /&gt;
&lt;br /&gt;
== Pinenut-01S Module information and schematics ==&lt;br /&gt;
[[File:Pinenut-01S_PCB-Front.png|225px]][[File:Pinenut-01S_PCB-Back.png|225px]]&lt;br /&gt;
* [https://files.pine64.org/doc/Pinenut/Pinenut-01S%20V1.01%20SCH.pdf Pinenut-01S schematic ver 1.01]&lt;br /&gt;
* [https://wiki.pine64.org/images/6/6b/PineNut-01S_v1.01_KiCad.zip PineNut-01S KiCad schematic ver 1.01]&lt;br /&gt;
* [https://files.pine64.org/doc/Pinenut/NUT-01S%20GPIO%20Definition%20ver%201.0.pdf Pinenut-01S GPIO Definition ver 1.0]&lt;br /&gt;
* [https://files.pine64.org/doc/Pinenut/USB%20Adapter%20for%20Pinenut-01S%20Schematic%20V1.0.pdf USB Programmer adapter for Pinenut-01S schematic ver 1.0]&lt;br /&gt;
* The default firmware runs the UART at 2000000 bps.  It will accept input whilst regularly outputting:&amp;lt;code&amp;gt;&amp;lt;br/&amp;gt;proc_hellow_entry: RISC-V rv32imafc&amp;lt;br/&amp;gt;cur key status:1&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Pinenut-12S Module information ==&lt;br /&gt;
[[File:NUT-12S_module-front.jpg|200px]][[File:NUT-12S_module-back.jpg|200px]]&lt;br /&gt;
* [https://files.pine64.org/doc/Pinenut/NUT-12S%20GPIO%20Definition%20ver%201.0.pdf Pinenut-12S GPIO Definition ver 1.0]&lt;br /&gt;
* Onboard LED is connected to IO0&lt;br /&gt;
&lt;br /&gt;
== Datasheets for components and peripherals ==&lt;br /&gt;
* Bouffalo BL-602 SoC information:&lt;br /&gt;
** [https://github.com/bouffalolab/bl_docs Bouffalo Lab's official bl_docs repository]: should always contain the latest SoC documentation available, in PDF, HTML, and reStructuredText source forms.&lt;br /&gt;
** [https://github.com/pine64/bl602-docs/tree/main/mirrored PINE64's bl602-docs repository]: contains an archive of all historical datasheets and reference manual PDFs but may lag behind Bouffalo's official repository. If you notice that it is, please submit a pull request!&lt;br /&gt;
* USB/Serial adapter:&lt;br /&gt;
** [https://cdn.sparkfun.com/datasheets/Dev/Arduino/Other/CH340DS1.PDF CH340 serial converter]&lt;br /&gt;
&lt;br /&gt;
== Misc notes ==&lt;br /&gt;
Planned to be available in at least three form factors:&lt;br /&gt;
* NUT-01S -&amp;gt; ESP-01S&lt;br /&gt;
* NUT-12S -&amp;gt; ESP-12S&lt;br /&gt;
* NUT-15 -&amp;gt; RTL8723/AMPAK&lt;br /&gt;
&lt;br /&gt;
== Loading code ==&lt;br /&gt;
To load code, you must move the jumper to the position closest to the edge, press reset, load the code, move the jumper back toward the center of the board, and press reset again.&lt;br /&gt;
&lt;br /&gt;
There are currently a number of loaders in progress, each with differing degrees of completeness and success on various operating systems.&lt;br /&gt;
* In the build tree, there is BLFlashCube for Windows, which is a proprietary GUI for flashing images. Linux and macOS binaries are available via [https://dev.bouffalolab.com/download Bouffalo Lab's developer portal].&lt;br /&gt;
* [https://github.com/stschake/bl60x-flash bl60x-flash] is in Python and has been reported successful on MacOS catalina (10.15.6) by Punnerud and madushan1000.&lt;br /&gt;
* [https://github.com/bouffalolab/BLOpenFlasher BLOpenFlasher] is a WIP, written in go, by Bouffalo Labs to provide source for a flash utility.&lt;br /&gt;
* [https://github.com/renzenicolai/bl602tool bl602tool] is a Python utility in development.&lt;br /&gt;
* &amp;lt;del&amp;gt;[https://pypi.org/project/bflb-eflash-loader/ Bouffalo's Python Flash Loader] is a new (Dec 20) flash loader by the makers of the chip.&amp;lt;/del&amp;gt;&lt;br /&gt;
* &amp;lt;del&amp;gt;[https://pypi.org/project/bflb-image-build/ Bouffalo's image build] smooshes code and adds headers for downloads.&amp;lt;/del&amp;gt;&lt;br /&gt;
* [https://pypi.org/project/bflb-mcu-tool/ Bouffalo's MCU tool] (Mar 2021) Python image tool replaced both of the above. Now combined with eflash loader, deals with partitions, DTS, signing, fuses etc.&lt;br /&gt;
* [https://github.com/spacemeowx2/blflash blflash serial flasher] BL602 serial flasher, inspired by BLOpenFlasher&lt;br /&gt;
&lt;br /&gt;
== Development efforts ==&lt;br /&gt;
* [https://github.com/pine64/bl_iot_sdk PineCone BL602 GitHub Page (PINE64 fork)] has compilers, linkers, and all the code to build on Windows, Linux (x86_64), and MacOS.&lt;br /&gt;
* [https://github.com/bouffalolab/bl_iot_sdk Bouffalo Lab GitHub Page]&lt;br /&gt;
* [https://github.com/renzenicolai/bl602-docs/ BL602 Developer organize documentation GitHub Page]&lt;br /&gt;
* [https://github.com/renzenicolai/bl602tool BL602 Developer organize tool GitHub Page]&lt;br /&gt;
* [https://github.com/stschake/bl60x-flash Programming tool for Bouffalo Labs BL602/BL604 chips]&lt;br /&gt;
* [https://github.com/pine64/bl602-re BL602 reverse engineering working group]&lt;br /&gt;
* [https://github.com/pine64/bl602-sdio-linux Linux kernel module]&lt;br /&gt;
* [https://github.com/tchebb/bl602-docs BL602 Documentation]&lt;br /&gt;
* [https://github.com/spacemeowx2/blflash BL602 serial flasher]&lt;br /&gt;
* [https://github.com/mkroman/awesome-bouffalo#feature-matrix Awesome Bouffalo]&lt;br /&gt;
&lt;br /&gt;
== Articles and Blogs ==&lt;br /&gt;
* [https://lupyuen.github.io/articles/pinecone Quick Peek of PineCone BL602 RISC-V Evaluation Board by Lup Yuen]&lt;br /&gt;
* [https://maero.dk/bl602-firmware-image-format/ Documenting the BouffaloLab BL602 firmware image format by MK]&lt;br /&gt;
* [https://lupyuen.github.io/articles/openocd Connect PineCone BL602 to OpenOCD by Lup Yuen]&lt;br /&gt;
* [https://lupyuen.github.io/articles/debug Debug Rust on PineCone BL602 with VSCode and GDB by Lup Yuen]&lt;br /&gt;
* [https://lupyuen.github.io/articles/mynewt Porting Mynewt to PineCone BL602 by Lup Yuen]&lt;br /&gt;
* [https://lupyuen.github.io/articles/flash Flashing Firmware to PineCone BL602 by Lup Yuen]&lt;br /&gt;
* [https://lupyuen.github.io/articles/led Control PineCone BL602 RGB LED with GPIO and PWM by Lup Yuen]&lt;br /&gt;
* [https://lupyuen.github.io/articles/gpio Mynewt GPIO ported to PineCone BL602 RISC-V Board by Lup Yuen]&lt;br /&gt;
* [https://lupyuen.github.io/articles/i2c PineCone BL602 talks to I2C Sensors by Lup Yuen]&lt;br /&gt;
* [https://lupyuen.github.io/articles/spi PineCone BL602 talks SPI too! by Lup Yuen]&lt;br /&gt;
* [https://lupyuen.github.io/articles/display PineCone BL602 Blasting Pixels to ST7789 Display with LVGL Library by Lup Yuen]&lt;br /&gt;
* [https://lupyuen.github.io/articles/uart PineCone BL602 Talks UART to Grove E-Ink Display by Lup Yuen]&lt;br /&gt;
* [https://lupyuen.github.io/articles/book The RISC-V BL602 Book by Lup Yuen]&lt;br /&gt;
* [https://lupyuen.github.io/articles/lora Connect PineCone BL602 to LoRa Transceiver by Lup Yuen]&lt;br /&gt;
* [https://lupyuen.github.io/articles/wisblock RAKwireless WisBlock talks LoRa with PineCone BL602 RISC-V Board by Lup Yuen]&lt;br /&gt;
* [https://lupyuen.github.io/articles/lora2 PineCone BL602 RISC-V Board Receives LoRa Packets by Lup Yuen]&lt;br /&gt;
* [https://lupyuen.github.io/articles/rust Run Rust RISC-V Firmware with BL602 IoT SDK by Lup Yuen]&lt;br /&gt;
* [https://lupyuen.github.io/articles/lorawan PineCone BL602 Talks LoRaWAN by Lup Yuen]&lt;br /&gt;
* [https://lupyuen.github.io/articles/lisp uLisp and Blockly on PineCone BL602 RISC-V Board by Lup Yuen]&lt;br /&gt;
* [https://lupyuen.github.io/articles/wasm Simulate RISC-V BL602 with WebAssembly, uLisp and Blockly by Lup Yuen]&lt;br /&gt;
* [https://lupyuen.github.io/articles/boot BL602 Bootloader by Lup Yuen]&lt;br /&gt;
* [https://lupyuen.github.io/articles/tflite Machine Learning on RISC-V BL602 with TensorFlow Lite by Lup Yuen]&lt;br /&gt;
* [https://lupyuen.github.io/articles/wifi Reverse Engineering WiFi on RISC-V BL602 by Lup Yuen]&lt;br /&gt;
* [https://lupyuen.github.io/articles/adc Rust on RISC-V BL602: Is It Sunny? by Lup Yuen]&lt;br /&gt;
* [https://lupyuen.github.io/articles/rustsim Rust on RISC-V BL602: Simulated with WebAssembly by Lup Yuen]&lt;br /&gt;
* [https://lupyuen.github.io/articles/pinedio PineDio Stack BL604 RISC-V Board: Testing The Prototype by Lup Yuen]&lt;br /&gt;
* [https://lupyuen.github.io/articles/rhai Rust on RISC-V BL602: Rhai Scripting by Lup Yuen]&lt;br /&gt;
* [https://lupyuen.github.io/articles/lorawan2 LoRaWAN on PineDio Stack BL604 RISC-V Board by Lup Yuen]&lt;br /&gt;
* [https://lupyuen.github.io/articles/ttn The Things Network on PineDio Stack BL604 RISC-V Board by Lup Yuen]&lt;br /&gt;
* [https://lupyuen.github.io/articles/cbor Encode Sensor Data with CBOR on BL602 by Lup Yuen]&lt;br /&gt;
* [https://lupyuen.github.io/articles/roblox IoT Digital Twin with Roblox and The Things Network by Lup Yuen]&lt;br /&gt;
* [https://lupyuen.github.io/articles/tsen Internal Temperature Sensor on BL602 by Lup Yuen]&lt;br /&gt;
* [https://lupyuen.github.io/articles/payload CBOR Payload Formatter for The Things Network by Lup Yuen]&lt;br /&gt;
* [https://lupyuen.github.io/articles/prometheus Monitor IoT Devices in The Things Network with Prometheus and Grafana by Lup Yuen]&lt;br /&gt;
* [https://lupyuen.github.io/articles/nuttx Apache NuttX OS on RISC-V BL602 and BL604 by Lup Yuen]&lt;br /&gt;
* [https://lupyuen.github.io/articles/spi2 SPI on Apache NuttX OS by Lup Yuen]&lt;br /&gt;
* [https://lupyuen.github.io/articles/sx1262 LoRa SX1262 on Apache NuttX OS by Lup Yuen]&lt;br /&gt;
* [https://lupyuen.github.io/articles/lorawan3 LoRaWAN on Apache NuttX OS by Lup Yuen]&lt;br /&gt;
* [https://lupyuen.github.io/articles/rust2 Rust on Apache NuttX OS by Lup Yuen]&lt;br /&gt;
* [https://lupyuen.github.io/articles/auto Auto Flash and Test NuttX on RISC-V BL602 by Lup Yuen]&lt;br /&gt;
* [https://lupyuen.github.io/articles/loader BL602 EFlash Loader: Reverse Engineered with Ghidra by Lup Yuen]&lt;br /&gt;
* [https://lupyuen.github.io/articles/ikea Connect IKEA Air Quality Sensor to Apache NuttX OS by Lup Yuen]&lt;br /&gt;
* [https://lupyuen.github.io/articles/bme280 Apache NuttX Driver for BME280 Sensor: Ported from Zephyr OS by Lup Yuen]&lt;br /&gt;
* [https://lupyuen.github.io/articles/rusti2c Rust talks I2C on Apache NuttX RTOS by Lup Yuen]&lt;br /&gt;
* [https://lupyuen.github.io/articles/st7789 ST7789 Display with LVGL Graphics on Apache NuttX RTOS by Lup Yuen]&lt;br /&gt;
* [https://lupyuen.github.io/articles/pinedio2 PineDio Stack BL604 runs Apache NuttX RTOS by Lup Yuen]&lt;br /&gt;
* [https://lupyuen.github.io/articles/touch NuttX Touch Panel Driver for PineDio Stack BL604 by Lup Yuen]&lt;br /&gt;
* [https://www.robertlipe.com/buttons-on-bl602-nuttx/ Buttons on BL602 NuttX]&lt;br /&gt;
* [https://lupyuen.github.io/articles/expander NuttX GPIO Expander for PineDio Stack BL604 by Lup Yuen]&lt;br /&gt;
* [https://lupyuen.github.io/articles/auto2 (Mostly) Automated Testing of Apache NuttX RTOS on PineDio Stack BL604 RISC-V Board by Lup Yuen]&lt;br /&gt;
* [https://lupyuen.github.io/articles/zig Zig on RISC-V BL602: Quick Peek with Apache NuttX RTOS by Lup Yuen]&lt;br /&gt;
* [https://lupyuen.github.io/articles/iot Build an IoT App with Zig and LoRaWAN by Lup Yuen]&lt;br /&gt;
* [https://lupyuen.github.io/articles/lvgl Build an LVGL Touchscreen App with Zig by Lup Yuen]&lt;br /&gt;
* [https://lupyuen.github.io/articles/sensor Read NuttX Sensor Data with Zig by Lup Yuen]&lt;br /&gt;
* [https://lupyuen.github.io/articles/visual Visual Programming with Zig and NuttX Sensors by Lup Yuen]&lt;br /&gt;
* [https://youtu.be/1O5Eb8bKxXA Visual Programming with Zig and Apache NuttX Sensors (Video)]&lt;br /&gt;
&lt;br /&gt;
[[Category:Nutcracker]]&lt;/div&gt;</summary>
		<author><name>Lupyuen</name></author>
	</entry>
	<entry>
		<id>https://wiki.pine64.org/index.php?title=Pinedio&amp;diff=14452</id>
		<title>Pinedio</title>
		<link rel="alternate" type="text/html" href="https://wiki.pine64.org/index.php?title=Pinedio&amp;diff=14452"/>
		<updated>2022-10-14T01:50:17Z</updated>

		<summary type="html">&lt;p&gt;Lupyuen: Add &amp;quot;Apache NuttX RTOS on a RISC-V IoT Gadget: PineDio Stack BL604 (Video)&amp;quot; and &amp;quot;Simpler, safer LVGL Touchscreen Apps with Zig and Apache NuttX RTOS (Video)&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{under construction}}&lt;br /&gt;
&lt;br /&gt;
The '''Pinedio''' is a device utilizing LoRa. LoRa is a long range, low power wireless platform that is being used by a lot of Internet of Things (IoT) products. Using LoRa and LoRaWAN, devices can communicate across the world using the internet, using various decentralised networks such as [https://www.thethingsnetwork.org/ The Things Network] or [https://www.helium.com/ Helium]. Since, PINE64 believes in openness, the LoRa gateway can connect to any network, per the developer implementation. If Helium Spots open up for PINE64 gateway and developers have implemented the hook for Helium, then this is good thing. The PINE64 LoRa gateway also open connect to The Things Network if developers implement support. The choice is yours!&lt;br /&gt;
&lt;br /&gt;
== Gateway ==&lt;br /&gt;
&lt;br /&gt;
The gateway will be available in two variants - indoor and outdoor. All that is known about the outdoor unit is that it will have &amp;quot;an aluminum, rugged and water resistant case&amp;quot;. &lt;br /&gt;
The indoor unit consists of a PINE A64-LTS, fitted with a purpose built hat (adapter) which uses a LoRa module by RakWireless. The chipset used is the SX1302, and the module via the SPI interface. There are two external connections on the enclosure for the GPS and loRa antenna. &lt;br /&gt;
&lt;br /&gt;
=== Connections ===&lt;br /&gt;
* GPS is connected to UART2 on the A64 board&lt;br /&gt;
* SX1302 on SPI0&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|RAK2287 module&lt;br /&gt;
|PI-2 connector&lt;br /&gt;
|PINE A64-LTS&lt;br /&gt;
|-&lt;br /&gt;
|SX1302 SPI&lt;br /&gt;
|Pin 19 = MOSI / PC0&amp;lt;br/&amp;gt;Pin 21 = MISO/PC1&amp;lt;br/&amp;gt;Pin23 = CLK/PC2&amp;lt;br/&amp;gt;Pin24 = CS/PC3&lt;br /&gt;
|SPI0 (/dev/spidev0.0)&lt;br /&gt;
|-&lt;br /&gt;
|SX1302 RESET&lt;br /&gt;
|Pin 11 = GPIO17/PC7&lt;br /&gt;
|GPIO71 (/sys/class/gpio/gpio71)&lt;br /&gt;
|-&lt;br /&gt;
|GPS UART&lt;br /&gt;
|Pin 8 = TX/&amp;lt;br&amp;gt;Pin 10 = RX&lt;br /&gt;
|UART2 (/dev/ttyS2)&lt;br /&gt;
|-&lt;br /&gt;
|GPS RESET&lt;br /&gt;
|Pin 33 = GPIO13/PC5&lt;br /&gt;
|GPIO69 (/sys/class/gpio/gpio69)&lt;br /&gt;
|-&lt;br /&gt;
|GPS Standby&lt;br /&gt;
|Pin 35 = GPIO19/PC9&lt;br /&gt;
|GPIO73 (/sys/class/gpio/gpio73)&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Pictures ===&lt;br /&gt;
&amp;lt;gallery&amp;gt;&lt;br /&gt;
File:Blog-april-InsideLoRaGateway.jpg&lt;br /&gt;
File:Blog-april-InsideLoRaGateway2.jpeg&lt;br /&gt;
File:Discord-lora-gateway-20210413_143615.jpg&lt;br /&gt;
File:Discord-lora-gateway-20210413_1435271.jpg&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Operating System Options===&lt;br /&gt;
&lt;br /&gt;
Pinedio Gateway carries the A64-LTS board. Based on ram specifications SOPINE images are also compatible.&lt;br /&gt;
&lt;br /&gt;
====Armbian====&lt;br /&gt;
&lt;br /&gt;
Gateway Hardware based on Pine64 A64-LTS + RAK2287 + GPS. &lt;br /&gt;
&lt;br /&gt;
Hardware compatible with SOPINE images.&lt;br /&gt;
&lt;br /&gt;
'''PineDio Gateway TTN/Chirpstack Image'''&lt;br /&gt;
&lt;br /&gt;
Debian image with (Default Choices: Chirpstack / TTN) software preinstalled / hardware enabled, available below.&lt;br /&gt;
&lt;br /&gt;
Latest: &lt;br /&gt;
    (PineDio-RAK-Armbian_09-25-2022.img.xz)&lt;br /&gt;
&lt;br /&gt;
    SHA256: 487bbb45ac78a4ee24b80918760673e58222aec60c81251617e932a8265d35b7&lt;br /&gt;
    SHA512: f21ee4e8b8739f2e0efc269ab158224d6dfc55b3d542118fb67286b5337a2499cda52f3df1f05db6b1202553fe227c6b90509275ec4a411b3972f9aefacc5364&lt;br /&gt;
&lt;br /&gt;
DOWNLOAD LOCATION: https://mega.nz/file/zB4gTLRZ#EUlJh2oYLgkfkphPBmQ8ufzQu9_b3nYFDGoXle4xyAk&lt;br /&gt;
&lt;br /&gt;
'''Switch Between Chirpstack / TTN (TheThingsNetwork)'''&lt;br /&gt;
&lt;br /&gt;
  gateway-config&lt;br /&gt;
&lt;br /&gt;
First Select:&lt;br /&gt;
&lt;br /&gt;
  Setup RAK Gateway Channel Plan&lt;br /&gt;
&lt;br /&gt;
Next For TTN (TheThingsNetwork) Select:&lt;br /&gt;
&lt;br /&gt;
  Server is TTN&lt;br /&gt;
&lt;br /&gt;
'''or'''&lt;br /&gt;
&lt;br /&gt;
Next For Chirpstack Select:&lt;br /&gt;
&lt;br /&gt;
  Server is Other server&lt;br /&gt;
&lt;br /&gt;
'''Accessing Chirpstack Admin Page'''&lt;br /&gt;
&lt;br /&gt;
Point web browser to:&lt;br /&gt;
&lt;br /&gt;
  http://gatewayIPaddress:8080&lt;br /&gt;
&lt;br /&gt;
'''Default Chirpstack Credentials'''&lt;br /&gt;
&lt;br /&gt;
  login: admin&lt;br /&gt;
  password: admin&lt;br /&gt;
&lt;br /&gt;
'''SSH Credentials'''&lt;br /&gt;
&lt;br /&gt;
 Login: pinedio&lt;br /&gt;
 password: SoPinePass!!!&lt;br /&gt;
&lt;br /&gt;
'''Changing EUI'''&lt;br /&gt;
&lt;br /&gt;
EUI stored in file:&lt;br /&gt;
&lt;br /&gt;
  /opt/ttn-gateway/packetforwarder/lorapkt_fwd/local_conf.json&lt;br /&gt;
&lt;br /&gt;
(edit EUI file above if you wish change it, and run: sudo systemctl restart ttn-gateway)&lt;br /&gt;
&lt;br /&gt;
'''Additional Shell Commands'''&lt;br /&gt;
&lt;br /&gt;
'''View Gateway ID/EUI'''&lt;br /&gt;
&lt;br /&gt;
  gateway-version&lt;br /&gt;
&lt;br /&gt;
'''Restart Packet Forwarder/Concentrator'''&lt;br /&gt;
&lt;br /&gt;
  sudo systemctl restart ttn-gateway&lt;br /&gt;
&lt;br /&gt;
'''Check Status'''&lt;br /&gt;
&lt;br /&gt;
  sudo systemctl status ttn-gateway&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Enabling Concentrator/GPS Steps (Below Already *Completed* For Above Image Download)'''&lt;br /&gt;
&lt;br /&gt;
Inside armbian-config -&amp;gt; system -&amp;gt; Bootenv (edit boot environment), enter the following 2 lines (to create spidev0.0):&lt;br /&gt;
&lt;br /&gt;
 overlays=spi-spidev uart2 i2c0&lt;br /&gt;
 param_spidev_spi_bus=0&lt;br /&gt;
&lt;br /&gt;
Or you may hand edit: /boot/armbianEnv.txt to add the above overlays/param_spidev_spi_bus lines.&lt;br /&gt;
&lt;br /&gt;
Save. Reboot. &lt;br /&gt;
&lt;br /&gt;
After rebooting you should see a new device /dev/spidev0.0. This will be the concentrator device for gateway related setup.&lt;br /&gt;
&lt;br /&gt;
GPS will be /dev/ttyS2 and should work (after editing armbianEnv.txt + reboot). &lt;br /&gt;
Make sure to offer GPS antenna a strong signal, preferably by a window (if indoors).&lt;br /&gt;
&lt;br /&gt;
== USB adapter ==&lt;br /&gt;
[[File:Pine64-lora-usb-adapter.jpg|500px]]&lt;br /&gt;
&lt;br /&gt;
The Pine64 USB LoRa adapter is based on the Semtech SX1262 LoRa module and the CH341 USB bus converter chip. The '''CH341''' chip can be configured in multiple mode to convert USB to various serial and parallel ports. In this case, it's configured in '''synchronous serial mode''', which allows this chip to convert from USB to the SPI bus needed to talk to the SX1262 LoRa module:&lt;br /&gt;
&lt;br /&gt;
 --------            --------------------------&lt;br /&gt;
 |      |            |   USB LoRa Adapter     |&lt;br /&gt;
 | PC   |  &amp;lt;--USB--&amp;gt; | CH341 &amp;lt;--SPI--&amp;gt; SX1262 |&lt;br /&gt;
 |      |            |       &amp;lt;--I/O--&amp;gt;        |&lt;br /&gt;
 --------            --------------------------&lt;br /&gt;
&lt;br /&gt;
=== Pins ===&lt;br /&gt;
[[File:Lora-usb-pins.jpg|500px]]&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
&lt;br /&gt;
!SX1262 Pin&lt;br /&gt;
!Name&lt;br /&gt;
!Description&lt;br /&gt;
|-&lt;br /&gt;
|1&lt;br /&gt;
|ANT&lt;br /&gt;
|Antenna&lt;br /&gt;
|-&lt;br /&gt;
|2&lt;br /&gt;
|GND2&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|3&lt;br /&gt;
|VREG&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|4&lt;br /&gt;
|DCC&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|5&lt;br /&gt;
|VCC&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|6&lt;br /&gt;
|DIO1&lt;br /&gt;
|Connected on CH341 Pin 7&lt;br /&gt;
|-&lt;br /&gt;
|7&lt;br /&gt;
|DIO2&lt;br /&gt;
|Connected on CH341 Pin6&lt;br /&gt;
|-&lt;br /&gt;
|8&lt;br /&gt;
|DIO3&lt;br /&gt;
|Connected on CH341 Pin 5&lt;br /&gt;
|-&lt;br /&gt;
|9&lt;br /&gt;
|GND&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|10&lt;br /&gt;
|MISO&lt;br /&gt;
|SPI MISO (CH341 Pin 20)&lt;br /&gt;
|-&lt;br /&gt;
|11&lt;br /&gt;
|MOSI&lt;br /&gt;
|SPI MOSI (CH341 Pin 22)&lt;br /&gt;
|-&lt;br /&gt;
|12&lt;br /&gt;
|SCK&lt;br /&gt;
|SPI clock (CH341 Pin 24)&lt;br /&gt;
|- &lt;br /&gt;
|13&lt;br /&gt;
|NSS&lt;br /&gt;
|SPI Chip select&lt;br /&gt;
|-&lt;br /&gt;
|14&lt;br /&gt;
|POR&lt;br /&gt;
|Reset pin&lt;br /&gt;
|-&lt;br /&gt;
|15&lt;br /&gt;
|Busy&lt;br /&gt;
|Busy pin&lt;br /&gt;
|-&lt;br /&gt;
|16&lt;br /&gt;
|GND&lt;br /&gt;
|&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Kernel module for CH341 === &lt;br /&gt;
We need a driver for the CH341 USB bus converter chip. This driver will allow us to send command to the CH341 (SPI messages and access to the GPIOs). I've successfully build and run [https://github.com/rogerjames99/spi-ch341-usb this driver from '''rogerjames99'''] on my desktop computer (running Manjaro Linux) and on my Pinebook Pro (ARM64, running Manjaro ARM Linux). For any kernel newer than 3.10 but mandatory for kernels newer than 5.15 you need to use the [https://github.com/dimich-dmb/spi-ch341-usb dimich-dmb fork of the the '''spi-ch341-usb driver.'''] This fork has updated documentation for the newer kernel interfaces. If this driver gives you problems please drop by any of the social platforms in the Pine64 LoRa chat and give a holler, and if you are using a 5.15 or older kernel you can use the rogerjames99 fork.&lt;br /&gt;
&lt;br /&gt;
 $ git clone https://github.com/rogerjames99/spi-ch341-usb.git &lt;br /&gt;
or&lt;br /&gt;
 $ git clone https://github.com/dimich-dmb/spi-ch341-usb.git&lt;br /&gt;
then&lt;br /&gt;
 $ cd spi-ch341-usb&lt;br /&gt;
 $ make&lt;br /&gt;
 $ sudo make install&lt;br /&gt;
&lt;br /&gt;
Once the driver is installed, unload the module ''ch341'' if it has been automatically loaded:&lt;br /&gt;
&lt;br /&gt;
 $ lsmod |grep ch341&lt;br /&gt;
 $ sudo rmmod ch341&lt;br /&gt;
&lt;br /&gt;
On my setup, ''ch341'' would be automatically loaded once I connected my USB adapter. This module drives the CH341 is asynchronous serial mode, which will not work for a SPI bus. &lt;br /&gt;
&lt;br /&gt;
Then load the new module:&lt;br /&gt;
&lt;br /&gt;
 $ sudo modprobe spi-ch341-usb&lt;br /&gt;
&lt;br /&gt;
Plug your USB adapter and check that the module is correctly loaded : &lt;br /&gt;
&lt;br /&gt;
 $ dmesg&lt;br /&gt;
 [20141.872107] usb 1-1.1: USB disconnect, device number 4&lt;br /&gt;
 [20143.820756] usb 1-1.1: new full-speed USB device number 5 using ehci-platform&lt;br /&gt;
 [20143.973366] usb 1-1.1: New USB device found, idVendor=1a86, idProduct=5512, bcdDevice= 3.04&lt;br /&gt;
 [20143.973413] usb 1-1.1: New USB device strings: Mfr=0, Product=2, SerialNumber=0&lt;br /&gt;
 [20143.973434] usb 1-1.1: Product: USB UART-LPT&lt;br /&gt;
 [20143.975137] spi-ch341-usb 1-1.1:1.0: ch341_usb_probe: connect device&lt;br /&gt;
 [20143.975164] spi-ch341-usb 1-1.1:1.0: ch341_usb_probe: bNumEndpoints=3&lt;br /&gt;
 [20143.975183] spi-ch341-usb 1-1.1:1.0: ch341_usb_probe:   endpoint=0 type=2 dir=1 addr=2&lt;br /&gt;
 [20143.975206] spi-ch341-usb 1-1.1:1.0: ch341_usb_probe:   endpoint=1 type=2 dir=0 addr=2&lt;br /&gt;
 [20143.975229] spi-ch341-usb 1-1.1:1.0: ch341_usb_probe:   endpoint=2 type=3 dir=1 addr=1&lt;br /&gt;
 [20143.975254] spi-ch341-usb 1-1.1:1.0: ch341_cfg_probe: output cs0 SPI slave with cs=0&lt;br /&gt;
 [20143.975273] spi-ch341-usb 1-1.1:1.0: ch341_cfg_probe: output cs0 gpio=0 irq=0 &lt;br /&gt;
 [20143.975295] spi-ch341-usb 1-1.1:1.0: ch341_cfg_probe: output cs1 SPI slave with cs=1&lt;br /&gt;
 [20143.975313] spi-ch341-usb 1-1.1:1.0: ch341_cfg_probe: output cs1 gpio=1 irq=1 &lt;br /&gt;
 [20143.975334] spi-ch341-usb 1-1.1:1.0: ch341_cfg_probe: output cs2 SPI slave with cs=2&lt;br /&gt;
 [20143.975352] spi-ch341-usb 1-1.1:1.0: ch341_cfg_probe: output cs2 gpio=2 irq=2 &lt;br /&gt;
 [20143.975373] spi-ch341-usb 1-1.1:1.0: ch341_cfg_probe: input  gpio4 gpio=3 irq=3 &lt;br /&gt;
 [20143.975394] spi-ch341-usb 1-1.1:1.0: ch341_cfg_probe: input  gpio6 gpio=4 irq=4 &lt;br /&gt;
 [20143.975415] spi-ch341-usb 1-1.1:1.0: ch341_cfg_probe: input  err gpio=5 irq=5 &lt;br /&gt;
 [20143.975435] spi-ch341-usb 1-1.1:1.0: ch341_cfg_probe: input  pemp gpio=6 irq=6 &lt;br /&gt;
 [20143.975456] spi-ch341-usb 1-1.1:1.0: ch341_cfg_probe: input  int gpio=7 irq=7 (hwirq)&lt;br /&gt;
 [20143.975478] spi-ch341-usb 1-1.1:1.0: ch341_cfg_probe: input  slct gpio=8 irq=8 &lt;br /&gt;
 [20143.975499] spi-ch341-usb 1-1.1:1.0: ch341_cfg_probe: input  wait gpio=9 irq=9 &lt;br /&gt;
 [20143.975520] spi-ch341-usb 1-1.1:1.0: ch341_cfg_probe: input  autofd gpio=10 irq=10 &lt;br /&gt;
 [20143.975542] spi-ch341-usb 1-1.1:1.0: ch341_cfg_probe: input  addr gpio=11 irq=11 &lt;br /&gt;
 [20143.975564] spi-ch341-usb 1-1.1:1.0: ch341_cfg_probe: output ini gpio=12 irq=12 &lt;br /&gt;
 [20143.975585] spi-ch341-usb 1-1.1:1.0: ch341_cfg_probe: output write gpio=13 irq=13 &lt;br /&gt;
 [20143.975607] spi-ch341-usb 1-1.1:1.0: ch341_cfg_probe: output scl gpio=14 irq=14 &lt;br /&gt;
 [20143.975628] spi-ch341-usb 1-1.1:1.0: ch341_cfg_probe: output sda gpio=15 irq=15 &lt;br /&gt;
 [20143.975650] spi-ch341-usb 1-1.1:1.0: ch341_spi_probe: start&lt;br /&gt;
 [20143.975677] spi-ch341-usb 1-1.1:1.0: ch341_spi_probe: SPI master connected to SPI bus 1&lt;br /&gt;
 [20143.977831] spi-ch341-usb 1-1.1:1.0: ch341_spi_probe: SPI device /dev/spidev1.0 created&lt;br /&gt;
 [20143.978183] spi-ch341-usb 1-1.1:1.0: ch341_spi_probe: SPI device /dev/spidev1.1 created&lt;br /&gt;
 [20143.978552] spi-ch341-usb 1-1.1:1.0: ch341_spi_probe: SPI device /dev/spidev1.2 created&lt;br /&gt;
 [20143.978726] spi-ch341-usb 1-1.1:1.0: ch341_spi_probe: done&lt;br /&gt;
 [20143.978735] spi-ch341-usb 1-1.1:1.0: ch341_irq_probe: start&lt;br /&gt;
 [20143.979133] spi-ch341-usb 1-1.1:1.0: ch341_irq_probe: irq_base=103&lt;br /&gt;
 [20143.979154] spi-ch341-usb 1-1.1:1.0: ch341_irq_probe: done&lt;br /&gt;
 [20143.979162] spi-ch341-usb 1-1.1:1.0: ch341_gpio_probe: start&lt;br /&gt;
 [20143.979220] spi-ch341-usb 1-1.1:1.0: ch341_gpio_get_direction: gpio=cs0 dir=0&lt;br /&gt;
 [20143.979229] spi-ch341-usb 1-1.1:1.0: ch341_gpio_get_direction: gpio=cs1 dir=0&lt;br /&gt;
 [20143.979237] spi-ch341-usb 1-1.1:1.0: ch341_gpio_get_direction: gpio=cs2 dir=0&lt;br /&gt;
 [20143.979245] spi-ch341-usb 1-1.1:1.0: ch341_gpio_get_direction: gpio=gpio4 dir=1&lt;br /&gt;
 [20143.979253] spi-ch341-usb 1-1.1:1.0: ch341_gpio_get_direction: gpio=gpio6 dir=1&lt;br /&gt;
 [20143.979260] spi-ch341-usb 1-1.1:1.0: ch341_gpio_get_direction: gpio=err dir=1&lt;br /&gt;
 [20143.979268] spi-ch341-usb 1-1.1:1.0: ch341_gpio_get_direction: gpio=pemp dir=1&lt;br /&gt;
 [20143.979275] spi-ch341-usb 1-1.1:1.0: ch341_gpio_get_direction: gpio=int dir=1&lt;br /&gt;
 [20143.979283] spi-ch341-usb 1-1.1:1.0: ch341_gpio_get_direction: gpio=slct dir=1&lt;br /&gt;
 [20143.979290] spi-ch341-usb 1-1.1:1.0: ch341_gpio_get_direction: gpio=wait dir=1&lt;br /&gt;
 [20143.979298] spi-ch341-usb 1-1.1:1.0: ch341_gpio_get_direction: gpio=autofd dir=1&lt;br /&gt;
 [20143.979306] spi-ch341-usb 1-1.1:1.0: ch341_gpio_get_direction: gpio=addr dir=1&lt;br /&gt;
 [20143.979314] spi-ch341-usb 1-1.1:1.0: ch341_gpio_get_direction: gpio=ini dir=0&lt;br /&gt;
 [20143.979321] spi-ch341-usb 1-1.1:1.0: ch341_gpio_get_direction: gpio=write dir=0&lt;br /&gt;
 [20143.979329] spi-ch341-usb 1-1.1:1.0: ch341_gpio_get_direction: gpio=scl dir=0&lt;br /&gt;
 [20143.979337] spi-ch341-usb 1-1.1:1.0: ch341_gpio_get_direction: gpio=sda dir=0&lt;br /&gt;
 [20143.979831] spi-ch341-usb 1-1.1:1.0: ch341_gpio_probe: registered GPIOs from 496 to 511&lt;br /&gt;
 [20143.981152] spi-ch341-usb 1-1.1:1.0: ch341_gpio_probe: done&lt;br /&gt;
 [20143.981212] spi-ch341-usb 1-1.1:1.0: ch341_gpio_poll_function: start&lt;br /&gt;
 [20143.981291] spi-ch341-usb 1-1.1:1.0: ch341_usb_probe: connected&lt;br /&gt;
 [20144.756250] usbcore: registered new interface driver ch341&lt;br /&gt;
 [20144.756334] usbserial: USB Serial support registered for ch341-uart&lt;br /&gt;
&lt;br /&gt;
With kernel 5.16 and newer the output is shorter:&lt;br /&gt;
&lt;br /&gt;
 $ dmesg&lt;br /&gt;
 [ 6744.813564] usb 1-2.1.1: new full-speed USB device number 21 using xhci_hcd&lt;br /&gt;
 [ 6744.904377] usb 1-2.1.1: New USB device found, idVendor=1a86, idProduct=5512, bcdDevice= 3.04&lt;br /&gt;
 [ 6744.904383] usb 1-2.1.1: New USB device strings: Mfr=0, Product=2, SerialNumber=0&lt;br /&gt;
 [ 6744.904385] usb 1-2.1.1: Product: USB UART-LPT&lt;br /&gt;
 [ 6744.960243] spi-ch341-usb 1-2.1.1:1.0: ch341_cfg_probe: output cs0 SPI slave with cs=0&lt;br /&gt;
 [ 6744.960246] spi-ch341-usb 1-2.1.1:1.0: ch341_cfg_probe: output cs1 SPI slave with cs=1&lt;br /&gt;
 [ 6744.960247] spi-ch341-usb 1-2.1.1:1.0: ch341_cfg_probe: output cs2 SPI slave with cs=2&lt;br /&gt;
 [ 6744.960249] spi-ch341-usb 1-2.1.1:1.0: ch341_cfg_probe: input  gpio4 gpio=0 irq=0 (hwirq)&lt;br /&gt;
 [ 6744.960251] spi-ch341-usb 1-2.1.1:1.0: ch341_cfg_probe: input  gpio5 gpio=1 irq=1&lt;br /&gt;
 [ 6744.960302] spi-ch341-usb 1-2.1.1:1.0: ch341_spi_probe: SPI master connected to SPI bus 0&lt;br /&gt;
 [ 6744.960350] spi-ch341-usb 1-2.1.1:1.0: ch341_spi_probe: SPI device /dev/spidev0.0 created&lt;br /&gt;
 [ 6744.960398] spi-ch341-usb 1-2.1.1:1.0: ch341_spi_probe: SPI device /dev/spidev0.1 created&lt;br /&gt;
 [ 6744.960445] spi-ch341-usb 1-2.1.1:1.0: ch341_spi_probe: SPI device /dev/spidev0.2 created&lt;br /&gt;
 [ 6744.960583] spi-ch341-usb 1-2.1.1:1.0: ch341_usb_probe: connected&lt;br /&gt;
&lt;br /&gt;
=== Driver development === &lt;br /&gt;
=====Kernels 5.14 and older=====&lt;br /&gt;
&lt;br /&gt;
Once the module ''spi-ch341-usb'' is correctly loaded, here's how you can transfer data on the SPI bus (in C):&lt;br /&gt;
&lt;br /&gt;
 /* Open the SPI bus */&lt;br /&gt;
 int spi = open(&amp;quot;/dev/spidev1.0&amp;quot;, O_RDWR);&lt;br /&gt;
 uint8_t mmode = SPI_MODE_0;&lt;br /&gt;
 uint8_t lsb = 0;&lt;br /&gt;
 ioctl(spi, SPI_IOC_WR_MODE, &amp;amp;mmode);&lt;br /&gt;
 ioctl(spi, SPI_IOC_WR_LSB_FIRST, &amp;amp;lsb);&lt;br /&gt;
 &lt;br /&gt;
 /* Transfer data */&lt;br /&gt;
 /* TODO: Init buffer_out, buffer_in and size */&lt;br /&gt;
 const uint8_t *mosi = buffer_out; // output data&lt;br /&gt;
 uint8_t *miso = buffer_in; // input data&lt;br /&gt;
 &lt;br /&gt;
 struct spi_ioc_transfer spi_trans;&lt;br /&gt;
 memset(&amp;amp;spi_trans, 0, sizeof(spi_trans));&lt;br /&gt;
 &lt;br /&gt;
 spi_trans.tx_buf = (unsigned long) mosi;&lt;br /&gt;
 spi_trans.rx_buf = (unsigned long) miso;&lt;br /&gt;
 spi_trans.cs_change = true;&lt;br /&gt;
 spi_trans.len = size;&lt;br /&gt;
 &lt;br /&gt;
 int status = ioctl (spi, SPI_IOC_MESSAGE(1), &amp;amp;spi_trans);&lt;br /&gt;
&lt;br /&gt;
To access GPIOs, you first need to export them (to make them accessible via ''/sys/class/gpio''. As you can see in the dmesg output, GPIOs from 496 to 511 were registered, which means we can export 16 GPIOs. The mapping of these I/O is available in the [https://github.com/rogerjames99/spi-ch341-usb/blob/master/spi-ch341-usb.c#L148 source code of the driver]. For example, pin ''slct'' is the 12th, meaning we need to export GPIO 496+12 = 508.&lt;br /&gt;
&lt;br /&gt;
 int  fd;&lt;br /&gt;
 if ((fd = open(&amp;quot;/sys/class/gpio/export&amp;quot;, O_WRONLY)) == -1)   {&lt;br /&gt;
   perror(&amp;quot;open ini&amp;quot;);&lt;br /&gt;
   exit(-1);&lt;br /&gt;
 }&lt;br /&gt;
 &lt;br /&gt;
 if (write(fd, &amp;quot;508&amp;quot;, 3) == -1){&lt;br /&gt;
   perror (&amp;quot;write export 508&amp;quot;);&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
Once exported, the GPIO is available in ''/sys/class/gpio/sclt'' (the naming is specified by the driver). You can read the pin in C:&lt;br /&gt;
&lt;br /&gt;
 int  fd;&lt;br /&gt;
 if ((fd = open(&amp;quot;/sys/class/gpio/slct/value&amp;quot;, O_RDWR)) == -1)   {&lt;br /&gt;
   perror(&amp;quot;open&amp;quot;);&lt;br /&gt;
 }&lt;br /&gt;
 &lt;br /&gt;
 char buf;&lt;br /&gt;
 if (read(fd, &amp;amp;buf, 1) == -1) {&lt;br /&gt;
    perror(&amp;quot;read&amp;quot;);&lt;br /&gt;
 }&lt;br /&gt;
 &lt;br /&gt;
 int value = (buf == '0') ? 0 : 1;&lt;br /&gt;
&lt;br /&gt;
You can also write it:&lt;br /&gt;
&lt;br /&gt;
 int  fd; &lt;br /&gt;
 if ((fd = open(&amp;quot;/sys/class/gpio/ini/value&amp;quot;, O_RDWR)) == -1)   {&lt;br /&gt;
   perror(&amp;quot;open ini&amp;quot;);&lt;br /&gt;
 }&lt;br /&gt;
 &lt;br /&gt;
 if (write(fd, value ? &amp;quot;1&amp;quot; : &amp;quot;0&amp;quot;, 1) == -1) {&lt;br /&gt;
    perror (&amp;quot;write&amp;quot;);&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
=====Kernel 5.15 and newer=====&lt;br /&gt;
&lt;br /&gt;
We need some help documenting how these interfaces work!&lt;br /&gt;
&lt;br /&gt;
The driver creates these interfaces:&lt;br /&gt;
 {| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
  |Pin  ||SPI Function ||GPIO function ||GPIO name ||IRQ&lt;br /&gt;
  |-&lt;br /&gt;
  |15||CS0||-||-||-&lt;br /&gt;
  |-&lt;br /&gt;
  |16||CS1||-||-||-&lt;br /&gt;
  |-&lt;br /&gt;
  |17||CS2||-||-||-&lt;br /&gt;
  |-&lt;br /&gt;
  |19||-||Input||gpio4||hardware&lt;br /&gt;
  |-&lt;br /&gt;
  |21||-||Input||gpio5||software&lt;br /&gt;
 |}&lt;br /&gt;
&lt;br /&gt;
The dimich-dmb fork of spi-ch341-usb works with 5.15+ kernels, but as you can see above it is not configured for the needs of the Pinedio-USB by default. I have started a branch in my fork to work on getting the driver pre-configured for our needs. The branch can be [https://github.com/UncleGrumpy/spi-ch341-usb/tree/pinedio found here.] Please feel free to help! And open issues or discussions in the repo if you have problems or ideas how to help. Any improvements to the actual code beyond configuration should be pushed to the temporary [https://github.com/dimich-dmb/spi-ch341-usb/ upstream.]&lt;br /&gt;
&lt;br /&gt;
Since linux-5.15 binding to spidev driver is required to make slave devices available via /dev/, e.g. for slave 1 on bus 0 as real root (not with sudo):&lt;br /&gt;
&lt;br /&gt;
 # echo spidev &amp;gt; /sys/class/spi_master/spi0/spi0.1/driver_override&lt;br /&gt;
 # echo spi0.1 &amp;gt; /sys/bus/spi/drivers/spidev/bind&lt;br /&gt;
&lt;br /&gt;
For all devices handled by spi_ch341_usb driver (again, only as real root):&lt;br /&gt;
&lt;br /&gt;
 # for i in /sys/bus/usb/drivers/spi-ch341-usb/*/spi_master/spi*/spi*.*; do echo spidev &amp;gt; $i/driver_override; echo $(basename $i) &amp;gt; /sys/bus/spi/drivers/spidev/bind; done&lt;br /&gt;
&lt;br /&gt;
The documentation found at https://github.com/dimich-dmb/spi-ch341-usb/blob/master/README.md has more information.&lt;br /&gt;
&lt;br /&gt;
The 5.15+ driver is not ready yet. But if you are interested in testing, helping to get the configuration right, or working on application development you can build and test the current driver:&lt;br /&gt;
&lt;br /&gt;
 $ git clone -b pinedio https://github.com/UncleGrumpy/spi-ch341-usb.git &lt;br /&gt;
 $ cd spi-ch341-usb&lt;br /&gt;
 $ make&lt;br /&gt;
 $ sudo make install&lt;br /&gt;
&lt;br /&gt;
So far this will automatically set up the SPI slave device /dev/spi0.0. It names the ch341-usb device as &amp;quot;pinedio&amp;quot; this will allow application developers to find the correct gpiochip by name. I need help confirming the correct gpio pins but as of now the driver will setup the following configuration:&lt;br /&gt;
&lt;br /&gt;
The driver uses following CH341A pins for the SPI interface. &lt;br /&gt;
 {| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
  | Pin || Name || Direction || Function SPI (CH341A)&lt;br /&gt;
  |-&lt;br /&gt;
  | 18  || D3   || output    || SCK (DCK)             &lt;br /&gt;
  |-&lt;br /&gt;
  | 20  || D5   || output    || MOSI (DOUT)           &lt;br /&gt;
  |-&lt;br /&gt;
  | 22  || D7   || input     || MISO (DIN)            &lt;br /&gt;
  |-&lt;br /&gt;
  | 15  || D0   || output    || CS0                   &lt;br /&gt;
 |}&lt;br /&gt;
&lt;br /&gt;
The driver uses the following GPIO configuration.  I am not at all sure these are the correct pins to use! This is one area that I could really use some help with!!!&lt;br /&gt;
 {| class=&amp;quot;wikitable&lt;br /&gt;
  | CH341 Pin || CH341A Name || Function   || GPIO Name  || GPIO Configuration || SX1262 connection&lt;br /&gt;
  |-&lt;br /&gt;
  |  7        || INT#        || IRQ        || dio_irq    || Output             || DIO1 (IRQ)        &lt;br /&gt;
  |-&lt;br /&gt;
  |  8        || SLCT        || BUSY       || dio_busy   || Input              || BUSY              &lt;br /&gt;
  |-&lt;br /&gt;
  | 26        || RST#        || Hard Reset || dio_reset  || Output             || NRESET            &lt;br /&gt;
 |}&lt;br /&gt;
&lt;br /&gt;
The function of these pins can be changed from user space by using libgpiod. The command line tools installed with the library (gpioset, gpioget, gpiodetect, gpioinfo...) can be used for bash scripts, etc. and applications should all use the libgpiod interfaces. The /sys/class/gpio interface has been removed from the kernel in 5.15, so any apps using /sys/class/gpio to access gpio pins are broken, or will be as distos update their kernels to 5.15 and beyond.&lt;br /&gt;
&lt;br /&gt;
GPIO pins can be listed with gpioinfo:&lt;br /&gt;
 $ gpioinfo pinedio&lt;br /&gt;
&lt;br /&gt;
The output should look similar to:&lt;br /&gt;
 gpiochip1 - 3 lines:&lt;br /&gt;
         line   0:    &amp;quot;dio_irq&amp;quot;       unused   input  active-high&lt;br /&gt;
         line   1:   &amp;quot;dio_busy&amp;quot;       unused   input  active-high&lt;br /&gt;
         line   2:  &amp;quot;dio_reset&amp;quot;       unused  output  active-high&lt;br /&gt;
&lt;br /&gt;
The gpiochip# might be different.  The driver exposes the Pinedio with the gpio name &amp;quot;pinedio&amp;quot;, developers should use this name to interact with the gpiochip because the gpiochip# of the device is likely to be different from one system to the next, or depending on the order devices are initialized.&lt;br /&gt;
&lt;br /&gt;
=== Driver for the SX1262 LoRa module ===&lt;br /&gt;
Now that we can talk to the SX1262 via the CH341 USB converter chip, we need to send actual commands to make it emit or receive LoRa messages. To do this, you can implement the driver yourself using info from the datasheet, or use an existing driver (you can easily find drivers for the Arduino framework, for example. &lt;br /&gt;
I found [https://github.com/YukiWorkshop/sx126x_driver this C++ driver]. It's well written, lightweight and easily portable across many platforms. All you have to do is implement 3 HAL function : read GPIO, write GPIO and transfer data on SPI. I wrote a quick'n'dirty app that emits a LoRa frame. It's [https://gist.github.com/JF002/f1af5595874942427eea9d375c18fc73 available here]. &lt;br /&gt;
&lt;br /&gt;
As I don't have any 'raw' LoRa device on hands, I check that it was actually transmitting something using my SDR setup (simple TNT usb key and '''Gqrx''' software):&lt;br /&gt;
&lt;br /&gt;
[[File:pine64-lora-usb-adapter-sdr.png|500px]]&lt;br /&gt;
&lt;br /&gt;
== Other end nodes ==&lt;br /&gt;
&lt;br /&gt;
There are several end-node units planned:&lt;br /&gt;
* loRa back case for the PinePhone&lt;br /&gt;
* standalone USB dongle-type end-node adapter&lt;br /&gt;
* PineTab adapter&lt;br /&gt;
* as well as a SPI module (which can also be configured as a USB LoRa dongle)&lt;br /&gt;
* a LoRa stick powered by a single 18650 battery (using the [https://wiki.pine64.org/wiki/Nutcracker BL602], and can be fitted with GPS, an low-power OLED panel and additional sensors)&lt;br /&gt;
&lt;br /&gt;
All the end-nodes use the SX1262 chip. &lt;br /&gt;
&lt;br /&gt;
=== Pictures ===&lt;br /&gt;
&amp;lt;gallery&amp;gt;&lt;br /&gt;
File:Blog-april-USB-LoRa-1024x655.jpg&lt;br /&gt;
File:Blog-april-LoRa-something-839x1024.jpg&lt;br /&gt;
File:Discord_20210421_lora_usb_closeup.jpg&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Datasheets and schematics ==&lt;br /&gt;
=== Gateway ===&lt;br /&gt;
* [https://www.semtech.com/products/wireless-rf/lora-gateways/sx1302 SX1302 datasheets and resources]&lt;br /&gt;
* [https://docs.rakwireless.com/Product-Categories/WisLink/RAK2247/Overview/ RAK2287 datasheets and resources]&lt;br /&gt;
* [https://wiki.pine64.org/images/5/54/PINE64_LoRa_Gateway_Module_Adapter_Schematic-v1.0-20210308.pdf Pine64 LoRa Gateway module adapter schematic]&lt;br /&gt;
&lt;br /&gt;
=== End nodes ===&lt;br /&gt;
* [https://www.semtech.com/products/wireless-rf/lora-transceivers/sx1262 SX1262 datasheets and resources]&lt;br /&gt;
&lt;br /&gt;
=== Pinephone backplate ===&lt;br /&gt;
* [[File:Pinephone_LoRa_BackPanel_Schematic-v1.0-20210402.pdf]]&lt;br /&gt;
* [[File:CA-S01_LoRa_Chip_Antenna_in_Chinese.pdf]]&lt;br /&gt;
* [https://github.com/zschroeder6212/tiny-i2c-spi I2C SPI Bridge code running on ATtiny84]&lt;br /&gt;
&lt;br /&gt;
=== USB LoRa adapter ===&lt;br /&gt;
* [[File:USB_LoRa_adapter-PINE64_RFM90_SCH_2021_04_26.pdf]]&lt;br /&gt;
* CH341 datasheet : [[File:CH341DS1.pdf]]&lt;br /&gt;
* Semtech SX1262 datasheet : [https://semtech.my.salesforce.com/sfc/p/#E0000000JelG/a/2R000000HT76/7Nka9W5WgugoZe.xwIHJy6ebj1hW8UJ.USO_Pt2CLLo File on Semtech website (file is too big for the wiki)]&lt;br /&gt;
&lt;br /&gt;
=== PineDio Stack ===&lt;br /&gt;
* Schematic : [[File:PINEDIO_STACK_V1_0-2021_05_24C.pdf]]&lt;br /&gt;
&lt;br /&gt;
== Other resources ==&lt;br /&gt;
* [https://www.youtube.com/watch?v=cJ0wpANpbyc Video: A peek at Pine64's LoRa gateway and modules]&lt;br /&gt;
* [https://iotw.io/ IOTW - Blockchain-Enabled IoT Data Platform]&lt;br /&gt;
* [https://lupyuen.github.io/articles/pinedio PineDio Stack BL604 RISC-V Board: Testing The Prototype]&lt;br /&gt;
* [https://lupyuen.github.io/articles/lorawan2 LoRaWAN on PineDio Stack BL604 RISC-V Board]&lt;br /&gt;
* [https://lupyuen.github.io/articles/ttn The Things Network on PineDio Stack BL604 RISC-V Board]&lt;br /&gt;
* [https://lupyuen.github.io/articles/prometheus Monitor IoT Devices in The Things Network with Prometheus and Grafana]&lt;br /&gt;
* [https://lupyuen.github.io/articles/tsen Internal Temperature Sensor on BL602]&lt;br /&gt;
* [https://lupyuen.github.io/articles/roblox IoT Digital Twin with Roblox and The Things Network]&lt;br /&gt;
* [https://lupyuen.github.io/articles/gateway PineDio LoRa Gateway: Testing The Prototype]&lt;br /&gt;
* [https://lupyuen.github.io/articles/nuttx Apache NuttX OS on RISC-V BL602 and BL604]&lt;br /&gt;
* [https://lupyuen.github.io/articles/spi2 SPI on Apache NuttX OS]&lt;br /&gt;
* [https://lupyuen.github.io/articles/sx1262 LoRa SX1262 on Apache NuttX OS]&lt;br /&gt;
* [https://lupyuen.github.io/articles/lorawan3 LoRaWAN on Apache NuttX OS]&lt;br /&gt;
* [https://lupyuen.github.io/articles/rust2 Rust on Apache NuttX OS]&lt;br /&gt;
* [https://lupyuen.github.io/articles/ikea Connect IKEA Air Quality Sensor to Apache NuttX OS]&lt;br /&gt;
* [https://lupyuen.github.io/articles/pinedio2 PineDio Stack BL604 runs Apache NuttX RTOS]&lt;br /&gt;
* [https://lupyuen.github.io/articles/touch NuttX Touch Panel Driver for PineDio Stack BL604]&lt;br /&gt;
* [https://www.robertlipe.com/buttons-on-bl602-nuttx/ Buttons on BL602 NuttX]&lt;br /&gt;
* [https://lupyuen.github.io/articles/expander NuttX GPIO Expander for PineDio Stack BL604]&lt;br /&gt;
* [https://lupyuen.github.io/articles/auto2 (Mostly) Automated Testing of Apache NuttX RTOS on PineDio Stack BL604 RISC-V Board]&lt;br /&gt;
* [https://lupyuen.github.io/articles/zig Zig on RISC-V BL602: Quick Peek with Apache NuttX RTOS]&lt;br /&gt;
* [https://lupyuen.github.io/articles/iot Build an IoT App with Zig and LoRaWAN]&lt;br /&gt;
* [https://lupyuen.github.io/articles/lvgl Build an LVGL Touchscreen App with Zig]&lt;br /&gt;
* [https://youtu.be/_vADRu939sI Apache NuttX RTOS on a RISC-V IoT Gadget: PineDio Stack BL604 (Video)]&lt;br /&gt;
* [https://youtu.be/-2OIHur8X1E Simpler, safer LVGL Touchscreen Apps with Zig and Apache NuttX RTOS (Video)]&lt;/div&gt;</summary>
		<author><name>Lupyuen</name></author>
	</entry>
	<entry>
		<id>https://wiki.pine64.org/index.php?title=Ox64&amp;diff=14451</id>
		<title>Ox64</title>
		<link rel="alternate" type="text/html" href="https://wiki.pine64.org/index.php?title=Ox64&amp;diff=14451"/>
		<updated>2022-10-13T23:45:36Z</updated>

		<summary type="html">&lt;p&gt;Lupyuen: Add Rust PAC and SVD&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[File:Ox64_board.jpg|400px|thumb|right|The Ox64]]&lt;br /&gt;
&lt;br /&gt;
The '''Ox64''' is a RISC-V based Single Board Computer powered by Bouffalo Lab BL808 C906 64-Bit RISC-V CPU, 32-Bit CPU, embedded 64MB PSRAM memory and build-on 3 radio RF (Wifi, BT, Zigbee). It provides breadboard friendly form factor, MicroSD Card slot, USB 2.0, and many other peripheral interfaces for makers to integrate with sensors and other devices.&lt;br /&gt;
&lt;br /&gt;
[[File:RISC-V.png|600px|]]&lt;br /&gt;
&lt;br /&gt;
== Software releases ==&lt;br /&gt;
&lt;br /&gt;
=== Quick Links to the Source of OS Images Build ===&lt;br /&gt;
&lt;br /&gt;
OS images are still in '''alpha build''' which are only fit for board bring up and testing purposes. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== SoC and Memory Specification ==&lt;br /&gt;
* Based on [https://en.bouffalolab.com/product/ Bouffalo Lab BL808]&lt;br /&gt;
[[File:Bouffalo_Lab_icon.png|right]]&lt;br /&gt;
[[File:BL808_Block_Diagram.jpg|600px]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== CPU Architecture ===&lt;br /&gt;
* [https://www.t-head.cn/product/c906?lang=en T_head C906 480MHz 64-bit RISC-V CPU]&lt;br /&gt;
[[File:T-Head.png|right|200px]]&lt;br /&gt;
** Supports RISC-V RV64IMAFCV instruction architecture&lt;br /&gt;
** Five-stage single-issue sequentially executed pipeline&lt;br /&gt;
** Level-1 instruction and data cache of Harvard architecture, with a size of 32 KB and a cache line of 64B&lt;br /&gt;
** Sv39 memory management unit, realizing the conversion of virtual and real addresses and memory management&lt;br /&gt;
** jTLB that supports 128 entries&lt;br /&gt;
** Supports AXI 4.0 128-bit master interface&lt;br /&gt;
** Supports core local interrupt (CLINT) and platform-level interrupt controller (PLIC)&lt;br /&gt;
** With 80 external interrupt sources, 3 bits for configuring interrupt priority&lt;br /&gt;
** Supports BHT (8K) and BTB&lt;br /&gt;
** Compatible with RISC-V PMP, 8 configurable areas&lt;br /&gt;
** Supports hardware performance monitor (HPM) units&lt;br /&gt;
&lt;br /&gt;
* [https://www.t-head.cn/product/e907?lang=en T_head E907 320MHz 32-bit RISC-V CPU]&lt;br /&gt;
** Supports RISC-V RV32IMAFCP instruction set&lt;br /&gt;
** Supports RISC-V 32-bit/16-bit mixed instruction set&lt;br /&gt;
** Supports RISC-V machine mode and user mode&lt;br /&gt;
** Thirty-two 32-bit integer general purpose registers (GPR) and thirty-two 32-bit/64-bit floating-point GPRs&lt;br /&gt;
** Integer (5-stage)/floating-point (7-stage), single-issue, sequentially executed pipeline&lt;br /&gt;
** Supports AXI 4.0 main device interface and AHB 5.0 peripheral interface&lt;br /&gt;
** 32K instruction cache, two-way set associative structure&lt;br /&gt;
** 16K data cache, two-way set associative structure&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== System Memory ===&lt;br /&gt;
* Embedded 64MB PSRAM&lt;br /&gt;
&lt;br /&gt;
== Board Features ==&lt;br /&gt;
&lt;br /&gt;
=== Network ===&lt;br /&gt;
* 2.4GHz 1T1R WiFi 802.11 b/g/n&lt;br /&gt;
* Bluetooth 5.2&lt;br /&gt;
* Zigbee&lt;br /&gt;
* 10/100Mbps Ethernet (optional, on expansion board)&lt;br /&gt;
&lt;br /&gt;
=== Storage ===&lt;br /&gt;
* on-board 16Mb (2MB) or 128Mb (16MB) XSPI NOR flash memory&lt;br /&gt;
* microSD - supports SDHC and SDXC&lt;br /&gt;
&lt;br /&gt;
=== Expansion Ports ===&lt;br /&gt;
* USB 2.0 OTG port&lt;br /&gt;
* 26 GPIO Pins, including SPI, I2C and UART functionality. Possible I2S and GMII expansion&lt;br /&gt;
* Dual lane MiPi CSI port, located at USB-C port, for camera module&lt;br /&gt;
&lt;br /&gt;
=== Audio ===&lt;br /&gt;
* mic (optional, on camera module)&lt;br /&gt;
* speaker (optional, on camera module)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Board Information, Schematics and Certifications ==&lt;br /&gt;
* Baseboard Dimensions: 51mm x 21mm x 19mm x 3.5mm (Breadboard friendly)&lt;br /&gt;
* Input Power: 5V 0.5A microSD or USB-C port&lt;br /&gt;
* Schematic:&lt;br /&gt;
** [https://files.pine64.org/doc/ox64/PINE64_Ox64-Schematic-202221007.pdf Ox64 Schematic 20221007 v1.0]&lt;br /&gt;
** [https://files.pine64.org/doc/ox64/PINE64_Ox64_PCB_Placement-Top-20221007.pdf Ox64 PCB Component placement(ToP) 20221007 v1.0]&lt;br /&gt;
** [https://files.pine64.org/doc/ox64/PINE64_Ox64_PCB_Placement-Bottom-20221007.pdf Ox64 PCB Component placement(Bottom) 20221007 v1.0]&lt;br /&gt;
* Certifications:&lt;br /&gt;
** Disclaimer: Please note that PINE64 SBC is not a &amp;quot;final&amp;quot; product and in general certification is not necessary. However, PINE64 still submits the SBC for FCC, CE, and ROHS certifications and obtain the certificates to prove that the SBC board can pass the testing. Please note, a final commercial product needs to perform its own testing and obtain its own certificate.&lt;br /&gt;
** Not yet available&lt;br /&gt;
&lt;br /&gt;
== Datasheets for Components and Peripherals ==&lt;br /&gt;
* Bouffalo BL808 SoC information:&lt;br /&gt;
** [https://files.pine64.org/doc/datasheet/ox64/BL808_DS_en_1.1(open).pdf Bouffalo Lab BL808 SoC Datasheet]&lt;br /&gt;
** [https://files.pine64.org/doc/datasheet/ox64/BL808_RM_en_1.0(open).pdf Bouffalo Lab BL808 SoC Reference Manual]&lt;br /&gt;
* SPI NOR Flash information:&lt;br /&gt;
** [https://files.pine64.org/doc/datasheet/ox64/gd25lq16e_rev1.2_20210108.pdf GigaDevive 16Mb XSPI-Flash Datasheet]&lt;br /&gt;
** [https://files.pine64.org/doc/datasheet/star64/gd25lq128e_rev1.0_20210513.pdf GigaDevive 128Mb XSPI-Flash Datasheet]&lt;br /&gt;
* Power Regulator information:&lt;br /&gt;
** [https://files.pine64.org/doc/datasheet/ox64/IA2014-03.pdf Innovation Analog Tech IA2014 Step_down Converter Datasheet]&lt;br /&gt;
&lt;br /&gt;
== Development efforts ==&lt;br /&gt;
* [https://github.com/bouffalolab/bl808-pac Rust Peripheral Access Crate (PAC) for BL808]&lt;br /&gt;
* [https://github.com/bouffalolab/bl808-pac/blob/main/bl808.svd System View Description (SVD) for BL808]&lt;br /&gt;
&lt;br /&gt;
[[Category:Ox64]] [[Category:Bouffalo BL808]]&lt;/div&gt;</summary>
		<author><name>Lupyuen</name></author>
	</entry>
	<entry>
		<id>https://wiki.pine64.org/index.php?title=PineCone&amp;diff=13604</id>
		<title>PineCone</title>
		<link rel="alternate" type="text/html" href="https://wiki.pine64.org/index.php?title=PineCone&amp;diff=13604"/>
		<updated>2022-08-18T04:06:17Z</updated>

		<summary type="html">&lt;p&gt;Lupyuen: Add article &amp;quot;Visual Programming with Zig and NuttX Sensors&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[File:Pine64_BL602_EVB_photo-3-small.jpg|thumb|PineCone BL602 EVB (Evaluation Board)]]&lt;br /&gt;
&lt;br /&gt;
The '''PineCone''' is a BL602 evaluation board, which was developed with the goal to challenge the open source community to achieve blob-free and free and open source WiFi and Bluetooth, see the [https://www.pine64.org/2020/10/28/nutcracker-challenge-blob-free-wifi-ble/ Nutcracker Challenge].&lt;br /&gt;
&lt;br /&gt;
== BL602 Specifications ==&lt;br /&gt;
* '''CPU:''' 32-bit RV32IMAFC RISC-V “SiFive E24 Core”&lt;br /&gt;
** [https://www.sifive.com/cores/e24 SiFive E24 Core information]&lt;br /&gt;
* '''Memory:'''&lt;br /&gt;
** 128KB ROM&lt;br /&gt;
** 276KB SRAM&lt;br /&gt;
** 1Kb eFuse&lt;br /&gt;
** 2MB Embedded Flash&lt;br /&gt;
* '''Security:'''&lt;br /&gt;
** Secure boot&lt;br /&gt;
** Secure debug&lt;br /&gt;
** AES 128/192/256&lt;br /&gt;
** SHA-1/224/256&lt;br /&gt;
** TRNG (True Random Number Generator)&lt;br /&gt;
** PKA (Public Key Accelerator)&lt;br /&gt;
* '''Wireless:'''&lt;br /&gt;
** Wi-Fi 802.11 b/g/n&lt;br /&gt;
** Bluetooth® Low Energy 5.0&lt;br /&gt;
** Wi-Fi Fast connection with BLE assistance&lt;br /&gt;
** Wi-Fi and BLE coexistence&lt;br /&gt;
** Wi-Fi Security WPS/WEP/WPA/WPA2/WPA3&lt;br /&gt;
** STA, SoftAP and sniffer modes&lt;br /&gt;
** Multi-Cloud connectivity&lt;br /&gt;
** 2.4 GHz RF transceiver&lt;br /&gt;
** Integrated RF balun, PA/LNA&lt;br /&gt;
* '''Package Type:'''&lt;br /&gt;
** 32 pin QFN 4mm x 4mm&lt;br /&gt;
* JTAG support (See below for BL602 impact)&lt;br /&gt;
&lt;br /&gt;
[[File:BL602_Block_Diagram.jpg|600px]]&lt;br /&gt;
&lt;br /&gt;
== JTAG ==&lt;br /&gt;
{| class=&amp;quot;wikitable floatright&amp;quot;&lt;br /&gt;
|+ Default JTAG pins&lt;br /&gt;
|-&lt;br /&gt;
| GPIO Pin || JTAG Pin&lt;br /&gt;
|-&lt;br /&gt;
| GPIO17 || TDI&lt;br /&gt;
|-&lt;br /&gt;
| GPIO11 || TDO&lt;br /&gt;
|-&lt;br /&gt;
| GPIO12 || TMS&lt;br /&gt;
|-&lt;br /&gt;
| GPIO14 || TCK&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
BL602 multiplexes four GPIO pins to provide the familiar JTAG lines. See the accompanying table for the default pin mappings.&lt;br /&gt;
&lt;br /&gt;
These are the default JTAG pins in use after a cold boot. However, many pieces of software, including the demo that's installed by default on new PineCones, remap these pins to other functions. You cannot use the default wiring for JTAG while such software is running. This issue is especially prevalent on the PineCone because three of the default JTAG pins are connected to the onboard RGB LED. Nothing about the LED itself interferes with JTAG, but any program that uses the LED will necessarily remap some of the default JTAG pins to be GPIO.&lt;br /&gt;
&lt;br /&gt;
The MaskROM download mode that the BL602 enters when you tie GPIO8 high does '''not''' remap the default JTAG pins, and so you can and should use that mode while checking basic functionality of your JTAG adapter.&lt;br /&gt;
&lt;br /&gt;
Note that, just as software can remap the default JTAG pins to be something else, it can also remap other pins to be JTAG. Control over this is quite granular, with 5-6 candidate pins for each individual JTAG signal that can be mapped independently of one another. LEE Lup Yuen has written some [https://lupyuen.github.io/articles/openocd#free-the-led-from-jtag-port sample code] showing how to remap the JTAG pins so that your software can use the LED without giving up support for debugging.&lt;br /&gt;
&lt;br /&gt;
== Pine64 USB JTAG Adapter information and schematics ==&lt;br /&gt;
* [https://files.pine64.org/doc/Pinenut/PINE64%20USB%20JTAG%20Adapter%20Schematic-20201215.pdf PINE64 USB JTAG Adapter Schematic-20201215.pdf (pine64_ft232hl_board-2020-12-14)] &lt;br /&gt;
* [[:File:PINE64_USB_JTAG_Adapter_Schematic_ver_1.0a-20210109.pdf|PINE64 USB JTAG Adapter schematic 20210109 1.0a]]&lt;br /&gt;
&lt;br /&gt;
== PineCone BL602 EVB information and schematics ==&lt;br /&gt;
* Approximate dimensions: 26mm x 43mm&lt;br /&gt;
* Board layout:&lt;br /&gt;
[[File:PADI-II_EVB.png]]&lt;br /&gt;
* [https://files.pine64.org/doc/Pinenut/Pine64%20BL602%20EVB%20Schematic%20ver%201.1.pdf PineCone BL602 EVB schematic ver 1.1]&lt;br /&gt;
** Note: In PineCone revision 1.1 (&amp;quot;BL62B_EVB V1.1&amp;quot; silkscreened on back of board), CC1 and CC2 share one 5.1KΩ resistor. This means the board will fail to power when you use an e-marked USB-C cable like the one that comes with Apple chargers. See [https://medium.com/@leung.benson/how-to-design-a-proper-usb-c-power-sink-hint-not-the-way-raspberry-pi-4-did-it-f470d7a5910 this article] for details of why this happens. The next schematic design will give each line its own 5.1KΩ resistor as per the USB-C specification.&lt;br /&gt;
* The board uses a CH340 Serial/USB adapter. This chip is commonly used in Arduino-class development boards. It is a full speed (12Mbps) USB interface and has vendor ID 0x1a86 with product ID 0x7523.&lt;br /&gt;
* The GPIO pins (11, 12, 14, 17) plus the nearby RESET, POWER, and GND pins are all located on one side of the board, on J1 to provide JTAG connection.&lt;br /&gt;
&lt;br /&gt;
== Pinenut-01S Module information and schematics ==&lt;br /&gt;
[[File:Pinenut-01S_PCB-Front.png|225px]][[File:Pinenut-01S_PCB-Back.png|225px]]&lt;br /&gt;
* [https://files.pine64.org/doc/Pinenut/Pinenut-01S%20V1.01%20SCH.pdf Pinenut-01S schematic ver 1.01]&lt;br /&gt;
* [https://wiki.pine64.org/images/6/6b/PineNut-01S_v1.01_KiCad.zip PineNut-01S KiCad schematic ver 1.01]&lt;br /&gt;
* [https://files.pine64.org/doc/Pinenut/NUT-01S%20GPIO%20Definition%20ver%201.0.pdf Pinenut-01S GPIO Definition ver 1.0]&lt;br /&gt;
* [https://files.pine64.org/doc/Pinenut/USB%20Adapter%20for%20Pinenut-01S%20Schematic%20V1.0.pdf USB Programmer adapter for Pinenut-01S schematic ver 1.0]&lt;br /&gt;
* The default firmware runs the UART at 2000000 bps.  It will accept input whilst regularly outputting:&amp;lt;code&amp;gt;&amp;lt;br/&amp;gt;proc_hellow_entry: RISC-V rv32imafc&amp;lt;br/&amp;gt;cur key status:1&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Pinenut-12S Module information ==&lt;br /&gt;
[[File:NUT-12S_module-front.jpg|200px]][[File:NUT-12S_module-back.jpg|200px]]&lt;br /&gt;
* [https://files.pine64.org/doc/Pinenut/NUT-12S%20GPIO%20Definition%20ver%201.0.pdf Pinenut-12S GPIO Definition ver 1.0]&lt;br /&gt;
* Onboard LED is connected to IO0&lt;br /&gt;
&lt;br /&gt;
== Datasheets for components and peripherals ==&lt;br /&gt;
* Bouffalo BL-602 SoC information:&lt;br /&gt;
** [https://github.com/bouffalolab/bl_docs Bouffalo Lab's official bl_docs repository]: should always contain the latest SoC documentation available, in PDF, HTML, and reStructuredText source forms.&lt;br /&gt;
** [https://github.com/pine64/bl602-docs/tree/main/mirrored PINE64's bl602-docs repository]: contains an archive of all historical datasheets and reference manual PDFs but may lag behind Bouffalo's official repository. If you notice that it is, please submit a pull request!&lt;br /&gt;
* USB/Serial adapter:&lt;br /&gt;
** [https://cdn.sparkfun.com/datasheets/Dev/Arduino/Other/CH340DS1.PDF CH340 serial converter]&lt;br /&gt;
&lt;br /&gt;
== Misc notes ==&lt;br /&gt;
Planned to be available in at least three form factors:&lt;br /&gt;
* NUT-01S -&amp;gt; ESP-01S&lt;br /&gt;
* NUT-12S -&amp;gt; ESP-12S&lt;br /&gt;
* NUT-15 -&amp;gt; RTL8723/AMPAK&lt;br /&gt;
&lt;br /&gt;
== Loading code ==&lt;br /&gt;
To load code, you must move the jumper to the position closest to the edge, press reset, load the code, move the jumper back toward the center of the board, and press reset again.&lt;br /&gt;
&lt;br /&gt;
There are currently a number of loaders in progress, each with differing degrees of completeness and success on various operating systems.&lt;br /&gt;
* In the build tree, there is BLFlashCube for Windows, which is a proprietary GUI for flashing images. Linux and macOS binaries are available via [https://dev.bouffalolab.com/download Bouffalo Lab's developer portal].&lt;br /&gt;
* [https://github.com/stschake/bl60x-flash bl60x-flash] is in Python and has been reported successful on MacOS catalina (10.15.6) by Punnerud and madushan1000.&lt;br /&gt;
* [https://github.com/bouffalolab/BLOpenFlasher BLOpenFlasher] is a WIP, written in go, by Bouffalo Labs to provide source for a flash utility.&lt;br /&gt;
* [https://github.com/renzenicolai/bl602tool bl602tool] is a Python utility in development.&lt;br /&gt;
* &amp;lt;del&amp;gt;[https://pypi.org/project/bflb-eflash-loader/ Bouffalo's Python Flash Loader] is a new (Dec 20) flash loader by the makers of the chip.&amp;lt;/del&amp;gt;&lt;br /&gt;
* &amp;lt;del&amp;gt;[https://pypi.org/project/bflb-image-build/ Bouffalo's image build] smooshes code and adds headers for downloads.&amp;lt;/del&amp;gt;&lt;br /&gt;
* [https://pypi.org/project/bflb-mcu-tool/ Bouffalo's MCU tool] (Mar 2021) Python image tool replaced both of the above. Now combined with eflash loader, deals with partitions, DTS, signing, fuses etc.&lt;br /&gt;
* [https://github.com/spacemeowx2/blflash blflash serial flasher] BL602 serial flasher, inspired by BLOpenFlasher&lt;br /&gt;
&lt;br /&gt;
== Development efforts ==&lt;br /&gt;
* [https://github.com/pine64/bl_iot_sdk PineCone BL602 GitHub Page (PINE64 fork)] has compilers, linkers, and all the code to build on Windows, Linux (x86_64), and MacOS.&lt;br /&gt;
* [https://github.com/bouffalolab/bl_iot_sdk Bouffalo Lab GitHub Page]&lt;br /&gt;
* [https://github.com/renzenicolai/bl602-docs/ BL602 Developer organize documentation GitHub Page]&lt;br /&gt;
* [https://github.com/renzenicolai/bl602tool BL602 Developer organize tool GitHub Page]&lt;br /&gt;
* [https://github.com/stschake/bl60x-flash Programming tool for Bouffalo Labs BL602/BL604 chips]&lt;br /&gt;
* [https://github.com/pine64/bl602-re BL602 reverse engineering working group]&lt;br /&gt;
* [https://github.com/pine64/bl602-sdio-linux Linux kernel module]&lt;br /&gt;
* [https://github.com/tchebb/bl602-docs BL602 Documentation]&lt;br /&gt;
* [https://github.com/spacemeowx2/blflash BL602 serial flasher]&lt;br /&gt;
* [https://github.com/mkroman/awesome-bouffalo#feature-matrix Awesome Bouffalo]&lt;br /&gt;
&lt;br /&gt;
== Articles and Blogs ==&lt;br /&gt;
* [https://lupyuen.github.io/articles/pinecone Quick Peek of PineCone BL602 RISC-V Evaluation Board by Lup Yuen]&lt;br /&gt;
* [https://maero.dk/bl602-firmware-image-format/ Documenting the BouffaloLab BL602 firmware image format by MK]&lt;br /&gt;
* [https://lupyuen.github.io/articles/openocd Connect PineCone BL602 to OpenOCD by Lup Yuen]&lt;br /&gt;
* [https://lupyuen.github.io/articles/debug Debug Rust on PineCone BL602 with VSCode and GDB by Lup Yuen]&lt;br /&gt;
* [https://lupyuen.github.io/articles/mynewt Porting Mynewt to PineCone BL602 by Lup Yuen]&lt;br /&gt;
* [https://lupyuen.github.io/articles/flash Flashing Firmware to PineCone BL602 by Lup Yuen]&lt;br /&gt;
* [https://lupyuen.github.io/articles/led Control PineCone BL602 RGB LED with GPIO and PWM by Lup Yuen]&lt;br /&gt;
* [https://lupyuen.github.io/articles/gpio Mynewt GPIO ported to PineCone BL602 RISC-V Board by Lup Yuen]&lt;br /&gt;
* [https://lupyuen.github.io/articles/i2c PineCone BL602 talks to I2C Sensors by Lup Yuen]&lt;br /&gt;
* [https://lupyuen.github.io/articles/spi PineCone BL602 talks SPI too! by Lup Yuen]&lt;br /&gt;
* [https://lupyuen.github.io/articles/display PineCone BL602 Blasting Pixels to ST7789 Display with LVGL Library by Lup Yuen]&lt;br /&gt;
* [https://lupyuen.github.io/articles/uart PineCone BL602 Talks UART to Grove E-Ink Display by Lup Yuen]&lt;br /&gt;
* [https://lupyuen.github.io/articles/book The RISC-V BL602 Book by Lup Yuen]&lt;br /&gt;
* [https://lupyuen.github.io/articles/lora Connect PineCone BL602 to LoRa Transceiver by Lup Yuen]&lt;br /&gt;
* [https://lupyuen.github.io/articles/wisblock RAKwireless WisBlock talks LoRa with PineCone BL602 RISC-V Board by Lup Yuen]&lt;br /&gt;
* [https://lupyuen.github.io/articles/lora2 PineCone BL602 RISC-V Board Receives LoRa Packets by Lup Yuen]&lt;br /&gt;
* [https://lupyuen.github.io/articles/rust Run Rust RISC-V Firmware with BL602 IoT SDK by Lup Yuen]&lt;br /&gt;
* [https://lupyuen.github.io/articles/lorawan PineCone BL602 Talks LoRaWAN by Lup Yuen]&lt;br /&gt;
* [https://lupyuen.github.io/articles/lisp uLisp and Blockly on PineCone BL602 RISC-V Board by Lup Yuen]&lt;br /&gt;
* [https://lupyuen.github.io/articles/wasm Simulate RISC-V BL602 with WebAssembly, uLisp and Blockly by Lup Yuen]&lt;br /&gt;
* [https://lupyuen.github.io/articles/boot BL602 Bootloader by Lup Yuen]&lt;br /&gt;
* [https://lupyuen.github.io/articles/tflite Machine Learning on RISC-V BL602 with TensorFlow Lite by Lup Yuen]&lt;br /&gt;
* [https://lupyuen.github.io/articles/wifi Reverse Engineering WiFi on RISC-V BL602 by Lup Yuen]&lt;br /&gt;
* [https://lupyuen.github.io/articles/adc Rust on RISC-V BL602: Is It Sunny? by Lup Yuen]&lt;br /&gt;
* [https://lupyuen.github.io/articles/rustsim Rust on RISC-V BL602: Simulated with WebAssembly by Lup Yuen]&lt;br /&gt;
* [https://lupyuen.github.io/articles/pinedio PineDio Stack BL604 RISC-V Board: Testing The Prototype by Lup Yuen]&lt;br /&gt;
* [https://lupyuen.github.io/articles/rhai Rust on RISC-V BL602: Rhai Scripting by Lup Yuen]&lt;br /&gt;
* [https://lupyuen.github.io/articles/lorawan2 LoRaWAN on PineDio Stack BL604 RISC-V Board by Lup Yuen]&lt;br /&gt;
* [https://lupyuen.github.io/articles/ttn The Things Network on PineDio Stack BL604 RISC-V Board by Lup Yuen]&lt;br /&gt;
* [https://lupyuen.github.io/articles/cbor Encode Sensor Data with CBOR on BL602 by Lup Yuen]&lt;br /&gt;
* [https://lupyuen.github.io/articles/roblox IoT Digital Twin with Roblox and The Things Network by Lup Yuen]&lt;br /&gt;
* [https://lupyuen.github.io/articles/tsen Internal Temperature Sensor on BL602 by Lup Yuen]&lt;br /&gt;
* [https://lupyuen.github.io/articles/payload CBOR Payload Formatter for The Things Network by Lup Yuen]&lt;br /&gt;
* [https://lupyuen.github.io/articles/prometheus Monitor IoT Devices in The Things Network with Prometheus and Grafana by Lup Yuen]&lt;br /&gt;
* [https://lupyuen.github.io/articles/nuttx Apache NuttX OS on RISC-V BL602 and BL604 by Lup Yuen]&lt;br /&gt;
* [https://lupyuen.github.io/articles/spi2 SPI on Apache NuttX OS by Lup Yuen]&lt;br /&gt;
* [https://lupyuen.github.io/articles/sx1262 LoRa SX1262 on Apache NuttX OS by Lup Yuen]&lt;br /&gt;
* [https://lupyuen.github.io/articles/lorawan3 LoRaWAN on Apache NuttX OS by Lup Yuen]&lt;br /&gt;
* [https://lupyuen.github.io/articles/rust2 Rust on Apache NuttX OS by Lup Yuen]&lt;br /&gt;
* [https://lupyuen.github.io/articles/auto Auto Flash and Test NuttX on RISC-V BL602 by Lup Yuen]&lt;br /&gt;
* [https://lupyuen.github.io/articles/loader BL602 EFlash Loader: Reverse Engineered with Ghidra by Lup Yuen]&lt;br /&gt;
* [https://lupyuen.github.io/articles/ikea Connect IKEA Air Quality Sensor to Apache NuttX OS by Lup Yuen]&lt;br /&gt;
* [https://lupyuen.github.io/articles/bme280 Apache NuttX Driver for BME280 Sensor: Ported from Zephyr OS by Lup Yuen]&lt;br /&gt;
* [https://lupyuen.github.io/articles/rusti2c Rust talks I2C on Apache NuttX RTOS by Lup Yuen]&lt;br /&gt;
* [https://lupyuen.github.io/articles/st7789 ST7789 Display with LVGL Graphics on Apache NuttX RTOS by Lup Yuen]&lt;br /&gt;
* [https://lupyuen.github.io/articles/pinedio2 PineDio Stack BL604 runs Apache NuttX RTOS by Lup Yuen]&lt;br /&gt;
* [https://lupyuen.github.io/articles/touch NuttX Touch Panel Driver for PineDio Stack BL604 by Lup Yuen]&lt;br /&gt;
* [https://www.robertlipe.com/buttons-on-bl602-nuttx/ Buttons on BL602 NuttX]&lt;br /&gt;
* [https://lupyuen.github.io/articles/expander NuttX GPIO Expander for PineDio Stack BL604 by Lup Yuen]&lt;br /&gt;
* [https://lupyuen.github.io/articles/auto2 (Mostly) Automated Testing of Apache NuttX RTOS on PineDio Stack BL604 RISC-V Board by Lup Yuen]&lt;br /&gt;
* [https://lupyuen.github.io/articles/zig Zig on RISC-V BL602: Quick Peek with Apache NuttX RTOS by Lup Yuen]&lt;br /&gt;
* [https://lupyuen.github.io/articles/iot Build an IoT App with Zig and LoRaWAN by Lup Yuen]&lt;br /&gt;
* [https://lupyuen.github.io/articles/lvgl Build an LVGL Touchscreen App with Zig by Lup Yuen]&lt;br /&gt;
* [https://lupyuen.github.io/articles/sensor Read NuttX Sensor Data with Zig by Lup Yuen]&lt;br /&gt;
* [https://lupyuen.github.io/articles/visual Visual Programming with Zig and NuttX Sensors by Lup Yuen]&lt;br /&gt;
&lt;br /&gt;
[[Category:Nutcracker]]&lt;/div&gt;</summary>
		<author><name>Lupyuen</name></author>
	</entry>
	<entry>
		<id>https://wiki.pine64.org/index.php?title=PineCone&amp;diff=13396</id>
		<title>PineCone</title>
		<link rel="alternate" type="text/html" href="https://wiki.pine64.org/index.php?title=PineCone&amp;diff=13396"/>
		<updated>2022-07-29T02:07:34Z</updated>

		<summary type="html">&lt;p&gt;Lupyuen: Add article &amp;quot;Read NuttX Sensor Data with Zig&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[File:Pine64_BL602_EVB_photo-3-small.jpg|thumb|PineCone BL602 EVB (Evaluation Board)]]&lt;br /&gt;
&lt;br /&gt;
The '''PineCone''' is a BL602 evaluation board, which was developed with the goal to challenge the open source community to achieve blob-free and free and open source WiFi and Bluetooth, see the [https://www.pine64.org/2020/10/28/nutcracker-challenge-blob-free-wifi-ble/ Nutcracker Challenge].&lt;br /&gt;
&lt;br /&gt;
== BL602 Specifications ==&lt;br /&gt;
* '''CPU:''' 32-bit RV32IMAFC RISC-V “SiFive E24 Core”&lt;br /&gt;
** [https://www.sifive.com/cores/e24 SiFive E24 Core information]&lt;br /&gt;
* '''Memory:'''&lt;br /&gt;
** 128KB ROM&lt;br /&gt;
** 276KB SRAM&lt;br /&gt;
** 1Kb eFuse&lt;br /&gt;
** 2MB Embedded Flash&lt;br /&gt;
* '''Security:'''&lt;br /&gt;
** Secure boot&lt;br /&gt;
** Secure debug&lt;br /&gt;
** AES 128/192/256&lt;br /&gt;
** SHA-1/224/256&lt;br /&gt;
** TRNG (True Random Number Generator)&lt;br /&gt;
** PKA (Public Key Accelerator)&lt;br /&gt;
* '''Wireless:'''&lt;br /&gt;
** Wi-Fi 802.11 b/g/n&lt;br /&gt;
** Bluetooth® Low Energy 5.0&lt;br /&gt;
** Wi-Fi Fast connection with BLE assistance&lt;br /&gt;
** Wi-Fi and BLE coexistence&lt;br /&gt;
** Wi-Fi Security WPS/WEP/WPA/WPA2/WPA3&lt;br /&gt;
** STA, SoftAP and sniffer modes&lt;br /&gt;
** Multi-Cloud connectivity&lt;br /&gt;
** 2.4 GHz RF transceiver&lt;br /&gt;
** Integrated RF balun, PA/LNA&lt;br /&gt;
* '''Package Type:'''&lt;br /&gt;
** 32 pin QFN 4mm x 4mm&lt;br /&gt;
* JTAG support (See below for BL602 impact)&lt;br /&gt;
&lt;br /&gt;
[[File:BL602_Block_Diagram.jpg|600px]]&lt;br /&gt;
&lt;br /&gt;
== JTAG ==&lt;br /&gt;
{| class=&amp;quot;wikitable floatright&amp;quot;&lt;br /&gt;
|+ Default JTAG pins&lt;br /&gt;
|-&lt;br /&gt;
| GPIO Pin || JTAG Pin&lt;br /&gt;
|-&lt;br /&gt;
| GPIO17 || TDI&lt;br /&gt;
|-&lt;br /&gt;
| GPIO11 || TDO&lt;br /&gt;
|-&lt;br /&gt;
| GPIO12 || TMS&lt;br /&gt;
|-&lt;br /&gt;
| GPIO14 || TCK&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
BL602 multiplexes four GPIO pins to provide the familiar JTAG lines. See the accompanying table for the default pin mappings.&lt;br /&gt;
&lt;br /&gt;
These are the default JTAG pins in use after a cold boot. However, many pieces of software, including the demo that's installed by default on new PineCones, remap these pins to other functions. You cannot use the default wiring for JTAG while such software is running. This issue is especially prevalent on the PineCone because three of the default JTAG pins are connected to the onboard RGB LED. Nothing about the LED itself interferes with JTAG, but any program that uses the LED will necessarily remap some of the default JTAG pins to be GPIO.&lt;br /&gt;
&lt;br /&gt;
The MaskROM download mode that the BL602 enters when you tie GPIO8 high does '''not''' remap the default JTAG pins, and so you can and should use that mode while checking basic functionality of your JTAG adapter.&lt;br /&gt;
&lt;br /&gt;
Note that, just as software can remap the default JTAG pins to be something else, it can also remap other pins to be JTAG. Control over this is quite granular, with 5-6 candidate pins for each individual JTAG signal that can be mapped independently of one another. LEE Lup Yuen has written some [https://lupyuen.github.io/articles/openocd#free-the-led-from-jtag-port sample code] showing how to remap the JTAG pins so that your software can use the LED without giving up support for debugging.&lt;br /&gt;
&lt;br /&gt;
== Pine64 USB JTAG Adapter information and schematics ==&lt;br /&gt;
* [https://files.pine64.org/doc/Pinenut/PINE64%20USB%20JTAG%20Adapter%20Schematic-20201215.pdf PINE64 USB JTAG Adapter Schematic-20201215.pdf (pine64_ft232hl_board-2020-12-14)] &lt;br /&gt;
* [[:File:PINE64_USB_JTAG_Adapter_Schematic_ver_1.0a-20210109.pdf|PINE64 USB JTAG Adapter schematic 20210109 1.0a]]&lt;br /&gt;
&lt;br /&gt;
== PineCone BL602 EVB information and schematics ==&lt;br /&gt;
* Approximate dimensions: 26mm x 43mm&lt;br /&gt;
* Board layout:&lt;br /&gt;
[[File:PADI-II_EVB.png]]&lt;br /&gt;
* [https://files.pine64.org/doc/Pinenut/Pine64%20BL602%20EVB%20Schematic%20ver%201.1.pdf PineCone BL602 EVB schematic ver 1.1]&lt;br /&gt;
** Note: In PineCone revision 1.1 (&amp;quot;BL62B_EVB V1.1&amp;quot; silkscreened on back of board), CC1 and CC2 share one 5.1KΩ resistor. This means the board will fail to power when you use an e-marked USB-C cable like the one that comes with Apple chargers. See [https://medium.com/@leung.benson/how-to-design-a-proper-usb-c-power-sink-hint-not-the-way-raspberry-pi-4-did-it-f470d7a5910 this article] for details of why this happens. The next schematic design will give each line its own 5.1KΩ resistor as per the USB-C specification.&lt;br /&gt;
* The board uses a CH340 Serial/USB adapter. This chip is commonly used in Arduino-class development boards. It is a full speed (12Mbps) USB interface and has vendor ID 0x1a86 with product ID 0x7523.&lt;br /&gt;
* The GPIO pins (11, 12, 14, 17) plus the nearby RESET, POWER, and GND pins are all located on one side of the board, on J1 to provide JTAG connection.&lt;br /&gt;
&lt;br /&gt;
== Pinenut-01S Module information and schematics ==&lt;br /&gt;
[[File:Pinenut-01S_PCB-Front.png|225px]][[File:Pinenut-01S_PCB-Back.png|225px]]&lt;br /&gt;
* [https://files.pine64.org/doc/Pinenut/Pinenut-01S%20V1.01%20SCH.pdf Pinenut-01S schematic ver 1.01]&lt;br /&gt;
* [https://wiki.pine64.org/images/6/6b/PineNut-01S_v1.01_KiCad.zip PineNut-01S KiCad schematic ver 1.01]&lt;br /&gt;
* [https://files.pine64.org/doc/Pinenut/NUT-01S%20GPIO%20Definition%20ver%201.0.pdf Pinenut-01S GPIO Definition ver 1.0]&lt;br /&gt;
* [https://files.pine64.org/doc/Pinenut/USB%20Adapter%20for%20Pinenut-01S%20Schematic%20V1.0.pdf USB Programmer adapter for Pinenut-01S schematic ver 1.0]&lt;br /&gt;
* The default firmware runs the UART at 2000000 bps.  It will accept input whilst regularly outputting:&amp;lt;code&amp;gt;&amp;lt;br/&amp;gt;proc_hellow_entry: RISC-V rv32imafc&amp;lt;br/&amp;gt;cur key status:1&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Pinenut-12S Module information ==&lt;br /&gt;
[[File:NUT-12S_module-front.jpg|200px]][[File:NUT-12S_module-back.jpg|200px]]&lt;br /&gt;
* [https://files.pine64.org/doc/Pinenut/NUT-12S%20GPIO%20Definition%20ver%201.0.pdf Pinenut-12S GPIO Definition ver 1.0]&lt;br /&gt;
* Onboard LED is connected to IO0&lt;br /&gt;
&lt;br /&gt;
== Datasheets for components and peripherals ==&lt;br /&gt;
* Bouffalo BL-602 SoC information:&lt;br /&gt;
** [https://github.com/bouffalolab/bl_docs Bouffalo Lab's official bl_docs repository]: should always contain the latest SoC documentation available, in PDF, HTML, and reStructuredText source forms.&lt;br /&gt;
** [https://github.com/pine64/bl602-docs/tree/main/mirrored PINE64's bl602-docs repository]: contains an archive of all historical datasheets and reference manual PDFs but may lag behind Bouffalo's official repository. If you notice that it is, please submit a pull request!&lt;br /&gt;
* USB/Serial adapter:&lt;br /&gt;
** [https://cdn.sparkfun.com/datasheets/Dev/Arduino/Other/CH340DS1.PDF CH340 serial converter]&lt;br /&gt;
&lt;br /&gt;
== Misc notes ==&lt;br /&gt;
Planned to be available in at least three form factors:&lt;br /&gt;
* NUT-01S -&amp;gt; ESP-01S&lt;br /&gt;
* NUT-12S -&amp;gt; ESP-12S&lt;br /&gt;
* NUT-15 -&amp;gt; RTL8723/AMPAK&lt;br /&gt;
&lt;br /&gt;
== Loading code ==&lt;br /&gt;
To load code, you must move the jumper to the position closest to the edge, press reset, load the code, move the jumper back toward the center of the board, and press reset again.&lt;br /&gt;
&lt;br /&gt;
There are currently a number of loaders in progress, each with differing degrees of completeness and success on various operating systems.&lt;br /&gt;
* In the build tree, there is BLFlashCube for Windows, which is a proprietary GUI for flashing images. Linux and macOS binaries are available via [https://dev.bouffalolab.com/download Bouffalo Lab's developer portal].&lt;br /&gt;
* [https://github.com/stschake/bl60x-flash bl60x-flash] is in Python and has been reported successful on MacOS catalina (10.15.6) by Punnerud and madushan1000.&lt;br /&gt;
* [https://github.com/bouffalolab/BLOpenFlasher BLOpenFlasher] is a WIP, written in go, by Bouffalo Labs to provide source for a flash utility.&lt;br /&gt;
* [https://github.com/renzenicolai/bl602tool bl602tool] is a Python utility in development.&lt;br /&gt;
* &amp;lt;del&amp;gt;[https://pypi.org/project/bflb-eflash-loader/ Bouffalo's Python Flash Loader] is a new (Dec 20) flash loader by the makers of the chip.&amp;lt;/del&amp;gt;&lt;br /&gt;
* &amp;lt;del&amp;gt;[https://pypi.org/project/bflb-image-build/ Bouffalo's image build] smooshes code and adds headers for downloads.&amp;lt;/del&amp;gt;&lt;br /&gt;
* [https://pypi.org/project/bflb-mcu-tool/ Bouffalo's MCU tool] (Mar 2021) Python image tool replaced both of the above. Now combined with eflash loader, deals with partitions, DTS, signing, fuses etc.&lt;br /&gt;
* [https://github.com/spacemeowx2/blflash blflash serial flasher] BL602 serial flasher, inspired by BLOpenFlasher&lt;br /&gt;
&lt;br /&gt;
== Development efforts ==&lt;br /&gt;
* [https://github.com/pine64/bl_iot_sdk PineCone BL602 GitHub Page (PINE64 fork)] has compilers, linkers, and all the code to build on Windows, Linux (x86_64), and MacOS.&lt;br /&gt;
* [https://github.com/bouffalolab/bl_iot_sdk Bouffalo Lab GitHub Page]&lt;br /&gt;
* [https://github.com/renzenicolai/bl602-docs/ BL602 Developer organize documentation GitHub Page]&lt;br /&gt;
* [https://github.com/renzenicolai/bl602tool BL602 Developer organize tool GitHub Page]&lt;br /&gt;
* [https://github.com/stschake/bl60x-flash Programming tool for Bouffalo Labs BL602/BL604 chips]&lt;br /&gt;
* [https://github.com/pine64/bl602-re BL602 reverse engineering working group]&lt;br /&gt;
* [https://github.com/pine64/bl602-sdio-linux Linux kernel module]&lt;br /&gt;
* [https://github.com/tchebb/bl602-docs BL602 Documentation]&lt;br /&gt;
* [https://github.com/spacemeowx2/blflash BL602 serial flasher]&lt;br /&gt;
* [https://github.com/mkroman/awesome-bouffalo#feature-matrix Awesome Bouffalo]&lt;br /&gt;
&lt;br /&gt;
== Articles and Blogs ==&lt;br /&gt;
* [https://lupyuen.github.io/articles/pinecone Quick Peek of PineCone BL602 RISC-V Evaluation Board by Lup Yuen]&lt;br /&gt;
* [https://maero.dk/bl602-firmware-image-format/ Documenting the BouffaloLab BL602 firmware image format by MK]&lt;br /&gt;
* [https://lupyuen.github.io/articles/openocd Connect PineCone BL602 to OpenOCD by Lup Yuen]&lt;br /&gt;
* [https://lupyuen.github.io/articles/debug Debug Rust on PineCone BL602 with VSCode and GDB by Lup Yuen]&lt;br /&gt;
* [https://lupyuen.github.io/articles/mynewt Porting Mynewt to PineCone BL602 by Lup Yuen]&lt;br /&gt;
* [https://lupyuen.github.io/articles/flash Flashing Firmware to PineCone BL602 by Lup Yuen]&lt;br /&gt;
* [https://lupyuen.github.io/articles/led Control PineCone BL602 RGB LED with GPIO and PWM by Lup Yuen]&lt;br /&gt;
* [https://lupyuen.github.io/articles/gpio Mynewt GPIO ported to PineCone BL602 RISC-V Board by Lup Yuen]&lt;br /&gt;
* [https://lupyuen.github.io/articles/i2c PineCone BL602 talks to I2C Sensors by Lup Yuen]&lt;br /&gt;
* [https://lupyuen.github.io/articles/spi PineCone BL602 talks SPI too! by Lup Yuen]&lt;br /&gt;
* [https://lupyuen.github.io/articles/display PineCone BL602 Blasting Pixels to ST7789 Display with LVGL Library by Lup Yuen]&lt;br /&gt;
* [https://lupyuen.github.io/articles/uart PineCone BL602 Talks UART to Grove E-Ink Display by Lup Yuen]&lt;br /&gt;
* [https://lupyuen.github.io/articles/book The RISC-V BL602 Book by Lup Yuen]&lt;br /&gt;
* [https://lupyuen.github.io/articles/lora Connect PineCone BL602 to LoRa Transceiver by Lup Yuen]&lt;br /&gt;
* [https://lupyuen.github.io/articles/wisblock RAKwireless WisBlock talks LoRa with PineCone BL602 RISC-V Board by Lup Yuen]&lt;br /&gt;
* [https://lupyuen.github.io/articles/lora2 PineCone BL602 RISC-V Board Receives LoRa Packets by Lup Yuen]&lt;br /&gt;
* [https://lupyuen.github.io/articles/rust Run Rust RISC-V Firmware with BL602 IoT SDK by Lup Yuen]&lt;br /&gt;
* [https://lupyuen.github.io/articles/lorawan PineCone BL602 Talks LoRaWAN by Lup Yuen]&lt;br /&gt;
* [https://lupyuen.github.io/articles/lisp uLisp and Blockly on PineCone BL602 RISC-V Board by Lup Yuen]&lt;br /&gt;
* [https://lupyuen.github.io/articles/wasm Simulate RISC-V BL602 with WebAssembly, uLisp and Blockly by Lup Yuen]&lt;br /&gt;
* [https://lupyuen.github.io/articles/boot BL602 Bootloader by Lup Yuen]&lt;br /&gt;
* [https://lupyuen.github.io/articles/tflite Machine Learning on RISC-V BL602 with TensorFlow Lite by Lup Yuen]&lt;br /&gt;
* [https://lupyuen.github.io/articles/wifi Reverse Engineering WiFi on RISC-V BL602 by Lup Yuen]&lt;br /&gt;
* [https://lupyuen.github.io/articles/adc Rust on RISC-V BL602: Is It Sunny? by Lup Yuen]&lt;br /&gt;
* [https://lupyuen.github.io/articles/rustsim Rust on RISC-V BL602: Simulated with WebAssembly by Lup Yuen]&lt;br /&gt;
* [https://lupyuen.github.io/articles/pinedio PineDio Stack BL604 RISC-V Board: Testing The Prototype by Lup Yuen]&lt;br /&gt;
* [https://lupyuen.github.io/articles/rhai Rust on RISC-V BL602: Rhai Scripting by Lup Yuen]&lt;br /&gt;
* [https://lupyuen.github.io/articles/lorawan2 LoRaWAN on PineDio Stack BL604 RISC-V Board by Lup Yuen]&lt;br /&gt;
* [https://lupyuen.github.io/articles/ttn The Things Network on PineDio Stack BL604 RISC-V Board by Lup Yuen]&lt;br /&gt;
* [https://lupyuen.github.io/articles/cbor Encode Sensor Data with CBOR on BL602 by Lup Yuen]&lt;br /&gt;
* [https://lupyuen.github.io/articles/roblox IoT Digital Twin with Roblox and The Things Network by Lup Yuen]&lt;br /&gt;
* [https://lupyuen.github.io/articles/tsen Internal Temperature Sensor on BL602 by Lup Yuen]&lt;br /&gt;
* [https://lupyuen.github.io/articles/payload CBOR Payload Formatter for The Things Network by Lup Yuen]&lt;br /&gt;
* [https://lupyuen.github.io/articles/prometheus Monitor IoT Devices in The Things Network with Prometheus and Grafana by Lup Yuen]&lt;br /&gt;
* [https://lupyuen.github.io/articles/nuttx Apache NuttX OS on RISC-V BL602 and BL604 by Lup Yuen]&lt;br /&gt;
* [https://lupyuen.github.io/articles/spi2 SPI on Apache NuttX OS by Lup Yuen]&lt;br /&gt;
* [https://lupyuen.github.io/articles/sx1262 LoRa SX1262 on Apache NuttX OS by Lup Yuen]&lt;br /&gt;
* [https://lupyuen.github.io/articles/lorawan3 LoRaWAN on Apache NuttX OS by Lup Yuen]&lt;br /&gt;
* [https://lupyuen.github.io/articles/rust2 Rust on Apache NuttX OS by Lup Yuen]&lt;br /&gt;
* [https://lupyuen.github.io/articles/auto Auto Flash and Test NuttX on RISC-V BL602 by Lup Yuen]&lt;br /&gt;
* [https://lupyuen.github.io/articles/loader BL602 EFlash Loader: Reverse Engineered with Ghidra by Lup Yuen]&lt;br /&gt;
* [https://lupyuen.github.io/articles/ikea Connect IKEA Air Quality Sensor to Apache NuttX OS by Lup Yuen]&lt;br /&gt;
* [https://lupyuen.github.io/articles/bme280 Apache NuttX Driver for BME280 Sensor: Ported from Zephyr OS by Lup Yuen]&lt;br /&gt;
* [https://lupyuen.github.io/articles/rusti2c Rust talks I2C on Apache NuttX RTOS by Lup Yuen]&lt;br /&gt;
* [https://lupyuen.github.io/articles/st7789 ST7789 Display with LVGL Graphics on Apache NuttX RTOS by Lup Yuen]&lt;br /&gt;
* [https://lupyuen.github.io/articles/pinedio2 PineDio Stack BL604 runs Apache NuttX RTOS by Lup Yuen]&lt;br /&gt;
* [https://lupyuen.github.io/articles/touch NuttX Touch Panel Driver for PineDio Stack BL604 by Lup Yuen]&lt;br /&gt;
* [https://www.robertlipe.com/buttons-on-bl602-nuttx/ Buttons on BL602 NuttX]&lt;br /&gt;
* [https://lupyuen.github.io/articles/expander NuttX GPIO Expander for PineDio Stack BL604 by Lup Yuen]&lt;br /&gt;
* [https://lupyuen.github.io/articles/auto2 (Mostly) Automated Testing of Apache NuttX RTOS on PineDio Stack BL604 RISC-V Board by Lup Yuen]&lt;br /&gt;
* [https://lupyuen.github.io/articles/zig Zig on RISC-V BL602: Quick Peek with Apache NuttX RTOS by Lup Yuen]&lt;br /&gt;
* [https://lupyuen.github.io/articles/iot Build an IoT App with Zig and LoRaWAN by Lup Yuen]&lt;br /&gt;
* [https://lupyuen.github.io/articles/lvgl Build an LVGL Touchscreen App with Zig by Lup Yuen]&lt;br /&gt;
* [https://lupyuen.github.io/articles/sensor Read NuttX Sensor Data with Zig by Lup Yuen]&lt;br /&gt;
&lt;br /&gt;
[[Category:Nutcracker]]&lt;/div&gt;</summary>
		<author><name>Lupyuen</name></author>
	</entry>
	<entry>
		<id>https://wiki.pine64.org/index.php?title=PineCone&amp;diff=13279</id>
		<title>PineCone</title>
		<link rel="alternate" type="text/html" href="https://wiki.pine64.org/index.php?title=PineCone&amp;diff=13279"/>
		<updated>2022-07-11T13:41:10Z</updated>

		<summary type="html">&lt;p&gt;Lupyuen: Add article &amp;quot;Build an LVGL Touchscreen App with Zig&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[File:Pine64_BL602_EVB_photo-3-small.jpg|thumb|PineCone BL602 EVB (Evaluation Board)]]&lt;br /&gt;
&lt;br /&gt;
The '''PineCone''' is a BL602 evaluation board, which was developed with the goal to challenge the open source community to achieve blob-free and free and open source WiFi and Bluetooth, see the [https://www.pine64.org/2020/10/28/nutcracker-challenge-blob-free-wifi-ble/ Nutcracker Challenge].&lt;br /&gt;
&lt;br /&gt;
== BL602 Specifications ==&lt;br /&gt;
* '''CPU:''' 32-bit RV32IMAFC RISC-V “SiFive E24 Core”&lt;br /&gt;
** [https://www.sifive.com/cores/e24 SiFive E24 Core information]&lt;br /&gt;
* '''Memory:'''&lt;br /&gt;
** 128KB ROM&lt;br /&gt;
** 276KB SRAM&lt;br /&gt;
** 1Kb eFuse&lt;br /&gt;
** 2MB Embedded Flash&lt;br /&gt;
* '''Security:'''&lt;br /&gt;
** Secure boot&lt;br /&gt;
** Secure debug&lt;br /&gt;
** AES 128/192/256&lt;br /&gt;
** SHA-1/224/256&lt;br /&gt;
** TRNG (True Random Number Generator)&lt;br /&gt;
** PKA (Public Key Accelerator)&lt;br /&gt;
* '''Wireless:'''&lt;br /&gt;
** Wi-Fi 802.11 b/g/n&lt;br /&gt;
** Bluetooth® Low Energy 5.0&lt;br /&gt;
** Wi-Fi Fast connection with BLE assistance&lt;br /&gt;
** Wi-Fi and BLE coexistence&lt;br /&gt;
** Wi-Fi Security WPS/WEP/WPA/WPA2/WPA3&lt;br /&gt;
** STA, SoftAP and sniffer modes&lt;br /&gt;
** Multi-Cloud connectivity&lt;br /&gt;
** 2.4 GHz RF transceiver&lt;br /&gt;
** Integrated RF balun, PA/LNA&lt;br /&gt;
* '''Package Type:'''&lt;br /&gt;
** 32 pin QFN 4mm x 4mm&lt;br /&gt;
* JTAG support (See below for BL602 impact)&lt;br /&gt;
&lt;br /&gt;
[[File:BL602_Block_Diagram.jpg|600px]]&lt;br /&gt;
&lt;br /&gt;
== JTAG ==&lt;br /&gt;
{| class=&amp;quot;wikitable floatright&amp;quot;&lt;br /&gt;
|+ Default JTAG pins&lt;br /&gt;
|-&lt;br /&gt;
| GPIO Pin || JTAG Pin&lt;br /&gt;
|-&lt;br /&gt;
| GPIO17 || TDI&lt;br /&gt;
|-&lt;br /&gt;
| GPIO11 || TDO&lt;br /&gt;
|-&lt;br /&gt;
| GPIO12 || TMS&lt;br /&gt;
|-&lt;br /&gt;
| GPIO14 || TCK&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
BL602 multiplexes four GPIO pins to provide the familiar JTAG lines. See the accompanying table for the default pin mappings.&lt;br /&gt;
&lt;br /&gt;
These are the default JTAG pins in use after a cold boot. However, many pieces of software, including the demo that's installed by default on new PineCones, remap these pins to other functions. You cannot use the default wiring for JTAG while such software is running. This issue is especially prevalent on the PineCone because three of the default JTAG pins are connected to the onboard RGB LED. Nothing about the LED itself interferes with JTAG, but any program that uses the LED will necessarily remap some of the default JTAG pins to be GPIO.&lt;br /&gt;
&lt;br /&gt;
The MaskROM download mode that the BL602 enters when you tie GPIO8 high does '''not''' remap the default JTAG pins, and so you can and should use that mode while checking basic functionality of your JTAG adapter.&lt;br /&gt;
&lt;br /&gt;
Note that, just as software can remap the default JTAG pins to be something else, it can also remap other pins to be JTAG. Control over this is quite granular, with 5-6 candidate pins for each individual JTAG signal that can be mapped independently of one another. LEE Lup Yuen has written some [https://lupyuen.github.io/articles/openocd#free-the-led-from-jtag-port sample code] showing how to remap the JTAG pins so that your software can use the LED without giving up support for debugging.&lt;br /&gt;
&lt;br /&gt;
== Pine64 USB JTAG Adapter information and schematics ==&lt;br /&gt;
* [https://files.pine64.org/doc/Pinenut/PINE64%20USB%20JTAG%20Adapter%20Schematic-20201215.pdf PINE64 USB JTAG Adapter Schematic-20201215.pdf (pine64_ft232hl_board-2020-12-14)] &lt;br /&gt;
* [[:File:PINE64_USB_JTAG_Adapter_Schematic_ver_1.0a-20210109.pdf|PINE64 USB JTAG Adapter schematic 20210109 1.0a]]&lt;br /&gt;
&lt;br /&gt;
== PineCone BL602 EVB information and schematics ==&lt;br /&gt;
* Approximate dimensions: 26mm x 43mm&lt;br /&gt;
* Board layout:&lt;br /&gt;
[[File:PADI-II_EVB.png]]&lt;br /&gt;
* [https://files.pine64.org/doc/Pinenut/Pine64%20BL602%20EVB%20Schematic%20ver%201.1.pdf PineCone BL602 EVB schematic ver 1.1]&lt;br /&gt;
** Note: In PineCone revision 1.1 (&amp;quot;BL62B_EVB V1.1&amp;quot; silkscreened on back of board), CC1 and CC2 share one 5.1KΩ resistor. This means the board will fail to power when you use an e-marked USB-C cable like the one that comes with Apple chargers. See [https://medium.com/@leung.benson/how-to-design-a-proper-usb-c-power-sink-hint-not-the-way-raspberry-pi-4-did-it-f470d7a5910 this article] for details of why this happens. The next schematic design will give each line its own 5.1KΩ resistor as per the USB-C specification.&lt;br /&gt;
* The board uses a CH340 Serial/USB adapter. This chip is commonly used in Arduino-class development boards. It is a full speed (12Mbps) USB interface and has vendor ID 0x1a86 with product ID 0x7523.&lt;br /&gt;
* The GPIO pins (11, 12, 14, 17) plus the nearby RESET, POWER, and GND pins are all located on one side of the board, on J1 to provide JTAG connection.&lt;br /&gt;
&lt;br /&gt;
== Pinenut-01S Module information and schematics ==&lt;br /&gt;
[[File:Pinenut-01S_PCB-Front.png|225px]][[File:Pinenut-01S_PCB-Back.png|225px]]&lt;br /&gt;
* [https://files.pine64.org/doc/Pinenut/Pinenut-01S%20V1.01%20SCH.pdf Pinenut-01S schematic ver 1.01]&lt;br /&gt;
* [https://wiki.pine64.org/images/6/6b/PineNut-01S_v1.01_KiCad.zip PineNut-01S KiCad schematic ver 1.01]&lt;br /&gt;
* [https://files.pine64.org/doc/Pinenut/NUT-01S%20GPIO%20Definition%20ver%201.0.pdf Pinenut-01S GPIO Definition ver 1.0]&lt;br /&gt;
* [https://files.pine64.org/doc/Pinenut/USB%20Adapter%20for%20Pinenut-01S%20Schematic%20V1.0.pdf USB Programmer adapter for Pinenut-01S schematic ver 1.0]&lt;br /&gt;
* The default firmware runs the UART at 2000000 bps.  It will accept input whilst regularly outputting:&amp;lt;code&amp;gt;&amp;lt;br/&amp;gt;proc_hellow_entry: RISC-V rv32imafc&amp;lt;br/&amp;gt;cur key status:1&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Pinenut-12S Module information ==&lt;br /&gt;
[[File:NUT-12S_module-front.jpg|200px]][[File:NUT-12S_module-back.jpg|200px]]&lt;br /&gt;
* [https://files.pine64.org/doc/Pinenut/NUT-12S%20GPIO%20Definition%20ver%201.0.pdf Pinenut-12S GPIO Definition ver 1.0]&lt;br /&gt;
* Onboard LED is connected to IO0&lt;br /&gt;
&lt;br /&gt;
== Datasheets for components and peripherals ==&lt;br /&gt;
* Bouffalo BL-602 SoC information:&lt;br /&gt;
** [https://github.com/bouffalolab/bl_docs Bouffalo Lab's official bl_docs repository]: should always contain the latest SoC documentation available, in PDF, HTML, and reStructuredText source forms.&lt;br /&gt;
** [https://github.com/pine64/bl602-docs/tree/main/mirrored PINE64's bl602-docs repository]: contains an archive of all historical datasheets and reference manual PDFs but may lag behind Bouffalo's official repository. If you notice that it is, please submit a pull request!&lt;br /&gt;
* USB/Serial adapter:&lt;br /&gt;
** [https://cdn.sparkfun.com/datasheets/Dev/Arduino/Other/CH340DS1.PDF CH340 serial converter]&lt;br /&gt;
&lt;br /&gt;
== Misc notes ==&lt;br /&gt;
Planned to be available in at least three form factors:&lt;br /&gt;
* NUT-01S -&amp;gt; ESP-01S&lt;br /&gt;
* NUT-12S -&amp;gt; ESP-12S&lt;br /&gt;
* NUT-15 -&amp;gt; RTL8723/AMPAK&lt;br /&gt;
&lt;br /&gt;
== Loading code ==&lt;br /&gt;
To load code, you must move the jumper to the position closest to the edge, press reset, load the code, move the jumper back toward the center of the board, and press reset again.&lt;br /&gt;
&lt;br /&gt;
There are currently a number of loaders in progress, each with differing degrees of completeness and success on various operating systems.&lt;br /&gt;
* In the build tree, there is BLFlashCube for Windows, which is a proprietary GUI for flashing images. Linux and macOS binaries are available via [https://dev.bouffalolab.com/download Bouffalo Lab's developer portal].&lt;br /&gt;
* [https://github.com/stschake/bl60x-flash bl60x-flash] is in Python and has been reported successful on MacOS catalina (10.15.6) by Punnerud and madushan1000.&lt;br /&gt;
* [https://github.com/bouffalolab/BLOpenFlasher BLOpenFlasher] is a WIP, written in go, by Bouffalo Labs to provide source for a flash utility.&lt;br /&gt;
* [https://github.com/renzenicolai/bl602tool bl602tool] is a Python utility in development.&lt;br /&gt;
* &amp;lt;del&amp;gt;[https://pypi.org/project/bflb-eflash-loader/ Bouffalo's Python Flash Loader] is a new (Dec 20) flash loader by the makers of the chip.&amp;lt;/del&amp;gt;&lt;br /&gt;
* &amp;lt;del&amp;gt;[https://pypi.org/project/bflb-image-build/ Bouffalo's image build] smooshes code and adds headers for downloads.&amp;lt;/del&amp;gt;&lt;br /&gt;
* [https://pypi.org/project/bflb-mcu-tool/ Bouffalo's MCU tool] (Mar 2021) Python image tool replaced both of the above. Now combined with eflash loader, deals with partitions, DTS, signing, fuses etc.&lt;br /&gt;
* [https://github.com/spacemeowx2/blflash blflash serial flasher] BL602 serial flasher, inspired by BLOpenFlasher&lt;br /&gt;
&lt;br /&gt;
== Development efforts ==&lt;br /&gt;
* [https://github.com/pine64/bl_iot_sdk PineCone BL602 GitHub Page (PINE64 fork)] has compilers, linkers, and all the code to build on Windows, Linux (x86_64), and MacOS.&lt;br /&gt;
* [https://github.com/bouffalolab/bl_iot_sdk Bouffalo Lab GitHub Page]&lt;br /&gt;
* [https://github.com/renzenicolai/bl602-docs/ BL602 Developer organize documentation GitHub Page]&lt;br /&gt;
* [https://github.com/renzenicolai/bl602tool BL602 Developer organize tool GitHub Page]&lt;br /&gt;
* [https://github.com/stschake/bl60x-flash Programming tool for Bouffalo Labs BL602/BL604 chips]&lt;br /&gt;
* [https://github.com/pine64/bl602-re BL602 reverse engineering working group]&lt;br /&gt;
* [https://github.com/pine64/bl602-sdio-linux Linux kernel module]&lt;br /&gt;
* [https://github.com/tchebb/bl602-docs BL602 Documentation]&lt;br /&gt;
* [https://github.com/spacemeowx2/blflash BL602 serial flasher]&lt;br /&gt;
* [https://github.com/mkroman/awesome-bouffalo#feature-matrix Awesome Bouffalo]&lt;br /&gt;
&lt;br /&gt;
== Articles and Blogs ==&lt;br /&gt;
* [https://lupyuen.github.io/articles/pinecone Quick Peek of PineCone BL602 RISC-V Evaluation Board by Lup Yuen]&lt;br /&gt;
* [https://maero.dk/bl602-firmware-image-format/ Documenting the BouffaloLab BL602 firmware image format by MK]&lt;br /&gt;
* [https://lupyuen.github.io/articles/openocd Connect PineCone BL602 to OpenOCD by Lup Yuen]&lt;br /&gt;
* [https://lupyuen.github.io/articles/debug Debug Rust on PineCone BL602 with VSCode and GDB by Lup Yuen]&lt;br /&gt;
* [https://lupyuen.github.io/articles/mynewt Porting Mynewt to PineCone BL602 by Lup Yuen]&lt;br /&gt;
* [https://lupyuen.github.io/articles/flash Flashing Firmware to PineCone BL602 by Lup Yuen]&lt;br /&gt;
* [https://lupyuen.github.io/articles/led Control PineCone BL602 RGB LED with GPIO and PWM by Lup Yuen]&lt;br /&gt;
* [https://lupyuen.github.io/articles/gpio Mynewt GPIO ported to PineCone BL602 RISC-V Board by Lup Yuen]&lt;br /&gt;
* [https://lupyuen.github.io/articles/i2c PineCone BL602 talks to I2C Sensors by Lup Yuen]&lt;br /&gt;
* [https://lupyuen.github.io/articles/spi PineCone BL602 talks SPI too! by Lup Yuen]&lt;br /&gt;
* [https://lupyuen.github.io/articles/display PineCone BL602 Blasting Pixels to ST7789 Display with LVGL Library by Lup Yuen]&lt;br /&gt;
* [https://lupyuen.github.io/articles/uart PineCone BL602 Talks UART to Grove E-Ink Display by Lup Yuen]&lt;br /&gt;
* [https://lupyuen.github.io/articles/book The RISC-V BL602 Book by Lup Yuen]&lt;br /&gt;
* [https://lupyuen.github.io/articles/lora Connect PineCone BL602 to LoRa Transceiver by Lup Yuen]&lt;br /&gt;
* [https://lupyuen.github.io/articles/wisblock RAKwireless WisBlock talks LoRa with PineCone BL602 RISC-V Board by Lup Yuen]&lt;br /&gt;
* [https://lupyuen.github.io/articles/lora2 PineCone BL602 RISC-V Board Receives LoRa Packets by Lup Yuen]&lt;br /&gt;
* [https://lupyuen.github.io/articles/rust Run Rust RISC-V Firmware with BL602 IoT SDK by Lup Yuen]&lt;br /&gt;
* [https://lupyuen.github.io/articles/lorawan PineCone BL602 Talks LoRaWAN by Lup Yuen]&lt;br /&gt;
* [https://lupyuen.github.io/articles/lisp uLisp and Blockly on PineCone BL602 RISC-V Board by Lup Yuen]&lt;br /&gt;
* [https://lupyuen.github.io/articles/wasm Simulate RISC-V BL602 with WebAssembly, uLisp and Blockly by Lup Yuen]&lt;br /&gt;
* [https://lupyuen.github.io/articles/boot BL602 Bootloader by Lup Yuen]&lt;br /&gt;
* [https://lupyuen.github.io/articles/tflite Machine Learning on RISC-V BL602 with TensorFlow Lite by Lup Yuen]&lt;br /&gt;
* [https://lupyuen.github.io/articles/wifi Reverse Engineering WiFi on RISC-V BL602 by Lup Yuen]&lt;br /&gt;
* [https://lupyuen.github.io/articles/adc Rust on RISC-V BL602: Is It Sunny? by Lup Yuen]&lt;br /&gt;
* [https://lupyuen.github.io/articles/rustsim Rust on RISC-V BL602: Simulated with WebAssembly by Lup Yuen]&lt;br /&gt;
* [https://lupyuen.github.io/articles/pinedio PineDio Stack BL604 RISC-V Board: Testing The Prototype by Lup Yuen]&lt;br /&gt;
* [https://lupyuen.github.io/articles/rhai Rust on RISC-V BL602: Rhai Scripting by Lup Yuen]&lt;br /&gt;
* [https://lupyuen.github.io/articles/lorawan2 LoRaWAN on PineDio Stack BL604 RISC-V Board by Lup Yuen]&lt;br /&gt;
* [https://lupyuen.github.io/articles/ttn The Things Network on PineDio Stack BL604 RISC-V Board by Lup Yuen]&lt;br /&gt;
* [https://lupyuen.github.io/articles/cbor Encode Sensor Data with CBOR on BL602 by Lup Yuen]&lt;br /&gt;
* [https://lupyuen.github.io/articles/roblox IoT Digital Twin with Roblox and The Things Network by Lup Yuen]&lt;br /&gt;
* [https://lupyuen.github.io/articles/tsen Internal Temperature Sensor on BL602 by Lup Yuen]&lt;br /&gt;
* [https://lupyuen.github.io/articles/payload CBOR Payload Formatter for The Things Network by Lup Yuen]&lt;br /&gt;
* [https://lupyuen.github.io/articles/prometheus Monitor IoT Devices in The Things Network with Prometheus and Grafana by Lup Yuen]&lt;br /&gt;
* [https://lupyuen.github.io/articles/nuttx Apache NuttX OS on RISC-V BL602 and BL604 by Lup Yuen]&lt;br /&gt;
* [https://lupyuen.github.io/articles/spi2 SPI on Apache NuttX OS by Lup Yuen]&lt;br /&gt;
* [https://lupyuen.github.io/articles/sx1262 LoRa SX1262 on Apache NuttX OS by Lup Yuen]&lt;br /&gt;
* [https://lupyuen.github.io/articles/lorawan3 LoRaWAN on Apache NuttX OS by Lup Yuen]&lt;br /&gt;
* [https://lupyuen.github.io/articles/rust2 Rust on Apache NuttX OS by Lup Yuen]&lt;br /&gt;
* [https://lupyuen.github.io/articles/auto Auto Flash and Test NuttX on RISC-V BL602 by Lup Yuen]&lt;br /&gt;
* [https://lupyuen.github.io/articles/loader BL602 EFlash Loader: Reverse Engineered with Ghidra by Lup Yuen]&lt;br /&gt;
* [https://lupyuen.github.io/articles/ikea Connect IKEA Air Quality Sensor to Apache NuttX OS by Lup Yuen]&lt;br /&gt;
* [https://lupyuen.github.io/articles/bme280 Apache NuttX Driver for BME280 Sensor: Ported from Zephyr OS by Lup Yuen]&lt;br /&gt;
* [https://lupyuen.github.io/articles/rusti2c Rust talks I2C on Apache NuttX RTOS by Lup Yuen]&lt;br /&gt;
* [https://lupyuen.github.io/articles/st7789 ST7789 Display with LVGL Graphics on Apache NuttX RTOS by Lup Yuen]&lt;br /&gt;
* [https://lupyuen.github.io/articles/pinedio2 PineDio Stack BL604 runs Apache NuttX RTOS by Lup Yuen]&lt;br /&gt;
* [https://lupyuen.github.io/articles/touch NuttX Touch Panel Driver for PineDio Stack BL604 by Lup Yuen]&lt;br /&gt;
* [https://www.robertlipe.com/buttons-on-bl602-nuttx/ Buttons on BL602 NuttX]&lt;br /&gt;
* [https://lupyuen.github.io/articles/expander NuttX GPIO Expander for PineDio Stack BL604 by Lup Yuen]&lt;br /&gt;
* [https://lupyuen.github.io/articles/auto2 (Mostly) Automated Testing of Apache NuttX RTOS on PineDio Stack BL604 RISC-V Board by Lup Yuen]&lt;br /&gt;
* [https://lupyuen.github.io/articles/zig Zig on RISC-V BL602: Quick Peek with Apache NuttX RTOS by Lup Yuen]&lt;br /&gt;
* [https://lupyuen.github.io/articles/iot Build an IoT App with Zig and LoRaWAN by Lup Yuen]&lt;br /&gt;
* [https://lupyuen.github.io/articles/lvgl Build an LVGL Touchscreen App with Zig by Lup Yuen]&lt;br /&gt;
&lt;br /&gt;
[[Category:Nutcracker]]&lt;/div&gt;</summary>
		<author><name>Lupyuen</name></author>
	</entry>
	<entry>
		<id>https://wiki.pine64.org/index.php?title=Pinedio&amp;diff=13278</id>
		<title>Pinedio</title>
		<link rel="alternate" type="text/html" href="https://wiki.pine64.org/index.php?title=Pinedio&amp;diff=13278"/>
		<updated>2022-07-11T13:40:46Z</updated>

		<summary type="html">&lt;p&gt;Lupyuen: Add article &amp;quot;Build an LVGL Touchscreen App with Zig&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{under construction}}&lt;br /&gt;
&lt;br /&gt;
The '''Pinedio''' is a device utilizing LoRa. LoRa is a long range, low power wireless platform that is being used by a lot of Internet of Things (IoT) products. Using LoRa and LoRaWAN, devices can communicate across the world using the internet, using various decentralised networks such as [https://www.thethingsnetwork.org/ The Things Network] or [https://www.helium.com/ Helium]. Since, PINE64 believes in openness, the LoRa gateway can connect to any network, per the developer implementation. If Helium Spots open up for PINE64 gateway and developers have implemented the hook for Helium, then this is good thing. The PINE64 LoRa gateway also open connect to The Things Network if developers implement support. The choice is yours!&lt;br /&gt;
&lt;br /&gt;
== Gateway ==&lt;br /&gt;
&lt;br /&gt;
The gateway will be available in two variants - indoor and outdoor. All that is known about the outdoor unit is that it will have &amp;quot;an aluminum, rugged and water resistant case&amp;quot;. &lt;br /&gt;
The indoor unit consists of a PINE A64-LTS, fitted with a purpose built hat (adapter) which uses a LoRa module by RakWireless. The chipset used is the SX1302, and the module via the SPI interface. There are two external connections on the enclosure for the GPS and loRa antenna. &lt;br /&gt;
&lt;br /&gt;
=== Connections ===&lt;br /&gt;
* GPS is connected to UART2 on the A64 board&lt;br /&gt;
* SX1302 on SPI0&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|RAK2287 module&lt;br /&gt;
|PI-2 connector&lt;br /&gt;
|PINE A64-LTS&lt;br /&gt;
|-&lt;br /&gt;
|SX1302 SPI&lt;br /&gt;
|Pin 19 = MOSI / PC0&amp;lt;br/&amp;gt;Pin 21 = MISO/PC1&amp;lt;br/&amp;gt;Pin23 = CLK/PC2&amp;lt;br/&amp;gt;Pin24 = CS/PC3&lt;br /&gt;
|SPI0 (/dev/spidev0.0)&lt;br /&gt;
|-&lt;br /&gt;
|SX1302 RESET&lt;br /&gt;
|Pin 11 = GPIO17/PC7&lt;br /&gt;
|GPIO71 (/sys/class/gpio/gpio71)&lt;br /&gt;
|-&lt;br /&gt;
|GPS UART&lt;br /&gt;
|Pin 8 = TX/&amp;lt;br&amp;gt;Pin 10 = RX&lt;br /&gt;
|UART2 (/dev/ttyS2)&lt;br /&gt;
|-&lt;br /&gt;
|GPS RESET&lt;br /&gt;
|Pin 33 = GPIO13/PC5&lt;br /&gt;
|GPIO69 (/sys/class/gpio/gpio69)&lt;br /&gt;
|-&lt;br /&gt;
|GPS Standby&lt;br /&gt;
|Pin 35 = GPIO19/PC9&lt;br /&gt;
|GPIO73 (/sys/class/gpio/gpio73)&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Pictures ===&lt;br /&gt;
&amp;lt;gallery&amp;gt;&lt;br /&gt;
File:Blog-april-InsideLoRaGateway.jpg&lt;br /&gt;
File:Blog-april-InsideLoRaGateway2.jpeg&lt;br /&gt;
File:Discord-lora-gateway-20210413_143615.jpg&lt;br /&gt;
File:Discord-lora-gateway-20210413_1435271.jpg&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Operating System Options===&lt;br /&gt;
&lt;br /&gt;
Pinedio Gateway carries the A64-LTS board. Based on ram specifications SOPINE images are also compatible.&lt;br /&gt;
&lt;br /&gt;
====Armbian====&lt;br /&gt;
&lt;br /&gt;
Gateway Hardware based on Pine64 A64-LTS + RAK2287 + GPS. &lt;br /&gt;
&lt;br /&gt;
Hardware compatible with SOPINE images.&lt;br /&gt;
&lt;br /&gt;
'''PineDio Gateway TTN/Chirpstack Image'''&lt;br /&gt;
&lt;br /&gt;
Debian image with (Default Choices: Chirpstack / TTN) software preinstalled / hardware enabled is available below.&lt;br /&gt;
&lt;br /&gt;
Latest: &lt;br /&gt;
    (PineDio-RAK-Armbian_02-26-2022.img.xz)&lt;br /&gt;
&lt;br /&gt;
    SHA256: 83c2fae06579c2101502963289682295b83164d322ae7359c7c584f0b0e57426&lt;br /&gt;
    SHA512: c5e8cb0b657ee02aa15c60dc7cab7b9e4a7785da548541c6a0eaf4ee7241600c18e339776d94731c5130ccceea4da4aad159af521c4f484c1a550a39fe707d95&lt;br /&gt;
&lt;br /&gt;
DOWNLOAD LOCATION:  https://mega.nz/file/CIoykITD#S_NQx9wRG05CTT7TdzBX8u24bGiVzT341VPZakycaw8&lt;br /&gt;
&lt;br /&gt;
'''Switch Between Chirpstack / TTN (TheThingsNetwork)'''&lt;br /&gt;
&lt;br /&gt;
  gateway-config&lt;br /&gt;
&lt;br /&gt;
First Select:&lt;br /&gt;
&lt;br /&gt;
  Setup RAK Gateway Channel Plan&lt;br /&gt;
&lt;br /&gt;
Next For TTN (TheThingsNetwork) Select:&lt;br /&gt;
&lt;br /&gt;
  Server is TTN&lt;br /&gt;
&lt;br /&gt;
'''or'''&lt;br /&gt;
&lt;br /&gt;
Next For Chirpstack Select:&lt;br /&gt;
&lt;br /&gt;
  Server is Other server&lt;br /&gt;
&lt;br /&gt;
'''Accessing Chirpstack Admin Page'''&lt;br /&gt;
&lt;br /&gt;
Point web browser to:&lt;br /&gt;
&lt;br /&gt;
  http://gatewayIPaddress:8080&lt;br /&gt;
&lt;br /&gt;
'''Default Chirpstack Credentials'''&lt;br /&gt;
&lt;br /&gt;
  login: admin&lt;br /&gt;
  password: admin&lt;br /&gt;
&lt;br /&gt;
'''SSH Credentials'''&lt;br /&gt;
&lt;br /&gt;
 Login: pinedio&lt;br /&gt;
 password: SoPinePass!!!&lt;br /&gt;
&lt;br /&gt;
'''Changing EUI'''&lt;br /&gt;
&lt;br /&gt;
EUI is stored in file:&lt;br /&gt;
&lt;br /&gt;
  /opt/ttn-gateway/packetforwarder/lorapkt_fwd/local_conf.json&lt;br /&gt;
&lt;br /&gt;
'''Additional Shell Commands'''&lt;br /&gt;
&lt;br /&gt;
'''View Gateway ID/EUI'''&lt;br /&gt;
&lt;br /&gt;
  gateway-version&lt;br /&gt;
&lt;br /&gt;
'''Restart Packet Forwarder/Concentrator'''&lt;br /&gt;
&lt;br /&gt;
  sudo systemctl restart ttn-gateway&lt;br /&gt;
&lt;br /&gt;
'''Check Status'''&lt;br /&gt;
&lt;br /&gt;
  sudo systemctl status ttn-gateway&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Enabling Concentrator/GPS Steps (Below Already *Completed* For Above Image Download)'''&lt;br /&gt;
&lt;br /&gt;
Inside armbian-config -&amp;gt; system -&amp;gt; Bootenv (edit boot environment), enter the following 2 lines (to create spidev0.0):&lt;br /&gt;
&lt;br /&gt;
 overlays=spi-spidev uart2 i2c0&lt;br /&gt;
 param_spidev_spi_bus=0&lt;br /&gt;
&lt;br /&gt;
Or you may hand edit: /boot/armbianEnv.txt to add the above overlays/param_spidev_spi_bus lines.&lt;br /&gt;
&lt;br /&gt;
Save. Reboot. &lt;br /&gt;
&lt;br /&gt;
After rebooting you should see a new device /dev/spidev0.0. This will be the concentrator device for gateway related setup.&lt;br /&gt;
&lt;br /&gt;
GPS will be /dev/ttyS2 and should work (after editing armbianEnv.txt + reboot). &lt;br /&gt;
Make sure to offer GPS antenna a strong signal, preferably by a window (if indoors).&lt;br /&gt;
&lt;br /&gt;
== USB adapter ==&lt;br /&gt;
[[File:Pine64-lora-usb-adapter.jpg|500px]]&lt;br /&gt;
&lt;br /&gt;
The Pine64 USB LoRa adapter is based on the Semtech SX1262 LoRa module and the CH341 USB bus converter chip. The '''CH341''' chip can be configured in multiple mode to convert USB to various serial and parallel ports. In this case, it's configured in '''synchronous serial mode''', which allows this chip to convert from USB to the SPI bus needed to talk to the SX1262 LoRa module:&lt;br /&gt;
&lt;br /&gt;
 --------            --------------------------&lt;br /&gt;
 |      |            |   USB LoRa Adapter     |&lt;br /&gt;
 | PC   |  &amp;lt;--USB--&amp;gt; | CH341 &amp;lt;--SPI--&amp;gt; SX1262 |&lt;br /&gt;
 |      |            |       &amp;lt;--I/O--&amp;gt;        |&lt;br /&gt;
 --------            --------------------------&lt;br /&gt;
&lt;br /&gt;
=== Pins ===&lt;br /&gt;
[[File:Lora-usb-pins.jpg|500px]]&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
&lt;br /&gt;
!SX1262 Pin&lt;br /&gt;
!Name&lt;br /&gt;
!Description&lt;br /&gt;
|-&lt;br /&gt;
|1&lt;br /&gt;
|ANT&lt;br /&gt;
|Antenna&lt;br /&gt;
|-&lt;br /&gt;
|2&lt;br /&gt;
|GND2&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|3&lt;br /&gt;
|VREG&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|4&lt;br /&gt;
|DCC&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|5&lt;br /&gt;
|VCC&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|6&lt;br /&gt;
|DIO1&lt;br /&gt;
|Connected on CH341 Pin 7&lt;br /&gt;
|-&lt;br /&gt;
|7&lt;br /&gt;
|DIO2&lt;br /&gt;
|Connected on CH341 Pin6&lt;br /&gt;
|-&lt;br /&gt;
|8&lt;br /&gt;
|DIO3&lt;br /&gt;
|Connected on CH341 Pin 5&lt;br /&gt;
|-&lt;br /&gt;
|9&lt;br /&gt;
|GND&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|10&lt;br /&gt;
|MISO&lt;br /&gt;
|SPI MISO (CH341 Pin 20)&lt;br /&gt;
|-&lt;br /&gt;
|11&lt;br /&gt;
|MOSI&lt;br /&gt;
|SPI MOSI (CH341 Pin 22)&lt;br /&gt;
|-&lt;br /&gt;
|12&lt;br /&gt;
|SCK&lt;br /&gt;
|SPI clock (CH341 Pin 24)&lt;br /&gt;
|- &lt;br /&gt;
|13&lt;br /&gt;
|NSS&lt;br /&gt;
|SPI Chip select&lt;br /&gt;
|-&lt;br /&gt;
|14&lt;br /&gt;
|POR&lt;br /&gt;
|Reset pin&lt;br /&gt;
|-&lt;br /&gt;
|15&lt;br /&gt;
|Busy&lt;br /&gt;
|Busy pin&lt;br /&gt;
|-&lt;br /&gt;
|16&lt;br /&gt;
|GND&lt;br /&gt;
|&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Kernel module for CH341 === &lt;br /&gt;
We need a driver for the CH341 USB bus converter chip. This driver will allow us to send command to the CH341 (SPI messages and access to the GPIOs). I've successfully build and run [https://github.com/rogerjames99/spi-ch341-usb this driver from '''rogerjames99'''] on my desktop computer (running Manjaro Linux) and on my Pinebook Pro (ARM64, running Manjaro ARM Linux). For any kernel newer than 3.10 but mandatory for kernels newer than 5.15 you need to use the [https://github.com/dimich-dmb/spi-ch341-usb dimich-dmb fork of the the '''spi-ch341-usb driver.'''] This fork has updated documentation for the newer kernel interfaces. If this driver gives you problems please drop by any of the social platforms in the Pine64 LoRa chat and give a holler, and if you are using a 5.15 or older kernel you can use the rogerjames99 fork.&lt;br /&gt;
&lt;br /&gt;
 $ git clone https://github.com/rogerjames99/spi-ch341-usb.git &lt;br /&gt;
or&lt;br /&gt;
 $ git clone https://github.com/dimich-dmb/spi-ch341-usb.git&lt;br /&gt;
then&lt;br /&gt;
 $ cd spi-ch341-usb&lt;br /&gt;
 $ make&lt;br /&gt;
 $ sudo make install&lt;br /&gt;
&lt;br /&gt;
Once the driver is installed, unload the module ''ch341'' if it has been automatically loaded:&lt;br /&gt;
&lt;br /&gt;
 $ lsmod |grep ch341&lt;br /&gt;
 $ sudo rmmod ch341&lt;br /&gt;
&lt;br /&gt;
On my setup, ''ch341'' would be automatically loaded once I connected my USB adapter. This module drives the CH341 is asynchronous serial mode, which will not work for a SPI bus. &lt;br /&gt;
&lt;br /&gt;
Then load the new module:&lt;br /&gt;
&lt;br /&gt;
 $ sudo modprobe spi-ch341-usb&lt;br /&gt;
&lt;br /&gt;
Plug your USB adapter and check that the module is correctly loaded : &lt;br /&gt;
&lt;br /&gt;
 $ dmesg&lt;br /&gt;
 [20141.872107] usb 1-1.1: USB disconnect, device number 4&lt;br /&gt;
 [20143.820756] usb 1-1.1: new full-speed USB device number 5 using ehci-platform&lt;br /&gt;
 [20143.973366] usb 1-1.1: New USB device found, idVendor=1a86, idProduct=5512, bcdDevice= 3.04&lt;br /&gt;
 [20143.973413] usb 1-1.1: New USB device strings: Mfr=0, Product=2, SerialNumber=0&lt;br /&gt;
 [20143.973434] usb 1-1.1: Product: USB UART-LPT&lt;br /&gt;
 [20143.975137] spi-ch341-usb 1-1.1:1.0: ch341_usb_probe: connect device&lt;br /&gt;
 [20143.975164] spi-ch341-usb 1-1.1:1.0: ch341_usb_probe: bNumEndpoints=3&lt;br /&gt;
 [20143.975183] spi-ch341-usb 1-1.1:1.0: ch341_usb_probe:   endpoint=0 type=2 dir=1 addr=2&lt;br /&gt;
 [20143.975206] spi-ch341-usb 1-1.1:1.0: ch341_usb_probe:   endpoint=1 type=2 dir=0 addr=2&lt;br /&gt;
 [20143.975229] spi-ch341-usb 1-1.1:1.0: ch341_usb_probe:   endpoint=2 type=3 dir=1 addr=1&lt;br /&gt;
 [20143.975254] spi-ch341-usb 1-1.1:1.0: ch341_cfg_probe: output cs0 SPI slave with cs=0&lt;br /&gt;
 [20143.975273] spi-ch341-usb 1-1.1:1.0: ch341_cfg_probe: output cs0 gpio=0 irq=0 &lt;br /&gt;
 [20143.975295] spi-ch341-usb 1-1.1:1.0: ch341_cfg_probe: output cs1 SPI slave with cs=1&lt;br /&gt;
 [20143.975313] spi-ch341-usb 1-1.1:1.0: ch341_cfg_probe: output cs1 gpio=1 irq=1 &lt;br /&gt;
 [20143.975334] spi-ch341-usb 1-1.1:1.0: ch341_cfg_probe: output cs2 SPI slave with cs=2&lt;br /&gt;
 [20143.975352] spi-ch341-usb 1-1.1:1.0: ch341_cfg_probe: output cs2 gpio=2 irq=2 &lt;br /&gt;
 [20143.975373] spi-ch341-usb 1-1.1:1.0: ch341_cfg_probe: input  gpio4 gpio=3 irq=3 &lt;br /&gt;
 [20143.975394] spi-ch341-usb 1-1.1:1.0: ch341_cfg_probe: input  gpio6 gpio=4 irq=4 &lt;br /&gt;
 [20143.975415] spi-ch341-usb 1-1.1:1.0: ch341_cfg_probe: input  err gpio=5 irq=5 &lt;br /&gt;
 [20143.975435] spi-ch341-usb 1-1.1:1.0: ch341_cfg_probe: input  pemp gpio=6 irq=6 &lt;br /&gt;
 [20143.975456] spi-ch341-usb 1-1.1:1.0: ch341_cfg_probe: input  int gpio=7 irq=7 (hwirq)&lt;br /&gt;
 [20143.975478] spi-ch341-usb 1-1.1:1.0: ch341_cfg_probe: input  slct gpio=8 irq=8 &lt;br /&gt;
 [20143.975499] spi-ch341-usb 1-1.1:1.0: ch341_cfg_probe: input  wait gpio=9 irq=9 &lt;br /&gt;
 [20143.975520] spi-ch341-usb 1-1.1:1.0: ch341_cfg_probe: input  autofd gpio=10 irq=10 &lt;br /&gt;
 [20143.975542] spi-ch341-usb 1-1.1:1.0: ch341_cfg_probe: input  addr gpio=11 irq=11 &lt;br /&gt;
 [20143.975564] spi-ch341-usb 1-1.1:1.0: ch341_cfg_probe: output ini gpio=12 irq=12 &lt;br /&gt;
 [20143.975585] spi-ch341-usb 1-1.1:1.0: ch341_cfg_probe: output write gpio=13 irq=13 &lt;br /&gt;
 [20143.975607] spi-ch341-usb 1-1.1:1.0: ch341_cfg_probe: output scl gpio=14 irq=14 &lt;br /&gt;
 [20143.975628] spi-ch341-usb 1-1.1:1.0: ch341_cfg_probe: output sda gpio=15 irq=15 &lt;br /&gt;
 [20143.975650] spi-ch341-usb 1-1.1:1.0: ch341_spi_probe: start&lt;br /&gt;
 [20143.975677] spi-ch341-usb 1-1.1:1.0: ch341_spi_probe: SPI master connected to SPI bus 1&lt;br /&gt;
 [20143.977831] spi-ch341-usb 1-1.1:1.0: ch341_spi_probe: SPI device /dev/spidev1.0 created&lt;br /&gt;
 [20143.978183] spi-ch341-usb 1-1.1:1.0: ch341_spi_probe: SPI device /dev/spidev1.1 created&lt;br /&gt;
 [20143.978552] spi-ch341-usb 1-1.1:1.0: ch341_spi_probe: SPI device /dev/spidev1.2 created&lt;br /&gt;
 [20143.978726] spi-ch341-usb 1-1.1:1.0: ch341_spi_probe: done&lt;br /&gt;
 [20143.978735] spi-ch341-usb 1-1.1:1.0: ch341_irq_probe: start&lt;br /&gt;
 [20143.979133] spi-ch341-usb 1-1.1:1.0: ch341_irq_probe: irq_base=103&lt;br /&gt;
 [20143.979154] spi-ch341-usb 1-1.1:1.0: ch341_irq_probe: done&lt;br /&gt;
 [20143.979162] spi-ch341-usb 1-1.1:1.0: ch341_gpio_probe: start&lt;br /&gt;
 [20143.979220] spi-ch341-usb 1-1.1:1.0: ch341_gpio_get_direction: gpio=cs0 dir=0&lt;br /&gt;
 [20143.979229] spi-ch341-usb 1-1.1:1.0: ch341_gpio_get_direction: gpio=cs1 dir=0&lt;br /&gt;
 [20143.979237] spi-ch341-usb 1-1.1:1.0: ch341_gpio_get_direction: gpio=cs2 dir=0&lt;br /&gt;
 [20143.979245] spi-ch341-usb 1-1.1:1.0: ch341_gpio_get_direction: gpio=gpio4 dir=1&lt;br /&gt;
 [20143.979253] spi-ch341-usb 1-1.1:1.0: ch341_gpio_get_direction: gpio=gpio6 dir=1&lt;br /&gt;
 [20143.979260] spi-ch341-usb 1-1.1:1.0: ch341_gpio_get_direction: gpio=err dir=1&lt;br /&gt;
 [20143.979268] spi-ch341-usb 1-1.1:1.0: ch341_gpio_get_direction: gpio=pemp dir=1&lt;br /&gt;
 [20143.979275] spi-ch341-usb 1-1.1:1.0: ch341_gpio_get_direction: gpio=int dir=1&lt;br /&gt;
 [20143.979283] spi-ch341-usb 1-1.1:1.0: ch341_gpio_get_direction: gpio=slct dir=1&lt;br /&gt;
 [20143.979290] spi-ch341-usb 1-1.1:1.0: ch341_gpio_get_direction: gpio=wait dir=1&lt;br /&gt;
 [20143.979298] spi-ch341-usb 1-1.1:1.0: ch341_gpio_get_direction: gpio=autofd dir=1&lt;br /&gt;
 [20143.979306] spi-ch341-usb 1-1.1:1.0: ch341_gpio_get_direction: gpio=addr dir=1&lt;br /&gt;
 [20143.979314] spi-ch341-usb 1-1.1:1.0: ch341_gpio_get_direction: gpio=ini dir=0&lt;br /&gt;
 [20143.979321] spi-ch341-usb 1-1.1:1.0: ch341_gpio_get_direction: gpio=write dir=0&lt;br /&gt;
 [20143.979329] spi-ch341-usb 1-1.1:1.0: ch341_gpio_get_direction: gpio=scl dir=0&lt;br /&gt;
 [20143.979337] spi-ch341-usb 1-1.1:1.0: ch341_gpio_get_direction: gpio=sda dir=0&lt;br /&gt;
 [20143.979831] spi-ch341-usb 1-1.1:1.0: ch341_gpio_probe: registered GPIOs from 496 to 511&lt;br /&gt;
 [20143.981152] spi-ch341-usb 1-1.1:1.0: ch341_gpio_probe: done&lt;br /&gt;
 [20143.981212] spi-ch341-usb 1-1.1:1.0: ch341_gpio_poll_function: start&lt;br /&gt;
 [20143.981291] spi-ch341-usb 1-1.1:1.0: ch341_usb_probe: connected&lt;br /&gt;
 [20144.756250] usbcore: registered new interface driver ch341&lt;br /&gt;
 [20144.756334] usbserial: USB Serial support registered for ch341-uart&lt;br /&gt;
&lt;br /&gt;
With kernel 5.16 and newer the output is shorter:&lt;br /&gt;
&lt;br /&gt;
 $ dmesg&lt;br /&gt;
 [ 6744.813564] usb 1-2.1.1: new full-speed USB device number 21 using xhci_hcd&lt;br /&gt;
 [ 6744.904377] usb 1-2.1.1: New USB device found, idVendor=1a86, idProduct=5512, bcdDevice= 3.04&lt;br /&gt;
 [ 6744.904383] usb 1-2.1.1: New USB device strings: Mfr=0, Product=2, SerialNumber=0&lt;br /&gt;
 [ 6744.904385] usb 1-2.1.1: Product: USB UART-LPT&lt;br /&gt;
 [ 6744.960243] spi-ch341-usb 1-2.1.1:1.0: ch341_cfg_probe: output cs0 SPI slave with cs=0&lt;br /&gt;
 [ 6744.960246] spi-ch341-usb 1-2.1.1:1.0: ch341_cfg_probe: output cs1 SPI slave with cs=1&lt;br /&gt;
 [ 6744.960247] spi-ch341-usb 1-2.1.1:1.0: ch341_cfg_probe: output cs2 SPI slave with cs=2&lt;br /&gt;
 [ 6744.960249] spi-ch341-usb 1-2.1.1:1.0: ch341_cfg_probe: input  gpio4 gpio=0 irq=0 (hwirq)&lt;br /&gt;
 [ 6744.960251] spi-ch341-usb 1-2.1.1:1.0: ch341_cfg_probe: input  gpio5 gpio=1 irq=1&lt;br /&gt;
 [ 6744.960302] spi-ch341-usb 1-2.1.1:1.0: ch341_spi_probe: SPI master connected to SPI bus 0&lt;br /&gt;
 [ 6744.960350] spi-ch341-usb 1-2.1.1:1.0: ch341_spi_probe: SPI device /dev/spidev0.0 created&lt;br /&gt;
 [ 6744.960398] spi-ch341-usb 1-2.1.1:1.0: ch341_spi_probe: SPI device /dev/spidev0.1 created&lt;br /&gt;
 [ 6744.960445] spi-ch341-usb 1-2.1.1:1.0: ch341_spi_probe: SPI device /dev/spidev0.2 created&lt;br /&gt;
 [ 6744.960583] spi-ch341-usb 1-2.1.1:1.0: ch341_usb_probe: connected&lt;br /&gt;
&lt;br /&gt;
=== Driver development === &lt;br /&gt;
=====Kernels 5.14 and older=====&lt;br /&gt;
&lt;br /&gt;
Once the module ''spi-ch341-usb'' is correctly loaded, here's how you can transfer data on the SPI bus (in C):&lt;br /&gt;
&lt;br /&gt;
 /* Open the SPI bus */&lt;br /&gt;
 int spi = open(&amp;quot;/dev/spidev1.0&amp;quot;, O_RDWR);&lt;br /&gt;
 uint8_t mmode = SPI_MODE_0;&lt;br /&gt;
 uint8_t lsb = 0;&lt;br /&gt;
 ioctl(spi, SPI_IOC_WR_MODE, &amp;amp;mmode);&lt;br /&gt;
 ioctl(spi, SPI_IOC_WR_LSB_FIRST, &amp;amp;lsb);&lt;br /&gt;
 &lt;br /&gt;
 /* Transfer data */&lt;br /&gt;
 /* TODO: Init buffer_out, buffer_in and size */&lt;br /&gt;
 const uint8_t *mosi = buffer_out; // output data&lt;br /&gt;
 uint8_t *miso = buffer_in; // input data&lt;br /&gt;
 &lt;br /&gt;
 struct spi_ioc_transfer spi_trans;&lt;br /&gt;
 memset(&amp;amp;spi_trans, 0, sizeof(spi_trans));&lt;br /&gt;
 &lt;br /&gt;
 spi_trans.tx_buf = (unsigned long) mosi;&lt;br /&gt;
 spi_trans.rx_buf = (unsigned long) miso;&lt;br /&gt;
 spi_trans.cs_change = true;&lt;br /&gt;
 spi_trans.len = size;&lt;br /&gt;
 &lt;br /&gt;
 int status = ioctl (spi, SPI_IOC_MESSAGE(1), &amp;amp;spi_trans);&lt;br /&gt;
&lt;br /&gt;
To access GPIOs, you first need to export them (to make them accessible via ''/sys/class/gpio''. As you can see in the dmesg output, GPIOs from 496 to 511 were registered, which means we can export 16 GPIOs. The mapping of these I/O is available in the [https://github.com/rogerjames99/spi-ch341-usb/blob/master/spi-ch341-usb.c#L148 source code of the driver]. For example, pin ''slct'' is the 12th, meaning we need to export GPIO 496+12 = 508.&lt;br /&gt;
&lt;br /&gt;
 int  fd;&lt;br /&gt;
 if ((fd = open(&amp;quot;/sys/class/gpio/export&amp;quot;, O_WRONLY)) == -1)   {&lt;br /&gt;
   perror(&amp;quot;open ini&amp;quot;);&lt;br /&gt;
   exit(-1);&lt;br /&gt;
 }&lt;br /&gt;
 &lt;br /&gt;
 if (write(fd, &amp;quot;508&amp;quot;, 3) == -1){&lt;br /&gt;
   perror (&amp;quot;write export 508&amp;quot;);&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
Once exported, the GPIO is available in ''/sys/class/gpio/sclt'' (the naming is specified by the driver). You can read the pin in C:&lt;br /&gt;
&lt;br /&gt;
 int  fd;&lt;br /&gt;
 if ((fd = open(&amp;quot;/sys/class/gpio/slct/value&amp;quot;, O_RDWR)) == -1)   {&lt;br /&gt;
   perror(&amp;quot;open&amp;quot;);&lt;br /&gt;
 }&lt;br /&gt;
 &lt;br /&gt;
 char buf;&lt;br /&gt;
 if (read(fd, &amp;amp;buf, 1) == -1) {&lt;br /&gt;
    perror(&amp;quot;read&amp;quot;);&lt;br /&gt;
 }&lt;br /&gt;
 &lt;br /&gt;
 int value = (buf == '0') ? 0 : 1;&lt;br /&gt;
&lt;br /&gt;
You can also write it:&lt;br /&gt;
&lt;br /&gt;
 int  fd; &lt;br /&gt;
 if ((fd = open(&amp;quot;/sys/class/gpio/ini/value&amp;quot;, O_RDWR)) == -1)   {&lt;br /&gt;
   perror(&amp;quot;open ini&amp;quot;);&lt;br /&gt;
 }&lt;br /&gt;
 &lt;br /&gt;
 if (write(fd, value ? &amp;quot;1&amp;quot; : &amp;quot;0&amp;quot;, 1) == -1) {&lt;br /&gt;
    perror (&amp;quot;write&amp;quot;);&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
=====Kernel 5.15 and newer=====&lt;br /&gt;
&lt;br /&gt;
We need some help documenting how these interfaces work!&lt;br /&gt;
&lt;br /&gt;
The driver creates these interfaces:&lt;br /&gt;
 {| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
  |Pin  ||SPI Function ||GPIO function ||GPIO name ||IRQ&lt;br /&gt;
  |-&lt;br /&gt;
  |15||CS0||-||-||-&lt;br /&gt;
  |-&lt;br /&gt;
  |16||CS1||-||-||-&lt;br /&gt;
  |-&lt;br /&gt;
  |17||CS2||-||-||-&lt;br /&gt;
  |-&lt;br /&gt;
  |19||-||Input||gpio4||hardware&lt;br /&gt;
  |-&lt;br /&gt;
  |21||-||Input||gpio5||software&lt;br /&gt;
 |}&lt;br /&gt;
&lt;br /&gt;
The dimich-dmb fork of spi-ch341-usb works with 5.15+ kernels, but as you can see above it is not configured for the needs of the Pinedio-USB by default. I have started a branch in my fork to work on getting the driver pre-configured for our needs. The branch can be [https://github.com/UncleGrumpy/spi-ch341-usb/tree/pinedio found here.] Please feel free to help! And open issues or discussions in the repo if you have problems or ideas how to help. Any improvements to the actual code beyond configuration should be pushed to the temporary [https://github.com/dimich-dmb/spi-ch341-usb/ upstream.]&lt;br /&gt;
&lt;br /&gt;
Since linux-5.15 binding to spidev driver is required to make slave devices available via /dev/, e.g. for slave 1 on bus 0 as real root (not with sudo):&lt;br /&gt;
&lt;br /&gt;
 # echo spidev &amp;gt; /sys/class/spi_master/spi0/spi0.1/driver_override&lt;br /&gt;
 # echo spi0.1 &amp;gt; /sys/bus/spi/drivers/spidev/bind&lt;br /&gt;
&lt;br /&gt;
For all devices handled by spi_ch341_usb driver (again, only as real root):&lt;br /&gt;
&lt;br /&gt;
 # for i in /sys/bus/usb/drivers/spi-ch341-usb/*/spi_master/spi*/spi*.*; do echo spidev &amp;gt; $i/driver_override; echo $(basename $i) &amp;gt; /sys/bus/spi/drivers/spidev/bind; done&lt;br /&gt;
&lt;br /&gt;
The documentation found at https://github.com/dimich-dmb/spi-ch341-usb/blob/master/README.md has more information.&lt;br /&gt;
&lt;br /&gt;
The 5.15+ driver is not ready yet. But if you are interested in testing, helping to get the configuration right, or working on application development you can build and test the current driver:&lt;br /&gt;
&lt;br /&gt;
 $ git clone -b pinedio https://github.com/UncleGrumpy/spi-ch341-usb.git &lt;br /&gt;
 $ cd spi-ch341-usb&lt;br /&gt;
 $ make&lt;br /&gt;
 $ sudo make install&lt;br /&gt;
&lt;br /&gt;
So far this will automatically set up the SPI slave device /dev/spi0.0. It names the ch341-usb device as &amp;quot;pinedio&amp;quot; this will allow application developers to find the correct gpiochip by name. I need help confirming the correct gpio pins but as of now the driver will setup the following configuration:&lt;br /&gt;
&lt;br /&gt;
The driver uses following CH341A pins for the SPI interface. &lt;br /&gt;
 {| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
  | Pin || Name || Direction || Function SPI (CH341A)&lt;br /&gt;
  |-&lt;br /&gt;
  | 18  || D3   || output    || SCK (DCK)             &lt;br /&gt;
  |-&lt;br /&gt;
  | 20  || D5   || output    || MOSI (DOUT)           &lt;br /&gt;
  |-&lt;br /&gt;
  | 22  || D7   || input     || MISO (DIN)            &lt;br /&gt;
  |-&lt;br /&gt;
  | 15  || D0   || output    || CS0                   &lt;br /&gt;
 |}&lt;br /&gt;
&lt;br /&gt;
The driver uses the following GPIO configuration.  I am not at all sure these are the correct pins to use! This is one area that I could really use some help with!!!&lt;br /&gt;
 {| class=&amp;quot;wikitable&lt;br /&gt;
  | CH341 Pin || CH341A Name || Function   || GPIO Name  || GPIO Configuration || SX1262 connection&lt;br /&gt;
  |-&lt;br /&gt;
  |  7        || INT#        || IRQ        || dio_irq    || Output             || DIO1 (IRQ)        &lt;br /&gt;
  |-&lt;br /&gt;
  |  8        || SLCT        || BUSY       || dio_busy   || Input              || BUSY              &lt;br /&gt;
  |-&lt;br /&gt;
  | 26        || RST#        || Hard Reset || dio_reset  || Output             || NRESET            &lt;br /&gt;
 |}&lt;br /&gt;
&lt;br /&gt;
The function of these pins can be changed from user space by using libgpiod. The command line tools installed with the library (gpioset, gpioget, gpiodetect, gpioinfo...) can be used for bash scripts, etc. and applications should all use the libgpiod interfaces. The /sys/class/gpio interface has been removed from the kernel in 5.15, so any apps using /sys/class/gpio to access gpio pins are broken, or will be as distos update their kernels to 5.15 and beyond.&lt;br /&gt;
&lt;br /&gt;
GPIO pins can be listed with gpioinfo:&lt;br /&gt;
 $ gpioinfo pinedio&lt;br /&gt;
&lt;br /&gt;
The output should look similar to:&lt;br /&gt;
 gpiochip1 - 3 lines:&lt;br /&gt;
         line   0:    &amp;quot;dio_irq&amp;quot;       unused   input  active-high&lt;br /&gt;
         line   1:   &amp;quot;dio_busy&amp;quot;       unused   input  active-high&lt;br /&gt;
         line   2:  &amp;quot;dio_reset&amp;quot;       unused  output  active-high&lt;br /&gt;
&lt;br /&gt;
The gpiochip# might be different.  The driver exposes the Pinedio with the gpio name &amp;quot;pinedio&amp;quot;, developers should use this name to interact with the gpiochip because the gpiochip# of the device is likely to be different from one system to the next, or depending on the order devices are initialized.&lt;br /&gt;
&lt;br /&gt;
=== Driver for the SX1262 LoRa module ===&lt;br /&gt;
Now that we can talk to the SX1262 via the CH341 USB converter chip, we need to send actual commands to make it emit or receive LoRa messages. To do this, you can implement the driver yourself using info from the datasheet, or use an existing driver (you can easily find drivers for the Arduino framework, for example. &lt;br /&gt;
I found [https://github.com/YukiWorkshop/sx126x_driver this C++ driver]. It's well written, lightweight and easily portable across many platforms. All you have to do is implement 3 HAL function : read GPIO, write GPIO and transfer data on SPI. I wrote a quick'n'dirty app that emits a LoRa frame. It's [https://gist.github.com/JF002/f1af5595874942427eea9d375c18fc73 available here]. &lt;br /&gt;
&lt;br /&gt;
As I don't have any 'raw' LoRa device on hands, I check that it was actually transmitting something using my SDR setup (simple TNT usb key and '''Gqrx''' software):&lt;br /&gt;
&lt;br /&gt;
[[File:pine64-lora-usb-adapter-sdr.png|500px]]&lt;br /&gt;
&lt;br /&gt;
== Other end nodes ==&lt;br /&gt;
&lt;br /&gt;
There are several end-node units planned:&lt;br /&gt;
* loRa back case for the PinePhone&lt;br /&gt;
* standalone USB dongle-type end-node adapter&lt;br /&gt;
* PineTab adapter&lt;br /&gt;
* as well as a SPI module (which can also be configured as a USB LoRa dongle)&lt;br /&gt;
* a LoRa stick powered by a single 18650 battery (using the [https://wiki.pine64.org/wiki/Nutcracker BL602], and can be fitted with GPS, an low-power OLED panel and additional sensors)&lt;br /&gt;
&lt;br /&gt;
All the end-nodes use the SX1262 chip. &lt;br /&gt;
&lt;br /&gt;
=== Pictures ===&lt;br /&gt;
&amp;lt;gallery&amp;gt;&lt;br /&gt;
File:Blog-april-USB-LoRa-1024x655.jpg&lt;br /&gt;
File:Blog-april-LoRa-something-839x1024.jpg&lt;br /&gt;
File:Discord_20210421_lora_usb_closeup.jpg&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Datasheets and schematics ==&lt;br /&gt;
=== Gateway ===&lt;br /&gt;
* [https://www.semtech.com/products/wireless-rf/lora-gateways/sx1302 SX1302 datasheets and resources]&lt;br /&gt;
* [https://docs.rakwireless.com/Product-Categories/WisLink/RAK2247/Overview/ RAK2287 datasheets and resources]&lt;br /&gt;
* [https://wiki.pine64.org/images/5/54/PINE64_LoRa_Gateway_Module_Adapter_Schematic-v1.0-20210308.pdf Pine64 LoRa Gateway module adapter schematic]&lt;br /&gt;
&lt;br /&gt;
=== End nodes ===&lt;br /&gt;
* [https://www.semtech.com/products/wireless-rf/lora-transceivers/sx1262 SX1262 datasheets and resources]&lt;br /&gt;
&lt;br /&gt;
=== Pinephone backplate ===&lt;br /&gt;
* [[File:Pinephone_LoRa_BackPanel_Schematic-v1.0-20210402.pdf]]&lt;br /&gt;
* [[File:CA-S01_LoRa_Chip_Antenna_in_Chinese.pdf]]&lt;br /&gt;
* [https://github.com/zschroeder6212/tiny-i2c-spi I2C SPI Bridge code running on ATtiny84]&lt;br /&gt;
&lt;br /&gt;
=== USB LoRa adapter ===&lt;br /&gt;
* [[File:USB_LoRa_adapter-PINE64_RFM90_SCH_2021_04_26.pdf]]&lt;br /&gt;
* CH341 datasheet : [[File:CH341DS1.pdf]]&lt;br /&gt;
* Semtech SX1262 datasheet : [https://semtech.my.salesforce.com/sfc/p/#E0000000JelG/a/2R000000HT76/7Nka9W5WgugoZe.xwIHJy6ebj1hW8UJ.USO_Pt2CLLo File on Semtech website (file is too big for the wiki)]&lt;br /&gt;
&lt;br /&gt;
=== PineDio Stack ===&lt;br /&gt;
* Schematic : [[File:PINEDIO_STACK_V1_0-2021_05_24C.pdf]]&lt;br /&gt;
&lt;br /&gt;
== Other resources ==&lt;br /&gt;
* [https://www.youtube.com/watch?v=cJ0wpANpbyc Video: A peek at Pine64's LoRa gateway and modules]&lt;br /&gt;
* [https://iotw.io/ IOTW - Blockchain-Enabled IoT Data Platform]&lt;br /&gt;
* [https://lupyuen.github.io/articles/pinedio PineDio Stack BL604 RISC-V Board: Testing The Prototype]&lt;br /&gt;
* [https://lupyuen.github.io/articles/lorawan2 LoRaWAN on PineDio Stack BL604 RISC-V Board]&lt;br /&gt;
* [https://lupyuen.github.io/articles/ttn The Things Network on PineDio Stack BL604 RISC-V Board]&lt;br /&gt;
* [https://lupyuen.github.io/articles/prometheus Monitor IoT Devices in The Things Network with Prometheus and Grafana]&lt;br /&gt;
* [https://lupyuen.github.io/articles/tsen Internal Temperature Sensor on BL602]&lt;br /&gt;
* [https://lupyuen.github.io/articles/roblox IoT Digital Twin with Roblox and The Things Network]&lt;br /&gt;
* [https://lupyuen.github.io/articles/gateway PineDio LoRa Gateway: Testing The Prototype]&lt;br /&gt;
* [https://lupyuen.github.io/articles/nuttx Apache NuttX OS on RISC-V BL602 and BL604]&lt;br /&gt;
* [https://lupyuen.github.io/articles/spi2 SPI on Apache NuttX OS]&lt;br /&gt;
* [https://lupyuen.github.io/articles/sx1262 LoRa SX1262 on Apache NuttX OS]&lt;br /&gt;
* [https://lupyuen.github.io/articles/lorawan3 LoRaWAN on Apache NuttX OS]&lt;br /&gt;
* [https://lupyuen.github.io/articles/rust2 Rust on Apache NuttX OS]&lt;br /&gt;
* [https://lupyuen.github.io/articles/ikea Connect IKEA Air Quality Sensor to Apache NuttX OS]&lt;br /&gt;
* [https://lupyuen.github.io/articles/pinedio2 PineDio Stack BL604 runs Apache NuttX RTOS]&lt;br /&gt;
* [https://lupyuen.github.io/articles/touch NuttX Touch Panel Driver for PineDio Stack BL604]&lt;br /&gt;
* [https://www.robertlipe.com/buttons-on-bl602-nuttx/ Buttons on BL602 NuttX]&lt;br /&gt;
* [https://lupyuen.github.io/articles/expander NuttX GPIO Expander for PineDio Stack BL604]&lt;br /&gt;
* [https://lupyuen.github.io/articles/auto2 (Mostly) Automated Testing of Apache NuttX RTOS on PineDio Stack BL604 RISC-V Board]&lt;br /&gt;
* [https://lupyuen.github.io/articles/zig Zig on RISC-V BL602: Quick Peek with Apache NuttX RTOS]&lt;br /&gt;
* [https://lupyuen.github.io/articles/iot Build an IoT App with Zig and LoRaWAN]&lt;br /&gt;
* [https://lupyuen.github.io/articles/lvgl Build an LVGL Touchscreen App with Zig]&lt;/div&gt;</summary>
		<author><name>Lupyuen</name></author>
	</entry>
	<entry>
		<id>https://wiki.pine64.org/index.php?title=PineCone&amp;diff=13189</id>
		<title>PineCone</title>
		<link rel="alternate" type="text/html" href="https://wiki.pine64.org/index.php?title=PineCone&amp;diff=13189"/>
		<updated>2022-06-14T05:13:01Z</updated>

		<summary type="html">&lt;p&gt;Lupyuen: Add article &amp;quot;Build an IoT App with Zig and LoRaWAN&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[File:Pine64_BL602_EVB_photo-3-small.jpg|thumb|PineCone BL602 EVB (Evaluation Board)]]&lt;br /&gt;
&lt;br /&gt;
The '''PineCone''' is a BL602 evaluation board, which was developed with the goal to challenge the open source community to achieve blob-free and free and open source WiFi and Bluetooth, see the [https://www.pine64.org/2020/10/28/nutcracker-challenge-blob-free-wifi-ble/ Nutcracker Challenge].&lt;br /&gt;
&lt;br /&gt;
== BL602 Specifications ==&lt;br /&gt;
* '''CPU:''' 32-bit RV32IMAFC RISC-V “SiFive E24 Core”&lt;br /&gt;
** [https://www.sifive.com/cores/e24 SiFive E24 Core information]&lt;br /&gt;
* '''Memory:'''&lt;br /&gt;
** 128KB ROM&lt;br /&gt;
** 276KB SRAM&lt;br /&gt;
** 1Kb eFuse&lt;br /&gt;
** 2MB Embedded Flash&lt;br /&gt;
* '''Security:'''&lt;br /&gt;
** Secure boot&lt;br /&gt;
** Secure debug&lt;br /&gt;
** AES 128/192/256&lt;br /&gt;
** SHA-1/224/256&lt;br /&gt;
** TRNG (True Random Number Generator)&lt;br /&gt;
** PKA (Public Key Accelerator)&lt;br /&gt;
* '''Wireless:'''&lt;br /&gt;
** Wi-Fi 802.11 b/g/n&lt;br /&gt;
** Bluetooth® Low Energy 5.0&lt;br /&gt;
** Wi-Fi Fast connection with BLE assistance&lt;br /&gt;
** Wi-Fi and BLE coexistence&lt;br /&gt;
** Wi-Fi Security WPS/WEP/WPA/WPA2/WPA3&lt;br /&gt;
** STA, SoftAP and sniffer modes&lt;br /&gt;
** Multi-Cloud connectivity&lt;br /&gt;
** 2.4 GHz RF transceiver&lt;br /&gt;
** Integrated RF balun, PA/LNA&lt;br /&gt;
* '''Package Type:'''&lt;br /&gt;
** 32 pin QFN 4mm x 4mm&lt;br /&gt;
* JTAG support (See below for BL602 impact)&lt;br /&gt;
&lt;br /&gt;
[[File:BL602_Block_Diagram.jpg|600px]]&lt;br /&gt;
&lt;br /&gt;
== JTAG ==&lt;br /&gt;
{| class=&amp;quot;wikitable floatright&amp;quot;&lt;br /&gt;
|+ Default JTAG pins&lt;br /&gt;
|-&lt;br /&gt;
| GPIO Pin || JTAG Pin&lt;br /&gt;
|-&lt;br /&gt;
| GPIO17 || TDI&lt;br /&gt;
|-&lt;br /&gt;
| GPIO11 || TDO&lt;br /&gt;
|-&lt;br /&gt;
| GPIO12 || TMS&lt;br /&gt;
|-&lt;br /&gt;
| GPIO14 || TCK&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
BL602 multiplexes four GPIO pins to provide the familiar JTAG lines. See the accompanying table for the default pin mappings.&lt;br /&gt;
&lt;br /&gt;
These are the default JTAG pins in use after a cold boot. However, many pieces of software, including the demo that's installed by default on new PineCones, remap these pins to other functions. You cannot use the default wiring for JTAG while such software is running. This issue is especially prevalent on the PineCone because three of the default JTAG pins are connected to the onboard RGB LED. Nothing about the LED itself interferes with JTAG, but any program that uses the LED will necessarily remap some of the default JTAG pins to be GPIO.&lt;br /&gt;
&lt;br /&gt;
The MaskROM download mode that the BL602 enters when you tie GPIO8 high does '''not''' remap the default JTAG pins, and so you can and should use that mode while checking basic functionality of your JTAG adapter.&lt;br /&gt;
&lt;br /&gt;
Note that, just as software can remap the default JTAG pins to be something else, it can also remap other pins to be JTAG. Control over this is quite granular, with 5-6 candidate pins for each individual JTAG signal that can be mapped independently of one another. LEE Lup Yuen has written some [https://lupyuen.github.io/articles/openocd#free-the-led-from-jtag-port sample code] showing how to remap the JTAG pins so that your software can use the LED without giving up support for debugging.&lt;br /&gt;
&lt;br /&gt;
== Pine64 USB JTAG Adapter information and schematics ==&lt;br /&gt;
* [https://files.pine64.org/doc/Pinenut/PINE64%20USB%20JTAG%20Adapter%20Schematic-20201215.pdf PINE64 USB JTAG Adapter schematic 20202018 1.0]&lt;br /&gt;
* [[:File:PINE64_USB_JTAG_Adapter_Schematic_ver_1.0a-20210109.pdf|PINE64 USB JTAG Adapter schematic 20210109 1.0a]]&lt;br /&gt;
&lt;br /&gt;
== PineCone BL602 EVB information and schematics ==&lt;br /&gt;
* Approximate dimensions: 26mm x 43mm&lt;br /&gt;
* Board layout:&lt;br /&gt;
[[File:PADI-II_EVB.png]]&lt;br /&gt;
* [https://files.pine64.org/doc/Pinenut/Pine64%20BL602%20EVB%20Schematic%20ver%201.1.pdf PineCone BL602 EVB schematic ver 1.1]&lt;br /&gt;
** Note: In PineCone revision 1.1 (&amp;quot;BL62B_EVB V1.1&amp;quot; silkscreened on back of board), CC1 and CC2 share one 5.1KΩ resistor. This means the board will fail to power when you use an e-marked USB-C cable like the one that comes with Apple chargers. See [https://medium.com/@leung.benson/how-to-design-a-proper-usb-c-power-sink-hint-not-the-way-raspberry-pi-4-did-it-f470d7a5910 this article] for details of why this happens. The next schematic design will give each line its own 5.1KΩ resistor as per the USB-C specification.&lt;br /&gt;
* The board uses a CH340 Serial/USB adapter. This chip is commonly used in Arduino-class development boards. It is a full speed (12Mbps) USB interface and has vendor ID 0x1a86 with product ID 0x7523.&lt;br /&gt;
* The GPIO pins (11, 12, 14, 17) plus the nearby RESET, POWER, and GND pins are all located on one side of the board, on J1 to provide JTAG connection.&lt;br /&gt;
&lt;br /&gt;
== Pinenut-01S Module information and schematics ==&lt;br /&gt;
[[File:Pinenut-01S_PCB-Front.png|225px]][[File:Pinenut-01S_PCB-Back.png|225px]]&lt;br /&gt;
* [https://files.pine64.org/doc/Pinenut/Pinenut-01S%20V1.01%20SCH.pdf Pinenut-01S schematic ver 1.01]&lt;br /&gt;
* [https://wiki.pine64.org/images/6/6b/PineNut-01S_v1.01_KiCad.zip PineNut-01S KiCad schematic ver 1.01]&lt;br /&gt;
* [https://files.pine64.org/doc/Pinenut/NUT-01S%20GPIO%20Definition%20ver%201.0.pdf Pinenut-01S GPIO Definition ver 1.0]&lt;br /&gt;
* [https://files.pine64.org/doc/Pinenut/USB%20Adapter%20for%20Pinenut-01S%20Schematic%20V1.0.pdf USB Programmer adapter for Pinenut-01S schematic ver 1.0]&lt;br /&gt;
* The default firmware runs the UART at 2000000 bps.  It will accept input whilst regularly outputting:&amp;lt;code&amp;gt;&amp;lt;br/&amp;gt;proc_hellow_entry: RISC-V rv32imafc&amp;lt;br/&amp;gt;cur key status:1&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Pinenut-12S Module information ==&lt;br /&gt;
[[File:NUT-12S_module-front.jpg|200px]][[File:NUT-12S_module-back.jpg|200px]]&lt;br /&gt;
* [https://files.pine64.org/doc/Pinenut/NUT-12S%20GPIO%20Definition%20ver%201.0.pdf Pinenut-12S GPIO Definition ver 1.0]&lt;br /&gt;
* Onboard LED is connected to IO0&lt;br /&gt;
&lt;br /&gt;
== Datasheets for components and peripherals ==&lt;br /&gt;
* Bouffalo BL-602 SoC information:&lt;br /&gt;
** [https://github.com/bouffalolab/bl_docs Bouffalo Lab's official bl_docs repository]: should always contain the latest SoC documentation available, in PDF, HTML, and reStructuredText source forms.&lt;br /&gt;
** [https://github.com/pine64/bl602-docs/tree/main/mirrored PINE64's bl602-docs repository]: contains an archive of all historical datasheets and reference manual PDFs but may lag behind Bouffalo's official repository. If you notice that it is, please submit a pull request!&lt;br /&gt;
* USB/Serial adapter:&lt;br /&gt;
** [https://cdn.sparkfun.com/datasheets/Dev/Arduino/Other/CH340DS1.PDF CH340 serial converter]&lt;br /&gt;
&lt;br /&gt;
== Misc notes ==&lt;br /&gt;
Planned to be available in at least three form factors:&lt;br /&gt;
* NUT-01S -&amp;gt; ESP-01S&lt;br /&gt;
* NUT-12S -&amp;gt; ESP-12S&lt;br /&gt;
* NUT-15 -&amp;gt; RTL8723/AMPAK&lt;br /&gt;
&lt;br /&gt;
== Loading code ==&lt;br /&gt;
To load code, you must move the jumper to the position closest to the edge, press reset, load the code, move the jumper back toward the center of the board, and press reset again.&lt;br /&gt;
&lt;br /&gt;
There are currently a number of loaders in progress, each with differing degrees of completeness and success on various operating systems.&lt;br /&gt;
* In the build tree, there is BLFlashCube for Windows, which is a proprietary GUI for flashing images. Linux and macOS binaries are available via [https://dev.bouffalolab.com/download Bouffalo Lab's developer portal].&lt;br /&gt;
* [https://github.com/stschake/bl60x-flash bl60x-flash] is in Python and has been reported successful on MacOS catalina (10.15.6) by Punnerud and madushan1000.&lt;br /&gt;
* [https://github.com/bouffalolab/BLOpenFlasher BLOpenFlasher] is a WIP, written in go, by Bouffalo Labs to provide source for a flash utility.&lt;br /&gt;
* [https://github.com/renzenicolai/bl602tool bl602tool] is a Python utility in development.&lt;br /&gt;
* &amp;lt;del&amp;gt;[https://pypi.org/project/bflb-eflash-loader/ Bouffalo's Python Flash Loader] is a new (Dec 20) flash loader by the makers of the chip.&amp;lt;/del&amp;gt;&lt;br /&gt;
* &amp;lt;del&amp;gt;[https://pypi.org/project/bflb-image-build/ Bouffalo's image build] smooshes code and adds headers for downloads.&amp;lt;/del&amp;gt;&lt;br /&gt;
* [https://pypi.org/project/bflb-mcu-tool/ Bouffalo's MCU tool] (Mar 2021) Python image tool replaced both of the above. Now combined with eflash loader, deals with partitions, DTS, signing, fuses etc.&lt;br /&gt;
* [https://github.com/spacemeowx2/blflash blflash serial flasher] BL602 serial flasher, inspired by BLOpenFlasher&lt;br /&gt;
&lt;br /&gt;
== Development efforts ==&lt;br /&gt;
* [https://github.com/pine64/bl_iot_sdk PineCone BL602 GitHub Page (PINE64 fork)] has compilers, linkers, and all the code to build on Windows, Linux (x86_64), and MacOS.&lt;br /&gt;
* [https://github.com/bouffalolab/bl_iot_sdk Bouffalo Lab GitHub Page]&lt;br /&gt;
* [https://github.com/renzenicolai/bl602-docs/ BL602 Developer organize documentation GitHub Page]&lt;br /&gt;
* [https://github.com/renzenicolai/bl602tool BL602 Developer organize tool GitHub Page]&lt;br /&gt;
* [https://github.com/stschake/bl60x-flash Programming tool for Bouffalo Labs BL602/BL604 chips]&lt;br /&gt;
* [https://github.com/pine64/bl602-re BL602 reverse engineering working group]&lt;br /&gt;
* [https://github.com/pine64/bl602-sdio-linux Linux kernel module]&lt;br /&gt;
* [https://github.com/tchebb/bl602-docs BL602 Documentation]&lt;br /&gt;
* [https://github.com/spacemeowx2/blflash BL602 serial flasher]&lt;br /&gt;
* [https://github.com/mkroman/awesome-bouffalo#feature-matrix Awesome Bouffalo]&lt;br /&gt;
&lt;br /&gt;
== Articles and Blogs ==&lt;br /&gt;
* [https://lupyuen.github.io/articles/pinecone Quick Peek of PineCone BL602 RISC-V Evaluation Board by Lup Yuen]&lt;br /&gt;
* [https://maero.dk/bl602-firmware-image-format/ Documenting the BouffaloLab BL602 firmware image format by MK]&lt;br /&gt;
* [https://lupyuen.github.io/articles/openocd Connect PineCone BL602 to OpenOCD by Lup Yuen]&lt;br /&gt;
* [https://lupyuen.github.io/articles/debug Debug Rust on PineCone BL602 with VSCode and GDB by Lup Yuen]&lt;br /&gt;
* [https://lupyuen.github.io/articles/mynewt Porting Mynewt to PineCone BL602 by Lup Yuen]&lt;br /&gt;
* [https://lupyuen.github.io/articles/flash Flashing Firmware to PineCone BL602 by Lup Yuen]&lt;br /&gt;
* [https://lupyuen.github.io/articles/led Control PineCone BL602 RGB LED with GPIO and PWM by Lup Yuen]&lt;br /&gt;
* [https://lupyuen.github.io/articles/gpio Mynewt GPIO ported to PineCone BL602 RISC-V Board by Lup Yuen]&lt;br /&gt;
* [https://lupyuen.github.io/articles/i2c PineCone BL602 talks to I2C Sensors by Lup Yuen]&lt;br /&gt;
* [https://lupyuen.github.io/articles/spi PineCone BL602 talks SPI too! by Lup Yuen]&lt;br /&gt;
* [https://lupyuen.github.io/articles/display PineCone BL602 Blasting Pixels to ST7789 Display with LVGL Library by Lup Yuen]&lt;br /&gt;
* [https://lupyuen.github.io/articles/uart PineCone BL602 Talks UART to Grove E-Ink Display by Lup Yuen]&lt;br /&gt;
* [https://lupyuen.github.io/articles/book The RISC-V BL602 Book by Lup Yuen]&lt;br /&gt;
* [https://lupyuen.github.io/articles/lora Connect PineCone BL602 to LoRa Transceiver by Lup Yuen]&lt;br /&gt;
* [https://lupyuen.github.io/articles/wisblock RAKwireless WisBlock talks LoRa with PineCone BL602 RISC-V Board by Lup Yuen]&lt;br /&gt;
* [https://lupyuen.github.io/articles/lora2 PineCone BL602 RISC-V Board Receives LoRa Packets by Lup Yuen]&lt;br /&gt;
* [https://lupyuen.github.io/articles/rust Run Rust RISC-V Firmware with BL602 IoT SDK by Lup Yuen]&lt;br /&gt;
* [https://lupyuen.github.io/articles/lorawan PineCone BL602 Talks LoRaWAN by Lup Yuen]&lt;br /&gt;
* [https://lupyuen.github.io/articles/lisp uLisp and Blockly on PineCone BL602 RISC-V Board by Lup Yuen]&lt;br /&gt;
* [https://lupyuen.github.io/articles/wasm Simulate RISC-V BL602 with WebAssembly, uLisp and Blockly by Lup Yuen]&lt;br /&gt;
* [https://lupyuen.github.io/articles/boot BL602 Bootloader by Lup Yuen]&lt;br /&gt;
* [https://lupyuen.github.io/articles/tflite Machine Learning on RISC-V BL602 with TensorFlow Lite by Lup Yuen]&lt;br /&gt;
* [https://lupyuen.github.io/articles/wifi Reverse Engineering WiFi on RISC-V BL602 by Lup Yuen]&lt;br /&gt;
* [https://lupyuen.github.io/articles/adc Rust on RISC-V BL602: Is It Sunny? by Lup Yuen]&lt;br /&gt;
* [https://lupyuen.github.io/articles/rustsim Rust on RISC-V BL602: Simulated with WebAssembly by Lup Yuen]&lt;br /&gt;
* [https://lupyuen.github.io/articles/pinedio PineDio Stack BL604 RISC-V Board: Testing The Prototype by Lup Yuen]&lt;br /&gt;
* [https://lupyuen.github.io/articles/rhai Rust on RISC-V BL602: Rhai Scripting by Lup Yuen]&lt;br /&gt;
* [https://lupyuen.github.io/articles/lorawan2 LoRaWAN on PineDio Stack BL604 RISC-V Board by Lup Yuen]&lt;br /&gt;
* [https://lupyuen.github.io/articles/ttn The Things Network on PineDio Stack BL604 RISC-V Board by Lup Yuen]&lt;br /&gt;
* [https://lupyuen.github.io/articles/cbor Encode Sensor Data with CBOR on BL602 by Lup Yuen]&lt;br /&gt;
* [https://lupyuen.github.io/articles/roblox IoT Digital Twin with Roblox and The Things Network by Lup Yuen]&lt;br /&gt;
* [https://lupyuen.github.io/articles/tsen Internal Temperature Sensor on BL602 by Lup Yuen]&lt;br /&gt;
* [https://lupyuen.github.io/articles/payload CBOR Payload Formatter for The Things Network by Lup Yuen]&lt;br /&gt;
* [https://lupyuen.github.io/articles/prometheus Monitor IoT Devices in The Things Network with Prometheus and Grafana by Lup Yuen]&lt;br /&gt;
* [https://lupyuen.github.io/articles/nuttx Apache NuttX OS on RISC-V BL602 and BL604 by Lup Yuen]&lt;br /&gt;
* [https://lupyuen.github.io/articles/spi2 SPI on Apache NuttX OS by Lup Yuen]&lt;br /&gt;
* [https://lupyuen.github.io/articles/sx1262 LoRa SX1262 on Apache NuttX OS by Lup Yuen]&lt;br /&gt;
* [https://lupyuen.github.io/articles/lorawan3 LoRaWAN on Apache NuttX OS by Lup Yuen]&lt;br /&gt;
* [https://lupyuen.github.io/articles/rust2 Rust on Apache NuttX OS by Lup Yuen]&lt;br /&gt;
* [https://lupyuen.github.io/articles/auto Auto Flash and Test NuttX on RISC-V BL602 by Lup Yuen]&lt;br /&gt;
* [https://lupyuen.github.io/articles/loader BL602 EFlash Loader: Reverse Engineered with Ghidra by Lup Yuen]&lt;br /&gt;
* [https://lupyuen.github.io/articles/ikea Connect IKEA Air Quality Sensor to Apache NuttX OS by Lup Yuen]&lt;br /&gt;
* [https://lupyuen.github.io/articles/bme280 Apache NuttX Driver for BME280 Sensor: Ported from Zephyr OS by Lup Yuen]&lt;br /&gt;
* [https://lupyuen.github.io/articles/rusti2c Rust talks I2C on Apache NuttX RTOS by Lup Yuen]&lt;br /&gt;
* [https://lupyuen.github.io/articles/st7789 ST7789 Display with LVGL Graphics on Apache NuttX RTOS by Lup Yuen]&lt;br /&gt;
* [https://lupyuen.github.io/articles/pinedio2 PineDio Stack BL604 runs Apache NuttX RTOS by Lup Yuen]&lt;br /&gt;
* [https://lupyuen.github.io/articles/touch NuttX Touch Panel Driver for PineDio Stack BL604 by Lup Yuen]&lt;br /&gt;
* [https://www.robertlipe.com/buttons-on-bl602-nuttx/ Buttons on BL602 NuttX]&lt;br /&gt;
* [https://lupyuen.github.io/articles/expander NuttX GPIO Expander for PineDio Stack BL604 by Lup Yuen]&lt;br /&gt;
* [https://lupyuen.github.io/articles/auto2 (Mostly) Automated Testing of Apache NuttX RTOS on PineDio Stack BL604 RISC-V Board by Lup Yuen]&lt;br /&gt;
* [https://lupyuen.github.io/articles/zig Zig on RISC-V BL602: Quick Peek with Apache NuttX RTOS by Lup Yuen]&lt;br /&gt;
* [https://lupyuen.github.io/articles/iot Build an IoT App with Zig and LoRaWAN by Lup Yuen]&lt;br /&gt;
&lt;br /&gt;
[[Category:Nutcracker]]&lt;/div&gt;</summary>
		<author><name>Lupyuen</name></author>
	</entry>
	<entry>
		<id>https://wiki.pine64.org/index.php?title=Pinedio&amp;diff=13188</id>
		<title>Pinedio</title>
		<link rel="alternate" type="text/html" href="https://wiki.pine64.org/index.php?title=Pinedio&amp;diff=13188"/>
		<updated>2022-06-14T05:12:51Z</updated>

		<summary type="html">&lt;p&gt;Lupyuen: Add article &amp;quot;Build an IoT App with Zig and LoRaWAN&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{under construction}}&lt;br /&gt;
&lt;br /&gt;
The '''Pinedio''' is a device utilizing LoRa. LoRa is a long range, low power wireless platform that is being used by a lot of Internet of Things (IoT) products. Using LoRa and LoRaWAN, devices can communicate across the world using the internet, using various decentralised networks such as [https://www.thethingsnetwork.org/ The Things Network] or [https://www.helium.com/ Helium]. Since, PINE64 believes in openness, the LoRa gateway can connect to any network, per the developer implementation. If Helium Spots open up for PINE64 gateway and developers have implemented the hook for Helium, then this is good thing. The PINE64 LoRa gateway also open connect to The Things Network if developers implement support. The choice is yours!&lt;br /&gt;
&lt;br /&gt;
== Gateway ==&lt;br /&gt;
&lt;br /&gt;
The gateway will be available in two variants - indoor and outdoor. All that is known about the outdoor unit is that it will have &amp;quot;an aluminum, rugged and water resistant case&amp;quot;. &lt;br /&gt;
The indoor unit consists of a PINE A64-LTS, fitted with a purpose built hat (adapter) which uses a LoRa module by RakWireless. The chipset used is the SX1302, and the module via the SPI interface. There are two external connections on the enclosure for the GPS and loRa antenna. &lt;br /&gt;
&lt;br /&gt;
=== Connections ===&lt;br /&gt;
* GPS is connected to UART2 on the A64 board&lt;br /&gt;
* SX1302 on SPI0&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|RAK2287 module&lt;br /&gt;
|PI-2 connector&lt;br /&gt;
|PINE A64-LTS&lt;br /&gt;
|-&lt;br /&gt;
|SX1302 SPI&lt;br /&gt;
|Pin 19 = MOSI / PC0&amp;lt;br/&amp;gt;Pin 21 = MISO/PC1&amp;lt;br/&amp;gt;Pin23 = CLK/PC2&amp;lt;br/&amp;gt;Pin24 = CS/PC3&lt;br /&gt;
|SPI0 (/dev/spidev0.0)&lt;br /&gt;
|-&lt;br /&gt;
|SX1302 RESET&lt;br /&gt;
|Pin 11 = GPIO17/PC7&lt;br /&gt;
|GPIO71 (/sys/class/gpio/gpio71)&lt;br /&gt;
|-&lt;br /&gt;
|GPS UART&lt;br /&gt;
|Pin 8 = TX/&amp;lt;br&amp;gt;Pin 10 = RX&lt;br /&gt;
|UART2 (/dev/ttyS2)&lt;br /&gt;
|-&lt;br /&gt;
|GPS RESET&lt;br /&gt;
|Pin 33 = GPIO13/PC5&lt;br /&gt;
|GPIO69 (/sys/class/gpio/gpio69)&lt;br /&gt;
|-&lt;br /&gt;
|GPS Standby&lt;br /&gt;
|Pin 35 = GPIO19/PC9&lt;br /&gt;
|GPIO73 (/sys/class/gpio/gpio73)&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Pictures ===&lt;br /&gt;
&amp;lt;gallery&amp;gt;&lt;br /&gt;
File:Blog-april-InsideLoRaGateway.jpg&lt;br /&gt;
File:Blog-april-InsideLoRaGateway2.jpeg&lt;br /&gt;
File:Discord-lora-gateway-20210413_143615.jpg&lt;br /&gt;
File:Discord-lora-gateway-20210413_1435271.jpg&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Operating System Options===&lt;br /&gt;
&lt;br /&gt;
Pinedio Gateway carries the A64-LTS board. Based on ram specifications SOPINE images are also compatible.&lt;br /&gt;
&lt;br /&gt;
====Armbian====&lt;br /&gt;
&lt;br /&gt;
Gateway Hardware based on Pine64 A64-LTS + RAK2287 + GPS. &lt;br /&gt;
&lt;br /&gt;
Hardware compatible with SOPINE images.&lt;br /&gt;
&lt;br /&gt;
'''PineDio Gateway TTN/Chirpstack Image'''&lt;br /&gt;
&lt;br /&gt;
Debian image with (Default Choices: Chirpstack / TTN) software preinstalled / hardware enabled is available below.&lt;br /&gt;
&lt;br /&gt;
Latest: &lt;br /&gt;
    (PineDio-RAK-Armbian_02-26-2022.img.xz)&lt;br /&gt;
&lt;br /&gt;
    SHA256: 83c2fae06579c2101502963289682295b83164d322ae7359c7c584f0b0e57426&lt;br /&gt;
    SHA512: c5e8cb0b657ee02aa15c60dc7cab7b9e4a7785da548541c6a0eaf4ee7241600c18e339776d94731c5130ccceea4da4aad159af521c4f484c1a550a39fe707d95&lt;br /&gt;
&lt;br /&gt;
DOWNLOAD LOCATION:  https://mega.nz/file/CIoykITD#S_NQx9wRG05CTT7TdzBX8u24bGiVzT341VPZakycaw8&lt;br /&gt;
&lt;br /&gt;
'''Switch Between Chirpstack / TTN (TheThingsNetwork)'''&lt;br /&gt;
&lt;br /&gt;
  gateway-config&lt;br /&gt;
&lt;br /&gt;
First Select:&lt;br /&gt;
&lt;br /&gt;
  Setup RAK Gateway Channel Plan&lt;br /&gt;
&lt;br /&gt;
Next For TTN (TheThingsNetwork) Select:&lt;br /&gt;
&lt;br /&gt;
  Server is TTN&lt;br /&gt;
&lt;br /&gt;
'''or'''&lt;br /&gt;
&lt;br /&gt;
Next For Chirpstack Select:&lt;br /&gt;
&lt;br /&gt;
  Server is Other server&lt;br /&gt;
&lt;br /&gt;
'''Accessing Chirpstack Admin Page'''&lt;br /&gt;
&lt;br /&gt;
Point web browser to:&lt;br /&gt;
&lt;br /&gt;
  http://gatewayIPaddress:8080&lt;br /&gt;
&lt;br /&gt;
'''Default Chirpstack Credentials'''&lt;br /&gt;
&lt;br /&gt;
  login: admin&lt;br /&gt;
  password: admin&lt;br /&gt;
&lt;br /&gt;
'''SSH Credentials'''&lt;br /&gt;
&lt;br /&gt;
 Login: pinedio&lt;br /&gt;
 password: SoPinePass!!!&lt;br /&gt;
&lt;br /&gt;
'''Changing EUI'''&lt;br /&gt;
&lt;br /&gt;
EUI is stored in file:&lt;br /&gt;
&lt;br /&gt;
  /opt/ttn-gateway/packetforwarder/lorapkt_fwd/local_conf.json&lt;br /&gt;
&lt;br /&gt;
'''Additional Shell Commands'''&lt;br /&gt;
&lt;br /&gt;
'''View Gateway ID/EUI'''&lt;br /&gt;
&lt;br /&gt;
  gateway-version&lt;br /&gt;
&lt;br /&gt;
'''Restart Packet Forwarder/Concentrator'''&lt;br /&gt;
&lt;br /&gt;
  sudo systemctl restart ttn-gateway&lt;br /&gt;
&lt;br /&gt;
'''Check Status'''&lt;br /&gt;
&lt;br /&gt;
  sudo systemctl status ttn-gateway&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Enabling Concentrator/GPS Steps (Below Already *Completed* For Above Image Download)'''&lt;br /&gt;
&lt;br /&gt;
Inside armbian-config -&amp;gt; system -&amp;gt; Bootenv (edit boot environment), enter the following 2 lines (to create spidev0.0):&lt;br /&gt;
&lt;br /&gt;
 overlays=spi-spidev uart2 i2c0&lt;br /&gt;
 param_spidev_spi_bus=0&lt;br /&gt;
&lt;br /&gt;
Or you may hand edit: /boot/armbianEnv.txt to add the above overlays/param_spidev_spi_bus lines.&lt;br /&gt;
&lt;br /&gt;
Save. Reboot. &lt;br /&gt;
&lt;br /&gt;
After rebooting you should see a new device /dev/spidev0.0. This will be the concentrator device for gateway related setup.&lt;br /&gt;
&lt;br /&gt;
GPS will be /dev/ttyS2 and should work (after editing armbianEnv.txt + reboot). &lt;br /&gt;
Make sure to offer GPS antenna a strong signal, preferably by a window (if indoors).&lt;br /&gt;
&lt;br /&gt;
== USB adapter ==&lt;br /&gt;
[[File:Pine64-lora-usb-adapter.jpg|500px]]&lt;br /&gt;
&lt;br /&gt;
The Pine64 USB LoRa adapter is based on the Semtech SX1262 LoRa module and the CH341 USB bus converter chip. The '''CH341''' chip can be configured in multiple mode to convert USB to various serial and parallel ports. In this case, it's configured in '''synchronous serial mode''', which allows this chip to convert from USB to the SPI bus needed to talk to the SX1262 LoRa module:&lt;br /&gt;
&lt;br /&gt;
 --------            --------------------------&lt;br /&gt;
 |      |            |   USB LoRa Adapter     |&lt;br /&gt;
 | PC   |  &amp;lt;--USB--&amp;gt; | CH341 &amp;lt;--SPI--&amp;gt; SX1262 |&lt;br /&gt;
 |      |            |       &amp;lt;--I/O--&amp;gt;        |&lt;br /&gt;
 --------            --------------------------&lt;br /&gt;
&lt;br /&gt;
=== Pins ===&lt;br /&gt;
[[File:Lora-usb-pins.jpg|500px]]&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
&lt;br /&gt;
!SX1262 Pin&lt;br /&gt;
!Name&lt;br /&gt;
!Description&lt;br /&gt;
|-&lt;br /&gt;
|1&lt;br /&gt;
|ANT&lt;br /&gt;
|Antenna&lt;br /&gt;
|-&lt;br /&gt;
|2&lt;br /&gt;
|GND2&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|3&lt;br /&gt;
|VREG&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|4&lt;br /&gt;
|DCC&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|5&lt;br /&gt;
|VCC&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|6&lt;br /&gt;
|DIO1&lt;br /&gt;
|Connected on CH341 Pin 7&lt;br /&gt;
|-&lt;br /&gt;
|7&lt;br /&gt;
|DIO2&lt;br /&gt;
|Connected on CH341 Pin6&lt;br /&gt;
|-&lt;br /&gt;
|8&lt;br /&gt;
|DIO3&lt;br /&gt;
|Connected on CH341 Pin 5&lt;br /&gt;
|-&lt;br /&gt;
|9&lt;br /&gt;
|GND&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|10&lt;br /&gt;
|MISO&lt;br /&gt;
|SPI MISO (CH341 Pin 20)&lt;br /&gt;
|-&lt;br /&gt;
|11&lt;br /&gt;
|MOSI&lt;br /&gt;
|SPI MOSI (CH341 Pin 22)&lt;br /&gt;
|-&lt;br /&gt;
|12&lt;br /&gt;
|SCK&lt;br /&gt;
|SPI clock (CH341 Pin 24)&lt;br /&gt;
|- &lt;br /&gt;
|13&lt;br /&gt;
|NSS&lt;br /&gt;
|SPI Chip select&lt;br /&gt;
|-&lt;br /&gt;
|14&lt;br /&gt;
|POR&lt;br /&gt;
|Reset pin&lt;br /&gt;
|-&lt;br /&gt;
|15&lt;br /&gt;
|Busy&lt;br /&gt;
|Busy pin&lt;br /&gt;
|-&lt;br /&gt;
|16&lt;br /&gt;
|GND&lt;br /&gt;
|&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Kernel module for CH341 === &lt;br /&gt;
We need a driver for the CH341 USB bus converter chip. This driver will allow us to send command to the CH341 (SPI messages and access to the GPIOs). I've successfully build and run [https://github.com/rogerjames99/spi-ch341-usb this driver from '''rogerjames99'''] on my desktop computer (running Manjaro Linux) and on my Pinebook Pro (ARM64, running Manjaro ARM Linux). For any kernel newer than 3.10 but mandatory for kernels newer than 5.15 you need to use the [https://github.com/dimich-dmb/spi-ch341-usb dimich-dmb fork of the the '''spi-ch341-usb driver.'''] This fork has updated documentation for the newer kernel interfaces. If this driver gives you problems please drop by any of the social platforms in the Pine64 LoRa chat and give a holler, and if you are using a 5.15 or older kernel you can use the rogerjames99 fork.&lt;br /&gt;
&lt;br /&gt;
 $ git clone https://github.com/rogerjames99/spi-ch341-usb.git &lt;br /&gt;
or&lt;br /&gt;
 $ git clone https://github.com/dimich-dmb/spi-ch341-usb.git&lt;br /&gt;
then&lt;br /&gt;
 $ cd spi-ch341-usb&lt;br /&gt;
 $ make&lt;br /&gt;
 $ sudo make install&lt;br /&gt;
&lt;br /&gt;
Once the driver is installed, unload the module ''ch341'' if it has been automatically loaded:&lt;br /&gt;
&lt;br /&gt;
 $ lsmod |grep ch341&lt;br /&gt;
 $ sudo rmmod ch341&lt;br /&gt;
&lt;br /&gt;
On my setup, ''ch341'' would be automatically loaded once I connected my USB adapter. This module drives the CH341 is asynchronous serial mode, which will not work for a SPI bus. &lt;br /&gt;
&lt;br /&gt;
Then load the new module:&lt;br /&gt;
&lt;br /&gt;
 $ sudo modprobe spi-ch341-usb&lt;br /&gt;
&lt;br /&gt;
Plug your USB adapter and check that the module is correctly loaded : &lt;br /&gt;
&lt;br /&gt;
 $ dmesg&lt;br /&gt;
 [20141.872107] usb 1-1.1: USB disconnect, device number 4&lt;br /&gt;
 [20143.820756] usb 1-1.1: new full-speed USB device number 5 using ehci-platform&lt;br /&gt;
 [20143.973366] usb 1-1.1: New USB device found, idVendor=1a86, idProduct=5512, bcdDevice= 3.04&lt;br /&gt;
 [20143.973413] usb 1-1.1: New USB device strings: Mfr=0, Product=2, SerialNumber=0&lt;br /&gt;
 [20143.973434] usb 1-1.1: Product: USB UART-LPT&lt;br /&gt;
 [20143.975137] spi-ch341-usb 1-1.1:1.0: ch341_usb_probe: connect device&lt;br /&gt;
 [20143.975164] spi-ch341-usb 1-1.1:1.0: ch341_usb_probe: bNumEndpoints=3&lt;br /&gt;
 [20143.975183] spi-ch341-usb 1-1.1:1.0: ch341_usb_probe:   endpoint=0 type=2 dir=1 addr=2&lt;br /&gt;
 [20143.975206] spi-ch341-usb 1-1.1:1.0: ch341_usb_probe:   endpoint=1 type=2 dir=0 addr=2&lt;br /&gt;
 [20143.975229] spi-ch341-usb 1-1.1:1.0: ch341_usb_probe:   endpoint=2 type=3 dir=1 addr=1&lt;br /&gt;
 [20143.975254] spi-ch341-usb 1-1.1:1.0: ch341_cfg_probe: output cs0 SPI slave with cs=0&lt;br /&gt;
 [20143.975273] spi-ch341-usb 1-1.1:1.0: ch341_cfg_probe: output cs0 gpio=0 irq=0 &lt;br /&gt;
 [20143.975295] spi-ch341-usb 1-1.1:1.0: ch341_cfg_probe: output cs1 SPI slave with cs=1&lt;br /&gt;
 [20143.975313] spi-ch341-usb 1-1.1:1.0: ch341_cfg_probe: output cs1 gpio=1 irq=1 &lt;br /&gt;
 [20143.975334] spi-ch341-usb 1-1.1:1.0: ch341_cfg_probe: output cs2 SPI slave with cs=2&lt;br /&gt;
 [20143.975352] spi-ch341-usb 1-1.1:1.0: ch341_cfg_probe: output cs2 gpio=2 irq=2 &lt;br /&gt;
 [20143.975373] spi-ch341-usb 1-1.1:1.0: ch341_cfg_probe: input  gpio4 gpio=3 irq=3 &lt;br /&gt;
 [20143.975394] spi-ch341-usb 1-1.1:1.0: ch341_cfg_probe: input  gpio6 gpio=4 irq=4 &lt;br /&gt;
 [20143.975415] spi-ch341-usb 1-1.1:1.0: ch341_cfg_probe: input  err gpio=5 irq=5 &lt;br /&gt;
 [20143.975435] spi-ch341-usb 1-1.1:1.0: ch341_cfg_probe: input  pemp gpio=6 irq=6 &lt;br /&gt;
 [20143.975456] spi-ch341-usb 1-1.1:1.0: ch341_cfg_probe: input  int gpio=7 irq=7 (hwirq)&lt;br /&gt;
 [20143.975478] spi-ch341-usb 1-1.1:1.0: ch341_cfg_probe: input  slct gpio=8 irq=8 &lt;br /&gt;
 [20143.975499] spi-ch341-usb 1-1.1:1.0: ch341_cfg_probe: input  wait gpio=9 irq=9 &lt;br /&gt;
 [20143.975520] spi-ch341-usb 1-1.1:1.0: ch341_cfg_probe: input  autofd gpio=10 irq=10 &lt;br /&gt;
 [20143.975542] spi-ch341-usb 1-1.1:1.0: ch341_cfg_probe: input  addr gpio=11 irq=11 &lt;br /&gt;
 [20143.975564] spi-ch341-usb 1-1.1:1.0: ch341_cfg_probe: output ini gpio=12 irq=12 &lt;br /&gt;
 [20143.975585] spi-ch341-usb 1-1.1:1.0: ch341_cfg_probe: output write gpio=13 irq=13 &lt;br /&gt;
 [20143.975607] spi-ch341-usb 1-1.1:1.0: ch341_cfg_probe: output scl gpio=14 irq=14 &lt;br /&gt;
 [20143.975628] spi-ch341-usb 1-1.1:1.0: ch341_cfg_probe: output sda gpio=15 irq=15 &lt;br /&gt;
 [20143.975650] spi-ch341-usb 1-1.1:1.0: ch341_spi_probe: start&lt;br /&gt;
 [20143.975677] spi-ch341-usb 1-1.1:1.0: ch341_spi_probe: SPI master connected to SPI bus 1&lt;br /&gt;
 [20143.977831] spi-ch341-usb 1-1.1:1.0: ch341_spi_probe: SPI device /dev/spidev1.0 created&lt;br /&gt;
 [20143.978183] spi-ch341-usb 1-1.1:1.0: ch341_spi_probe: SPI device /dev/spidev1.1 created&lt;br /&gt;
 [20143.978552] spi-ch341-usb 1-1.1:1.0: ch341_spi_probe: SPI device /dev/spidev1.2 created&lt;br /&gt;
 [20143.978726] spi-ch341-usb 1-1.1:1.0: ch341_spi_probe: done&lt;br /&gt;
 [20143.978735] spi-ch341-usb 1-1.1:1.0: ch341_irq_probe: start&lt;br /&gt;
 [20143.979133] spi-ch341-usb 1-1.1:1.0: ch341_irq_probe: irq_base=103&lt;br /&gt;
 [20143.979154] spi-ch341-usb 1-1.1:1.0: ch341_irq_probe: done&lt;br /&gt;
 [20143.979162] spi-ch341-usb 1-1.1:1.0: ch341_gpio_probe: start&lt;br /&gt;
 [20143.979220] spi-ch341-usb 1-1.1:1.0: ch341_gpio_get_direction: gpio=cs0 dir=0&lt;br /&gt;
 [20143.979229] spi-ch341-usb 1-1.1:1.0: ch341_gpio_get_direction: gpio=cs1 dir=0&lt;br /&gt;
 [20143.979237] spi-ch341-usb 1-1.1:1.0: ch341_gpio_get_direction: gpio=cs2 dir=0&lt;br /&gt;
 [20143.979245] spi-ch341-usb 1-1.1:1.0: ch341_gpio_get_direction: gpio=gpio4 dir=1&lt;br /&gt;
 [20143.979253] spi-ch341-usb 1-1.1:1.0: ch341_gpio_get_direction: gpio=gpio6 dir=1&lt;br /&gt;
 [20143.979260] spi-ch341-usb 1-1.1:1.0: ch341_gpio_get_direction: gpio=err dir=1&lt;br /&gt;
 [20143.979268] spi-ch341-usb 1-1.1:1.0: ch341_gpio_get_direction: gpio=pemp dir=1&lt;br /&gt;
 [20143.979275] spi-ch341-usb 1-1.1:1.0: ch341_gpio_get_direction: gpio=int dir=1&lt;br /&gt;
 [20143.979283] spi-ch341-usb 1-1.1:1.0: ch341_gpio_get_direction: gpio=slct dir=1&lt;br /&gt;
 [20143.979290] spi-ch341-usb 1-1.1:1.0: ch341_gpio_get_direction: gpio=wait dir=1&lt;br /&gt;
 [20143.979298] spi-ch341-usb 1-1.1:1.0: ch341_gpio_get_direction: gpio=autofd dir=1&lt;br /&gt;
 [20143.979306] spi-ch341-usb 1-1.1:1.0: ch341_gpio_get_direction: gpio=addr dir=1&lt;br /&gt;
 [20143.979314] spi-ch341-usb 1-1.1:1.0: ch341_gpio_get_direction: gpio=ini dir=0&lt;br /&gt;
 [20143.979321] spi-ch341-usb 1-1.1:1.0: ch341_gpio_get_direction: gpio=write dir=0&lt;br /&gt;
 [20143.979329] spi-ch341-usb 1-1.1:1.0: ch341_gpio_get_direction: gpio=scl dir=0&lt;br /&gt;
 [20143.979337] spi-ch341-usb 1-1.1:1.0: ch341_gpio_get_direction: gpio=sda dir=0&lt;br /&gt;
 [20143.979831] spi-ch341-usb 1-1.1:1.0: ch341_gpio_probe: registered GPIOs from 496 to 511&lt;br /&gt;
 [20143.981152] spi-ch341-usb 1-1.1:1.0: ch341_gpio_probe: done&lt;br /&gt;
 [20143.981212] spi-ch341-usb 1-1.1:1.0: ch341_gpio_poll_function: start&lt;br /&gt;
 [20143.981291] spi-ch341-usb 1-1.1:1.0: ch341_usb_probe: connected&lt;br /&gt;
 [20144.756250] usbcore: registered new interface driver ch341&lt;br /&gt;
 [20144.756334] usbserial: USB Serial support registered for ch341-uart&lt;br /&gt;
&lt;br /&gt;
With kernel 5.16 and newer the output is shorter:&lt;br /&gt;
&lt;br /&gt;
 $ dmesg&lt;br /&gt;
 [ 6744.813564] usb 1-2.1.1: new full-speed USB device number 21 using xhci_hcd&lt;br /&gt;
 [ 6744.904377] usb 1-2.1.1: New USB device found, idVendor=1a86, idProduct=5512, bcdDevice= 3.04&lt;br /&gt;
 [ 6744.904383] usb 1-2.1.1: New USB device strings: Mfr=0, Product=2, SerialNumber=0&lt;br /&gt;
 [ 6744.904385] usb 1-2.1.1: Product: USB UART-LPT&lt;br /&gt;
 [ 6744.960243] spi-ch341-usb 1-2.1.1:1.0: ch341_cfg_probe: output cs0 SPI slave with cs=0&lt;br /&gt;
 [ 6744.960246] spi-ch341-usb 1-2.1.1:1.0: ch341_cfg_probe: output cs1 SPI slave with cs=1&lt;br /&gt;
 [ 6744.960247] spi-ch341-usb 1-2.1.1:1.0: ch341_cfg_probe: output cs2 SPI slave with cs=2&lt;br /&gt;
 [ 6744.960249] spi-ch341-usb 1-2.1.1:1.0: ch341_cfg_probe: input  gpio4 gpio=0 irq=0 (hwirq)&lt;br /&gt;
 [ 6744.960251] spi-ch341-usb 1-2.1.1:1.0: ch341_cfg_probe: input  gpio5 gpio=1 irq=1&lt;br /&gt;
 [ 6744.960302] spi-ch341-usb 1-2.1.1:1.0: ch341_spi_probe: SPI master connected to SPI bus 0&lt;br /&gt;
 [ 6744.960350] spi-ch341-usb 1-2.1.1:1.0: ch341_spi_probe: SPI device /dev/spidev0.0 created&lt;br /&gt;
 [ 6744.960398] spi-ch341-usb 1-2.1.1:1.0: ch341_spi_probe: SPI device /dev/spidev0.1 created&lt;br /&gt;
 [ 6744.960445] spi-ch341-usb 1-2.1.1:1.0: ch341_spi_probe: SPI device /dev/spidev0.2 created&lt;br /&gt;
 [ 6744.960583] spi-ch341-usb 1-2.1.1:1.0: ch341_usb_probe: connected&lt;br /&gt;
&lt;br /&gt;
=== Driver development === &lt;br /&gt;
=====Kernels 5.14 and older=====&lt;br /&gt;
&lt;br /&gt;
Once the module ''spi-ch341-usb'' is correctly loaded, here's how you can transfer data on the SPI bus (in C):&lt;br /&gt;
&lt;br /&gt;
 /* Open the SPI bus */&lt;br /&gt;
 int spi = open(&amp;quot;/dev/spidev1.0&amp;quot;, O_RDWR);&lt;br /&gt;
 uint8_t mmode = SPI_MODE_0;&lt;br /&gt;
 uint8_t lsb = 0;&lt;br /&gt;
 ioctl(spi, SPI_IOC_WR_MODE, &amp;amp;mmode);&lt;br /&gt;
 ioctl(spi, SPI_IOC_WR_LSB_FIRST, &amp;amp;lsb);&lt;br /&gt;
 &lt;br /&gt;
 /* Transfer data */&lt;br /&gt;
 /* TODO: Init buffer_out, buffer_in and size */&lt;br /&gt;
 const uint8_t *mosi = buffer_out; // output data&lt;br /&gt;
 uint8_t *miso = buffer_in; // input data&lt;br /&gt;
 &lt;br /&gt;
 struct spi_ioc_transfer spi_trans;&lt;br /&gt;
 memset(&amp;amp;spi_trans, 0, sizeof(spi_trans));&lt;br /&gt;
 &lt;br /&gt;
 spi_trans.tx_buf = (unsigned long) mosi;&lt;br /&gt;
 spi_trans.rx_buf = (unsigned long) miso;&lt;br /&gt;
 spi_trans.cs_change = true;&lt;br /&gt;
 spi_trans.len = size;&lt;br /&gt;
 &lt;br /&gt;
 int status = ioctl (spi, SPI_IOC_MESSAGE(1), &amp;amp;spi_trans);&lt;br /&gt;
&lt;br /&gt;
To access GPIOs, you first need to export them (to make them accessible via ''/sys/class/gpio''. As you can see in the dmesg output, GPIOs from 496 to 511 were registered, which means we can export 16 GPIOs. The mapping of these I/O is available in the [https://github.com/rogerjames99/spi-ch341-usb/blob/master/spi-ch341-usb.c#L148 source code of the driver]. For example, pin ''slct'' is the 12th, meaning we need to export GPIO 496+12 = 508.&lt;br /&gt;
&lt;br /&gt;
 int  fd;&lt;br /&gt;
 if ((fd = open(&amp;quot;/sys/class/gpio/export&amp;quot;, O_WRONLY)) == -1)   {&lt;br /&gt;
   perror(&amp;quot;open ini&amp;quot;);&lt;br /&gt;
   exit(-1);&lt;br /&gt;
 }&lt;br /&gt;
 &lt;br /&gt;
 if (write(fd, &amp;quot;508&amp;quot;, 3) == -1){&lt;br /&gt;
   perror (&amp;quot;write export 508&amp;quot;);&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
Once exported, the GPIO is available in ''/sys/class/gpio/sclt'' (the naming is specified by the driver). You can read the pin in C:&lt;br /&gt;
&lt;br /&gt;
 int  fd;&lt;br /&gt;
 if ((fd = open(&amp;quot;/sys/class/gpio/slct/value&amp;quot;, O_RDWR)) == -1)   {&lt;br /&gt;
   perror(&amp;quot;open&amp;quot;);&lt;br /&gt;
 }&lt;br /&gt;
 &lt;br /&gt;
 char buf;&lt;br /&gt;
 if (read(fd, &amp;amp;buf, 1) == -1) {&lt;br /&gt;
    perror(&amp;quot;read&amp;quot;);&lt;br /&gt;
 }&lt;br /&gt;
 &lt;br /&gt;
 int value = (buf == '0') ? 0 : 1;&lt;br /&gt;
&lt;br /&gt;
You can also write it:&lt;br /&gt;
&lt;br /&gt;
 int  fd; &lt;br /&gt;
 if ((fd = open(&amp;quot;/sys/class/gpio/ini/value&amp;quot;, O_RDWR)) == -1)   {&lt;br /&gt;
   perror(&amp;quot;open ini&amp;quot;);&lt;br /&gt;
 }&lt;br /&gt;
 &lt;br /&gt;
 if (write(fd, value ? &amp;quot;1&amp;quot; : &amp;quot;0&amp;quot;, 1) == -1) {&lt;br /&gt;
    perror (&amp;quot;write&amp;quot;);&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
=====Kernel 5.15 and newer=====&lt;br /&gt;
&lt;br /&gt;
We need some help documenting how these interfaces work!&lt;br /&gt;
&lt;br /&gt;
The driver creates these interfaces:&lt;br /&gt;
 {| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
  |Pin  ||SPI Function ||GPIO function ||GPIO name ||IRQ&lt;br /&gt;
  |-&lt;br /&gt;
  |15||CS0||-||-||-&lt;br /&gt;
  |-&lt;br /&gt;
  |16||CS1||-||-||-&lt;br /&gt;
  |-&lt;br /&gt;
  |17||CS2||-||-||-&lt;br /&gt;
  |-&lt;br /&gt;
  |19||-||Input||gpio4||hardware&lt;br /&gt;
  |-&lt;br /&gt;
  |21||-||Input||gpio5||software&lt;br /&gt;
 |}&lt;br /&gt;
&lt;br /&gt;
The dimich-dmb fork of spi-ch341-usb works with 5.15+ kernels, but as you can see above it is not configured for the needs of the Pinedio-USB by default. I have started a branch in my fork to work on getting the driver pre-configured for our needs. The branch can be [https://github.com/UncleGrumpy/spi-ch341-usb/tree/pinedio found here.] Please feel free to help! And open issues or discussions in the repo if you have problems or ideas how to help. Any improvements to the actual code beyond configuration should be pushed to the temporary [https://github.com/dimich-dmb/spi-ch341-usb/ upstream.]&lt;br /&gt;
&lt;br /&gt;
Since linux-5.15 binding to spidev driver is required to make slave devices available via /dev/, e.g. for slave 1 on bus 0 as real root (not with sudo):&lt;br /&gt;
&lt;br /&gt;
 # echo spidev &amp;gt; /sys/class/spi_master/spi0/spi0.1/driver_override&lt;br /&gt;
 # echo spi0.1 &amp;gt; /sys/bus/spi/drivers/spidev/bind&lt;br /&gt;
&lt;br /&gt;
For all devices handled by spi_ch341_usb driver (again, only as real root):&lt;br /&gt;
&lt;br /&gt;
 # for i in /sys/bus/usb/drivers/spi-ch341-usb/*/spi_master/spi*/spi*.*; do echo spidev &amp;gt; $i/driver_override; echo $(basename $i) &amp;gt; /sys/bus/spi/drivers/spidev/bind; done&lt;br /&gt;
&lt;br /&gt;
The documentation found at https://github.com/dimich-dmb/spi-ch341-usb/blob/master/README.md has more information.&lt;br /&gt;
&lt;br /&gt;
The 5.15+ driver is not ready yet. But if you are interested in testing, helping to get the configuration right, or working on application development you can build and test the current driver:&lt;br /&gt;
&lt;br /&gt;
 $ git clone -b pinedio https://github.com/UncleGrumpy/spi-ch341-usb.git &lt;br /&gt;
 $ cd spi-ch341-usb&lt;br /&gt;
 $ make&lt;br /&gt;
 $ sudo make install&lt;br /&gt;
&lt;br /&gt;
So far this will automatically set up the SPI slave device /dev/spi0.0. It names the ch341-usb device as &amp;quot;pinedio&amp;quot; this will allow application developers to find the correct gpiochip by name. I need help confirming the correct gpio pins but as of now the driver will setup the following configuration:&lt;br /&gt;
&lt;br /&gt;
The driver uses following CH341A pins for the SPI interface. &lt;br /&gt;
 {| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
  | Pin || Name || Direction || Function SPI (CH341A)&lt;br /&gt;
  |-&lt;br /&gt;
  | 18  || D3   || output    || SCK (DCK)             &lt;br /&gt;
  |-&lt;br /&gt;
  | 20  || D5   || output    || MOSI (DOUT)           &lt;br /&gt;
  |-&lt;br /&gt;
  | 22  || D7   || input     || MISO (DIN)            &lt;br /&gt;
  |-&lt;br /&gt;
  | 15  || D0   || output    || CS0                   &lt;br /&gt;
 |}&lt;br /&gt;
&lt;br /&gt;
The driver uses the following GPIO configuration.  I am not at all sure these are the correct pins to use! This is one area that I could really use some help with!!!&lt;br /&gt;
 {| class=&amp;quot;wikitable&lt;br /&gt;
  | CH341 Pin || CH341A Name || Function   || GPIO Name  || GPIO Configuration || SX1262 connection&lt;br /&gt;
  |-&lt;br /&gt;
  |  7        || INT#        || IRQ        || dio_irq    || Output             || DIO1 (IRQ)        &lt;br /&gt;
  |-&lt;br /&gt;
  |  8        || SLCT        || BUSY       || dio_busy   || Input              || BUSY              &lt;br /&gt;
  |-&lt;br /&gt;
  | 26        || RST#        || Hard Reset || dio_reset  || Output             || NRESET            &lt;br /&gt;
 |}&lt;br /&gt;
&lt;br /&gt;
The function of these pins can be changed from user space by using libgpiod. The command line tools installed with the library (gpioset, gpioget, gpiodetect, gpioinfo...) can be used for bash scripts, etc. and applications should all use the libgpiod interfaces. The /sys/class/gpio interface has been removed from the kernel in 5.15, so any apps using /sys/class/gpio to access gpio pins are broken, or will be as distos update their kernels to 5.15 and beyond.&lt;br /&gt;
&lt;br /&gt;
GPIO pins can be listed with gpioinfo:&lt;br /&gt;
 $ gpioinfo pinedio&lt;br /&gt;
&lt;br /&gt;
The output should look similar to:&lt;br /&gt;
 gpiochip1 - 3 lines:&lt;br /&gt;
         line   0:    &amp;quot;dio_irq&amp;quot;       unused   input  active-high&lt;br /&gt;
         line   1:   &amp;quot;dio_busy&amp;quot;       unused   input  active-high&lt;br /&gt;
         line   2:  &amp;quot;dio_reset&amp;quot;       unused  output  active-high&lt;br /&gt;
&lt;br /&gt;
The gpiochip# might be different.  The driver exposes the Pinedio with the gpio name &amp;quot;pinedio&amp;quot;, developers should use this name to interact with the gpiochip because the gpiochip# of the device is likely to be different from one system to the next, or depending on the order devices are initialized.&lt;br /&gt;
&lt;br /&gt;
=== Driver for the SX1262 LoRa module ===&lt;br /&gt;
Now that we can talk to the SX1262 via the CH341 USB converter chip, we need to send actual commands to make it emit or receive LoRa messages. To do this, you can implement the driver yourself using info from the datasheet, or use an existing driver (you can easily find drivers for the Arduino framework, for example. &lt;br /&gt;
I found [https://github.com/YukiWorkshop/sx126x_driver this C++ driver]. It's well written, lightweight and easily portable across many platforms. All you have to do is implement 3 HAL function : read GPIO, write GPIO and transfer data on SPI. I wrote a quick'n'dirty app that emits a LoRa frame. It's [https://gist.github.com/JF002/f1af5595874942427eea9d375c18fc73 available here]. &lt;br /&gt;
&lt;br /&gt;
As I don't have any 'raw' LoRa device on hands, I check that it was actually transmitting something using my SDR setup (simple TNT usb key and '''Gqrx''' software):&lt;br /&gt;
&lt;br /&gt;
[[File:pine64-lora-usb-adapter-sdr.png|500px]]&lt;br /&gt;
&lt;br /&gt;
== Other end nodes ==&lt;br /&gt;
&lt;br /&gt;
There are several end-node units planned:&lt;br /&gt;
* loRa back case for the PinePhone&lt;br /&gt;
* standalone USB dongle-type end-node adapter&lt;br /&gt;
* PineTab adapter&lt;br /&gt;
* as well as a SPI module (which can also be configured as a USB LoRa dongle)&lt;br /&gt;
* a LoRa stick powered by a single 18650 battery (using the [https://wiki.pine64.org/wiki/Nutcracker BL602], and can be fitted with GPS, an low-power OLED panel and additional sensors)&lt;br /&gt;
&lt;br /&gt;
All the end-nodes use the SX1262 chip. &lt;br /&gt;
&lt;br /&gt;
=== Pictures ===&lt;br /&gt;
&amp;lt;gallery&amp;gt;&lt;br /&gt;
File:Blog-april-USB-LoRa-1024x655.jpg&lt;br /&gt;
File:Blog-april-LoRa-something-839x1024.jpg&lt;br /&gt;
File:Discord_20210421_lora_usb_closeup.jpg&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Datasheets and schematics ==&lt;br /&gt;
=== Gateway ===&lt;br /&gt;
* [https://www.semtech.com/products/wireless-rf/lora-gateways/sx1302 SX1302 datasheets and resources]&lt;br /&gt;
* [https://docs.rakwireless.com/Product-Categories/WisLink/RAK2247/Overview/ RAK2287 datasheets and resources]&lt;br /&gt;
* [https://wiki.pine64.org/images/5/54/PINE64_LoRa_Gateway_Module_Adapter_Schematic-v1.0-20210308.pdf Pine64 LoRa Gateway module adapter schematic]&lt;br /&gt;
&lt;br /&gt;
=== End nodes ===&lt;br /&gt;
* [https://www.semtech.com/products/wireless-rf/lora-transceivers/sx1262 SX1262 datasheets and resources]&lt;br /&gt;
&lt;br /&gt;
=== Pinephone backplate ===&lt;br /&gt;
* [[File:Pinephone_LoRa_BackPanel_Schematic-v1.0-20210402.pdf]]&lt;br /&gt;
* [[File:CA-S01_LoRa_Chip_Antenna_in_Chinese.pdf]]&lt;br /&gt;
* [https://github.com/zschroeder6212/tiny-i2c-spi I2C SPI Bridge code running on ATtiny84]&lt;br /&gt;
&lt;br /&gt;
=== USB LoRa adapter ===&lt;br /&gt;
* [[File:USB_LoRa_adapter-PINE64_RFM90_SCH_2021_04_26.pdf]]&lt;br /&gt;
* CH341 datasheet : [[File:CH341DS1.pdf]]&lt;br /&gt;
* Semtech SX1262 datasheet : [https://semtech.my.salesforce.com/sfc/p/#E0000000JelG/a/2R000000HT76/7Nka9W5WgugoZe.xwIHJy6ebj1hW8UJ.USO_Pt2CLLo File on Semtech website (file is too big for the wiki)]&lt;br /&gt;
&lt;br /&gt;
=== PineDio Stack ===&lt;br /&gt;
* Schematic : [[File:PINEDIO_STACK_V1_0-2021_05_24C.pdf]]&lt;br /&gt;
&lt;br /&gt;
== Other resources ==&lt;br /&gt;
* [https://www.youtube.com/watch?v=cJ0wpANpbyc Video: A peek at Pine64's LoRa gateway and modules]&lt;br /&gt;
* [https://iotw.io/ IOTW - Blockchain-Enabled IoT Data Platform]&lt;br /&gt;
* [https://lupyuen.github.io/articles/pinedio PineDio Stack BL604 RISC-V Board: Testing The Prototype]&lt;br /&gt;
* [https://lupyuen.github.io/articles/lorawan2 LoRaWAN on PineDio Stack BL604 RISC-V Board]&lt;br /&gt;
* [https://lupyuen.github.io/articles/ttn The Things Network on PineDio Stack BL604 RISC-V Board]&lt;br /&gt;
* [https://lupyuen.github.io/articles/prometheus Monitor IoT Devices in The Things Network with Prometheus and Grafana]&lt;br /&gt;
* [https://lupyuen.github.io/articles/tsen Internal Temperature Sensor on BL602]&lt;br /&gt;
* [https://lupyuen.github.io/articles/roblox IoT Digital Twin with Roblox and The Things Network]&lt;br /&gt;
* [https://lupyuen.github.io/articles/gateway PineDio LoRa Gateway: Testing The Prototype]&lt;br /&gt;
* [https://lupyuen.github.io/articles/nuttx Apache NuttX OS on RISC-V BL602 and BL604]&lt;br /&gt;
* [https://lupyuen.github.io/articles/spi2 SPI on Apache NuttX OS]&lt;br /&gt;
* [https://lupyuen.github.io/articles/sx1262 LoRa SX1262 on Apache NuttX OS]&lt;br /&gt;
* [https://lupyuen.github.io/articles/lorawan3 LoRaWAN on Apache NuttX OS]&lt;br /&gt;
* [https://lupyuen.github.io/articles/rust2 Rust on Apache NuttX OS]&lt;br /&gt;
* [https://lupyuen.github.io/articles/ikea Connect IKEA Air Quality Sensor to Apache NuttX OS]&lt;br /&gt;
* [https://lupyuen.github.io/articles/pinedio2 PineDio Stack BL604 runs Apache NuttX RTOS]&lt;br /&gt;
* [https://lupyuen.github.io/articles/touch NuttX Touch Panel Driver for PineDio Stack BL604]&lt;br /&gt;
* [https://www.robertlipe.com/buttons-on-bl602-nuttx/ Buttons on BL602 NuttX]&lt;br /&gt;
* [https://lupyuen.github.io/articles/expander NuttX GPIO Expander for PineDio Stack BL604]&lt;br /&gt;
* [https://lupyuen.github.io/articles/auto2 (Mostly) Automated Testing of Apache NuttX RTOS on PineDio Stack BL604 RISC-V Board]&lt;br /&gt;
* [https://lupyuen.github.io/articles/zig Zig on RISC-V BL602: Quick Peek with Apache NuttX RTOS]&lt;br /&gt;
* [https://lupyuen.github.io/articles/iot Build an IoT App with Zig and LoRaWAN]&lt;/div&gt;</summary>
		<author><name>Lupyuen</name></author>
	</entry>
	<entry>
		<id>https://wiki.pine64.org/index.php?title=PineCone&amp;diff=13142</id>
		<title>PineCone</title>
		<link rel="alternate" type="text/html" href="https://wiki.pine64.org/index.php?title=PineCone&amp;diff=13142"/>
		<updated>2022-06-02T03:35:43Z</updated>

		<summary type="html">&lt;p&gt;Lupyuen: Add article: &amp;quot;Zig on RISC-V BL602: Quick Peek with Apache NuttX RTOS&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[File:Pine64_BL602_EVB_photo-3-small.jpg|thumb|PineCone BL602 EVB (Evaluation Board)]]&lt;br /&gt;
&lt;br /&gt;
The '''PineCone''' is a BL602 evaluation board, which was developed with the goal to challenge the open source community to achieve blob-free and free and open source WiFi and Bluetooth, see the [https://www.pine64.org/2020/10/28/nutcracker-challenge-blob-free-wifi-ble/ Nutcracker Challenge].&lt;br /&gt;
&lt;br /&gt;
== BL602 Specifications ==&lt;br /&gt;
* '''CPU:''' 32-bit RV32IMAFC RISC-V “SiFive E24 Core”&lt;br /&gt;
** [https://www.sifive.com/cores/e24 SiFive E24 Core information]&lt;br /&gt;
* '''Memory:'''&lt;br /&gt;
** 128KB ROM&lt;br /&gt;
** 276KB SRAM&lt;br /&gt;
** 1Kb eFuse&lt;br /&gt;
** 2MB Embedded Flash&lt;br /&gt;
* '''Security:'''&lt;br /&gt;
** Secure boot&lt;br /&gt;
** Secure debug&lt;br /&gt;
** AES 128/192/256&lt;br /&gt;
** SHA-1/224/256&lt;br /&gt;
** TRNG (True Random Number Generator)&lt;br /&gt;
** PKA (Public Key Accelerator)&lt;br /&gt;
* '''Wireless:'''&lt;br /&gt;
** Wi-Fi 802.11 b/g/n&lt;br /&gt;
** Bluetooth® Low Energy 5.0&lt;br /&gt;
** Wi-Fi Fast connection with BLE assistance&lt;br /&gt;
** Wi-Fi and BLE coexistence&lt;br /&gt;
** Wi-Fi Security WPS/WEP/WPA/WPA2/WPA3&lt;br /&gt;
** STA, SoftAP and sniffer modes&lt;br /&gt;
** Multi-Cloud connectivity&lt;br /&gt;
** 2.4 GHz RF transceiver&lt;br /&gt;
** Integrated RF balun, PA/LNA&lt;br /&gt;
* '''Package Type:'''&lt;br /&gt;
** 32 pin QFN 4mm x 4mm&lt;br /&gt;
* JTAG support (See below for BL602 impact)&lt;br /&gt;
&lt;br /&gt;
[[File:BL602_Block_Diagram.jpg|600px]]&lt;br /&gt;
&lt;br /&gt;
== JTAG ==&lt;br /&gt;
{| class=&amp;quot;wikitable floatright&amp;quot;&lt;br /&gt;
|+ Default JTAG pins&lt;br /&gt;
|-&lt;br /&gt;
| GPIO Pin || JTAG Pin&lt;br /&gt;
|-&lt;br /&gt;
| GPIO17 || TDI&lt;br /&gt;
|-&lt;br /&gt;
| GPIO11 || TDO&lt;br /&gt;
|-&lt;br /&gt;
| GPIO12 || TMS&lt;br /&gt;
|-&lt;br /&gt;
| GPIO14 || TCK&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
BL602 multiplexes four GPIO pins to provide the familiar JTAG lines. See the accompanying table for the default pin mappings.&lt;br /&gt;
&lt;br /&gt;
These are the default JTAG pins in use after a cold boot. However, many pieces of software, including the demo that's installed by default on new PineCones, remap these pins to other functions. You cannot use the default wiring for JTAG while such software is running. This issue is especially prevalent on the PineCone because three of the default JTAG pins are connected to the onboard RGB LED. Nothing about the LED itself interferes with JTAG, but any program that uses the LED will necessarily remap some of the default JTAG pins to be GPIO.&lt;br /&gt;
&lt;br /&gt;
The MaskROM download mode that the BL602 enters when you tie GPIO8 high does '''not''' remap the default JTAG pins, and so you can and should use that mode while checking basic functionality of your JTAG adapter.&lt;br /&gt;
&lt;br /&gt;
Note that, just as software can remap the default JTAG pins to be something else, it can also remap other pins to be JTAG. Control over this is quite granular, with 5-6 candidate pins for each individual JTAG signal that can be mapped independently of one another. LEE Lup Yuen has written some [https://lupyuen.github.io/articles/openocd#free-the-led-from-jtag-port sample code] showing how to remap the JTAG pins so that your software can use the LED without giving up support for debugging.&lt;br /&gt;
&lt;br /&gt;
== Pine64 USB JTAG Adapter information and schematics ==&lt;br /&gt;
* [https://files.pine64.org/doc/Pinenut/PINE64%20USB%20JTAG%20Adapter%20Schematic-20201215.pdf PINE64 USB JTAG Adapter schematic 20202018 1.0]&lt;br /&gt;
* [[:File:PINE64_USB_JTAG_Adapter_Schematic_ver_1.0a-20210109.pdf|PINE64 USB JTAG Adapter schematic 20210109 1.0a]]&lt;br /&gt;
&lt;br /&gt;
== PineCone BL602 EVB information and schematics ==&lt;br /&gt;
* Approximate dimensions: 26mm x 43mm&lt;br /&gt;
* Board layout:&lt;br /&gt;
[[File:PADI-II_EVB.png]]&lt;br /&gt;
* [https://files.pine64.org/doc/Pinenut/Pine64%20BL602%20EVB%20Schematic%20ver%201.1.pdf PineCone BL602 EVB schematic ver 1.1]&lt;br /&gt;
** Note: In PineCone revision 1.1 (&amp;quot;BL62B_EVB V1.1&amp;quot; silkscreened on back of board), CC1 and CC2 share one 5.1KΩ resistor. This means the board will fail to power when you use an e-marked USB-C cable like the one that comes with Apple chargers. See [https://medium.com/@leung.benson/how-to-design-a-proper-usb-c-power-sink-hint-not-the-way-raspberry-pi-4-did-it-f470d7a5910 this article] for details of why this happens. The next schematic design will give each line its own 5.1KΩ resistor as per the USB-C specification.&lt;br /&gt;
* The board uses a CH340 Serial/USB adapter. This chip is commonly used in Arduino-class development boards. It is a full speed (12Mbps) USB interface and has vendor ID 0x1a86 with product ID 0x7523.&lt;br /&gt;
* The GPIO pins (11, 12, 14, 17) plus the nearby RESET, POWER, and GND pins are all located on one side of the board, on J1 to provide JTAG connection.&lt;br /&gt;
&lt;br /&gt;
== Pinenut-01S Module information and schematics ==&lt;br /&gt;
[[File:Pinenut-01S_PCB-Front.png|225px]][[File:Pinenut-01S_PCB-Back.png|225px]]&lt;br /&gt;
* [https://files.pine64.org/doc/Pinenut/Pinenut-01S%20V1.01%20SCH.pdf Pinenut-01S schematic ver 1.01]&lt;br /&gt;
* [https://wiki.pine64.org/images/6/6b/PineNut-01S_v1.01_KiCad.zip PineNut-01S KiCad schematic ver 1.01]&lt;br /&gt;
* [https://files.pine64.org/doc/Pinenut/NUT-01S%20GPIO%20Definition%20ver%201.0.pdf Pinenut-01S GPIO Definition ver 1.0]&lt;br /&gt;
* [https://files.pine64.org/doc/Pinenut/USB%20Adapter%20for%20Pinenut-01S%20Schematic%20V1.0.pdf USB Programmer adapter for Pinenut-01S schematic ver 1.0]&lt;br /&gt;
* The default firmware runs the UART at 2000000 bps.  It will accept input whilst regularly outputting:&amp;lt;code&amp;gt;&amp;lt;br/&amp;gt;proc_hellow_entry: RISC-V rv32imafc&amp;lt;br/&amp;gt;cur key status:1&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Pinenut-12S Module information ==&lt;br /&gt;
[[File:NUT-12S_module-front.jpg|200px]][[File:NUT-12S_module-back.jpg|200px]]&lt;br /&gt;
* [https://files.pine64.org/doc/Pinenut/NUT-12S%20GPIO%20Definition%20ver%201.0.pdf Pinenut-12S GPIO Definition ver 1.0]&lt;br /&gt;
* Onboard LED is connected to IO0&lt;br /&gt;
&lt;br /&gt;
== Datasheets for components and peripherals ==&lt;br /&gt;
* Bouffalo BL-602 SoC information:&lt;br /&gt;
** [https://github.com/bouffalolab/bl_docs Bouffalo Lab's official bl_docs repository]: should always contain the latest SoC documentation available, in PDF, HTML, and reStructuredText source forms.&lt;br /&gt;
** [https://github.com/pine64/bl602-docs/tree/main/mirrored PINE64's bl602-docs repository]: contains an archive of all historical datasheets and reference manual PDFs but may lag behind Bouffalo's official repository. If you notice that it is, please submit a pull request!&lt;br /&gt;
* USB/Serial adapter:&lt;br /&gt;
** [https://cdn.sparkfun.com/datasheets/Dev/Arduino/Other/CH340DS1.PDF CH340 serial converter]&lt;br /&gt;
&lt;br /&gt;
== Misc notes ==&lt;br /&gt;
Planned to be available in at least three form factors:&lt;br /&gt;
* NUT-01S -&amp;gt; ESP-01S&lt;br /&gt;
* NUT-12S -&amp;gt; ESP-12S&lt;br /&gt;
* NUT-15 -&amp;gt; RTL8723/AMPAK&lt;br /&gt;
&lt;br /&gt;
== Loading code ==&lt;br /&gt;
To load code, you must move the jumper to the position closest to the edge, press reset, load the code, move the jumper back toward the center of the board, and press reset again.&lt;br /&gt;
&lt;br /&gt;
There are currently a number of loaders in progress, each with differing degrees of completeness and success on various operating systems.&lt;br /&gt;
* In the build tree, there is BLFlashCube for Windows, which is a proprietary GUI for flashing images. Linux and macOS binaries are available via [https://dev.bouffalolab.com/download Bouffalo Lab's developer portal].&lt;br /&gt;
* [https://github.com/stschake/bl60x-flash bl60x-flash] is in Python and has been reported successful on MacOS catalina (10.15.6) by Punnerud and madushan1000.&lt;br /&gt;
* [https://github.com/bouffalolab/BLOpenFlasher BLOpenFlasher] is a WIP, written in go, by Bouffalo Labs to provide source for a flash utility.&lt;br /&gt;
* [https://github.com/renzenicolai/bl602tool bl602tool] is a Python utility in development.&lt;br /&gt;
* &amp;lt;del&amp;gt;[https://pypi.org/project/bflb-eflash-loader/ Bouffalo's Python Flash Loader] is a new (Dec 20) flash loader by the makers of the chip.&amp;lt;/del&amp;gt;&lt;br /&gt;
* &amp;lt;del&amp;gt;[https://pypi.org/project/bflb-image-build/ Bouffalo's image build] smooshes code and adds headers for downloads.&amp;lt;/del&amp;gt;&lt;br /&gt;
* [https://pypi.org/project/bflb-mcu-tool/ Bouffalo's MCU tool] (Mar 2021) Python image tool replaced both of the above. Now combined with eflash loader, deals with partitions, DTS, signing, fuses etc.&lt;br /&gt;
* [https://github.com/spacemeowx2/blflash blflash serial flasher] BL602 serial flasher, inspired by BLOpenFlasher&lt;br /&gt;
&lt;br /&gt;
== Development efforts ==&lt;br /&gt;
* [https://github.com/pine64/bl_iot_sdk PineCone BL602 GitHub Page (PINE64 fork)] has compilers, linkers, and all the code to build on Windows, Linux (x86_64), and MacOS.&lt;br /&gt;
* [https://github.com/bouffalolab/bl_iot_sdk Bouffalo Lab GitHub Page]&lt;br /&gt;
* [https://github.com/renzenicolai/bl602-docs/ BL602 Developer organize documentation GitHub Page]&lt;br /&gt;
* [https://github.com/renzenicolai/bl602tool BL602 Developer organize tool GitHub Page]&lt;br /&gt;
* [https://github.com/stschake/bl60x-flash Programming tool for Bouffalo Labs BL602/BL604 chips]&lt;br /&gt;
* [https://github.com/pine64/bl602-re BL602 reverse engineering working group]&lt;br /&gt;
* [https://github.com/pine64/bl602-sdio-linux Linux kernel module]&lt;br /&gt;
* [https://github.com/tchebb/bl602-docs BL602 Documentation]&lt;br /&gt;
* [https://github.com/spacemeowx2/blflash BL602 serial flasher]&lt;br /&gt;
* [https://github.com/mkroman/awesome-bouffalo#feature-matrix Awesome Bouffalo]&lt;br /&gt;
&lt;br /&gt;
== Articles and Blogs ==&lt;br /&gt;
* [https://lupyuen.github.io/articles/pinecone Quick Peek of PineCone BL602 RISC-V Evaluation Board by Lup Yuen]&lt;br /&gt;
* [https://maero.dk/bl602-firmware-image-format/ Documenting the BouffaloLab BL602 firmware image format by MK]&lt;br /&gt;
* [https://lupyuen.github.io/articles/openocd Connect PineCone BL602 to OpenOCD by Lup Yuen]&lt;br /&gt;
* [https://lupyuen.github.io/articles/debug Debug Rust on PineCone BL602 with VSCode and GDB by Lup Yuen]&lt;br /&gt;
* [https://lupyuen.github.io/articles/mynewt Porting Mynewt to PineCone BL602 by Lup Yuen]&lt;br /&gt;
* [https://lupyuen.github.io/articles/flash Flashing Firmware to PineCone BL602 by Lup Yuen]&lt;br /&gt;
* [https://lupyuen.github.io/articles/led Control PineCone BL602 RGB LED with GPIO and PWM by Lup Yuen]&lt;br /&gt;
* [https://lupyuen.github.io/articles/gpio Mynewt GPIO ported to PineCone BL602 RISC-V Board by Lup Yuen]&lt;br /&gt;
* [https://lupyuen.github.io/articles/i2c PineCone BL602 talks to I2C Sensors by Lup Yuen]&lt;br /&gt;
* [https://lupyuen.github.io/articles/spi PineCone BL602 talks SPI too! by Lup Yuen]&lt;br /&gt;
* [https://lupyuen.github.io/articles/display PineCone BL602 Blasting Pixels to ST7789 Display with LVGL Library by Lup Yuen]&lt;br /&gt;
* [https://lupyuen.github.io/articles/uart PineCone BL602 Talks UART to Grove E-Ink Display by Lup Yuen]&lt;br /&gt;
* [https://lupyuen.github.io/articles/book The RISC-V BL602 Book by Lup Yuen]&lt;br /&gt;
* [https://lupyuen.github.io/articles/lora Connect PineCone BL602 to LoRa Transceiver by Lup Yuen]&lt;br /&gt;
* [https://lupyuen.github.io/articles/wisblock RAKwireless WisBlock talks LoRa with PineCone BL602 RISC-V Board by Lup Yuen]&lt;br /&gt;
* [https://lupyuen.github.io/articles/lora2 PineCone BL602 RISC-V Board Receives LoRa Packets by Lup Yuen]&lt;br /&gt;
* [https://lupyuen.github.io/articles/rust Run Rust RISC-V Firmware with BL602 IoT SDK by Lup Yuen]&lt;br /&gt;
* [https://lupyuen.github.io/articles/lorawan PineCone BL602 Talks LoRaWAN by Lup Yuen]&lt;br /&gt;
* [https://lupyuen.github.io/articles/lisp uLisp and Blockly on PineCone BL602 RISC-V Board by Lup Yuen]&lt;br /&gt;
* [https://lupyuen.github.io/articles/wasm Simulate RISC-V BL602 with WebAssembly, uLisp and Blockly by Lup Yuen]&lt;br /&gt;
* [https://lupyuen.github.io/articles/boot BL602 Bootloader by Lup Yuen]&lt;br /&gt;
* [https://lupyuen.github.io/articles/tflite Machine Learning on RISC-V BL602 with TensorFlow Lite by Lup Yuen]&lt;br /&gt;
* [https://lupyuen.github.io/articles/wifi Reverse Engineering WiFi on RISC-V BL602 by Lup Yuen]&lt;br /&gt;
* [https://lupyuen.github.io/articles/adc Rust on RISC-V BL602: Is It Sunny? by Lup Yuen]&lt;br /&gt;
* [https://lupyuen.github.io/articles/rustsim Rust on RISC-V BL602: Simulated with WebAssembly by Lup Yuen]&lt;br /&gt;
* [https://lupyuen.github.io/articles/pinedio PineDio Stack BL604 RISC-V Board: Testing The Prototype by Lup Yuen]&lt;br /&gt;
* [https://lupyuen.github.io/articles/rhai Rust on RISC-V BL602: Rhai Scripting by Lup Yuen]&lt;br /&gt;
* [https://lupyuen.github.io/articles/lorawan2 LoRaWAN on PineDio Stack BL604 RISC-V Board by Lup Yuen]&lt;br /&gt;
* [https://lupyuen.github.io/articles/ttn The Things Network on PineDio Stack BL604 RISC-V Board by Lup Yuen]&lt;br /&gt;
* [https://lupyuen.github.io/articles/cbor Encode Sensor Data with CBOR on BL602 by Lup Yuen]&lt;br /&gt;
* [https://lupyuen.github.io/articles/roblox IoT Digital Twin with Roblox and The Things Network by Lup Yuen]&lt;br /&gt;
* [https://lupyuen.github.io/articles/tsen Internal Temperature Sensor on BL602 by Lup Yuen]&lt;br /&gt;
* [https://lupyuen.github.io/articles/payload CBOR Payload Formatter for The Things Network by Lup Yuen]&lt;br /&gt;
* [https://lupyuen.github.io/articles/prometheus Monitor IoT Devices in The Things Network with Prometheus and Grafana by Lup Yuen]&lt;br /&gt;
* [https://lupyuen.github.io/articles/nuttx Apache NuttX OS on RISC-V BL602 and BL604 by Lup Yuen]&lt;br /&gt;
* [https://lupyuen.github.io/articles/spi2 SPI on Apache NuttX OS by Lup Yuen]&lt;br /&gt;
* [https://lupyuen.github.io/articles/sx1262 LoRa SX1262 on Apache NuttX OS by Lup Yuen]&lt;br /&gt;
* [https://lupyuen.github.io/articles/lorawan3 LoRaWAN on Apache NuttX OS by Lup Yuen]&lt;br /&gt;
* [https://lupyuen.github.io/articles/rust2 Rust on Apache NuttX OS by Lup Yuen]&lt;br /&gt;
* [https://lupyuen.github.io/articles/auto Auto Flash and Test NuttX on RISC-V BL602 by Lup Yuen]&lt;br /&gt;
* [https://lupyuen.github.io/articles/loader BL602 EFlash Loader: Reverse Engineered with Ghidra by Lup Yuen]&lt;br /&gt;
* [https://lupyuen.github.io/articles/ikea Connect IKEA Air Quality Sensor to Apache NuttX OS by Lup Yuen]&lt;br /&gt;
* [https://lupyuen.github.io/articles/bme280 Apache NuttX Driver for BME280 Sensor: Ported from Zephyr OS by Lup Yuen]&lt;br /&gt;
* [https://lupyuen.github.io/articles/rusti2c Rust talks I2C on Apache NuttX RTOS by Lup Yuen]&lt;br /&gt;
* [https://lupyuen.github.io/articles/st7789 ST7789 Display with LVGL Graphics on Apache NuttX RTOS by Lup Yuen]&lt;br /&gt;
* [https://lupyuen.github.io/articles/pinedio2 PineDio Stack BL604 runs Apache NuttX RTOS by Lup Yuen]&lt;br /&gt;
* [https://lupyuen.github.io/articles/touch NuttX Touch Panel Driver for PineDio Stack BL604 by Lup Yuen]&lt;br /&gt;
* [https://www.robertlipe.com/buttons-on-bl602-nuttx/ Buttons on BL602 NuttX]&lt;br /&gt;
* [https://lupyuen.github.io/articles/expander NuttX GPIO Expander for PineDio Stack BL604 by Lup Yuen]&lt;br /&gt;
* [https://lupyuen.github.io/articles/auto2 (Mostly) Automated Testing of Apache NuttX RTOS on PineDio Stack BL604 RISC-V Board by Lup Yuen]&lt;br /&gt;
* [https://lupyuen.github.io/articles/zig Zig on RISC-V BL602: Quick Peek with Apache NuttX RTOS by Lup Yuen]&lt;br /&gt;
&lt;br /&gt;
[[Category:Nutcracker]]&lt;/div&gt;</summary>
		<author><name>Lupyuen</name></author>
	</entry>
	<entry>
		<id>https://wiki.pine64.org/index.php?title=Pinedio&amp;diff=13141</id>
		<title>Pinedio</title>
		<link rel="alternate" type="text/html" href="https://wiki.pine64.org/index.php?title=Pinedio&amp;diff=13141"/>
		<updated>2022-06-02T03:35:26Z</updated>

		<summary type="html">&lt;p&gt;Lupyuen: Add article: &amp;quot;Zig on RISC-V BL602: Quick Peek with Apache NuttX RTOS&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{under construction}}&lt;br /&gt;
&lt;br /&gt;
The '''Pinedio''' is a device utilizing LoRa. LoRa is a long range, low power wireless platform that is being used by a lot of Internet of Things (IoT) products. Using LoRa and LoRaWAN, devices can communicate across the world using the internet, using various decentralised networks such as [https://www.thethingsnetwork.org/ The Things Network] or [https://www.helium.com/ Helium]. Since, PINE64 believes in openness, the LoRa gateway can connect to any network, per the developer implementation. If Helium Spots open up for PINE64 gateway and developers have implemented the hook for Helium, then this is good thing. The PINE64 LoRa gateway also open connect to The Things Network if developers implement support. The choice is yours!&lt;br /&gt;
&lt;br /&gt;
== Gateway ==&lt;br /&gt;
&lt;br /&gt;
The gateway will be available in two variants - indoor and outdoor. All that is known about the outdoor unit is that it will have &amp;quot;an aluminum, rugged and water resistant case&amp;quot;. &lt;br /&gt;
The indoor unit consists of a PINE A64-LTS, fitted with a purpose built hat (adapter) which uses a LoRa module by RakWireless. The chipset used is the SX1302, and the module via the SPI interface. There are two external connections on the enclosure for the GPS and loRa antenna. &lt;br /&gt;
&lt;br /&gt;
=== Connections ===&lt;br /&gt;
* GPS is connected to UART2 on the A64 board&lt;br /&gt;
* SX1302 on SPI0&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|RAK2287 module&lt;br /&gt;
|PI-2 connector&lt;br /&gt;
|PINE A64-LTS&lt;br /&gt;
|-&lt;br /&gt;
|SX1302 SPI&lt;br /&gt;
|Pin 19 = MOSI / PC0&amp;lt;br/&amp;gt;Pin 21 = MISO/PC1&amp;lt;br/&amp;gt;Pin23 = CLK/PC2&amp;lt;br/&amp;gt;Pin24 = CS/PC3&lt;br /&gt;
|SPI0 (/dev/spidev0.0)&lt;br /&gt;
|-&lt;br /&gt;
|SX1302 RESET&lt;br /&gt;
|Pin 11 = GPIO17/PC7&lt;br /&gt;
|GPIO71 (/sys/class/gpio/gpio71)&lt;br /&gt;
|-&lt;br /&gt;
|GPS UART&lt;br /&gt;
|Pin 8 = TX/&amp;lt;br&amp;gt;Pin 10 = RX&lt;br /&gt;
|UART2 (/dev/ttyS2)&lt;br /&gt;
|-&lt;br /&gt;
|GPS RESET&lt;br /&gt;
|Pin 33 = GPIO13/PC5&lt;br /&gt;
|GPIO69 (/sys/class/gpio/gpio69)&lt;br /&gt;
|-&lt;br /&gt;
|GPS Standby&lt;br /&gt;
|Pin 35 = GPIO19/PC9&lt;br /&gt;
|GPIO73 (/sys/class/gpio/gpio73)&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Pictures ===&lt;br /&gt;
&amp;lt;gallery&amp;gt;&lt;br /&gt;
File:Blog-april-InsideLoRaGateway.jpg&lt;br /&gt;
File:Blog-april-InsideLoRaGateway2.jpeg&lt;br /&gt;
File:Discord-lora-gateway-20210413_143615.jpg&lt;br /&gt;
File:Discord-lora-gateway-20210413_1435271.jpg&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Operating System Options===&lt;br /&gt;
&lt;br /&gt;
Pinedio Gateway carries the A64-LTS board. Based on ram specifications SOPINE images are also compatible.&lt;br /&gt;
&lt;br /&gt;
====Armbian====&lt;br /&gt;
&lt;br /&gt;
Gateway Hardware based on Pine64 A64-LTS + RAK2287 + GPS. &lt;br /&gt;
&lt;br /&gt;
Hardware compatible with SOPINE images.&lt;br /&gt;
&lt;br /&gt;
'''PineDio Gateway TTN/Chirpstack Image'''&lt;br /&gt;
&lt;br /&gt;
Debian image with (Default Choices: Chirpstack / TTN) software preinstalled / hardware enabled is available below.&lt;br /&gt;
&lt;br /&gt;
Latest: &lt;br /&gt;
    (PineDio-RAK-Armbian_02-26-2022.img.xz)&lt;br /&gt;
&lt;br /&gt;
    SHA256: 83c2fae06579c2101502963289682295b83164d322ae7359c7c584f0b0e57426&lt;br /&gt;
    SHA512: c5e8cb0b657ee02aa15c60dc7cab7b9e4a7785da548541c6a0eaf4ee7241600c18e339776d94731c5130ccceea4da4aad159af521c4f484c1a550a39fe707d95&lt;br /&gt;
&lt;br /&gt;
DOWNLOAD LOCATION:  https://mega.nz/file/CIoykITD#S_NQx9wRG05CTT7TdzBX8u24bGiVzT341VPZakycaw8&lt;br /&gt;
&lt;br /&gt;
'''Switch Between Chirpstack / TTN (TheThingsNetwork)'''&lt;br /&gt;
&lt;br /&gt;
  gateway-config&lt;br /&gt;
&lt;br /&gt;
First Select:&lt;br /&gt;
&lt;br /&gt;
  Setup RAK Gateway Channel Plan&lt;br /&gt;
&lt;br /&gt;
Next For TTN (TheThingsNetwork) Select:&lt;br /&gt;
&lt;br /&gt;
  Server is TTN&lt;br /&gt;
&lt;br /&gt;
'''or'''&lt;br /&gt;
&lt;br /&gt;
Next For Chirpstack Select:&lt;br /&gt;
&lt;br /&gt;
  Server is Other server&lt;br /&gt;
&lt;br /&gt;
'''Accessing Chirpstack Admin Page'''&lt;br /&gt;
&lt;br /&gt;
Point web browser to:&lt;br /&gt;
&lt;br /&gt;
  http://gatewayIPaddress:8080&lt;br /&gt;
&lt;br /&gt;
'''Default Chirpstack Credentials'''&lt;br /&gt;
&lt;br /&gt;
  login: admin&lt;br /&gt;
  password: admin&lt;br /&gt;
&lt;br /&gt;
'''SSH Credentials'''&lt;br /&gt;
&lt;br /&gt;
 Login: pinedio&lt;br /&gt;
 password: SoPinePass!!!&lt;br /&gt;
&lt;br /&gt;
'''Changing EUI'''&lt;br /&gt;
&lt;br /&gt;
EUI is stored in file:&lt;br /&gt;
&lt;br /&gt;
  /opt/ttn-gateway/packetforwarder/lorapkt_fwd/local_conf.json&lt;br /&gt;
&lt;br /&gt;
'''Additional Shell Commands'''&lt;br /&gt;
&lt;br /&gt;
'''View Gateway ID/EUI'''&lt;br /&gt;
&lt;br /&gt;
  gateway-version&lt;br /&gt;
&lt;br /&gt;
'''Restart Packet Forwarder/Concentrator'''&lt;br /&gt;
&lt;br /&gt;
  sudo systemctl restart ttn-gateway&lt;br /&gt;
&lt;br /&gt;
'''Check Status'''&lt;br /&gt;
&lt;br /&gt;
  sudo systemctl status ttn-gateway&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Enabling Concentrator/GPS Steps (Below Already *Completed* For Above Image Download)'''&lt;br /&gt;
&lt;br /&gt;
Inside armbian-config -&amp;gt; system -&amp;gt; Bootenv (edit boot environment), enter the following 2 lines (to create spidev0.0):&lt;br /&gt;
&lt;br /&gt;
 overlays=spi-spidev uart2 i2c0&lt;br /&gt;
 param_spidev_spi_bus=0&lt;br /&gt;
&lt;br /&gt;
Or you may hand edit: /boot/armbianEnv.txt to add the above overlays/param_spidev_spi_bus lines.&lt;br /&gt;
&lt;br /&gt;
Save. Reboot. &lt;br /&gt;
&lt;br /&gt;
After rebooting you should see a new device /dev/spidev0.0. This will be the concentrator device for gateway related setup.&lt;br /&gt;
&lt;br /&gt;
GPS will be /dev/ttyS2 and should work (after editing armbianEnv.txt + reboot). &lt;br /&gt;
Make sure to offer GPS antenna a strong signal, preferably by a window (if indoors).&lt;br /&gt;
&lt;br /&gt;
== USB adapter ==&lt;br /&gt;
[[File:Pine64-lora-usb-adapter.jpg|500px]]&lt;br /&gt;
&lt;br /&gt;
The Pine64 USB LoRa adapter is based on the Semtech SX1262 LoRa module and the CH341 USB bus converter chip. The '''CH341''' chip can be configured in multiple mode to convert USB to various serial and parallel ports. In this case, it's configured in '''synchronous serial mode''', which allows this chip to convert from USB to the SPI bus needed to talk to the SX1262 LoRa module:&lt;br /&gt;
&lt;br /&gt;
 --------            --------------------------&lt;br /&gt;
 |      |            |   USB LoRa Adapter     |&lt;br /&gt;
 | PC   |  &amp;lt;--USB--&amp;gt; | CH341 &amp;lt;--SPI--&amp;gt; SX1262 |&lt;br /&gt;
 |      |            |       &amp;lt;--I/O--&amp;gt;        |&lt;br /&gt;
 --------            --------------------------&lt;br /&gt;
&lt;br /&gt;
=== Pins ===&lt;br /&gt;
[[File:Lora-usb-pins.jpg|500px]]&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
&lt;br /&gt;
!SX1262 Pin&lt;br /&gt;
!Name&lt;br /&gt;
!Description&lt;br /&gt;
|-&lt;br /&gt;
|1&lt;br /&gt;
|ANT&lt;br /&gt;
|Antenna&lt;br /&gt;
|-&lt;br /&gt;
|2&lt;br /&gt;
|GND2&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|3&lt;br /&gt;
|VREG&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|4&lt;br /&gt;
|DCC&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|5&lt;br /&gt;
|VCC&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|6&lt;br /&gt;
|DIO1&lt;br /&gt;
|Connected on CH341 Pin 7&lt;br /&gt;
|-&lt;br /&gt;
|7&lt;br /&gt;
|DIO2&lt;br /&gt;
|Connected on CH341 Pin6&lt;br /&gt;
|-&lt;br /&gt;
|8&lt;br /&gt;
|DIO3&lt;br /&gt;
|Connected on CH341 Pin 5&lt;br /&gt;
|-&lt;br /&gt;
|9&lt;br /&gt;
|GND&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|10&lt;br /&gt;
|MISO&lt;br /&gt;
|SPI MISO (CH341 Pin 20)&lt;br /&gt;
|-&lt;br /&gt;
|11&lt;br /&gt;
|MOSI&lt;br /&gt;
|SPI MOSI (CH341 Pin 22)&lt;br /&gt;
|-&lt;br /&gt;
|12&lt;br /&gt;
|SCK&lt;br /&gt;
|SPI clock (CH341 Pin 24)&lt;br /&gt;
|- &lt;br /&gt;
|13&lt;br /&gt;
|NSS&lt;br /&gt;
|SPI Chip select&lt;br /&gt;
|-&lt;br /&gt;
|14&lt;br /&gt;
|POR&lt;br /&gt;
|Reset pin&lt;br /&gt;
|-&lt;br /&gt;
|15&lt;br /&gt;
|Busy&lt;br /&gt;
|Busy pin&lt;br /&gt;
|-&lt;br /&gt;
|16&lt;br /&gt;
|GND&lt;br /&gt;
|&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Kernel module for CH341 === &lt;br /&gt;
We need a driver for the CH341 USB bus converter chip. This driver will allow us to send command to the CH341 (SPI messages and access to the GPIOs). I've successfully build and run [https://github.com/rogerjames99/spi-ch341-usb this driver from '''rogerjames99'''] on my desktop computer (running Manjaro Linux) and on my Pinebook Pro (ARM64, running Manjaro ARM Linux). For any kernel newer than 3.10 but mandatory for kernels newer than 5.15 you need to use the [https://github.com/dimich-dmb/spi-ch341-usb dimich-dmb fork of the the '''spi-ch341-usb driver.'''] This fork has updated documentation for the newer kernel interfaces. If this driver gives you problems please drop by any of the social platforms in the Pine64 LoRa chat and give a holler, and if you are using a 5.15 or older kernel you can use the rogerjames99 fork.&lt;br /&gt;
&lt;br /&gt;
 $ git clone https://github.com/rogerjames99/spi-ch341-usb.git &lt;br /&gt;
or&lt;br /&gt;
 $ git clone https://github.com/dimich-dmb/spi-ch341-usb.git&lt;br /&gt;
then&lt;br /&gt;
 $ cd spi-ch341-usb&lt;br /&gt;
 $ make&lt;br /&gt;
 $ sudo make install&lt;br /&gt;
&lt;br /&gt;
Once the driver is installed, unload the module ''ch341'' if it has been automatically loaded:&lt;br /&gt;
&lt;br /&gt;
 $ lsmod |grep ch341&lt;br /&gt;
 $ sudo rmmod ch341&lt;br /&gt;
&lt;br /&gt;
On my setup, ''ch341'' would be automatically loaded once I connected my USB adapter. This module drives the CH341 is asynchronous serial mode, which will not work for a SPI bus. &lt;br /&gt;
&lt;br /&gt;
Then load the new module:&lt;br /&gt;
&lt;br /&gt;
 $ sudo modprobe spi-ch341-usb&lt;br /&gt;
&lt;br /&gt;
Plug your USB adapter and check that the module is correctly loaded : &lt;br /&gt;
&lt;br /&gt;
 $ dmesg&lt;br /&gt;
 [20141.872107] usb 1-1.1: USB disconnect, device number 4&lt;br /&gt;
 [20143.820756] usb 1-1.1: new full-speed USB device number 5 using ehci-platform&lt;br /&gt;
 [20143.973366] usb 1-1.1: New USB device found, idVendor=1a86, idProduct=5512, bcdDevice= 3.04&lt;br /&gt;
 [20143.973413] usb 1-1.1: New USB device strings: Mfr=0, Product=2, SerialNumber=0&lt;br /&gt;
 [20143.973434] usb 1-1.1: Product: USB UART-LPT&lt;br /&gt;
 [20143.975137] spi-ch341-usb 1-1.1:1.0: ch341_usb_probe: connect device&lt;br /&gt;
 [20143.975164] spi-ch341-usb 1-1.1:1.0: ch341_usb_probe: bNumEndpoints=3&lt;br /&gt;
 [20143.975183] spi-ch341-usb 1-1.1:1.0: ch341_usb_probe:   endpoint=0 type=2 dir=1 addr=2&lt;br /&gt;
 [20143.975206] spi-ch341-usb 1-1.1:1.0: ch341_usb_probe:   endpoint=1 type=2 dir=0 addr=2&lt;br /&gt;
 [20143.975229] spi-ch341-usb 1-1.1:1.0: ch341_usb_probe:   endpoint=2 type=3 dir=1 addr=1&lt;br /&gt;
 [20143.975254] spi-ch341-usb 1-1.1:1.0: ch341_cfg_probe: output cs0 SPI slave with cs=0&lt;br /&gt;
 [20143.975273] spi-ch341-usb 1-1.1:1.0: ch341_cfg_probe: output cs0 gpio=0 irq=0 &lt;br /&gt;
 [20143.975295] spi-ch341-usb 1-1.1:1.0: ch341_cfg_probe: output cs1 SPI slave with cs=1&lt;br /&gt;
 [20143.975313] spi-ch341-usb 1-1.1:1.0: ch341_cfg_probe: output cs1 gpio=1 irq=1 &lt;br /&gt;
 [20143.975334] spi-ch341-usb 1-1.1:1.0: ch341_cfg_probe: output cs2 SPI slave with cs=2&lt;br /&gt;
 [20143.975352] spi-ch341-usb 1-1.1:1.0: ch341_cfg_probe: output cs2 gpio=2 irq=2 &lt;br /&gt;
 [20143.975373] spi-ch341-usb 1-1.1:1.0: ch341_cfg_probe: input  gpio4 gpio=3 irq=3 &lt;br /&gt;
 [20143.975394] spi-ch341-usb 1-1.1:1.0: ch341_cfg_probe: input  gpio6 gpio=4 irq=4 &lt;br /&gt;
 [20143.975415] spi-ch341-usb 1-1.1:1.0: ch341_cfg_probe: input  err gpio=5 irq=5 &lt;br /&gt;
 [20143.975435] spi-ch341-usb 1-1.1:1.0: ch341_cfg_probe: input  pemp gpio=6 irq=6 &lt;br /&gt;
 [20143.975456] spi-ch341-usb 1-1.1:1.0: ch341_cfg_probe: input  int gpio=7 irq=7 (hwirq)&lt;br /&gt;
 [20143.975478] spi-ch341-usb 1-1.1:1.0: ch341_cfg_probe: input  slct gpio=8 irq=8 &lt;br /&gt;
 [20143.975499] spi-ch341-usb 1-1.1:1.0: ch341_cfg_probe: input  wait gpio=9 irq=9 &lt;br /&gt;
 [20143.975520] spi-ch341-usb 1-1.1:1.0: ch341_cfg_probe: input  autofd gpio=10 irq=10 &lt;br /&gt;
 [20143.975542] spi-ch341-usb 1-1.1:1.0: ch341_cfg_probe: input  addr gpio=11 irq=11 &lt;br /&gt;
 [20143.975564] spi-ch341-usb 1-1.1:1.0: ch341_cfg_probe: output ini gpio=12 irq=12 &lt;br /&gt;
 [20143.975585] spi-ch341-usb 1-1.1:1.0: ch341_cfg_probe: output write gpio=13 irq=13 &lt;br /&gt;
 [20143.975607] spi-ch341-usb 1-1.1:1.0: ch341_cfg_probe: output scl gpio=14 irq=14 &lt;br /&gt;
 [20143.975628] spi-ch341-usb 1-1.1:1.0: ch341_cfg_probe: output sda gpio=15 irq=15 &lt;br /&gt;
 [20143.975650] spi-ch341-usb 1-1.1:1.0: ch341_spi_probe: start&lt;br /&gt;
 [20143.975677] spi-ch341-usb 1-1.1:1.0: ch341_spi_probe: SPI master connected to SPI bus 1&lt;br /&gt;
 [20143.977831] spi-ch341-usb 1-1.1:1.0: ch341_spi_probe: SPI device /dev/spidev1.0 created&lt;br /&gt;
 [20143.978183] spi-ch341-usb 1-1.1:1.0: ch341_spi_probe: SPI device /dev/spidev1.1 created&lt;br /&gt;
 [20143.978552] spi-ch341-usb 1-1.1:1.0: ch341_spi_probe: SPI device /dev/spidev1.2 created&lt;br /&gt;
 [20143.978726] spi-ch341-usb 1-1.1:1.0: ch341_spi_probe: done&lt;br /&gt;
 [20143.978735] spi-ch341-usb 1-1.1:1.0: ch341_irq_probe: start&lt;br /&gt;
 [20143.979133] spi-ch341-usb 1-1.1:1.0: ch341_irq_probe: irq_base=103&lt;br /&gt;
 [20143.979154] spi-ch341-usb 1-1.1:1.0: ch341_irq_probe: done&lt;br /&gt;
 [20143.979162] spi-ch341-usb 1-1.1:1.0: ch341_gpio_probe: start&lt;br /&gt;
 [20143.979220] spi-ch341-usb 1-1.1:1.0: ch341_gpio_get_direction: gpio=cs0 dir=0&lt;br /&gt;
 [20143.979229] spi-ch341-usb 1-1.1:1.0: ch341_gpio_get_direction: gpio=cs1 dir=0&lt;br /&gt;
 [20143.979237] spi-ch341-usb 1-1.1:1.0: ch341_gpio_get_direction: gpio=cs2 dir=0&lt;br /&gt;
 [20143.979245] spi-ch341-usb 1-1.1:1.0: ch341_gpio_get_direction: gpio=gpio4 dir=1&lt;br /&gt;
 [20143.979253] spi-ch341-usb 1-1.1:1.0: ch341_gpio_get_direction: gpio=gpio6 dir=1&lt;br /&gt;
 [20143.979260] spi-ch341-usb 1-1.1:1.0: ch341_gpio_get_direction: gpio=err dir=1&lt;br /&gt;
 [20143.979268] spi-ch341-usb 1-1.1:1.0: ch341_gpio_get_direction: gpio=pemp dir=1&lt;br /&gt;
 [20143.979275] spi-ch341-usb 1-1.1:1.0: ch341_gpio_get_direction: gpio=int dir=1&lt;br /&gt;
 [20143.979283] spi-ch341-usb 1-1.1:1.0: ch341_gpio_get_direction: gpio=slct dir=1&lt;br /&gt;
 [20143.979290] spi-ch341-usb 1-1.1:1.0: ch341_gpio_get_direction: gpio=wait dir=1&lt;br /&gt;
 [20143.979298] spi-ch341-usb 1-1.1:1.0: ch341_gpio_get_direction: gpio=autofd dir=1&lt;br /&gt;
 [20143.979306] spi-ch341-usb 1-1.1:1.0: ch341_gpio_get_direction: gpio=addr dir=1&lt;br /&gt;
 [20143.979314] spi-ch341-usb 1-1.1:1.0: ch341_gpio_get_direction: gpio=ini dir=0&lt;br /&gt;
 [20143.979321] spi-ch341-usb 1-1.1:1.0: ch341_gpio_get_direction: gpio=write dir=0&lt;br /&gt;
 [20143.979329] spi-ch341-usb 1-1.1:1.0: ch341_gpio_get_direction: gpio=scl dir=0&lt;br /&gt;
 [20143.979337] spi-ch341-usb 1-1.1:1.0: ch341_gpio_get_direction: gpio=sda dir=0&lt;br /&gt;
 [20143.979831] spi-ch341-usb 1-1.1:1.0: ch341_gpio_probe: registered GPIOs from 496 to 511&lt;br /&gt;
 [20143.981152] spi-ch341-usb 1-1.1:1.0: ch341_gpio_probe: done&lt;br /&gt;
 [20143.981212] spi-ch341-usb 1-1.1:1.0: ch341_gpio_poll_function: start&lt;br /&gt;
 [20143.981291] spi-ch341-usb 1-1.1:1.0: ch341_usb_probe: connected&lt;br /&gt;
 [20144.756250] usbcore: registered new interface driver ch341&lt;br /&gt;
 [20144.756334] usbserial: USB Serial support registered for ch341-uart&lt;br /&gt;
&lt;br /&gt;
With kernel 5.16 and newer the output is shorter:&lt;br /&gt;
&lt;br /&gt;
 $ dmesg&lt;br /&gt;
 [ 6744.813564] usb 1-2.1.1: new full-speed USB device number 21 using xhci_hcd&lt;br /&gt;
 [ 6744.904377] usb 1-2.1.1: New USB device found, idVendor=1a86, idProduct=5512, bcdDevice= 3.04&lt;br /&gt;
 [ 6744.904383] usb 1-2.1.1: New USB device strings: Mfr=0, Product=2, SerialNumber=0&lt;br /&gt;
 [ 6744.904385] usb 1-2.1.1: Product: USB UART-LPT&lt;br /&gt;
 [ 6744.960243] spi-ch341-usb 1-2.1.1:1.0: ch341_cfg_probe: output cs0 SPI slave with cs=0&lt;br /&gt;
 [ 6744.960246] spi-ch341-usb 1-2.1.1:1.0: ch341_cfg_probe: output cs1 SPI slave with cs=1&lt;br /&gt;
 [ 6744.960247] spi-ch341-usb 1-2.1.1:1.0: ch341_cfg_probe: output cs2 SPI slave with cs=2&lt;br /&gt;
 [ 6744.960249] spi-ch341-usb 1-2.1.1:1.0: ch341_cfg_probe: input  gpio4 gpio=0 irq=0 (hwirq)&lt;br /&gt;
 [ 6744.960251] spi-ch341-usb 1-2.1.1:1.0: ch341_cfg_probe: input  gpio5 gpio=1 irq=1&lt;br /&gt;
 [ 6744.960302] spi-ch341-usb 1-2.1.1:1.0: ch341_spi_probe: SPI master connected to SPI bus 0&lt;br /&gt;
 [ 6744.960350] spi-ch341-usb 1-2.1.1:1.0: ch341_spi_probe: SPI device /dev/spidev0.0 created&lt;br /&gt;
 [ 6744.960398] spi-ch341-usb 1-2.1.1:1.0: ch341_spi_probe: SPI device /dev/spidev0.1 created&lt;br /&gt;
 [ 6744.960445] spi-ch341-usb 1-2.1.1:1.0: ch341_spi_probe: SPI device /dev/spidev0.2 created&lt;br /&gt;
 [ 6744.960583] spi-ch341-usb 1-2.1.1:1.0: ch341_usb_probe: connected&lt;br /&gt;
&lt;br /&gt;
=== Driver development === &lt;br /&gt;
=====Kernels 5.14 and older=====&lt;br /&gt;
&lt;br /&gt;
Once the module ''spi-ch341-usb'' is correctly loaded, here's how you can transfer data on the SPI bus (in C):&lt;br /&gt;
&lt;br /&gt;
 /* Open the SPI bus */&lt;br /&gt;
 int spi = open(&amp;quot;/dev/spidev1.0&amp;quot;, O_RDWR);&lt;br /&gt;
 uint8_t mmode = SPI_MODE_0;&lt;br /&gt;
 uint8_t lsb = 0;&lt;br /&gt;
 ioctl(spi, SPI_IOC_WR_MODE, &amp;amp;mmode);&lt;br /&gt;
 ioctl(spi, SPI_IOC_WR_LSB_FIRST, &amp;amp;lsb);&lt;br /&gt;
 &lt;br /&gt;
 /* Transfer data */&lt;br /&gt;
 /* TODO: Init buffer_out, buffer_in and size */&lt;br /&gt;
 const uint8_t *mosi = buffer_out; // output data&lt;br /&gt;
 uint8_t *miso = buffer_in; // input data&lt;br /&gt;
 &lt;br /&gt;
 struct spi_ioc_transfer spi_trans;&lt;br /&gt;
 memset(&amp;amp;spi_trans, 0, sizeof(spi_trans));&lt;br /&gt;
 &lt;br /&gt;
 spi_trans.tx_buf = (unsigned long) mosi;&lt;br /&gt;
 spi_trans.rx_buf = (unsigned long) miso;&lt;br /&gt;
 spi_trans.cs_change = true;&lt;br /&gt;
 spi_trans.len = size;&lt;br /&gt;
 &lt;br /&gt;
 int status = ioctl (spi, SPI_IOC_MESSAGE(1), &amp;amp;spi_trans);&lt;br /&gt;
&lt;br /&gt;
To access GPIOs, you first need to export them (to make them accessible via ''/sys/class/gpio''. As you can see in the dmesg output, GPIOs from 496 to 511 were registered, which means we can export 16 GPIOs. The mapping of these I/O is available in the [https://github.com/rogerjames99/spi-ch341-usb/blob/master/spi-ch341-usb.c#L148 source code of the driver]. For example, pin ''slct'' is the 12th, meaning we need to export GPIO 496+12 = 508.&lt;br /&gt;
&lt;br /&gt;
 int  fd;&lt;br /&gt;
 if ((fd = open(&amp;quot;/sys/class/gpio/export&amp;quot;, O_WRONLY)) == -1)   {&lt;br /&gt;
   perror(&amp;quot;open ini&amp;quot;);&lt;br /&gt;
   exit(-1);&lt;br /&gt;
 }&lt;br /&gt;
 &lt;br /&gt;
 if (write(fd, &amp;quot;508&amp;quot;, 3) == -1){&lt;br /&gt;
   perror (&amp;quot;write export 508&amp;quot;);&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
Once exported, the GPIO is available in ''/sys/class/gpio/sclt'' (the naming is specified by the driver). You can read the pin in C:&lt;br /&gt;
&lt;br /&gt;
 int  fd;&lt;br /&gt;
 if ((fd = open(&amp;quot;/sys/class/gpio/slct/value&amp;quot;, O_RDWR)) == -1)   {&lt;br /&gt;
   perror(&amp;quot;open&amp;quot;);&lt;br /&gt;
 }&lt;br /&gt;
 &lt;br /&gt;
 char buf;&lt;br /&gt;
 if (read(fd, &amp;amp;buf, 1) == -1) {&lt;br /&gt;
    perror(&amp;quot;read&amp;quot;);&lt;br /&gt;
 }&lt;br /&gt;
 &lt;br /&gt;
 int value = (buf == '0') ? 0 : 1;&lt;br /&gt;
&lt;br /&gt;
You can also write it:&lt;br /&gt;
&lt;br /&gt;
 int  fd; &lt;br /&gt;
 if ((fd = open(&amp;quot;/sys/class/gpio/ini/value&amp;quot;, O_RDWR)) == -1)   {&lt;br /&gt;
   perror(&amp;quot;open ini&amp;quot;);&lt;br /&gt;
 }&lt;br /&gt;
 &lt;br /&gt;
 if (write(fd, value ? &amp;quot;1&amp;quot; : &amp;quot;0&amp;quot;, 1) == -1) {&lt;br /&gt;
    perror (&amp;quot;write&amp;quot;);&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
=====Kernel 5.15 and newer=====&lt;br /&gt;
&lt;br /&gt;
We need some help documenting how these interfaces work!&lt;br /&gt;
&lt;br /&gt;
The driver creates these interfaces:&lt;br /&gt;
 {| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
  |Pin  ||SPI Function ||GPIO function ||GPIO name ||IRQ&lt;br /&gt;
  |-&lt;br /&gt;
  |15||CS0||-||-||-&lt;br /&gt;
  |-&lt;br /&gt;
  |16||CS1||-||-||-&lt;br /&gt;
  |-&lt;br /&gt;
  |17||CS2||-||-||-&lt;br /&gt;
  |-&lt;br /&gt;
  |19||-||Input||gpio4||hardware&lt;br /&gt;
  |-&lt;br /&gt;
  |21||-||Input||gpio5||software&lt;br /&gt;
 |}&lt;br /&gt;
&lt;br /&gt;
The dimich-dmb fork of spi-ch341-usb works with 5.15+ kernels, but as you can see above it is not configured for the needs of the Pinedio-USB by default. I have started a branch in my fork to work on getting the driver pre-configured for our needs. The branch can be [https://github.com/UncleGrumpy/spi-ch341-usb/tree/pinedio found here.] Please feel free to help! And open issues or discussions in the repo if you have problems or ideas how to help. Any improvements to the actual code beyond configuration should be pushed to the temporary [https://github.com/dimich-dmb/spi-ch341-usb/ upstream.]&lt;br /&gt;
&lt;br /&gt;
Since linux-5.15 binding to spidev driver is required to make slave devices available via /dev/, e.g. for slave 1 on bus 0 as real root (not with sudo):&lt;br /&gt;
&lt;br /&gt;
 # echo spidev &amp;gt; /sys/class/spi_master/spi0/spi0.1/driver_override&lt;br /&gt;
 # echo spi0.1 &amp;gt; /sys/bus/spi/drivers/spidev/bind&lt;br /&gt;
&lt;br /&gt;
For all devices handled by spi_ch341_usb driver (again, only as real root):&lt;br /&gt;
&lt;br /&gt;
 # for i in /sys/bus/usb/drivers/spi-ch341-usb/*/spi_master/spi*/spi*.*; do echo spidev &amp;gt; $i/driver_override; echo $(basename $i) &amp;gt; /sys/bus/spi/drivers/spidev/bind; done&lt;br /&gt;
&lt;br /&gt;
The documentation found at https://github.com/dimich-dmb/spi-ch341-usb/blob/master/README.md has more information.&lt;br /&gt;
&lt;br /&gt;
The 5.15+ driver is not ready yet. But if you are interested in testing, helping to get the configuration right, or working on application development you can build and test the current driver:&lt;br /&gt;
&lt;br /&gt;
 $ git clone -b pinedio https://github.com/UncleGrumpy/spi-ch341-usb.git &lt;br /&gt;
 $ cd spi-ch341-usb&lt;br /&gt;
 $ make&lt;br /&gt;
 $ sudo make install&lt;br /&gt;
&lt;br /&gt;
So far this will automatically set up the SPI slave device /dev/spi0.0. It names the ch341-usb device as &amp;quot;pinedio&amp;quot; this will allow application developers to find the correct gpiochip by name. I need help confirming the correct gpio pins but as of now the driver will setup the following configuration:&lt;br /&gt;
&lt;br /&gt;
The driver uses following CH341A pins for the SPI interface. &lt;br /&gt;
 {| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
  | Pin || Name || Direction || Function SPI (CH341A)&lt;br /&gt;
  |-&lt;br /&gt;
  | 18  || D3   || output    || SCK (DCK)             &lt;br /&gt;
  |-&lt;br /&gt;
  | 20  || D5   || output    || MOSI (DOUT)           &lt;br /&gt;
  |-&lt;br /&gt;
  | 22  || D7   || input     || MISO (DIN)            &lt;br /&gt;
  |-&lt;br /&gt;
  | 15  || D0   || output    || CS0                   &lt;br /&gt;
 |}&lt;br /&gt;
&lt;br /&gt;
The driver uses the following GPIO configuration.  I am not at all sure these are the correct pins to use! This is one area that I could really use some help with!!!&lt;br /&gt;
 {| class=&amp;quot;wikitable&lt;br /&gt;
  | CH341 Pin || CH341A Name || Function   || GPIO Name  || GPIO Configuration || SX1262 connection&lt;br /&gt;
  |-&lt;br /&gt;
  |  7        || INT#        || IRQ        || dio_irq    || Output             || DIO1 (IRQ)        &lt;br /&gt;
  |-&lt;br /&gt;
  |  8        || SLCT        || BUSY       || dio_busy   || Input              || BUSY              &lt;br /&gt;
  |-&lt;br /&gt;
  | 26        || RST#        || Hard Reset || dio_reset  || Output             || NRESET            &lt;br /&gt;
 |}&lt;br /&gt;
&lt;br /&gt;
The function of these pins can be changed from user space by using libgpiod. The command line tools installed with the library (gpioset, gpioget, gpiodetect, gpioinfo...) can be used for bash scripts, etc. and applications should all use the libgpiod interfaces. The /sys/class/gpio interface has been removed from the kernel in 5.15, so any apps using /sys/class/gpio to access gpio pins are broken, or will be as distos update their kernels to 5.15 and beyond.&lt;br /&gt;
&lt;br /&gt;
GPIO pins can be listed with gpioinfo:&lt;br /&gt;
 $ gpioinfo pinedio&lt;br /&gt;
&lt;br /&gt;
The output should look similar to:&lt;br /&gt;
 gpiochip1 - 3 lines:&lt;br /&gt;
         line   0:    &amp;quot;dio_irq&amp;quot;       unused   input  active-high&lt;br /&gt;
         line   1:   &amp;quot;dio_busy&amp;quot;       unused   input  active-high&lt;br /&gt;
         line   2:  &amp;quot;dio_reset&amp;quot;       unused  output  active-high&lt;br /&gt;
&lt;br /&gt;
The gpiochip# might be different.  The driver exposes the Pinedio with the gpio name &amp;quot;pinedio&amp;quot;, developers should use this name to interact with the gpiochip because the gpiochip# of the device is likely to be different from one system to the next, or depending on the order devices are initialized.&lt;br /&gt;
&lt;br /&gt;
=== Driver for the SX1262 LoRa module ===&lt;br /&gt;
Now that we can talk to the SX1262 via the CH341 USB converter chip, we need to send actual commands to make it emit or receive LoRa messages. To do this, you can implement the driver yourself using info from the datasheet, or use an existing driver (you can easily find drivers for the Arduino framework, for example. &lt;br /&gt;
I found [https://github.com/YukiWorkshop/sx126x_driver this C++ driver]. It's well written, lightweight and easily portable across many platforms. All you have to do is implement 3 HAL function : read GPIO, write GPIO and transfer data on SPI. I wrote a quick'n'dirty app that emits a LoRa frame. It's [https://gist.github.com/JF002/f1af5595874942427eea9d375c18fc73 available here]. &lt;br /&gt;
&lt;br /&gt;
As I don't have any 'raw' LoRa device on hands, I check that it was actually transmitting something using my SDR setup (simple TNT usb key and '''Gqrx''' software):&lt;br /&gt;
&lt;br /&gt;
[[File:pine64-lora-usb-adapter-sdr.png|500px]]&lt;br /&gt;
&lt;br /&gt;
== Other end nodes ==&lt;br /&gt;
&lt;br /&gt;
There are several end-node units planned:&lt;br /&gt;
* loRa back case for the PinePhone&lt;br /&gt;
* standalone USB dongle-type end-node adapter&lt;br /&gt;
* PineTab adapter&lt;br /&gt;
* as well as a SPI module (which can also be configured as a USB LoRa dongle)&lt;br /&gt;
* a LoRa stick powered by a single 18650 battery (using the [https://wiki.pine64.org/wiki/Nutcracker BL602], and can be fitted with GPS, an low-power OLED panel and additional sensors)&lt;br /&gt;
&lt;br /&gt;
All the end-nodes use the SX1262 chip. &lt;br /&gt;
&lt;br /&gt;
=== Pictures ===&lt;br /&gt;
&amp;lt;gallery&amp;gt;&lt;br /&gt;
File:Blog-april-USB-LoRa-1024x655.jpg&lt;br /&gt;
File:Blog-april-LoRa-something-839x1024.jpg&lt;br /&gt;
File:Discord_20210421_lora_usb_closeup.jpg&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Datasheets and schematics ==&lt;br /&gt;
=== Gateway ===&lt;br /&gt;
* [https://www.semtech.com/products/wireless-rf/lora-gateways/sx1302 SX1302 datasheets and resources]&lt;br /&gt;
* [https://docs.rakwireless.com/Product-Categories/WisLink/RAK2247/Overview/ RAK2287 datasheets and resources]&lt;br /&gt;
* [https://wiki.pine64.org/images/5/54/PINE64_LoRa_Gateway_Module_Adapter_Schematic-v1.0-20210308.pdf Pine64 LoRa Gateway module adapter schematic]&lt;br /&gt;
&lt;br /&gt;
=== End nodes ===&lt;br /&gt;
* [https://www.semtech.com/products/wireless-rf/lora-transceivers/sx1262 SX1262 datasheets and resources]&lt;br /&gt;
&lt;br /&gt;
=== Pinephone backplate ===&lt;br /&gt;
* [[File:Pinephone_LoRa_BackPanel_Schematic-v1.0-20210402.pdf]]&lt;br /&gt;
* [[File:CA-S01_LoRa_Chip_Antenna_in_Chinese.pdf]]&lt;br /&gt;
* [https://github.com/zschroeder6212/tiny-i2c-spi I2C SPI Bridge code running on ATtiny84]&lt;br /&gt;
&lt;br /&gt;
=== USB LoRa adapter ===&lt;br /&gt;
* [[File:USB_LoRa_adapter-PINE64_RFM90_SCH_2021_04_26.pdf]]&lt;br /&gt;
* CH341 datasheet : [[File:CH341DS1.pdf]]&lt;br /&gt;
* Semtech SX1262 datasheet : [https://semtech.my.salesforce.com/sfc/p/#E0000000JelG/a/2R000000HT76/7Nka9W5WgugoZe.xwIHJy6ebj1hW8UJ.USO_Pt2CLLo File on Semtech website (file is too big for the wiki)]&lt;br /&gt;
&lt;br /&gt;
=== PineDio Stack ===&lt;br /&gt;
* Schematic : [[File:PINEDIO_STACK_V1_0-2021_05_24C.pdf]]&lt;br /&gt;
&lt;br /&gt;
== Other resources ==&lt;br /&gt;
* [https://www.youtube.com/watch?v=cJ0wpANpbyc Video: A peek at Pine64's LoRa gateway and modules]&lt;br /&gt;
* [https://iotw.io/ IOTW - Blockchain-Enabled IoT Data Platform]&lt;br /&gt;
* [https://lupyuen.github.io/articles/pinedio PineDio Stack BL604 RISC-V Board: Testing The Prototype]&lt;br /&gt;
* [https://lupyuen.github.io/articles/lorawan2 LoRaWAN on PineDio Stack BL604 RISC-V Board]&lt;br /&gt;
* [https://lupyuen.github.io/articles/ttn The Things Network on PineDio Stack BL604 RISC-V Board]&lt;br /&gt;
* [https://lupyuen.github.io/articles/prometheus Monitor IoT Devices in The Things Network with Prometheus and Grafana]&lt;br /&gt;
* [https://lupyuen.github.io/articles/tsen Internal Temperature Sensor on BL602]&lt;br /&gt;
* [https://lupyuen.github.io/articles/roblox IoT Digital Twin with Roblox and The Things Network]&lt;br /&gt;
* [https://lupyuen.github.io/articles/gateway PineDio LoRa Gateway: Testing The Prototype]&lt;br /&gt;
* [https://lupyuen.github.io/articles/nuttx Apache NuttX OS on RISC-V BL602 and BL604]&lt;br /&gt;
* [https://lupyuen.github.io/articles/spi2 SPI on Apache NuttX OS]&lt;br /&gt;
* [https://lupyuen.github.io/articles/sx1262 LoRa SX1262 on Apache NuttX OS]&lt;br /&gt;
* [https://lupyuen.github.io/articles/lorawan3 LoRaWAN on Apache NuttX OS]&lt;br /&gt;
* [https://lupyuen.github.io/articles/rust2 Rust on Apache NuttX OS]&lt;br /&gt;
* [https://lupyuen.github.io/articles/ikea Connect IKEA Air Quality Sensor to Apache NuttX OS]&lt;br /&gt;
* [https://lupyuen.github.io/articles/pinedio2 PineDio Stack BL604 runs Apache NuttX RTOS]&lt;br /&gt;
* [https://lupyuen.github.io/articles/touch NuttX Touch Panel Driver for PineDio Stack BL604]&lt;br /&gt;
* [https://www.robertlipe.com/buttons-on-bl602-nuttx/ Buttons on BL602 NuttX]&lt;br /&gt;
* [https://lupyuen.github.io/articles/expander NuttX GPIO Expander for PineDio Stack BL604]&lt;br /&gt;
* [https://lupyuen.github.io/articles/auto2 (Mostly) Automated Testing of Apache NuttX RTOS on PineDio Stack BL604 RISC-V Board]&lt;br /&gt;
* [https://lupyuen.github.io/articles/zig Zig on RISC-V BL602: Quick Peek with Apache NuttX RTOS]&lt;/div&gt;</summary>
		<author><name>Lupyuen</name></author>
	</entry>
	<entry>
		<id>https://wiki.pine64.org/index.php?title=PineCone&amp;diff=13112</id>
		<title>PineCone</title>
		<link rel="alternate" type="text/html" href="https://wiki.pine64.org/index.php?title=PineCone&amp;diff=13112"/>
		<updated>2022-05-22T03:39:01Z</updated>

		<summary type="html">&lt;p&gt;Lupyuen: Add article &amp;quot;(Mostly) Automated Testing of Apache NuttX RTOS on PineDio Stack BL604 RISC-V Board&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[File:Pine64_BL602_EVB_photo-3-small.jpg|thumb|PineCone BL602 EVB (Evaluation Board)]]&lt;br /&gt;
&lt;br /&gt;
The '''PineCone''' is a BL602 evaluation board, which was developed with the goal to challenge the open source community to achieve blob-free and free and open source WiFi and Bluetooth, see the [https://www.pine64.org/2020/10/28/nutcracker-challenge-blob-free-wifi-ble/ Nutcracker Challenge].&lt;br /&gt;
&lt;br /&gt;
== BL602 Specifications ==&lt;br /&gt;
* '''CPU:''' 32-bit RV32IMAFC RISC-V “SiFive E24 Core”&lt;br /&gt;
** [https://www.sifive.com/cores/e24 SiFive E24 Core information]&lt;br /&gt;
* '''Memory:'''&lt;br /&gt;
** 128KB ROM&lt;br /&gt;
** 276KB SRAM&lt;br /&gt;
** 1Kb eFuse&lt;br /&gt;
** 2MB Embedded Flash&lt;br /&gt;
* '''Security:'''&lt;br /&gt;
** Secure boot&lt;br /&gt;
** Secure debug&lt;br /&gt;
** AES 128/192/256&lt;br /&gt;
** SHA-1/224/256&lt;br /&gt;
** TRNG (True Random Number Generator)&lt;br /&gt;
** PKA (Public Key Accelerator)&lt;br /&gt;
* '''Wireless:'''&lt;br /&gt;
** Wi-Fi 802.11 b/g/n&lt;br /&gt;
** Bluetooth® Low Energy 5.0&lt;br /&gt;
** Wi-Fi Fast connection with BLE assistance&lt;br /&gt;
** Wi-Fi and BLE coexistence&lt;br /&gt;
** Wi-Fi Security WPS/WEP/WPA/WPA2/WPA3&lt;br /&gt;
** STA, SoftAP and sniffer modes&lt;br /&gt;
** Multi-Cloud connectivity&lt;br /&gt;
** 2.4 GHz RF transceiver&lt;br /&gt;
** Integrated RF balun, PA/LNA&lt;br /&gt;
* '''Package Type:'''&lt;br /&gt;
** 32 pin QFN 4mm x 4mm&lt;br /&gt;
* JTAG support (See below for BL602 impact)&lt;br /&gt;
&lt;br /&gt;
[[File:BL602_Block_Diagram.jpg|600px]]&lt;br /&gt;
&lt;br /&gt;
== JTAG ==&lt;br /&gt;
{| class=&amp;quot;wikitable floatright&amp;quot;&lt;br /&gt;
|+ Default JTAG pins&lt;br /&gt;
|-&lt;br /&gt;
| GPIO Pin || JTAG Pin&lt;br /&gt;
|-&lt;br /&gt;
| GPIO17 || TDI&lt;br /&gt;
|-&lt;br /&gt;
| GPIO11 || TDO&lt;br /&gt;
|-&lt;br /&gt;
| GPIO12 || TMS&lt;br /&gt;
|-&lt;br /&gt;
| GPIO14 || TCK&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
BL602 multiplexes four GPIO pins to provide the familiar JTAG lines. See the accompanying table for the default pin mappings.&lt;br /&gt;
&lt;br /&gt;
These are the default JTAG pins in use after a cold boot. However, many pieces of software, including the demo that's installed by default on new PineCones, remap these pins to other functions. You cannot use the default wiring for JTAG while such software is running. This issue is especially prevalent on the PineCone because three of the default JTAG pins are connected to the onboard RGB LED. Nothing about the LED itself interferes with JTAG, but any program that uses the LED will necessarily remap some of the default JTAG pins to be GPIO.&lt;br /&gt;
&lt;br /&gt;
The MaskROM download mode that the BL602 enters when you tie GPIO8 high does '''not''' remap the default JTAG pins, and so you can and should use that mode while checking basic functionality of your JTAG adapter.&lt;br /&gt;
&lt;br /&gt;
Note that, just as software can remap the default JTAG pins to be something else, it can also remap other pins to be JTAG. Control over this is quite granular, with 5-6 candidate pins for each individual JTAG signal that can be mapped independently of one another. LEE Lup Yuen has written some [https://lupyuen.github.io/articles/openocd#free-the-led-from-jtag-port sample code] showing how to remap the JTAG pins so that your software can use the LED without giving up support for debugging.&lt;br /&gt;
&lt;br /&gt;
== Pine64 USB JTAG Adapter information and schematics ==&lt;br /&gt;
* [https://files.pine64.org/doc/Pinenut/PINE64%20USB%20JTAG%20Adapter%20Schematic-20201215.pdf PINE64 USB JTAG Adapter schematic 20202018 1.0]&lt;br /&gt;
* [[:File:PINE64_USB_JTAG_Adapter_Schematic_ver_1.0a-20210109.pdf|PINE64 USB JTAG Adapter schematic 20210109 1.0a]]&lt;br /&gt;
&lt;br /&gt;
== PineCone BL602 EVB information and schematics ==&lt;br /&gt;
* Approximate dimensions: 26mm x 43mm&lt;br /&gt;
* Board layout:&lt;br /&gt;
[[File:PADI-II_EVB.png]]&lt;br /&gt;
* [https://files.pine64.org/doc/Pinenut/Pine64%20BL602%20EVB%20Schematic%20ver%201.1.pdf PineCone BL602 EVB schematic ver 1.1]&lt;br /&gt;
** Note: In PineCone revision 1.1 (&amp;quot;BL62B_EVB V1.1&amp;quot; silkscreened on back of board), CC1 and CC2 share one 5.1KΩ resistor. This means the board will fail to power when you use an e-marked USB-C cable like the one that comes with Apple chargers. See [https://medium.com/@leung.benson/how-to-design-a-proper-usb-c-power-sink-hint-not-the-way-raspberry-pi-4-did-it-f470d7a5910 this article] for details of why this happens. The next schematic design will give each line its own 5.1KΩ resistor as per the USB-C specification.&lt;br /&gt;
* The board uses a CH340 Serial/USB adapter. This chip is commonly used in Arduino-class development boards. It is a full speed (12Mbps) USB interface and has vendor ID 0x1a86 with product ID 0x7523.&lt;br /&gt;
* The GPIO pins (11, 12, 14, 17) plus the nearby RESET, POWER, and GND pins are all located on one side of the board, on J1 to provide JTAG connection.&lt;br /&gt;
&lt;br /&gt;
== Pinenut-01S Module information and schematics ==&lt;br /&gt;
[[File:Pinenut-01S_PCB-Front.png|225px]][[File:Pinenut-01S_PCB-Back.png|225px]]&lt;br /&gt;
* [https://files.pine64.org/doc/Pinenut/Pinenut-01S%20V1.01%20SCH.pdf Pinenut-01S schematic ver 1.01]&lt;br /&gt;
* [https://wiki.pine64.org/images/6/6b/PineNut-01S_v1.01_KiCad.zip PineNut-01S KiCad schematic ver 1.01]&lt;br /&gt;
* [https://files.pine64.org/doc/Pinenut/NUT-01S%20GPIO%20Definition%20ver%201.0.pdf Pinenut-01S GPIO Definition ver 1.0]&lt;br /&gt;
* [https://files.pine64.org/doc/Pinenut/USB%20Adapter%20for%20Pinenut-01S%20Schematic%20V1.0.pdf USB Programmer adapter for Pinenut-01S schematic ver 1.0]&lt;br /&gt;
* The default firmware runs the UART at 2000000 bps.  It will accept input whilst regularly outputting:&amp;lt;code&amp;gt;&amp;lt;br/&amp;gt;proc_hellow_entry: RISC-V rv32imafc&amp;lt;br/&amp;gt;cur key status:1&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Pinenut-12S Module information ==&lt;br /&gt;
[[File:NUT-12S_module-front.jpg|200px]][[File:NUT-12S_module-back.jpg|200px]]&lt;br /&gt;
* [https://files.pine64.org/doc/Pinenut/NUT-12S%20GPIO%20Definition%20ver%201.0.pdf Pinenut-12S GPIO Definition ver 1.0]&lt;br /&gt;
* Onboard LED is connected to IO0&lt;br /&gt;
&lt;br /&gt;
== Datasheets for components and peripherals ==&lt;br /&gt;
* Bouffalo BL-602 SoC information:&lt;br /&gt;
** [https://github.com/bouffalolab/bl_docs Bouffalo Lab's official bl_docs repository]: should always contain the latest SoC documentation available, in PDF, HTML, and reStructuredText source forms.&lt;br /&gt;
** [https://github.com/pine64/bl602-docs/tree/main/mirrored PINE64's bl602-docs repository]: contains an archive of all historical datasheets and reference manual PDFs but may lag behind Bouffalo's official repository. If you notice that it is, please submit a pull request!&lt;br /&gt;
* USB/Serial adapter:&lt;br /&gt;
** [https://cdn.sparkfun.com/datasheets/Dev/Arduino/Other/CH340DS1.PDF CH340 serial converter]&lt;br /&gt;
&lt;br /&gt;
== Misc notes ==&lt;br /&gt;
Planned to be available in at least three form factors:&lt;br /&gt;
* NUT-01S -&amp;gt; ESP-01S&lt;br /&gt;
* NUT-12S -&amp;gt; ESP-12S&lt;br /&gt;
* NUT-15 -&amp;gt; RTL8723/AMPAK&lt;br /&gt;
&lt;br /&gt;
== Loading code ==&lt;br /&gt;
To load code, you must move the jumper to the position closest to the edge, press reset, load the code, move the jumper back toward the center of the board, and press reset again.&lt;br /&gt;
&lt;br /&gt;
There are currently a number of loaders in progress, each with differing degrees of completeness and success on various operating systems.&lt;br /&gt;
* In the build tree, there is BLFlashCube for Windows, which is a proprietary GUI for flashing images. Linux and macOS binaries are available via [https://dev.bouffalolab.com/download Bouffalo Lab's developer portal].&lt;br /&gt;
* [https://github.com/stschake/bl60x-flash bl60x-flash] is in Python and has been reported successful on MacOS catalina (10.15.6) by Punnerud and madushan1000.&lt;br /&gt;
* [https://github.com/bouffalolab/BLOpenFlasher BLOpenFlasher] is a WIP, written in go, by Bouffalo Labs to provide source for a flash utility.&lt;br /&gt;
* [https://github.com/renzenicolai/bl602tool bl602tool] is a Python utility in development.&lt;br /&gt;
* &amp;lt;del&amp;gt;[https://pypi.org/project/bflb-eflash-loader/ Bouffalo's Python Flash Loader] is a new (Dec 20) flash loader by the makers of the chip.&amp;lt;/del&amp;gt;&lt;br /&gt;
* &amp;lt;del&amp;gt;[https://pypi.org/project/bflb-image-build/ Bouffalo's image build] smooshes code and adds headers for downloads.&amp;lt;/del&amp;gt;&lt;br /&gt;
* [https://pypi.org/project/bflb-mcu-tool/ Bouffalo's MCU tool] (Mar 2021) Python image tool replaced both of the above. Now combined with eflash loader, deals with partitions, DTS, signing, fuses etc.&lt;br /&gt;
* [https://github.com/spacemeowx2/blflash blflash serial flasher] BL602 serial flasher, inspired by BLOpenFlasher&lt;br /&gt;
&lt;br /&gt;
== Development efforts ==&lt;br /&gt;
* [https://github.com/pine64/bl_iot_sdk PineCone BL602 GitHub Page (PINE64 fork)] has compilers, linkers, and all the code to build on Windows, Linux (x86_64), and MacOS.&lt;br /&gt;
* [https://github.com/bouffalolab/bl_iot_sdk Bouffalo Lab GitHub Page]&lt;br /&gt;
* [https://github.com/renzenicolai/bl602-docs/ BL602 Developer organize documentation GitHub Page]&lt;br /&gt;
* [https://github.com/renzenicolai/bl602tool BL602 Developer organize tool GitHub Page]&lt;br /&gt;
* [https://github.com/stschake/bl60x-flash Programming tool for Bouffalo Labs BL602/BL604 chips]&lt;br /&gt;
* [https://github.com/pine64/bl602-re BL602 reverse engineering working group]&lt;br /&gt;
* [https://github.com/pine64/bl602-sdio-linux Linux kernel module]&lt;br /&gt;
* [https://github.com/tchebb/bl602-docs BL602 Documentation]&lt;br /&gt;
* [https://github.com/spacemeowx2/blflash BL602 serial flasher]&lt;br /&gt;
* [https://github.com/mkroman/awesome-bouffalo#feature-matrix Awesome Bouffalo]&lt;br /&gt;
&lt;br /&gt;
== Articles and Blogs ==&lt;br /&gt;
* [https://lupyuen.github.io/articles/pinecone Quick Peek of PineCone BL602 RISC-V Evaluation Board by Lup Yuen]&lt;br /&gt;
* [https://maero.dk/bl602-firmware-image-format/ Documenting the BouffaloLab BL602 firmware image format by MK]&lt;br /&gt;
* [https://lupyuen.github.io/articles/openocd Connect PineCone BL602 to OpenOCD by Lup Yuen]&lt;br /&gt;
* [https://lupyuen.github.io/articles/debug Debug Rust on PineCone BL602 with VSCode and GDB by Lup Yuen]&lt;br /&gt;
* [https://lupyuen.github.io/articles/mynewt Porting Mynewt to PineCone BL602 by Lup Yuen]&lt;br /&gt;
* [https://lupyuen.github.io/articles/flash Flashing Firmware to PineCone BL602 by Lup Yuen]&lt;br /&gt;
* [https://lupyuen.github.io/articles/led Control PineCone BL602 RGB LED with GPIO and PWM by Lup Yuen]&lt;br /&gt;
* [https://lupyuen.github.io/articles/gpio Mynewt GPIO ported to PineCone BL602 RISC-V Board by Lup Yuen]&lt;br /&gt;
* [https://lupyuen.github.io/articles/i2c PineCone BL602 talks to I2C Sensors by Lup Yuen]&lt;br /&gt;
* [https://lupyuen.github.io/articles/spi PineCone BL602 talks SPI too! by Lup Yuen]&lt;br /&gt;
* [https://lupyuen.github.io/articles/display PineCone BL602 Blasting Pixels to ST7789 Display with LVGL Library by Lup Yuen]&lt;br /&gt;
* [https://lupyuen.github.io/articles/uart PineCone BL602 Talks UART to Grove E-Ink Display by Lup Yuen]&lt;br /&gt;
* [https://lupyuen.github.io/articles/book The RISC-V BL602 Book by Lup Yuen]&lt;br /&gt;
* [https://lupyuen.github.io/articles/lora Connect PineCone BL602 to LoRa Transceiver by Lup Yuen]&lt;br /&gt;
* [https://lupyuen.github.io/articles/wisblock RAKwireless WisBlock talks LoRa with PineCone BL602 RISC-V Board by Lup Yuen]&lt;br /&gt;
* [https://lupyuen.github.io/articles/lora2 PineCone BL602 RISC-V Board Receives LoRa Packets by Lup Yuen]&lt;br /&gt;
* [https://lupyuen.github.io/articles/rust Run Rust RISC-V Firmware with BL602 IoT SDK by Lup Yuen]&lt;br /&gt;
* [https://lupyuen.github.io/articles/lorawan PineCone BL602 Talks LoRaWAN by Lup Yuen]&lt;br /&gt;
* [https://lupyuen.github.io/articles/lisp uLisp and Blockly on PineCone BL602 RISC-V Board by Lup Yuen]&lt;br /&gt;
* [https://lupyuen.github.io/articles/wasm Simulate RISC-V BL602 with WebAssembly, uLisp and Blockly by Lup Yuen]&lt;br /&gt;
* [https://lupyuen.github.io/articles/boot BL602 Bootloader by Lup Yuen]&lt;br /&gt;
* [https://lupyuen.github.io/articles/tflite Machine Learning on RISC-V BL602 with TensorFlow Lite by Lup Yuen]&lt;br /&gt;
* [https://lupyuen.github.io/articles/wifi Reverse Engineering WiFi on RISC-V BL602 by Lup Yuen]&lt;br /&gt;
* [https://lupyuen.github.io/articles/adc Rust on RISC-V BL602: Is It Sunny? by Lup Yuen]&lt;br /&gt;
* [https://lupyuen.github.io/articles/rustsim Rust on RISC-V BL602: Simulated with WebAssembly by Lup Yuen]&lt;br /&gt;
* [https://lupyuen.github.io/articles/pinedio PineDio Stack BL604 RISC-V Board: Testing The Prototype by Lup Yuen]&lt;br /&gt;
* [https://lupyuen.github.io/articles/rhai Rust on RISC-V BL602: Rhai Scripting by Lup Yuen]&lt;br /&gt;
* [https://lupyuen.github.io/articles/lorawan2 LoRaWAN on PineDio Stack BL604 RISC-V Board by Lup Yuen]&lt;br /&gt;
* [https://lupyuen.github.io/articles/ttn The Things Network on PineDio Stack BL604 RISC-V Board by Lup Yuen]&lt;br /&gt;
* [https://lupyuen.github.io/articles/cbor Encode Sensor Data with CBOR on BL602 by Lup Yuen]&lt;br /&gt;
* [https://lupyuen.github.io/articles/roblox IoT Digital Twin with Roblox and The Things Network by Lup Yuen]&lt;br /&gt;
* [https://lupyuen.github.io/articles/tsen Internal Temperature Sensor on BL602 by Lup Yuen]&lt;br /&gt;
* [https://lupyuen.github.io/articles/payload CBOR Payload Formatter for The Things Network by Lup Yuen]&lt;br /&gt;
* [https://lupyuen.github.io/articles/prometheus Monitor IoT Devices in The Things Network with Prometheus and Grafana by Lup Yuen]&lt;br /&gt;
* [https://lupyuen.github.io/articles/nuttx Apache NuttX OS on RISC-V BL602 and BL604 by Lup Yuen]&lt;br /&gt;
* [https://lupyuen.github.io/articles/spi2 SPI on Apache NuttX OS by Lup Yuen]&lt;br /&gt;
* [https://lupyuen.github.io/articles/sx1262 LoRa SX1262 on Apache NuttX OS by Lup Yuen]&lt;br /&gt;
* [https://lupyuen.github.io/articles/lorawan3 LoRaWAN on Apache NuttX OS by Lup Yuen]&lt;br /&gt;
* [https://lupyuen.github.io/articles/rust2 Rust on Apache NuttX OS by Lup Yuen]&lt;br /&gt;
* [https://lupyuen.github.io/articles/auto Auto Flash and Test NuttX on RISC-V BL602 by Lup Yuen]&lt;br /&gt;
* [https://lupyuen.github.io/articles/loader BL602 EFlash Loader: Reverse Engineered with Ghidra by Lup Yuen]&lt;br /&gt;
* [https://lupyuen.github.io/articles/ikea Connect IKEA Air Quality Sensor to Apache NuttX OS by Lup Yuen]&lt;br /&gt;
* [https://lupyuen.github.io/articles/bme280 Apache NuttX Driver for BME280 Sensor: Ported from Zephyr OS by Lup Yuen]&lt;br /&gt;
* [https://lupyuen.github.io/articles/rusti2c Rust talks I2C on Apache NuttX RTOS by Lup Yuen]&lt;br /&gt;
* [https://lupyuen.github.io/articles/st7789 ST7789 Display with LVGL Graphics on Apache NuttX RTOS by Lup Yuen]&lt;br /&gt;
* [https://lupyuen.github.io/articles/pinedio2 PineDio Stack BL604 runs Apache NuttX RTOS by Lup Yuen]&lt;br /&gt;
* [https://lupyuen.github.io/articles/touch NuttX Touch Panel Driver for PineDio Stack BL604 by Lup Yuen]&lt;br /&gt;
* [https://www.robertlipe.com/buttons-on-bl602-nuttx/ Buttons on BL602 NuttX]&lt;br /&gt;
* [https://lupyuen.github.io/articles/expander NuttX GPIO Expander for PineDio Stack BL604 by Lup Yuen]&lt;br /&gt;
* [https://lupyuen.github.io/articles/auto2 (Mostly) Automated Testing of Apache NuttX RTOS on PineDio Stack BL604 RISC-V Board by Lup Yuen]&lt;br /&gt;
&lt;br /&gt;
[[Category:Nutcracker]]&lt;/div&gt;</summary>
		<author><name>Lupyuen</name></author>
	</entry>
	<entry>
		<id>https://wiki.pine64.org/index.php?title=Pinedio&amp;diff=13111</id>
		<title>Pinedio</title>
		<link rel="alternate" type="text/html" href="https://wiki.pine64.org/index.php?title=Pinedio&amp;diff=13111"/>
		<updated>2022-05-22T03:38:54Z</updated>

		<summary type="html">&lt;p&gt;Lupyuen: Add article &amp;quot;(Mostly) Automated Testing of Apache NuttX RTOS on PineDio Stack BL604 RISC-V Board&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{under construction}}&lt;br /&gt;
&lt;br /&gt;
The '''Pinedio''' is a device utilizing LoRa. LoRa is a long range, low power wireless platform that is being used by a lot of Internet of Things (IoT) products. Using LoRa and LoRaWAN, devices can communicate across the world using the internet, using various decentralised networks such as [https://www.thethingsnetwork.org/ The Things Network] or [https://www.helium.com/ Helium]. Since, PINE64 believes in openness, the LoRa gateway can connect to any network, per the developer implementation. If Helium Spots open up for PINE64 gateway and developers have implemented the hook for Helium, then this is good thing. The PINE64 LoRa gateway also open connect to The Things Network if developers implement support. The choice is yours!&lt;br /&gt;
&lt;br /&gt;
== Gateway ==&lt;br /&gt;
&lt;br /&gt;
The gateway will be available in two variants - indoor and outdoor. All that is known about the outdoor unit is that it will have &amp;quot;an aluminum, rugged and water resistant case&amp;quot;. &lt;br /&gt;
The indoor unit consists of a PINE A64-LTS, fitted with a purpose built hat (adapter) which uses a LoRa module by RakWireless. The chipset used is the SX1302, and the module via the SPI interface. There are two external connections on the enclosure for the GPS and loRa antenna. &lt;br /&gt;
&lt;br /&gt;
=== Connections ===&lt;br /&gt;
* GPS is connected to UART2 on the A64 board&lt;br /&gt;
* SX1302 on SPI0&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|RAK2287 module&lt;br /&gt;
|PI-2 connector&lt;br /&gt;
|PINE A64-LTS&lt;br /&gt;
|-&lt;br /&gt;
|SX1302 SPI&lt;br /&gt;
|Pin 19 = MOSI / PC0&amp;lt;br/&amp;gt;Pin 21 = MISO/PC1&amp;lt;br/&amp;gt;Pin23 = CLK/PC2&amp;lt;br/&amp;gt;Pin24 = CS/PC3&lt;br /&gt;
|SPI0 (/dev/spidev0.0)&lt;br /&gt;
|-&lt;br /&gt;
|SX1302 RESET&lt;br /&gt;
|Pin 11 = GPIO17/PC7&lt;br /&gt;
|GPIO71 (/sys/class/gpio/gpio71)&lt;br /&gt;
|-&lt;br /&gt;
|GPS UART&lt;br /&gt;
|Pin 8 = TX/&amp;lt;br&amp;gt;Pin 10 = RX&lt;br /&gt;
|UART2 (/dev/ttyS2)&lt;br /&gt;
|-&lt;br /&gt;
|GPS RESET&lt;br /&gt;
|Pin 33 = GPIO13/PC5&lt;br /&gt;
|GPIO69 (/sys/class/gpio/gpio69)&lt;br /&gt;
|-&lt;br /&gt;
|GPS Standby&lt;br /&gt;
|Pin 35 = GPIO19/PC9&lt;br /&gt;
|GPIO73 (/sys/class/gpio/gpio73)&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Pictures ===&lt;br /&gt;
&amp;lt;gallery&amp;gt;&lt;br /&gt;
File:Blog-april-InsideLoRaGateway.jpg&lt;br /&gt;
File:Blog-april-InsideLoRaGateway2.jpeg&lt;br /&gt;
File:Discord-lora-gateway-20210413_143615.jpg&lt;br /&gt;
File:Discord-lora-gateway-20210413_1435271.jpg&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Operating System Options===&lt;br /&gt;
&lt;br /&gt;
Pinedio Gateway carries the A64-LTS board. Based on ram specifications SOPINE images are also compatible.&lt;br /&gt;
&lt;br /&gt;
====Armbian====&lt;br /&gt;
&lt;br /&gt;
Gateway Hardware based on Pine64 A64-LTS + RAK2287 + GPS. &lt;br /&gt;
&lt;br /&gt;
Hardware compatible with SOPINE images.&lt;br /&gt;
&lt;br /&gt;
'''PineDio Gateway TTN/Chirpstack Image'''&lt;br /&gt;
&lt;br /&gt;
Debian image with (Default Choices: Chirpstack / TTN) software preinstalled / hardware enabled is available below.&lt;br /&gt;
&lt;br /&gt;
Latest: &lt;br /&gt;
    (PineDio-RAK-Armbian_02-26-2022.img.xz)&lt;br /&gt;
&lt;br /&gt;
    SHA256: 83c2fae06579c2101502963289682295b83164d322ae7359c7c584f0b0e57426&lt;br /&gt;
    SHA512: c5e8cb0b657ee02aa15c60dc7cab7b9e4a7785da548541c6a0eaf4ee7241600c18e339776d94731c5130ccceea4da4aad159af521c4f484c1a550a39fe707d95&lt;br /&gt;
&lt;br /&gt;
DOWNLOAD LOCATION:  https://mega.nz/file/CIoykITD#S_NQx9wRG05CTT7TdzBX8u24bGiVzT341VPZakycaw8&lt;br /&gt;
&lt;br /&gt;
'''Switch Between Chirpstack / TTN (TheThingsNetwork)'''&lt;br /&gt;
&lt;br /&gt;
  gateway-config&lt;br /&gt;
&lt;br /&gt;
First Select:&lt;br /&gt;
&lt;br /&gt;
  Setup RAK Gateway Channel Plan&lt;br /&gt;
&lt;br /&gt;
Next For TTN (TheThingsNetwork) Select:&lt;br /&gt;
&lt;br /&gt;
  Server is TTN&lt;br /&gt;
&lt;br /&gt;
'''or'''&lt;br /&gt;
&lt;br /&gt;
Next For Chirpstack Select:&lt;br /&gt;
&lt;br /&gt;
  Server is Other server&lt;br /&gt;
&lt;br /&gt;
'''Accessing Chirpstack Admin Page'''&lt;br /&gt;
&lt;br /&gt;
Point web browser to:&lt;br /&gt;
&lt;br /&gt;
  http://gatewayIPaddress:8080&lt;br /&gt;
&lt;br /&gt;
'''Default Chirpstack Credentials'''&lt;br /&gt;
&lt;br /&gt;
  login: admin&lt;br /&gt;
  password: admin&lt;br /&gt;
&lt;br /&gt;
'''SSH Credentials'''&lt;br /&gt;
&lt;br /&gt;
 Login: pinedio&lt;br /&gt;
 password: SoPinePass!!!&lt;br /&gt;
&lt;br /&gt;
'''Changing EUI'''&lt;br /&gt;
&lt;br /&gt;
EUI is stored in file:&lt;br /&gt;
&lt;br /&gt;
  /opt/ttn-gateway/packetforwarder/lorapkt_fwd/local_conf.json&lt;br /&gt;
&lt;br /&gt;
'''Additional Shell Commands'''&lt;br /&gt;
&lt;br /&gt;
'''View Gateway ID/EUI'''&lt;br /&gt;
&lt;br /&gt;
  gateway-version&lt;br /&gt;
&lt;br /&gt;
'''Restart Packet Forwarder/Concentrator'''&lt;br /&gt;
&lt;br /&gt;
  sudo systemctl restart ttn-gateway&lt;br /&gt;
&lt;br /&gt;
'''Check Status'''&lt;br /&gt;
&lt;br /&gt;
  sudo systemctl status ttn-gateway&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Enabling Concentrator/GPS Steps (Below Already *Completed* For Above Image Download)'''&lt;br /&gt;
&lt;br /&gt;
Inside armbian-config -&amp;gt; system -&amp;gt; Bootenv (edit boot environment), enter the following 2 lines (to create spidev0.0):&lt;br /&gt;
&lt;br /&gt;
 overlays=spi-spidev uart2 i2c0&lt;br /&gt;
 param_spidev_spi_bus=0&lt;br /&gt;
&lt;br /&gt;
Or you may hand edit: /boot/armbianEnv.txt to add the above overlays/param_spidev_spi_bus lines.&lt;br /&gt;
&lt;br /&gt;
Save. Reboot. &lt;br /&gt;
&lt;br /&gt;
After rebooting you should see a new device /dev/spidev0.0. This will be the concentrator device for gateway related setup.&lt;br /&gt;
&lt;br /&gt;
GPS will be /dev/ttyS2 and should work (after editing armbianEnv.txt + reboot). &lt;br /&gt;
Make sure to offer GPS antenna a strong signal, preferably by a window (if indoors).&lt;br /&gt;
&lt;br /&gt;
== USB adapter ==&lt;br /&gt;
[[File:Pine64-lora-usb-adapter.jpg|500px]]&lt;br /&gt;
&lt;br /&gt;
The Pine64 USB LoRa adapter is based on the Semtech SX1262 LoRa module and the CH341 USB bus converter chip. The '''CH341''' chip can be configured in multiple mode to convert USB to various serial and parallel ports. In this case, it's configured in '''synchronous serial mode''', which allows this chip to convert from USB to the SPI bus needed to talk to the SX1262 LoRa module:&lt;br /&gt;
&lt;br /&gt;
 --------            --------------------------&lt;br /&gt;
 |      |            |   USB LoRa Adapter     |&lt;br /&gt;
 | PC   |  &amp;lt;--USB--&amp;gt; | CH341 &amp;lt;--SPI--&amp;gt; SX1262 |&lt;br /&gt;
 |      |            |       &amp;lt;--I/O--&amp;gt;        |&lt;br /&gt;
 --------            --------------------------&lt;br /&gt;
&lt;br /&gt;
=== Pins ===&lt;br /&gt;
[[File:Lora-usb-pins.jpg|500px]]&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
&lt;br /&gt;
!SX1262 Pin&lt;br /&gt;
!Name&lt;br /&gt;
!Description&lt;br /&gt;
|-&lt;br /&gt;
|1&lt;br /&gt;
|ANT&lt;br /&gt;
|Antenna&lt;br /&gt;
|-&lt;br /&gt;
|2&lt;br /&gt;
|GND2&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|3&lt;br /&gt;
|VREG&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|4&lt;br /&gt;
|DCC&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|5&lt;br /&gt;
|VCC&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|6&lt;br /&gt;
|DIO1&lt;br /&gt;
|Connected on CH341 Pin 7&lt;br /&gt;
|-&lt;br /&gt;
|7&lt;br /&gt;
|DIO2&lt;br /&gt;
|Connected on CH341 Pin6&lt;br /&gt;
|-&lt;br /&gt;
|8&lt;br /&gt;
|DIO3&lt;br /&gt;
|Connected on CH341 Pin 5&lt;br /&gt;
|-&lt;br /&gt;
|9&lt;br /&gt;
|GND&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|10&lt;br /&gt;
|MISO&lt;br /&gt;
|SPI MISO (CH341 Pin 20)&lt;br /&gt;
|-&lt;br /&gt;
|11&lt;br /&gt;
|MOSI&lt;br /&gt;
|SPI MOSI (CH341 Pin 22)&lt;br /&gt;
|-&lt;br /&gt;
|12&lt;br /&gt;
|SCK&lt;br /&gt;
|SPI clock (CH341 Pin 24)&lt;br /&gt;
|- &lt;br /&gt;
|13&lt;br /&gt;
|NSS&lt;br /&gt;
|SPI Chip select&lt;br /&gt;
|-&lt;br /&gt;
|14&lt;br /&gt;
|POR&lt;br /&gt;
|Reset pin&lt;br /&gt;
|-&lt;br /&gt;
|15&lt;br /&gt;
|Busy&lt;br /&gt;
|Busy pin&lt;br /&gt;
|-&lt;br /&gt;
|16&lt;br /&gt;
|GND&lt;br /&gt;
|&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Kernel module for CH341 === &lt;br /&gt;
We need a driver for the CH341 USB bus converter chip. This driver will allow us to send command to the CH341 (SPI messages and access to the GPIOs). I've successfully build and run [https://github.com/rogerjames99/spi-ch341-usb this driver from '''rogerjames99'''] on my desktop computer (running Manjaro Linux) and on my Pinebook Pro (ARM64, running Manjaro ARM Linux). For any kernel newer than 3.10 but mandatory for kernels newer than 5.15 you need to use the [https://github.com/dimich-dmb/spi-ch341-usb dimich-dmb fork of the the '''spi-ch341-usb driver.'''] This fork has updated documentation for the newer kernel interfaces. If this driver gives you problems please drop by any of the social platforms in the Pine64 LoRa chat and give a holler, and if you are using a 5.15 or older kernel you can use the rogerjames99 fork.&lt;br /&gt;
&lt;br /&gt;
 $ git clone https://github.com/rogerjames99/spi-ch341-usb.git &lt;br /&gt;
or&lt;br /&gt;
 $ git clone https://github.com/dimich-dmb/spi-ch341-usb.git&lt;br /&gt;
then&lt;br /&gt;
 $ cd spi-ch341-usb&lt;br /&gt;
 $ make&lt;br /&gt;
 $ sudo make install&lt;br /&gt;
&lt;br /&gt;
Once the driver is installed, unload the module ''ch341'' if it has been automatically loaded:&lt;br /&gt;
&lt;br /&gt;
 $ lsmod |grep ch341&lt;br /&gt;
 $ sudo rmmod ch341&lt;br /&gt;
&lt;br /&gt;
On my setup, ''ch341'' would be automatically loaded once I connected my USB adapter. This module drives the CH341 is asynchronous serial mode, which will not work for a SPI bus. &lt;br /&gt;
&lt;br /&gt;
Then load the new module:&lt;br /&gt;
&lt;br /&gt;
 $ sudo modprobe spi-ch341-usb&lt;br /&gt;
&lt;br /&gt;
Plug your USB adapter and check that the module is correctly loaded : &lt;br /&gt;
&lt;br /&gt;
 $ dmesg&lt;br /&gt;
 [20141.872107] usb 1-1.1: USB disconnect, device number 4&lt;br /&gt;
 [20143.820756] usb 1-1.1: new full-speed USB device number 5 using ehci-platform&lt;br /&gt;
 [20143.973366] usb 1-1.1: New USB device found, idVendor=1a86, idProduct=5512, bcdDevice= 3.04&lt;br /&gt;
 [20143.973413] usb 1-1.1: New USB device strings: Mfr=0, Product=2, SerialNumber=0&lt;br /&gt;
 [20143.973434] usb 1-1.1: Product: USB UART-LPT&lt;br /&gt;
 [20143.975137] spi-ch341-usb 1-1.1:1.0: ch341_usb_probe: connect device&lt;br /&gt;
 [20143.975164] spi-ch341-usb 1-1.1:1.0: ch341_usb_probe: bNumEndpoints=3&lt;br /&gt;
 [20143.975183] spi-ch341-usb 1-1.1:1.0: ch341_usb_probe:   endpoint=0 type=2 dir=1 addr=2&lt;br /&gt;
 [20143.975206] spi-ch341-usb 1-1.1:1.0: ch341_usb_probe:   endpoint=1 type=2 dir=0 addr=2&lt;br /&gt;
 [20143.975229] spi-ch341-usb 1-1.1:1.0: ch341_usb_probe:   endpoint=2 type=3 dir=1 addr=1&lt;br /&gt;
 [20143.975254] spi-ch341-usb 1-1.1:1.0: ch341_cfg_probe: output cs0 SPI slave with cs=0&lt;br /&gt;
 [20143.975273] spi-ch341-usb 1-1.1:1.0: ch341_cfg_probe: output cs0 gpio=0 irq=0 &lt;br /&gt;
 [20143.975295] spi-ch341-usb 1-1.1:1.0: ch341_cfg_probe: output cs1 SPI slave with cs=1&lt;br /&gt;
 [20143.975313] spi-ch341-usb 1-1.1:1.0: ch341_cfg_probe: output cs1 gpio=1 irq=1 &lt;br /&gt;
 [20143.975334] spi-ch341-usb 1-1.1:1.0: ch341_cfg_probe: output cs2 SPI slave with cs=2&lt;br /&gt;
 [20143.975352] spi-ch341-usb 1-1.1:1.0: ch341_cfg_probe: output cs2 gpio=2 irq=2 &lt;br /&gt;
 [20143.975373] spi-ch341-usb 1-1.1:1.0: ch341_cfg_probe: input  gpio4 gpio=3 irq=3 &lt;br /&gt;
 [20143.975394] spi-ch341-usb 1-1.1:1.0: ch341_cfg_probe: input  gpio6 gpio=4 irq=4 &lt;br /&gt;
 [20143.975415] spi-ch341-usb 1-1.1:1.0: ch341_cfg_probe: input  err gpio=5 irq=5 &lt;br /&gt;
 [20143.975435] spi-ch341-usb 1-1.1:1.0: ch341_cfg_probe: input  pemp gpio=6 irq=6 &lt;br /&gt;
 [20143.975456] spi-ch341-usb 1-1.1:1.0: ch341_cfg_probe: input  int gpio=7 irq=7 (hwirq)&lt;br /&gt;
 [20143.975478] spi-ch341-usb 1-1.1:1.0: ch341_cfg_probe: input  slct gpio=8 irq=8 &lt;br /&gt;
 [20143.975499] spi-ch341-usb 1-1.1:1.0: ch341_cfg_probe: input  wait gpio=9 irq=9 &lt;br /&gt;
 [20143.975520] spi-ch341-usb 1-1.1:1.0: ch341_cfg_probe: input  autofd gpio=10 irq=10 &lt;br /&gt;
 [20143.975542] spi-ch341-usb 1-1.1:1.0: ch341_cfg_probe: input  addr gpio=11 irq=11 &lt;br /&gt;
 [20143.975564] spi-ch341-usb 1-1.1:1.0: ch341_cfg_probe: output ini gpio=12 irq=12 &lt;br /&gt;
 [20143.975585] spi-ch341-usb 1-1.1:1.0: ch341_cfg_probe: output write gpio=13 irq=13 &lt;br /&gt;
 [20143.975607] spi-ch341-usb 1-1.1:1.0: ch341_cfg_probe: output scl gpio=14 irq=14 &lt;br /&gt;
 [20143.975628] spi-ch341-usb 1-1.1:1.0: ch341_cfg_probe: output sda gpio=15 irq=15 &lt;br /&gt;
 [20143.975650] spi-ch341-usb 1-1.1:1.0: ch341_spi_probe: start&lt;br /&gt;
 [20143.975677] spi-ch341-usb 1-1.1:1.0: ch341_spi_probe: SPI master connected to SPI bus 1&lt;br /&gt;
 [20143.977831] spi-ch341-usb 1-1.1:1.0: ch341_spi_probe: SPI device /dev/spidev1.0 created&lt;br /&gt;
 [20143.978183] spi-ch341-usb 1-1.1:1.0: ch341_spi_probe: SPI device /dev/spidev1.1 created&lt;br /&gt;
 [20143.978552] spi-ch341-usb 1-1.1:1.0: ch341_spi_probe: SPI device /dev/spidev1.2 created&lt;br /&gt;
 [20143.978726] spi-ch341-usb 1-1.1:1.0: ch341_spi_probe: done&lt;br /&gt;
 [20143.978735] spi-ch341-usb 1-1.1:1.0: ch341_irq_probe: start&lt;br /&gt;
 [20143.979133] spi-ch341-usb 1-1.1:1.0: ch341_irq_probe: irq_base=103&lt;br /&gt;
 [20143.979154] spi-ch341-usb 1-1.1:1.0: ch341_irq_probe: done&lt;br /&gt;
 [20143.979162] spi-ch341-usb 1-1.1:1.0: ch341_gpio_probe: start&lt;br /&gt;
 [20143.979220] spi-ch341-usb 1-1.1:1.0: ch341_gpio_get_direction: gpio=cs0 dir=0&lt;br /&gt;
 [20143.979229] spi-ch341-usb 1-1.1:1.0: ch341_gpio_get_direction: gpio=cs1 dir=0&lt;br /&gt;
 [20143.979237] spi-ch341-usb 1-1.1:1.0: ch341_gpio_get_direction: gpio=cs2 dir=0&lt;br /&gt;
 [20143.979245] spi-ch341-usb 1-1.1:1.0: ch341_gpio_get_direction: gpio=gpio4 dir=1&lt;br /&gt;
 [20143.979253] spi-ch341-usb 1-1.1:1.0: ch341_gpio_get_direction: gpio=gpio6 dir=1&lt;br /&gt;
 [20143.979260] spi-ch341-usb 1-1.1:1.0: ch341_gpio_get_direction: gpio=err dir=1&lt;br /&gt;
 [20143.979268] spi-ch341-usb 1-1.1:1.0: ch341_gpio_get_direction: gpio=pemp dir=1&lt;br /&gt;
 [20143.979275] spi-ch341-usb 1-1.1:1.0: ch341_gpio_get_direction: gpio=int dir=1&lt;br /&gt;
 [20143.979283] spi-ch341-usb 1-1.1:1.0: ch341_gpio_get_direction: gpio=slct dir=1&lt;br /&gt;
 [20143.979290] spi-ch341-usb 1-1.1:1.0: ch341_gpio_get_direction: gpio=wait dir=1&lt;br /&gt;
 [20143.979298] spi-ch341-usb 1-1.1:1.0: ch341_gpio_get_direction: gpio=autofd dir=1&lt;br /&gt;
 [20143.979306] spi-ch341-usb 1-1.1:1.0: ch341_gpio_get_direction: gpio=addr dir=1&lt;br /&gt;
 [20143.979314] spi-ch341-usb 1-1.1:1.0: ch341_gpio_get_direction: gpio=ini dir=0&lt;br /&gt;
 [20143.979321] spi-ch341-usb 1-1.1:1.0: ch341_gpio_get_direction: gpio=write dir=0&lt;br /&gt;
 [20143.979329] spi-ch341-usb 1-1.1:1.0: ch341_gpio_get_direction: gpio=scl dir=0&lt;br /&gt;
 [20143.979337] spi-ch341-usb 1-1.1:1.0: ch341_gpio_get_direction: gpio=sda dir=0&lt;br /&gt;
 [20143.979831] spi-ch341-usb 1-1.1:1.0: ch341_gpio_probe: registered GPIOs from 496 to 511&lt;br /&gt;
 [20143.981152] spi-ch341-usb 1-1.1:1.0: ch341_gpio_probe: done&lt;br /&gt;
 [20143.981212] spi-ch341-usb 1-1.1:1.0: ch341_gpio_poll_function: start&lt;br /&gt;
 [20143.981291] spi-ch341-usb 1-1.1:1.0: ch341_usb_probe: connected&lt;br /&gt;
 [20144.756250] usbcore: registered new interface driver ch341&lt;br /&gt;
 [20144.756334] usbserial: USB Serial support registered for ch341-uart&lt;br /&gt;
&lt;br /&gt;
With kernel 5.16 and newer the output is shorter:&lt;br /&gt;
&lt;br /&gt;
 $ dmesg&lt;br /&gt;
 [ 6744.813564] usb 1-2.1.1: new full-speed USB device number 21 using xhci_hcd&lt;br /&gt;
 [ 6744.904377] usb 1-2.1.1: New USB device found, idVendor=1a86, idProduct=5512, bcdDevice= 3.04&lt;br /&gt;
 [ 6744.904383] usb 1-2.1.1: New USB device strings: Mfr=0, Product=2, SerialNumber=0&lt;br /&gt;
 [ 6744.904385] usb 1-2.1.1: Product: USB UART-LPT&lt;br /&gt;
 [ 6744.960243] spi-ch341-usb 1-2.1.1:1.0: ch341_cfg_probe: output cs0 SPI slave with cs=0&lt;br /&gt;
 [ 6744.960246] spi-ch341-usb 1-2.1.1:1.0: ch341_cfg_probe: output cs1 SPI slave with cs=1&lt;br /&gt;
 [ 6744.960247] spi-ch341-usb 1-2.1.1:1.0: ch341_cfg_probe: output cs2 SPI slave with cs=2&lt;br /&gt;
 [ 6744.960249] spi-ch341-usb 1-2.1.1:1.0: ch341_cfg_probe: input  gpio4 gpio=0 irq=0 (hwirq)&lt;br /&gt;
 [ 6744.960251] spi-ch341-usb 1-2.1.1:1.0: ch341_cfg_probe: input  gpio5 gpio=1 irq=1&lt;br /&gt;
 [ 6744.960302] spi-ch341-usb 1-2.1.1:1.0: ch341_spi_probe: SPI master connected to SPI bus 0&lt;br /&gt;
 [ 6744.960350] spi-ch341-usb 1-2.1.1:1.0: ch341_spi_probe: SPI device /dev/spidev0.0 created&lt;br /&gt;
 [ 6744.960398] spi-ch341-usb 1-2.1.1:1.0: ch341_spi_probe: SPI device /dev/spidev0.1 created&lt;br /&gt;
 [ 6744.960445] spi-ch341-usb 1-2.1.1:1.0: ch341_spi_probe: SPI device /dev/spidev0.2 created&lt;br /&gt;
 [ 6744.960583] spi-ch341-usb 1-2.1.1:1.0: ch341_usb_probe: connected&lt;br /&gt;
&lt;br /&gt;
=== Driver development === &lt;br /&gt;
=====Kernels 5.14 and older=====&lt;br /&gt;
&lt;br /&gt;
Once the module ''spi-ch341-usb'' is correctly loaded, here's how you can transfer data on the SPI bus (in C):&lt;br /&gt;
&lt;br /&gt;
 /* Open the SPI bus */&lt;br /&gt;
 int spi = open(&amp;quot;/dev/spidev1.0&amp;quot;, O_RDWR);&lt;br /&gt;
 uint8_t mmode = SPI_MODE_0;&lt;br /&gt;
 uint8_t lsb = 0;&lt;br /&gt;
 ioctl(spi, SPI_IOC_WR_MODE, &amp;amp;mmode);&lt;br /&gt;
 ioctl(spi, SPI_IOC_WR_LSB_FIRST, &amp;amp;lsb);&lt;br /&gt;
 &lt;br /&gt;
 /* Transfer data */&lt;br /&gt;
 /* TODO: Init buffer_out, buffer_in and size */&lt;br /&gt;
 const uint8_t *mosi = buffer_out; // output data&lt;br /&gt;
 uint8_t *miso = buffer_in; // input data&lt;br /&gt;
 &lt;br /&gt;
 struct spi_ioc_transfer spi_trans;&lt;br /&gt;
 memset(&amp;amp;spi_trans, 0, sizeof(spi_trans));&lt;br /&gt;
 &lt;br /&gt;
 spi_trans.tx_buf = (unsigned long) mosi;&lt;br /&gt;
 spi_trans.rx_buf = (unsigned long) miso;&lt;br /&gt;
 spi_trans.cs_change = true;&lt;br /&gt;
 spi_trans.len = size;&lt;br /&gt;
 &lt;br /&gt;
 int status = ioctl (spi, SPI_IOC_MESSAGE(1), &amp;amp;spi_trans);&lt;br /&gt;
&lt;br /&gt;
To access GPIOs, you first need to export them (to make them accessible via ''/sys/class/gpio''. As you can see in the dmesg output, GPIOs from 496 to 511 were registered, which means we can export 16 GPIOs. The mapping of these I/O is available in the [https://github.com/rogerjames99/spi-ch341-usb/blob/master/spi-ch341-usb.c#L148 source code of the driver]. For example, pin ''slct'' is the 12th, meaning we need to export GPIO 496+12 = 508.&lt;br /&gt;
&lt;br /&gt;
 int  fd;&lt;br /&gt;
 if ((fd = open(&amp;quot;/sys/class/gpio/export&amp;quot;, O_WRONLY)) == -1)   {&lt;br /&gt;
   perror(&amp;quot;open ini&amp;quot;);&lt;br /&gt;
   exit(-1);&lt;br /&gt;
 }&lt;br /&gt;
 &lt;br /&gt;
 if (write(fd, &amp;quot;508&amp;quot;, 3) == -1){&lt;br /&gt;
   perror (&amp;quot;write export 508&amp;quot;);&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
Once exported, the GPIO is available in ''/sys/class/gpio/sclt'' (the naming is specified by the driver). You can read the pin in C:&lt;br /&gt;
&lt;br /&gt;
 int  fd;&lt;br /&gt;
 if ((fd = open(&amp;quot;/sys/class/gpio/slct/value&amp;quot;, O_RDWR)) == -1)   {&lt;br /&gt;
   perror(&amp;quot;open&amp;quot;);&lt;br /&gt;
 }&lt;br /&gt;
 &lt;br /&gt;
 char buf;&lt;br /&gt;
 if (read(fd, &amp;amp;buf, 1) == -1) {&lt;br /&gt;
    perror(&amp;quot;read&amp;quot;);&lt;br /&gt;
 }&lt;br /&gt;
 &lt;br /&gt;
 int value = (buf == '0') ? 0 : 1;&lt;br /&gt;
&lt;br /&gt;
You can also write it:&lt;br /&gt;
&lt;br /&gt;
 int  fd; &lt;br /&gt;
 if ((fd = open(&amp;quot;/sys/class/gpio/ini/value&amp;quot;, O_RDWR)) == -1)   {&lt;br /&gt;
   perror(&amp;quot;open ini&amp;quot;);&lt;br /&gt;
 }&lt;br /&gt;
 &lt;br /&gt;
 if (write(fd, value ? &amp;quot;1&amp;quot; : &amp;quot;0&amp;quot;, 1) == -1) {&lt;br /&gt;
    perror (&amp;quot;write&amp;quot;);&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
=====Kernel 5.15 and newer=====&lt;br /&gt;
&lt;br /&gt;
We need some help documenting how these interfaces work!&lt;br /&gt;
&lt;br /&gt;
The driver creates these interfaces:&lt;br /&gt;
 {| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
  |Pin  ||SPI Function ||GPIO function ||GPIO name ||IRQ&lt;br /&gt;
  |-&lt;br /&gt;
  |15||CS0||-||-||-&lt;br /&gt;
  |-&lt;br /&gt;
  |16||CS1||-||-||-&lt;br /&gt;
  |-&lt;br /&gt;
  |17||CS2||-||-||-&lt;br /&gt;
  |-&lt;br /&gt;
  |19||-||Input||gpio4||hardware&lt;br /&gt;
  |-&lt;br /&gt;
  |21||-||Input||gpio5||software&lt;br /&gt;
 |}&lt;br /&gt;
&lt;br /&gt;
The dimich-dmb fork of spi-ch341-usb works with 5.15+ kernels, but as you can see above it is not configured for the needs of the Pinedio-USB by default. I have started a branch in my fork to work on getting the driver pre-configured for our needs. The branch can be [https://github.com/UncleGrumpy/spi-ch341-usb/tree/pinedio found here.] Please feel free to help! And open issues or discussions in the repo if you have problems or ideas how to help. Any improvements to the actual code beyond configuration should be pushed to the temporary [https://github.com/dimich-dmb/spi-ch341-usb/ upstream.]&lt;br /&gt;
&lt;br /&gt;
Since linux-5.15 binding to spidev driver is required to make slave devices available via /dev/, e.g. for slave 1 on bus 0 as real root (not with sudo):&lt;br /&gt;
&lt;br /&gt;
 # echo spidev &amp;gt; /sys/class/spi_master/spi0/spi0.1/driver_override&lt;br /&gt;
 # echo spi0.1 &amp;gt; /sys/bus/spi/drivers/spidev/bind&lt;br /&gt;
&lt;br /&gt;
For all devices handled by spi_ch341_usb driver (again, only as real root):&lt;br /&gt;
&lt;br /&gt;
 # for i in /sys/bus/usb/drivers/spi-ch341-usb/*/spi_master/spi*/spi*.*; do echo spidev &amp;gt; $i/driver_override; echo $(basename $i) &amp;gt; /sys/bus/spi/drivers/spidev/bind; done&lt;br /&gt;
&lt;br /&gt;
The documentation found at https://github.com/dimich-dmb/spi-ch341-usb/blob/master/README.md has more information.&lt;br /&gt;
&lt;br /&gt;
The 5.15+ driver is not ready yet. But if you are interested in testing, helping to get the configuration right, or working on application development you can build and test the current driver:&lt;br /&gt;
&lt;br /&gt;
 $ git clone -b pinedio https://github.com/UncleGrumpy/spi-ch341-usb.git &lt;br /&gt;
 $ cd spi-ch341-usb&lt;br /&gt;
 $ make&lt;br /&gt;
 $ sudo make install&lt;br /&gt;
&lt;br /&gt;
So far this will automatically set up the SPI slave device /dev/spi0.0. It names the ch341-usb device as &amp;quot;pinedio&amp;quot; this will allow application developers to find the correct gpiochip by name. I need help confirming the correct gpio pins but as of now the driver will setup the following configuration:&lt;br /&gt;
&lt;br /&gt;
The driver uses following CH341A pins for the SPI interface. &lt;br /&gt;
 {| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
  | Pin || Name || Direction || Function SPI (CH341A)&lt;br /&gt;
  |-&lt;br /&gt;
  | 18  || D3   || output    || SCK (DCK)             &lt;br /&gt;
  |-&lt;br /&gt;
  | 20  || D5   || output    || MOSI (DOUT)           &lt;br /&gt;
  |-&lt;br /&gt;
  | 22  || D7   || input     || MISO (DIN)            &lt;br /&gt;
  |-&lt;br /&gt;
  | 15  || D0   || output    || CS0                   &lt;br /&gt;
 |}&lt;br /&gt;
&lt;br /&gt;
The driver uses the following GPIO configuration.  I am not at all sure these are the correct pins to use! This is one area that I could really use some help with!!!&lt;br /&gt;
 {| class=&amp;quot;wikitable&lt;br /&gt;
  | CH341 Pin || CH341A Name || Function   || GPIO Name  || GPIO Configuration || SX1262 connection&lt;br /&gt;
  |-&lt;br /&gt;
  |  7        || INT#        || IRQ        || dio_irq    || Output             || DIO1 (IRQ)        &lt;br /&gt;
  |-&lt;br /&gt;
  |  8        || SLCT        || BUSY       || dio_busy   || Input              || BUSY              &lt;br /&gt;
  |-&lt;br /&gt;
  | 26        || RST#        || Hard Reset || dio_reset  || Output             || NRESET            &lt;br /&gt;
 |}&lt;br /&gt;
&lt;br /&gt;
The function of these pins can be changed from user space by using libgpiod. The command line tools installed with the library (gpioset, gpioget, gpiodetect, gpioinfo...) can be used for bash scripts, etc. and applications should all use the libgpiod interfaces. The /sys/class/gpio interface has been removed from the kernel in 5.15, so any apps using /sys/class/gpio to access gpio pins are broken, or will be as distos update their kernels to 5.15 and beyond.&lt;br /&gt;
&lt;br /&gt;
GPIO pins can be listed with gpioinfo:&lt;br /&gt;
 $ gpioinfo pinedio&lt;br /&gt;
&lt;br /&gt;
The output should look similar to:&lt;br /&gt;
 gpiochip1 - 3 lines:&lt;br /&gt;
         line   0:    &amp;quot;dio_irq&amp;quot;       unused   input  active-high&lt;br /&gt;
         line   1:   &amp;quot;dio_busy&amp;quot;       unused   input  active-high&lt;br /&gt;
         line   2:  &amp;quot;dio_reset&amp;quot;       unused  output  active-high&lt;br /&gt;
&lt;br /&gt;
The gpiochip# might be different.  The driver exposes the Pinedio with the gpio name &amp;quot;pinedio&amp;quot;, developers should use this name to interact with the gpiochip because the gpiochip# of the device is likely to be different from one system to the next, or depending on the order devices are initialized.&lt;br /&gt;
&lt;br /&gt;
=== Driver for the SX1262 LoRa module ===&lt;br /&gt;
Now that we can talk to the SX1262 via the CH341 USB converter chip, we need to send actual commands to make it emit or receive LoRa messages. To do this, you can implement the driver yourself using info from the datasheet, or use an existing driver (you can easily find drivers for the Arduino framework, for example. &lt;br /&gt;
I found [https://github.com/YukiWorkshop/sx126x_driver this C++ driver]. It's well written, lightweight and easily portable across many platforms. All you have to do is implement 3 HAL function : read GPIO, write GPIO and transfer data on SPI. I wrote a quick'n'dirty app that emits a LoRa frame. It's [https://gist.github.com/JF002/f1af5595874942427eea9d375c18fc73 available here]. &lt;br /&gt;
&lt;br /&gt;
As I don't have any 'raw' LoRa device on hands, I check that it was actually transmitting something using my SDR setup (simple TNT usb key and '''Gqrx''' software):&lt;br /&gt;
&lt;br /&gt;
[[File:pine64-lora-usb-adapter-sdr.png|500px]]&lt;br /&gt;
&lt;br /&gt;
== Other end nodes ==&lt;br /&gt;
&lt;br /&gt;
There are several end-node units planned:&lt;br /&gt;
* loRa back case for the PinePhone&lt;br /&gt;
* standalone USB dongle-type end-node adapter&lt;br /&gt;
* PineTab adapter&lt;br /&gt;
* as well as a SPI module (which can also be configured as a USB LoRa dongle)&lt;br /&gt;
* a LoRa stick powered by a single 18650 battery (using the [https://wiki.pine64.org/wiki/Nutcracker BL602], and can be fitted with GPS, an low-power OLED panel and additional sensors)&lt;br /&gt;
&lt;br /&gt;
All the end-nodes use the SX1262 chip. &lt;br /&gt;
&lt;br /&gt;
=== Pictures ===&lt;br /&gt;
&amp;lt;gallery&amp;gt;&lt;br /&gt;
File:Blog-april-USB-LoRa-1024x655.jpg&lt;br /&gt;
File:Blog-april-LoRa-something-839x1024.jpg&lt;br /&gt;
File:Discord_20210421_lora_usb_closeup.jpg&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Datasheets and schematics ==&lt;br /&gt;
=== Gateway ===&lt;br /&gt;
* [https://www.semtech.com/products/wireless-rf/lora-gateways/sx1302 SX1302 datasheets and resources]&lt;br /&gt;
* [https://docs.rakwireless.com/Product-Categories/WisLink/RAK2247/Overview/ RAK2287 datasheets and resources]&lt;br /&gt;
* [https://wiki.pine64.org/images/5/54/PINE64_LoRa_Gateway_Module_Adapter_Schematic-v1.0-20210308.pdf Pine64 LoRa Gateway module adapter schematic]&lt;br /&gt;
&lt;br /&gt;
=== End nodes ===&lt;br /&gt;
* [https://www.semtech.com/products/wireless-rf/lora-transceivers/sx1262 SX1262 datasheets and resources]&lt;br /&gt;
&lt;br /&gt;
=== Pinephone backplate ===&lt;br /&gt;
* [[File:Pinephone_LoRa_BackPanel_Schematic-v1.0-20210402.pdf]]&lt;br /&gt;
* [[File:CA-S01_LoRa_Chip_Antenna_in_Chinese.pdf]]&lt;br /&gt;
* [https://github.com/zschroeder6212/tiny-i2c-spi I2C SPI Bridge code running on ATtiny84]&lt;br /&gt;
&lt;br /&gt;
=== USB LoRa adapter ===&lt;br /&gt;
* [[File:USB_LoRa_adapter-PINE64_RFM90_SCH_2021_04_26.pdf]]&lt;br /&gt;
* CH341 datasheet : [[File:CH341DS1.pdf]]&lt;br /&gt;
* Semtech SX1262 datasheet : [https://semtech.my.salesforce.com/sfc/p/#E0000000JelG/a/2R000000HT76/7Nka9W5WgugoZe.xwIHJy6ebj1hW8UJ.USO_Pt2CLLo File on Semtech website (file is too big for the wiki)]&lt;br /&gt;
&lt;br /&gt;
=== PineDio Stack ===&lt;br /&gt;
* Schematic : [[File:PINEDIO_STACK_V1_0-2021_05_24C.pdf]]&lt;br /&gt;
&lt;br /&gt;
== Other resources ==&lt;br /&gt;
* [https://www.youtube.com/watch?v=cJ0wpANpbyc Video: A peek at Pine64's LoRa gateway and modules]&lt;br /&gt;
* [https://iotw.io/ IOTW - Blockchain-Enabled IoT Data Platform]&lt;br /&gt;
* [https://lupyuen.github.io/articles/pinedio PineDio Stack BL604 RISC-V Board: Testing The Prototype]&lt;br /&gt;
* [https://lupyuen.github.io/articles/lorawan2 LoRaWAN on PineDio Stack BL604 RISC-V Board]&lt;br /&gt;
* [https://lupyuen.github.io/articles/ttn The Things Network on PineDio Stack BL604 RISC-V Board]&lt;br /&gt;
* [https://lupyuen.github.io/articles/prometheus Monitor IoT Devices in The Things Network with Prometheus and Grafana]&lt;br /&gt;
* [https://lupyuen.github.io/articles/tsen Internal Temperature Sensor on BL602]&lt;br /&gt;
* [https://lupyuen.github.io/articles/roblox IoT Digital Twin with Roblox and The Things Network]&lt;br /&gt;
* [https://lupyuen.github.io/articles/gateway PineDio LoRa Gateway: Testing The Prototype]&lt;br /&gt;
* [https://lupyuen.github.io/articles/nuttx Apache NuttX OS on RISC-V BL602 and BL604]&lt;br /&gt;
* [https://lupyuen.github.io/articles/spi2 SPI on Apache NuttX OS]&lt;br /&gt;
* [https://lupyuen.github.io/articles/sx1262 LoRa SX1262 on Apache NuttX OS]&lt;br /&gt;
* [https://lupyuen.github.io/articles/lorawan3 LoRaWAN on Apache NuttX OS]&lt;br /&gt;
* [https://lupyuen.github.io/articles/rust2 Rust on Apache NuttX OS]&lt;br /&gt;
* [https://lupyuen.github.io/articles/ikea Connect IKEA Air Quality Sensor to Apache NuttX OS]&lt;br /&gt;
* [https://lupyuen.github.io/articles/pinedio2 PineDio Stack BL604 runs Apache NuttX RTOS]&lt;br /&gt;
* [https://lupyuen.github.io/articles/touch NuttX Touch Panel Driver for PineDio Stack BL604]&lt;br /&gt;
* [https://www.robertlipe.com/buttons-on-bl602-nuttx/ Buttons on BL602 NuttX]&lt;br /&gt;
* [https://lupyuen.github.io/articles/expander NuttX GPIO Expander for PineDio Stack BL604]&lt;br /&gt;
* [https://lupyuen.github.io/articles/auto2 (Mostly) Automated Testing of Apache NuttX RTOS on PineDio Stack BL604 RISC-V Board]&lt;/div&gt;</summary>
		<author><name>Lupyuen</name></author>
	</entry>
	<entry>
		<id>https://wiki.pine64.org/index.php?title=PineCone&amp;diff=12970</id>
		<title>PineCone</title>
		<link rel="alternate" type="text/html" href="https://wiki.pine64.org/index.php?title=PineCone&amp;diff=12970"/>
		<updated>2022-05-02T09:07:38Z</updated>

		<summary type="html">&lt;p&gt;Lupyuen: Add article &amp;quot;Buttons on BL602 NuttX&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[File:Pine64_BL602_EVB_photo-3-small.jpg|thumb|PineCone BL602 EVB (Evaluation Board)]]&lt;br /&gt;
&lt;br /&gt;
The '''PineCone''' is a BL602 evaluation board, which was developed with the goal to challenge the open source community to achieve blob-free and free and open source WiFi and Bluetooth, see the [https://www.pine64.org/2020/10/28/nutcracker-challenge-blob-free-wifi-ble/ Nutcracker Challenge].&lt;br /&gt;
&lt;br /&gt;
== BL602 Specifications ==&lt;br /&gt;
* '''CPU:''' 32-bit RV32IMAFC RISC-V “SiFive E24 Core”&lt;br /&gt;
** [https://www.sifive.com/cores/e24 SiFive E24 Core information]&lt;br /&gt;
* '''Memory:'''&lt;br /&gt;
** 128KB ROM&lt;br /&gt;
** 276KB SRAM&lt;br /&gt;
** 1Kb eFuse&lt;br /&gt;
** 2MB Embedded Flash&lt;br /&gt;
* '''Security:'''&lt;br /&gt;
** Secure boot&lt;br /&gt;
** Secure debug&lt;br /&gt;
** AES 128/192/256&lt;br /&gt;
** SHA-1/224/256&lt;br /&gt;
** TRNG (True Random Number Generator)&lt;br /&gt;
** PKA (Public Key Accelerator)&lt;br /&gt;
* '''Wireless:'''&lt;br /&gt;
** Wi-Fi 802.11 b/g/n&lt;br /&gt;
** Bluetooth® Low Energy 5.0&lt;br /&gt;
** Wi-Fi Fast connection with BLE assistance&lt;br /&gt;
** Wi-Fi and BLE coexistence&lt;br /&gt;
** Wi-Fi Security WPS/WEP/WPA/WPA2/WPA3&lt;br /&gt;
** STA, SoftAP and sniffer modes&lt;br /&gt;
** Multi-Cloud connectivity&lt;br /&gt;
** 2.4 GHz RF transceiver&lt;br /&gt;
** Integrated RF balun, PA/LNA&lt;br /&gt;
* '''Package Type:'''&lt;br /&gt;
** 32 pin QFN 4mm x 4mm&lt;br /&gt;
* JTAG support (See below for BL602 impact)&lt;br /&gt;
&lt;br /&gt;
[[File:BL602_Block_Diagram.jpg|600px]]&lt;br /&gt;
&lt;br /&gt;
== JTAG ==&lt;br /&gt;
{| class=&amp;quot;wikitable floatright&amp;quot;&lt;br /&gt;
|+ Default JTAG pins&lt;br /&gt;
|-&lt;br /&gt;
| GPIO Pin || JTAG Pin&lt;br /&gt;
|-&lt;br /&gt;
| GPIO17 || TDI&lt;br /&gt;
|-&lt;br /&gt;
| GPIO11 || TDO&lt;br /&gt;
|-&lt;br /&gt;
| GPIO12 || TMS&lt;br /&gt;
|-&lt;br /&gt;
| GPIO14 || TCK&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
BL602 multiplexes four GPIO pins to provide the familiar JTAG lines. See the accompanying table for the default pin mappings.&lt;br /&gt;
&lt;br /&gt;
These are the default JTAG pins in use after a cold boot. However, many pieces of software, including the demo that's installed by default on new PineCones, remap these pins to other functions. You cannot use the default wiring for JTAG while such software is running. This issue is especially prevalent on the PineCone because three of the default JTAG pins are connected to the onboard RGB LED. Nothing about the LED itself interferes with JTAG, but any program that uses the LED will necessarily remap some of the default JTAG pins to be GPIO.&lt;br /&gt;
&lt;br /&gt;
The MaskROM download mode that the BL602 enters when you tie GPIO8 high does '''not''' remap the default JTAG pins, and so you can and should use that mode while checking basic functionality of your JTAG adapter.&lt;br /&gt;
&lt;br /&gt;
Note that, just as software can remap the default JTAG pins to be something else, it can also remap other pins to be JTAG. Control over this is quite granular, with 5-6 candidate pins for each individual JTAG signal that can be mapped independently of one another. LEE Lup Yuen has written some [https://lupyuen.github.io/articles/openocd#free-the-led-from-jtag-port sample code] showing how to remap the JTAG pins so that your software can use the LED without giving up support for debugging.&lt;br /&gt;
&lt;br /&gt;
== Pine64 USB JTAG Adapter information and schematics ==&lt;br /&gt;
* [https://files.pine64.org/doc/Pinenut/PINE64%20USB%20JTAG%20Adapter%20Schematic-20201215.pdf PINE64 USB JTAG Adapter schematic 20202018 1.0]&lt;br /&gt;
* [[:File:PINE64_USB_JTAG_Adapter_Schematic_ver_1.0a-20210109.pdf|PINE64 USB JTAG Adapter schematic 20210109 1.0a]]&lt;br /&gt;
&lt;br /&gt;
== PineCone BL602 EVB information and schematics ==&lt;br /&gt;
* Approximate dimensions: 26mm x 43mm&lt;br /&gt;
* Board layout:&lt;br /&gt;
[[File:PADI-II_EVB.png]]&lt;br /&gt;
* [https://files.pine64.org/doc/Pinenut/Pine64%20BL602%20EVB%20Schematic%20ver%201.1.pdf PineCone BL602 EVB schematic ver 1.1]&lt;br /&gt;
** Note: In PineCone revision 1.1 (&amp;quot;BL62B_EVB V1.1&amp;quot; silkscreened on back of board), CC1 and CC2 share one 5.1KΩ resistor. This means the board will fail to power when you use an e-marked USB-C cable like the one that comes with Apple chargers. See [https://medium.com/@leung.benson/how-to-design-a-proper-usb-c-power-sink-hint-not-the-way-raspberry-pi-4-did-it-f470d7a5910 this article] for details of why this happens. The next schematic design will give each line its own 5.1KΩ resistor as per the USB-C specification.&lt;br /&gt;
* The board uses a CH340 Serial/USB adapter. This chip is commonly used in Arduino-class development boards. It is a full speed (12Mbps) USB interface and has vendor ID 0x1a86 with product ID 0x7523.&lt;br /&gt;
* The GPIO pins (11, 12, 14, 17) plus the nearby RESET, POWER, and GND pins are all located on one side of the board, on J1 to provide JTAG connection.&lt;br /&gt;
&lt;br /&gt;
== Pinenut-01S Module information and schematics ==&lt;br /&gt;
[[File:Pinenut-01S_PCB-Front.png|225px]][[File:Pinenut-01S_PCB-Back.png|225px]]&lt;br /&gt;
* [https://files.pine64.org/doc/Pinenut/Pinenut-01S%20V1.01%20SCH.pdf Pinenut-01S schematic ver 1.01]&lt;br /&gt;
* [https://wiki.pine64.org/images/6/6b/PineNut-01S_v1.01_KiCad.zip PineNut-01S KiCad schematic ver 1.01]&lt;br /&gt;
* [https://files.pine64.org/doc/Pinenut/NUT-01S%20GPIO%20Definition%20ver%201.0.pdf Pinenut-01S GPIO Definition ver 1.0]&lt;br /&gt;
* [https://files.pine64.org/doc/Pinenut/USB%20Adapter%20for%20Pinenut-01S%20Schematic%20V1.0.pdf USB Programmer adapter for Pinenut-01S schematic ver 1.0]&lt;br /&gt;
* The default firmware runs the UART at 2000000 bps.  It will accept input whilst regularly outputting:&amp;lt;code&amp;gt;&amp;lt;br/&amp;gt;proc_hellow_entry: RISC-V rv32imafc&amp;lt;br/&amp;gt;cur key status:1&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Pinenut-12S Module information ==&lt;br /&gt;
[[File:NUT-12S_module-front.jpg|200px]][[File:NUT-12S_module-back.jpg|200px]]&lt;br /&gt;
* [https://files.pine64.org/doc/Pinenut/NUT-12S%20GPIO%20Definition%20ver%201.0.pdf Pinenut-12S GPIO Definition ver 1.0]&lt;br /&gt;
* Onboard LED is connected to IO0&lt;br /&gt;
&lt;br /&gt;
== Datasheets for components and peripherals ==&lt;br /&gt;
* Bouffalo BL-602 SoC information:&lt;br /&gt;
** [https://github.com/bouffalolab/bl_docs Bouffalo Lab's official bl_docs repository]: should always contain the latest SoC documentation available, in PDF, HTML, and reStructuredText source forms.&lt;br /&gt;
** [https://github.com/pine64/bl602-docs/tree/main/mirrored PINE64's bl602-docs repository]: contains an archive of all historical datasheets and reference manual PDFs but may lag behind Bouffalo's official repository. If you notice that it is, please submit a pull request!&lt;br /&gt;
* USB/Serial adapter:&lt;br /&gt;
** [https://cdn.sparkfun.com/datasheets/Dev/Arduino/Other/CH340DS1.PDF CH340 serial converter]&lt;br /&gt;
&lt;br /&gt;
== Misc notes ==&lt;br /&gt;
Planned to be available in at least three form factors:&lt;br /&gt;
* NUT-01S -&amp;gt; ESP-01S&lt;br /&gt;
* NUT-12S -&amp;gt; ESP-12S&lt;br /&gt;
* NUT-15 -&amp;gt; RTL8723/AMPAK&lt;br /&gt;
&lt;br /&gt;
== Loading code ==&lt;br /&gt;
To load code, you must move the jumper to the position closest to the edge, press reset, load the code, move the jumper back toward the center of the board, and press reset again.&lt;br /&gt;
&lt;br /&gt;
There are currently a number of loaders in progress, each with differing degrees of completeness and success on various operating systems.&lt;br /&gt;
* In the build tree, there is BLFlashCube for Windows, which is a proprietary GUI for flashing images. Linux and macOS binaries are available via [https://dev.bouffalolab.com/download Bouffalo Lab's developer portal].&lt;br /&gt;
* [https://github.com/stschake/bl60x-flash bl60x-flash] is in Python and has been reported successful on MacOS catalina (10.15.6) by Punnerud and madushan1000.&lt;br /&gt;
* [https://github.com/bouffalolab/BLOpenFlasher BLOpenFlasher] is a WIP, written in go, by Bouffalo Labs to provide source for a flash utility.&lt;br /&gt;
* [https://github.com/renzenicolai/bl602tool bl602tool] is a Python utility in development.&lt;br /&gt;
* &amp;lt;del&amp;gt;[https://pypi.org/project/bflb-eflash-loader/ Bouffalo's Python Flash Loader] is a new (Dec 20) flash loader by the makers of the chip.&amp;lt;/del&amp;gt;&lt;br /&gt;
* &amp;lt;del&amp;gt;[https://pypi.org/project/bflb-image-build/ Bouffalo's image build] smooshes code and adds headers for downloads.&amp;lt;/del&amp;gt;&lt;br /&gt;
* [https://pypi.org/project/bflb-mcu-tool/ Bouffalo's MCU tool] (Mar 2021) Python image tool replaced both of the above. Now combined with eflash loader, deals with partitions, DTS, signing, fuses etc.&lt;br /&gt;
* [https://github.com/spacemeowx2/blflash blflash serial flasher] BL602 serial flasher, inspired by BLOpenFlasher&lt;br /&gt;
&lt;br /&gt;
== Development efforts ==&lt;br /&gt;
* [https://github.com/pine64/bl_iot_sdk PineCone BL602 GitHub Page (PINE64 fork)] has compilers, linkers, and all the code to build on Windows, Linux (x86_64), and MacOS.&lt;br /&gt;
* [https://github.com/bouffalolab/bl_iot_sdk Bouffalo Lab GitHub Page]&lt;br /&gt;
* [https://github.com/renzenicolai/bl602-docs/ BL602 Developer organize documentation GitHub Page]&lt;br /&gt;
* [https://github.com/renzenicolai/bl602tool BL602 Developer organize tool GitHub Page]&lt;br /&gt;
* [https://github.com/stschake/bl60x-flash Programming tool for Bouffalo Labs BL602/BL604 chips]&lt;br /&gt;
* [https://github.com/pine64/bl602-re BL602 reverse engineering working group]&lt;br /&gt;
* [https://github.com/pine64/bl602-sdio-linux Linux kernel module]&lt;br /&gt;
* [https://github.com/tchebb/bl602-docs BL602 Documentation]&lt;br /&gt;
* [https://github.com/spacemeowx2/blflash BL602 serial flasher]&lt;br /&gt;
* [https://github.com/mkroman/awesome-bouffalo#feature-matrix Awesome Bouffalo]&lt;br /&gt;
&lt;br /&gt;
== Articles and Blogs ==&lt;br /&gt;
* [https://lupyuen.github.io/articles/pinecone Quick Peek of PineCone BL602 RISC-V Evaluation Board by Lup Yuen]&lt;br /&gt;
* [https://maero.dk/bl602-firmware-image-format/ Documenting the BouffaloLab BL602 firmware image format by MK]&lt;br /&gt;
* [https://lupyuen.github.io/articles/openocd Connect PineCone BL602 to OpenOCD by Lup Yuen]&lt;br /&gt;
* [https://lupyuen.github.io/articles/debug Debug Rust on PineCone BL602 with VSCode and GDB by Lup Yuen]&lt;br /&gt;
* [https://lupyuen.github.io/articles/mynewt Porting Mynewt to PineCone BL602 by Lup Yuen]&lt;br /&gt;
* [https://lupyuen.github.io/articles/flash Flashing Firmware to PineCone BL602 by Lup Yuen]&lt;br /&gt;
* [https://lupyuen.github.io/articles/led Control PineCone BL602 RGB LED with GPIO and PWM by Lup Yuen]&lt;br /&gt;
* [https://lupyuen.github.io/articles/gpio Mynewt GPIO ported to PineCone BL602 RISC-V Board by Lup Yuen]&lt;br /&gt;
* [https://lupyuen.github.io/articles/i2c PineCone BL602 talks to I2C Sensors by Lup Yuen]&lt;br /&gt;
* [https://lupyuen.github.io/articles/spi PineCone BL602 talks SPI too! by Lup Yuen]&lt;br /&gt;
* [https://lupyuen.github.io/articles/display PineCone BL602 Blasting Pixels to ST7789 Display with LVGL Library by Lup Yuen]&lt;br /&gt;
* [https://lupyuen.github.io/articles/uart PineCone BL602 Talks UART to Grove E-Ink Display by Lup Yuen]&lt;br /&gt;
* [https://lupyuen.github.io/articles/book The RISC-V BL602 Book by Lup Yuen]&lt;br /&gt;
* [https://lupyuen.github.io/articles/lora Connect PineCone BL602 to LoRa Transceiver by Lup Yuen]&lt;br /&gt;
* [https://lupyuen.github.io/articles/wisblock RAKwireless WisBlock talks LoRa with PineCone BL602 RISC-V Board by Lup Yuen]&lt;br /&gt;
* [https://lupyuen.github.io/articles/lora2 PineCone BL602 RISC-V Board Receives LoRa Packets by Lup Yuen]&lt;br /&gt;
* [https://lupyuen.github.io/articles/rust Run Rust RISC-V Firmware with BL602 IoT SDK by Lup Yuen]&lt;br /&gt;
* [https://lupyuen.github.io/articles/lorawan PineCone BL602 Talks LoRaWAN by Lup Yuen]&lt;br /&gt;
* [https://lupyuen.github.io/articles/lisp uLisp and Blockly on PineCone BL602 RISC-V Board by Lup Yuen]&lt;br /&gt;
* [https://lupyuen.github.io/articles/wasm Simulate RISC-V BL602 with WebAssembly, uLisp and Blockly by Lup Yuen]&lt;br /&gt;
* [https://lupyuen.github.io/articles/boot BL602 Bootloader by Lup Yuen]&lt;br /&gt;
* [https://lupyuen.github.io/articles/tflite Machine Learning on RISC-V BL602 with TensorFlow Lite by Lup Yuen]&lt;br /&gt;
* [https://lupyuen.github.io/articles/wifi Reverse Engineering WiFi on RISC-V BL602 by Lup Yuen]&lt;br /&gt;
* [https://lupyuen.github.io/articles/adc Rust on RISC-V BL602: Is It Sunny? by Lup Yuen]&lt;br /&gt;
* [https://lupyuen.github.io/articles/rustsim Rust on RISC-V BL602: Simulated with WebAssembly by Lup Yuen]&lt;br /&gt;
* [https://lupyuen.github.io/articles/pinedio PineDio Stack BL604 RISC-V Board: Testing The Prototype by Lup Yuen]&lt;br /&gt;
* [https://lupyuen.github.io/articles/rhai Rust on RISC-V BL602: Rhai Scripting by Lup Yuen]&lt;br /&gt;
* [https://lupyuen.github.io/articles/lorawan2 LoRaWAN on PineDio Stack BL604 RISC-V Board by Lup Yuen]&lt;br /&gt;
* [https://lupyuen.github.io/articles/ttn The Things Network on PineDio Stack BL604 RISC-V Board by Lup Yuen]&lt;br /&gt;
* [https://lupyuen.github.io/articles/cbor Encode Sensor Data with CBOR on BL602 by Lup Yuen]&lt;br /&gt;
* [https://lupyuen.github.io/articles/roblox IoT Digital Twin with Roblox and The Things Network by Lup Yuen]&lt;br /&gt;
* [https://lupyuen.github.io/articles/tsen Internal Temperature Sensor on BL602 by Lup Yuen]&lt;br /&gt;
* [https://lupyuen.github.io/articles/payload CBOR Payload Formatter for The Things Network by Lup Yuen]&lt;br /&gt;
* [https://lupyuen.github.io/articles/prometheus Monitor IoT Devices in The Things Network with Prometheus and Grafana by Lup Yuen]&lt;br /&gt;
* [https://lupyuen.github.io/articles/nuttx Apache NuttX OS on RISC-V BL602 and BL604 by Lup Yuen]&lt;br /&gt;
* [https://lupyuen.github.io/articles/spi2 SPI on Apache NuttX OS by Lup Yuen]&lt;br /&gt;
* [https://lupyuen.github.io/articles/sx1262 LoRa SX1262 on Apache NuttX OS by Lup Yuen]&lt;br /&gt;
* [https://lupyuen.github.io/articles/lorawan3 LoRaWAN on Apache NuttX OS by Lup Yuen]&lt;br /&gt;
* [https://lupyuen.github.io/articles/rust2 Rust on Apache NuttX OS by Lup Yuen]&lt;br /&gt;
* [https://lupyuen.github.io/articles/auto Auto Flash and Test NuttX on RISC-V BL602 by Lup Yuen]&lt;br /&gt;
* [https://lupyuen.github.io/articles/loader BL602 EFlash Loader: Reverse Engineered with Ghidra by Lup Yuen]&lt;br /&gt;
* [https://lupyuen.github.io/articles/ikea Connect IKEA Air Quality Sensor to Apache NuttX OS by Lup Yuen]&lt;br /&gt;
* [https://lupyuen.github.io/articles/bme280 Apache NuttX Driver for BME280 Sensor: Ported from Zephyr OS by Lup Yuen]&lt;br /&gt;
* [https://lupyuen.github.io/articles/rusti2c Rust talks I2C on Apache NuttX RTOS by Lup Yuen]&lt;br /&gt;
* [https://lupyuen.github.io/articles/st7789 ST7789 Display with LVGL Graphics on Apache NuttX RTOS by Lup Yuen]&lt;br /&gt;
* [https://lupyuen.github.io/articles/pinedio2 PineDio Stack BL604 runs Apache NuttX RTOS by Lup Yuen]&lt;br /&gt;
* [https://lupyuen.github.io/articles/touch NuttX Touch Panel Driver for PineDio Stack BL604 by Lup Yuen]&lt;br /&gt;
* [https://www.robertlipe.com/buttons-on-bl602-nuttx/ Buttons on BL602 NuttX]&lt;br /&gt;
* [https://lupyuen.github.io/articles/expander NuttX GPIO Expander for PineDio Stack BL604 by Lup Yuen]&lt;br /&gt;
&lt;br /&gt;
[[Category:Nutcracker]]&lt;/div&gt;</summary>
		<author><name>Lupyuen</name></author>
	</entry>
	<entry>
		<id>https://wiki.pine64.org/index.php?title=PineCone&amp;diff=12969</id>
		<title>PineCone</title>
		<link rel="alternate" type="text/html" href="https://wiki.pine64.org/index.php?title=PineCone&amp;diff=12969"/>
		<updated>2022-05-02T09:05:53Z</updated>

		<summary type="html">&lt;p&gt;Lupyuen: Add article &amp;quot;NuttX GPIO Expander for PineDio Stack BL604&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[File:Pine64_BL602_EVB_photo-3-small.jpg|thumb|PineCone BL602 EVB (Evaluation Board)]]&lt;br /&gt;
&lt;br /&gt;
The '''PineCone''' is a BL602 evaluation board, which was developed with the goal to challenge the open source community to achieve blob-free and free and open source WiFi and Bluetooth, see the [https://www.pine64.org/2020/10/28/nutcracker-challenge-blob-free-wifi-ble/ Nutcracker Challenge].&lt;br /&gt;
&lt;br /&gt;
== BL602 Specifications ==&lt;br /&gt;
* '''CPU:''' 32-bit RV32IMAFC RISC-V “SiFive E24 Core”&lt;br /&gt;
** [https://www.sifive.com/cores/e24 SiFive E24 Core information]&lt;br /&gt;
* '''Memory:'''&lt;br /&gt;
** 128KB ROM&lt;br /&gt;
** 276KB SRAM&lt;br /&gt;
** 1Kb eFuse&lt;br /&gt;
** 2MB Embedded Flash&lt;br /&gt;
* '''Security:'''&lt;br /&gt;
** Secure boot&lt;br /&gt;
** Secure debug&lt;br /&gt;
** AES 128/192/256&lt;br /&gt;
** SHA-1/224/256&lt;br /&gt;
** TRNG (True Random Number Generator)&lt;br /&gt;
** PKA (Public Key Accelerator)&lt;br /&gt;
* '''Wireless:'''&lt;br /&gt;
** Wi-Fi 802.11 b/g/n&lt;br /&gt;
** Bluetooth® Low Energy 5.0&lt;br /&gt;
** Wi-Fi Fast connection with BLE assistance&lt;br /&gt;
** Wi-Fi and BLE coexistence&lt;br /&gt;
** Wi-Fi Security WPS/WEP/WPA/WPA2/WPA3&lt;br /&gt;
** STA, SoftAP and sniffer modes&lt;br /&gt;
** Multi-Cloud connectivity&lt;br /&gt;
** 2.4 GHz RF transceiver&lt;br /&gt;
** Integrated RF balun, PA/LNA&lt;br /&gt;
* '''Package Type:'''&lt;br /&gt;
** 32 pin QFN 4mm x 4mm&lt;br /&gt;
* JTAG support (See below for BL602 impact)&lt;br /&gt;
&lt;br /&gt;
[[File:BL602_Block_Diagram.jpg|600px]]&lt;br /&gt;
&lt;br /&gt;
== JTAG ==&lt;br /&gt;
{| class=&amp;quot;wikitable floatright&amp;quot;&lt;br /&gt;
|+ Default JTAG pins&lt;br /&gt;
|-&lt;br /&gt;
| GPIO Pin || JTAG Pin&lt;br /&gt;
|-&lt;br /&gt;
| GPIO17 || TDI&lt;br /&gt;
|-&lt;br /&gt;
| GPIO11 || TDO&lt;br /&gt;
|-&lt;br /&gt;
| GPIO12 || TMS&lt;br /&gt;
|-&lt;br /&gt;
| GPIO14 || TCK&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
BL602 multiplexes four GPIO pins to provide the familiar JTAG lines. See the accompanying table for the default pin mappings.&lt;br /&gt;
&lt;br /&gt;
These are the default JTAG pins in use after a cold boot. However, many pieces of software, including the demo that's installed by default on new PineCones, remap these pins to other functions. You cannot use the default wiring for JTAG while such software is running. This issue is especially prevalent on the PineCone because three of the default JTAG pins are connected to the onboard RGB LED. Nothing about the LED itself interferes with JTAG, but any program that uses the LED will necessarily remap some of the default JTAG pins to be GPIO.&lt;br /&gt;
&lt;br /&gt;
The MaskROM download mode that the BL602 enters when you tie GPIO8 high does '''not''' remap the default JTAG pins, and so you can and should use that mode while checking basic functionality of your JTAG adapter.&lt;br /&gt;
&lt;br /&gt;
Note that, just as software can remap the default JTAG pins to be something else, it can also remap other pins to be JTAG. Control over this is quite granular, with 5-6 candidate pins for each individual JTAG signal that can be mapped independently of one another. LEE Lup Yuen has written some [https://lupyuen.github.io/articles/openocd#free-the-led-from-jtag-port sample code] showing how to remap the JTAG pins so that your software can use the LED without giving up support for debugging.&lt;br /&gt;
&lt;br /&gt;
== Pine64 USB JTAG Adapter information and schematics ==&lt;br /&gt;
* [https://files.pine64.org/doc/Pinenut/PINE64%20USB%20JTAG%20Adapter%20Schematic-20201215.pdf PINE64 USB JTAG Adapter schematic 20202018 1.0]&lt;br /&gt;
* [[:File:PINE64_USB_JTAG_Adapter_Schematic_ver_1.0a-20210109.pdf|PINE64 USB JTAG Adapter schematic 20210109 1.0a]]&lt;br /&gt;
&lt;br /&gt;
== PineCone BL602 EVB information and schematics ==&lt;br /&gt;
* Approximate dimensions: 26mm x 43mm&lt;br /&gt;
* Board layout:&lt;br /&gt;
[[File:PADI-II_EVB.png]]&lt;br /&gt;
* [https://files.pine64.org/doc/Pinenut/Pine64%20BL602%20EVB%20Schematic%20ver%201.1.pdf PineCone BL602 EVB schematic ver 1.1]&lt;br /&gt;
** Note: In PineCone revision 1.1 (&amp;quot;BL62B_EVB V1.1&amp;quot; silkscreened on back of board), CC1 and CC2 share one 5.1KΩ resistor. This means the board will fail to power when you use an e-marked USB-C cable like the one that comes with Apple chargers. See [https://medium.com/@leung.benson/how-to-design-a-proper-usb-c-power-sink-hint-not-the-way-raspberry-pi-4-did-it-f470d7a5910 this article] for details of why this happens. The next schematic design will give each line its own 5.1KΩ resistor as per the USB-C specification.&lt;br /&gt;
* The board uses a CH340 Serial/USB adapter. This chip is commonly used in Arduino-class development boards. It is a full speed (12Mbps) USB interface and has vendor ID 0x1a86 with product ID 0x7523.&lt;br /&gt;
* The GPIO pins (11, 12, 14, 17) plus the nearby RESET, POWER, and GND pins are all located on one side of the board, on J1 to provide JTAG connection.&lt;br /&gt;
&lt;br /&gt;
== Pinenut-01S Module information and schematics ==&lt;br /&gt;
[[File:Pinenut-01S_PCB-Front.png|225px]][[File:Pinenut-01S_PCB-Back.png|225px]]&lt;br /&gt;
* [https://files.pine64.org/doc/Pinenut/Pinenut-01S%20V1.01%20SCH.pdf Pinenut-01S schematic ver 1.01]&lt;br /&gt;
* [https://wiki.pine64.org/images/6/6b/PineNut-01S_v1.01_KiCad.zip PineNut-01S KiCad schematic ver 1.01]&lt;br /&gt;
* [https://files.pine64.org/doc/Pinenut/NUT-01S%20GPIO%20Definition%20ver%201.0.pdf Pinenut-01S GPIO Definition ver 1.0]&lt;br /&gt;
* [https://files.pine64.org/doc/Pinenut/USB%20Adapter%20for%20Pinenut-01S%20Schematic%20V1.0.pdf USB Programmer adapter for Pinenut-01S schematic ver 1.0]&lt;br /&gt;
* The default firmware runs the UART at 2000000 bps.  It will accept input whilst regularly outputting:&amp;lt;code&amp;gt;&amp;lt;br/&amp;gt;proc_hellow_entry: RISC-V rv32imafc&amp;lt;br/&amp;gt;cur key status:1&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Pinenut-12S Module information ==&lt;br /&gt;
[[File:NUT-12S_module-front.jpg|200px]][[File:NUT-12S_module-back.jpg|200px]]&lt;br /&gt;
* [https://files.pine64.org/doc/Pinenut/NUT-12S%20GPIO%20Definition%20ver%201.0.pdf Pinenut-12S GPIO Definition ver 1.0]&lt;br /&gt;
* Onboard LED is connected to IO0&lt;br /&gt;
&lt;br /&gt;
== Datasheets for components and peripherals ==&lt;br /&gt;
* Bouffalo BL-602 SoC information:&lt;br /&gt;
** [https://github.com/bouffalolab/bl_docs Bouffalo Lab's official bl_docs repository]: should always contain the latest SoC documentation available, in PDF, HTML, and reStructuredText source forms.&lt;br /&gt;
** [https://github.com/pine64/bl602-docs/tree/main/mirrored PINE64's bl602-docs repository]: contains an archive of all historical datasheets and reference manual PDFs but may lag behind Bouffalo's official repository. If you notice that it is, please submit a pull request!&lt;br /&gt;
* USB/Serial adapter:&lt;br /&gt;
** [https://cdn.sparkfun.com/datasheets/Dev/Arduino/Other/CH340DS1.PDF CH340 serial converter]&lt;br /&gt;
&lt;br /&gt;
== Misc notes ==&lt;br /&gt;
Planned to be available in at least three form factors:&lt;br /&gt;
* NUT-01S -&amp;gt; ESP-01S&lt;br /&gt;
* NUT-12S -&amp;gt; ESP-12S&lt;br /&gt;
* NUT-15 -&amp;gt; RTL8723/AMPAK&lt;br /&gt;
&lt;br /&gt;
== Loading code ==&lt;br /&gt;
To load code, you must move the jumper to the position closest to the edge, press reset, load the code, move the jumper back toward the center of the board, and press reset again.&lt;br /&gt;
&lt;br /&gt;
There are currently a number of loaders in progress, each with differing degrees of completeness and success on various operating systems.&lt;br /&gt;
* In the build tree, there is BLFlashCube for Windows, which is a proprietary GUI for flashing images. Linux and macOS binaries are available via [https://dev.bouffalolab.com/download Bouffalo Lab's developer portal].&lt;br /&gt;
* [https://github.com/stschake/bl60x-flash bl60x-flash] is in Python and has been reported successful on MacOS catalina (10.15.6) by Punnerud and madushan1000.&lt;br /&gt;
* [https://github.com/bouffalolab/BLOpenFlasher BLOpenFlasher] is a WIP, written in go, by Bouffalo Labs to provide source for a flash utility.&lt;br /&gt;
* [https://github.com/renzenicolai/bl602tool bl602tool] is a Python utility in development.&lt;br /&gt;
* &amp;lt;del&amp;gt;[https://pypi.org/project/bflb-eflash-loader/ Bouffalo's Python Flash Loader] is a new (Dec 20) flash loader by the makers of the chip.&amp;lt;/del&amp;gt;&lt;br /&gt;
* &amp;lt;del&amp;gt;[https://pypi.org/project/bflb-image-build/ Bouffalo's image build] smooshes code and adds headers for downloads.&amp;lt;/del&amp;gt;&lt;br /&gt;
* [https://pypi.org/project/bflb-mcu-tool/ Bouffalo's MCU tool] (Mar 2021) Python image tool replaced both of the above. Now combined with eflash loader, deals with partitions, DTS, signing, fuses etc.&lt;br /&gt;
* [https://github.com/spacemeowx2/blflash blflash serial flasher] BL602 serial flasher, inspired by BLOpenFlasher&lt;br /&gt;
&lt;br /&gt;
== Development efforts ==&lt;br /&gt;
* [https://github.com/pine64/bl_iot_sdk PineCone BL602 GitHub Page (PINE64 fork)] has compilers, linkers, and all the code to build on Windows, Linux (x86_64), and MacOS.&lt;br /&gt;
* [https://github.com/bouffalolab/bl_iot_sdk Bouffalo Lab GitHub Page]&lt;br /&gt;
* [https://github.com/renzenicolai/bl602-docs/ BL602 Developer organize documentation GitHub Page]&lt;br /&gt;
* [https://github.com/renzenicolai/bl602tool BL602 Developer organize tool GitHub Page]&lt;br /&gt;
* [https://github.com/stschake/bl60x-flash Programming tool for Bouffalo Labs BL602/BL604 chips]&lt;br /&gt;
* [https://github.com/pine64/bl602-re BL602 reverse engineering working group]&lt;br /&gt;
* [https://github.com/pine64/bl602-sdio-linux Linux kernel module]&lt;br /&gt;
* [https://github.com/tchebb/bl602-docs BL602 Documentation]&lt;br /&gt;
* [https://github.com/spacemeowx2/blflash BL602 serial flasher]&lt;br /&gt;
* [https://github.com/mkroman/awesome-bouffalo#feature-matrix Awesome Bouffalo]&lt;br /&gt;
&lt;br /&gt;
== Articles and Blogs ==&lt;br /&gt;
* [https://lupyuen.github.io/articles/pinecone Quick Peek of PineCone BL602 RISC-V Evaluation Board by Lup Yuen]&lt;br /&gt;
* [https://maero.dk/bl602-firmware-image-format/ Documenting the BouffaloLab BL602 firmware image format by MK]&lt;br /&gt;
* [https://lupyuen.github.io/articles/openocd Connect PineCone BL602 to OpenOCD by Lup Yuen]&lt;br /&gt;
* [https://lupyuen.github.io/articles/debug Debug Rust on PineCone BL602 with VSCode and GDB by Lup Yuen]&lt;br /&gt;
* [https://lupyuen.github.io/articles/mynewt Porting Mynewt to PineCone BL602 by Lup Yuen]&lt;br /&gt;
* [https://lupyuen.github.io/articles/flash Flashing Firmware to PineCone BL602 by Lup Yuen]&lt;br /&gt;
* [https://lupyuen.github.io/articles/led Control PineCone BL602 RGB LED with GPIO and PWM by Lup Yuen]&lt;br /&gt;
* [https://lupyuen.github.io/articles/gpio Mynewt GPIO ported to PineCone BL602 RISC-V Board by Lup Yuen]&lt;br /&gt;
* [https://lupyuen.github.io/articles/i2c PineCone BL602 talks to I2C Sensors by Lup Yuen]&lt;br /&gt;
* [https://lupyuen.github.io/articles/spi PineCone BL602 talks SPI too! by Lup Yuen]&lt;br /&gt;
* [https://lupyuen.github.io/articles/display PineCone BL602 Blasting Pixels to ST7789 Display with LVGL Library by Lup Yuen]&lt;br /&gt;
* [https://lupyuen.github.io/articles/uart PineCone BL602 Talks UART to Grove E-Ink Display by Lup Yuen]&lt;br /&gt;
* [https://lupyuen.github.io/articles/book The RISC-V BL602 Book by Lup Yuen]&lt;br /&gt;
* [https://lupyuen.github.io/articles/lora Connect PineCone BL602 to LoRa Transceiver by Lup Yuen]&lt;br /&gt;
* [https://lupyuen.github.io/articles/wisblock RAKwireless WisBlock talks LoRa with PineCone BL602 RISC-V Board by Lup Yuen]&lt;br /&gt;
* [https://lupyuen.github.io/articles/lora2 PineCone BL602 RISC-V Board Receives LoRa Packets by Lup Yuen]&lt;br /&gt;
* [https://lupyuen.github.io/articles/rust Run Rust RISC-V Firmware with BL602 IoT SDK by Lup Yuen]&lt;br /&gt;
* [https://lupyuen.github.io/articles/lorawan PineCone BL602 Talks LoRaWAN by Lup Yuen]&lt;br /&gt;
* [https://lupyuen.github.io/articles/lisp uLisp and Blockly on PineCone BL602 RISC-V Board by Lup Yuen]&lt;br /&gt;
* [https://lupyuen.github.io/articles/wasm Simulate RISC-V BL602 with WebAssembly, uLisp and Blockly by Lup Yuen]&lt;br /&gt;
* [https://lupyuen.github.io/articles/boot BL602 Bootloader by Lup Yuen]&lt;br /&gt;
* [https://lupyuen.github.io/articles/tflite Machine Learning on RISC-V BL602 with TensorFlow Lite by Lup Yuen]&lt;br /&gt;
* [https://lupyuen.github.io/articles/wifi Reverse Engineering WiFi on RISC-V BL602 by Lup Yuen]&lt;br /&gt;
* [https://lupyuen.github.io/articles/adc Rust on RISC-V BL602: Is It Sunny? by Lup Yuen]&lt;br /&gt;
* [https://lupyuen.github.io/articles/rustsim Rust on RISC-V BL602: Simulated with WebAssembly by Lup Yuen]&lt;br /&gt;
* [https://lupyuen.github.io/articles/pinedio PineDio Stack BL604 RISC-V Board: Testing The Prototype by Lup Yuen]&lt;br /&gt;
* [https://lupyuen.github.io/articles/rhai Rust on RISC-V BL602: Rhai Scripting by Lup Yuen]&lt;br /&gt;
* [https://lupyuen.github.io/articles/lorawan2 LoRaWAN on PineDio Stack BL604 RISC-V Board by Lup Yuen]&lt;br /&gt;
* [https://lupyuen.github.io/articles/ttn The Things Network on PineDio Stack BL604 RISC-V Board by Lup Yuen]&lt;br /&gt;
* [https://lupyuen.github.io/articles/cbor Encode Sensor Data with CBOR on BL602 by Lup Yuen]&lt;br /&gt;
* [https://lupyuen.github.io/articles/roblox IoT Digital Twin with Roblox and The Things Network by Lup Yuen]&lt;br /&gt;
* [https://lupyuen.github.io/articles/tsen Internal Temperature Sensor on BL602 by Lup Yuen]&lt;br /&gt;
* [https://lupyuen.github.io/articles/payload CBOR Payload Formatter for The Things Network by Lup Yuen]&lt;br /&gt;
* [https://lupyuen.github.io/articles/prometheus Monitor IoT Devices in The Things Network with Prometheus and Grafana by Lup Yuen]&lt;br /&gt;
* [https://lupyuen.github.io/articles/nuttx Apache NuttX OS on RISC-V BL602 and BL604 by Lup Yuen]&lt;br /&gt;
* [https://lupyuen.github.io/articles/spi2 SPI on Apache NuttX OS by Lup Yuen]&lt;br /&gt;
* [https://lupyuen.github.io/articles/sx1262 LoRa SX1262 on Apache NuttX OS by Lup Yuen]&lt;br /&gt;
* [https://lupyuen.github.io/articles/lorawan3 LoRaWAN on Apache NuttX OS by Lup Yuen]&lt;br /&gt;
* [https://lupyuen.github.io/articles/rust2 Rust on Apache NuttX OS by Lup Yuen]&lt;br /&gt;
* [https://lupyuen.github.io/articles/auto Auto Flash and Test NuttX on RISC-V BL602 by Lup Yuen]&lt;br /&gt;
* [https://lupyuen.github.io/articles/loader BL602 EFlash Loader: Reverse Engineered with Ghidra by Lup Yuen]&lt;br /&gt;
* [https://lupyuen.github.io/articles/ikea Connect IKEA Air Quality Sensor to Apache NuttX OS by Lup Yuen]&lt;br /&gt;
* [https://lupyuen.github.io/articles/bme280 Apache NuttX Driver for BME280 Sensor: Ported from Zephyr OS by Lup Yuen]&lt;br /&gt;
* [https://lupyuen.github.io/articles/rusti2c Rust talks I2C on Apache NuttX RTOS by Lup Yuen]&lt;br /&gt;
* [https://lupyuen.github.io/articles/st7789 ST7789 Display with LVGL Graphics on Apache NuttX RTOS by Lup Yuen]&lt;br /&gt;
* [https://lupyuen.github.io/articles/pinedio2 PineDio Stack BL604 runs Apache NuttX RTOS by Lup Yuen]&lt;br /&gt;
* [https://lupyuen.github.io/articles/touch NuttX Touch Panel Driver for PineDio Stack BL604 by Lup Yuen]&lt;br /&gt;
* [https://lupyuen.github.io/articles/expander NuttX GPIO Expander for PineDio Stack BL604 by Lup Yuen]&lt;br /&gt;
&lt;br /&gt;
[[Category:Nutcracker]]&lt;/div&gt;</summary>
		<author><name>Lupyuen</name></author>
	</entry>
	<entry>
		<id>https://wiki.pine64.org/index.php?title=Pinedio&amp;diff=12968</id>
		<title>Pinedio</title>
		<link rel="alternate" type="text/html" href="https://wiki.pine64.org/index.php?title=Pinedio&amp;diff=12968"/>
		<updated>2022-05-02T09:05:39Z</updated>

		<summary type="html">&lt;p&gt;Lupyuen: Add article &amp;quot;NuttX GPIO Expander for PineDio Stack BL604&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{under construction}}&lt;br /&gt;
&lt;br /&gt;
The '''Pinedio''' is a device utilizing LoRa. LoRa is a long range, low power wireless platform that is being used by a lot of Internet of Things (IoT) products. Using LoRa and LoRaWAN, devices can communicate across the world using the internet, using various decentralised networks such as [https://www.thethingsnetwork.org/ The Things Network] or [https://www.helium.com/ Helium]. Since, PINE64 believes in openness, the LoRa gateway can connect to any network, per the developer implementation. If Helium Spots open up for PINE64 gateway and developers have implemented the hook for Helium, then this is good thing. The PINE64 LoRa gateway also open connect to The Things Network if developers implement support. The choice is yours!&lt;br /&gt;
&lt;br /&gt;
== Gateway ==&lt;br /&gt;
&lt;br /&gt;
The gateway will be available in two variants - indoor and outdoor. All that is known about the outdoor unit is that it will have &amp;quot;an aluminum, rugged and water resistant case&amp;quot;. &lt;br /&gt;
The indoor unit consists of a PINE A64-LTS, fitted with a purpose built hat (adapter) which uses a LoRa module by RakWireless. The chipset used is the SX1302, and the module via the SPI interface. There are two external connections on the enclosure for the GPS and loRa antenna. &lt;br /&gt;
&lt;br /&gt;
=== Connections ===&lt;br /&gt;
* GPS is connected to UART2 on the A64 board&lt;br /&gt;
* SX1302 on SPI0&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|RAK2287 module&lt;br /&gt;
|PI-2 connector&lt;br /&gt;
|PINE A64-LTS&lt;br /&gt;
|-&lt;br /&gt;
|SX1302 SPI&lt;br /&gt;
|Pin 19 = MOSI / PC0&amp;lt;br/&amp;gt;Pin 21 = MISO/PC1&amp;lt;br/&amp;gt;Pin23 = CLK/PC2&amp;lt;br/&amp;gt;Pin24 = CS/PC3&lt;br /&gt;
|SPI0 (/dev/spidev0.0)&lt;br /&gt;
|-&lt;br /&gt;
|SX1302 RESET&lt;br /&gt;
|Pin 11 = GPIO17/PC7&lt;br /&gt;
|GPIO71 (/sys/class/gpio/gpio71)&lt;br /&gt;
|-&lt;br /&gt;
|GPS UART&lt;br /&gt;
|Pin 8 = TX/&amp;lt;br&amp;gt;Pin 10 = RX&lt;br /&gt;
|UART2 (/dev/ttyS2)&lt;br /&gt;
|-&lt;br /&gt;
|GPS RESET&lt;br /&gt;
|Pin 33 = GPIO13/PC5&lt;br /&gt;
|GPIO69 (/sys/class/gpio/gpio69)&lt;br /&gt;
|-&lt;br /&gt;
|GPS Standby&lt;br /&gt;
|Pin 35 = GPIO19/PC9&lt;br /&gt;
|GPIO73 (/sys/class/gpio/gpio73)&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Pictures ===&lt;br /&gt;
&amp;lt;gallery&amp;gt;&lt;br /&gt;
File:Blog-april-InsideLoRaGateway.jpg&lt;br /&gt;
File:Blog-april-InsideLoRaGateway2.jpeg&lt;br /&gt;
File:Discord-lora-gateway-20210413_143615.jpg&lt;br /&gt;
File:Discord-lora-gateway-20210413_1435271.jpg&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Operating System Options===&lt;br /&gt;
&lt;br /&gt;
Pinedio Gateway carries the A64-LTS board. Based on ram specifications SOPINE images are also compatible.&lt;br /&gt;
&lt;br /&gt;
====Armbian====&lt;br /&gt;
&lt;br /&gt;
Gateway Hardware based on Pine64 A64-LTS + RAK2287 + GPS. &lt;br /&gt;
&lt;br /&gt;
Hardware compatible with SOPINE images.&lt;br /&gt;
&lt;br /&gt;
'''PineDio Gateway TTN/Chirpstack Image'''&lt;br /&gt;
&lt;br /&gt;
Debian image with (Default Choices: Chirpstack / TTN) software preinstalled / hardware enabled is available below.&lt;br /&gt;
&lt;br /&gt;
Latest: &lt;br /&gt;
    (PineDio-RAK-Armbian_02-26-2022.img.xz)&lt;br /&gt;
&lt;br /&gt;
    SHA256: 83c2fae06579c2101502963289682295b83164d322ae7359c7c584f0b0e57426&lt;br /&gt;
    SHA512: c5e8cb0b657ee02aa15c60dc7cab7b9e4a7785da548541c6a0eaf4ee7241600c18e339776d94731c5130ccceea4da4aad159af521c4f484c1a550a39fe707d95&lt;br /&gt;
&lt;br /&gt;
DOWNLOAD LOCATION:  https://mega.nz/file/CIoykITD#S_NQx9wRG05CTT7TdzBX8u24bGiVzT341VPZakycaw8&lt;br /&gt;
&lt;br /&gt;
'''Switch Between Chirpstack / TTN (TheThingsNetwork)'''&lt;br /&gt;
&lt;br /&gt;
  gateway-config&lt;br /&gt;
&lt;br /&gt;
First Select:&lt;br /&gt;
&lt;br /&gt;
  Setup RAK Gateway Channel Plan&lt;br /&gt;
&lt;br /&gt;
Next For TTN (TheThingsNetwork) Select:&lt;br /&gt;
&lt;br /&gt;
  Server is TTN&lt;br /&gt;
&lt;br /&gt;
'''or'''&lt;br /&gt;
&lt;br /&gt;
Next For Chirpstack Select:&lt;br /&gt;
&lt;br /&gt;
  Server is Other server&lt;br /&gt;
&lt;br /&gt;
'''Accessing Chirpstack Admin Page'''&lt;br /&gt;
&lt;br /&gt;
Point web browser to:&lt;br /&gt;
&lt;br /&gt;
  http://gatewayIPaddress:8080&lt;br /&gt;
&lt;br /&gt;
'''Default Chirpstack Credentials'''&lt;br /&gt;
&lt;br /&gt;
  login: admin&lt;br /&gt;
  password: admin&lt;br /&gt;
&lt;br /&gt;
'''SSH Credentials'''&lt;br /&gt;
&lt;br /&gt;
 Login: pinedio&lt;br /&gt;
 password: SoPinePass!!!&lt;br /&gt;
&lt;br /&gt;
'''Changing EUI'''&lt;br /&gt;
&lt;br /&gt;
EUI is stored in file:&lt;br /&gt;
&lt;br /&gt;
  /opt/ttn-gateway/packetforwarder/lorapkt_fwd/local_conf.json&lt;br /&gt;
&lt;br /&gt;
'''Additional Shell Commands'''&lt;br /&gt;
&lt;br /&gt;
'''View Gateway ID/EUI'''&lt;br /&gt;
&lt;br /&gt;
  gateway-version&lt;br /&gt;
&lt;br /&gt;
'''Restart Packet Forwarder/Concentrator'''&lt;br /&gt;
&lt;br /&gt;
  sudo systemctl restart ttn-gateway&lt;br /&gt;
&lt;br /&gt;
'''Check Status'''&lt;br /&gt;
&lt;br /&gt;
  sudo systemctl status ttn-gateway&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Enabling Concentrator/GPS Steps (Below Already *Completed* For Above Image Download)'''&lt;br /&gt;
&lt;br /&gt;
Inside armbian-config -&amp;gt; system -&amp;gt; Bootenv (edit boot environment), enter the following 2 lines (to create spidev0.0):&lt;br /&gt;
&lt;br /&gt;
 overlays=spi-spidev uart2 i2c0&lt;br /&gt;
 param_spidev_spi_bus=0&lt;br /&gt;
&lt;br /&gt;
Or you may hand edit: /boot/armbianEnv.txt to add the above overlays/param_spidev_spi_bus lines.&lt;br /&gt;
&lt;br /&gt;
Save. Reboot. &lt;br /&gt;
&lt;br /&gt;
After rebooting you should see a new device /dev/spidev0.0. This will be the concentrator device for gateway related setup.&lt;br /&gt;
&lt;br /&gt;
GPS will be /dev/ttyS2 and should work (after editing armbianEnv.txt + reboot). &lt;br /&gt;
Make sure to offer GPS antenna a strong signal, preferably by a window (if indoors).&lt;br /&gt;
&lt;br /&gt;
== USB adapter ==&lt;br /&gt;
[[File:Pine64-lora-usb-adapter.jpg|500px]]&lt;br /&gt;
&lt;br /&gt;
The Pine64 USB LoRa adapter is based on the Semtech SX1262 LoRa module and the CH341 USB bus converter chip. The '''CH341''' chip can be configured in multiple mode to convert USB to various serial and parallel ports. In this case, it's configured in '''synchronous serial mode''', which allows this chip to convert from USB to the SPI bus needed to talk to the SX1262 LoRa module:&lt;br /&gt;
&lt;br /&gt;
 --------            --------------------------&lt;br /&gt;
 |      |            |   USB LoRa Adapter     |&lt;br /&gt;
 | PC   |  &amp;lt;--USB--&amp;gt; | CH341 &amp;lt;--SPI--&amp;gt; SX1262 |&lt;br /&gt;
 |      |            |       &amp;lt;--I/O--&amp;gt;        |&lt;br /&gt;
 --------            --------------------------&lt;br /&gt;
&lt;br /&gt;
=== Pins ===&lt;br /&gt;
[[File:Lora-usb-pins.jpg|500px]]&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
&lt;br /&gt;
!SX1262 Pin&lt;br /&gt;
!Name&lt;br /&gt;
!Description&lt;br /&gt;
|-&lt;br /&gt;
|1&lt;br /&gt;
|ANT&lt;br /&gt;
|Antenna&lt;br /&gt;
|-&lt;br /&gt;
|2&lt;br /&gt;
|GND2&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|3&lt;br /&gt;
|VREG&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|4&lt;br /&gt;
|DCC&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|5&lt;br /&gt;
|VCC&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|6&lt;br /&gt;
|DIO1&lt;br /&gt;
|Connected on CH341 Pin 7&lt;br /&gt;
|-&lt;br /&gt;
|7&lt;br /&gt;
|DIO2&lt;br /&gt;
|Connected on CH341 Pin6&lt;br /&gt;
|-&lt;br /&gt;
|8&lt;br /&gt;
|DIO3&lt;br /&gt;
|Connected on CH341 Pin 5&lt;br /&gt;
|-&lt;br /&gt;
|9&lt;br /&gt;
|GND&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|10&lt;br /&gt;
|MISO&lt;br /&gt;
|SPI MISO (CH341 Pin 20)&lt;br /&gt;
|-&lt;br /&gt;
|11&lt;br /&gt;
|MOSI&lt;br /&gt;
|SPI MOSI (CH341 Pin 22)&lt;br /&gt;
|-&lt;br /&gt;
|12&lt;br /&gt;
|SCK&lt;br /&gt;
|SPI clock (CH341 Pin 24)&lt;br /&gt;
|- &lt;br /&gt;
|13&lt;br /&gt;
|NSS&lt;br /&gt;
|SPI Chip select&lt;br /&gt;
|-&lt;br /&gt;
|14&lt;br /&gt;
|POR&lt;br /&gt;
|Reset pin&lt;br /&gt;
|-&lt;br /&gt;
|15&lt;br /&gt;
|Busy&lt;br /&gt;
|Busy pin&lt;br /&gt;
|-&lt;br /&gt;
|16&lt;br /&gt;
|GND&lt;br /&gt;
|&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Kernel module for CH341 === &lt;br /&gt;
We need a driver for the CH341 USB bus converter chip. This driver will allow us to send command to the CH341 (SPI messages and access to the GPIOs). I've successfully build and run [https://github.com/rogerjames99/spi-ch341-usb this driver from '''rogerjames99'''] on my desktop computer (running Manjaro Linux) and on my Pinebook Pro (ARM64, running Manjaro ARM Linux). For any kernel newer than 3.10 but mandatory for kernels newer than 5.15 you need to use the [https://github.com/dimich-dmb/spi-ch341-usb dimich-dmb fork of the the '''spi-ch341-usb driver.'''] This fork has updated documentation for the newer kernel interfaces. If this driver gives you problems please drop by any of the social platforms in the Pine64 LoRa chat and give a holler, and if you are using a 5.15 or older kernel you can use the rogerjames99 fork.&lt;br /&gt;
&lt;br /&gt;
 $ git clone https://github.com/rogerjames99/spi-ch341-usb.git &lt;br /&gt;
or&lt;br /&gt;
 $ git clone https://github.com/dimich-dmb/spi-ch341-usb.git&lt;br /&gt;
then&lt;br /&gt;
 $ cd spi-ch341-usb&lt;br /&gt;
 $ make&lt;br /&gt;
 $ sudo make install&lt;br /&gt;
&lt;br /&gt;
Once the driver is installed, unload the module ''ch341'' if it has been automatically loaded:&lt;br /&gt;
&lt;br /&gt;
 $ lsmod |grep ch341&lt;br /&gt;
 $ sudo rmmod ch341&lt;br /&gt;
&lt;br /&gt;
On my setup, ''ch341'' would be automatically loaded once I connected my USB adapter. This module drives the CH341 is asynchronous serial mode, which will not work for a SPI bus. &lt;br /&gt;
&lt;br /&gt;
Then load the new module:&lt;br /&gt;
&lt;br /&gt;
 $ sudo modprobe spi-ch341-usb&lt;br /&gt;
&lt;br /&gt;
Plug your USB adapter and check that the module is correctly loaded : &lt;br /&gt;
&lt;br /&gt;
 $ dmesg&lt;br /&gt;
 [20141.872107] usb 1-1.1: USB disconnect, device number 4&lt;br /&gt;
 [20143.820756] usb 1-1.1: new full-speed USB device number 5 using ehci-platform&lt;br /&gt;
 [20143.973366] usb 1-1.1: New USB device found, idVendor=1a86, idProduct=5512, bcdDevice= 3.04&lt;br /&gt;
 [20143.973413] usb 1-1.1: New USB device strings: Mfr=0, Product=2, SerialNumber=0&lt;br /&gt;
 [20143.973434] usb 1-1.1: Product: USB UART-LPT&lt;br /&gt;
 [20143.975137] spi-ch341-usb 1-1.1:1.0: ch341_usb_probe: connect device&lt;br /&gt;
 [20143.975164] spi-ch341-usb 1-1.1:1.0: ch341_usb_probe: bNumEndpoints=3&lt;br /&gt;
 [20143.975183] spi-ch341-usb 1-1.1:1.0: ch341_usb_probe:   endpoint=0 type=2 dir=1 addr=2&lt;br /&gt;
 [20143.975206] spi-ch341-usb 1-1.1:1.0: ch341_usb_probe:   endpoint=1 type=2 dir=0 addr=2&lt;br /&gt;
 [20143.975229] spi-ch341-usb 1-1.1:1.0: ch341_usb_probe:   endpoint=2 type=3 dir=1 addr=1&lt;br /&gt;
 [20143.975254] spi-ch341-usb 1-1.1:1.0: ch341_cfg_probe: output cs0 SPI slave with cs=0&lt;br /&gt;
 [20143.975273] spi-ch341-usb 1-1.1:1.0: ch341_cfg_probe: output cs0 gpio=0 irq=0 &lt;br /&gt;
 [20143.975295] spi-ch341-usb 1-1.1:1.0: ch341_cfg_probe: output cs1 SPI slave with cs=1&lt;br /&gt;
 [20143.975313] spi-ch341-usb 1-1.1:1.0: ch341_cfg_probe: output cs1 gpio=1 irq=1 &lt;br /&gt;
 [20143.975334] spi-ch341-usb 1-1.1:1.0: ch341_cfg_probe: output cs2 SPI slave with cs=2&lt;br /&gt;
 [20143.975352] spi-ch341-usb 1-1.1:1.0: ch341_cfg_probe: output cs2 gpio=2 irq=2 &lt;br /&gt;
 [20143.975373] spi-ch341-usb 1-1.1:1.0: ch341_cfg_probe: input  gpio4 gpio=3 irq=3 &lt;br /&gt;
 [20143.975394] spi-ch341-usb 1-1.1:1.0: ch341_cfg_probe: input  gpio6 gpio=4 irq=4 &lt;br /&gt;
 [20143.975415] spi-ch341-usb 1-1.1:1.0: ch341_cfg_probe: input  err gpio=5 irq=5 &lt;br /&gt;
 [20143.975435] spi-ch341-usb 1-1.1:1.0: ch341_cfg_probe: input  pemp gpio=6 irq=6 &lt;br /&gt;
 [20143.975456] spi-ch341-usb 1-1.1:1.0: ch341_cfg_probe: input  int gpio=7 irq=7 (hwirq)&lt;br /&gt;
 [20143.975478] spi-ch341-usb 1-1.1:1.0: ch341_cfg_probe: input  slct gpio=8 irq=8 &lt;br /&gt;
 [20143.975499] spi-ch341-usb 1-1.1:1.0: ch341_cfg_probe: input  wait gpio=9 irq=9 &lt;br /&gt;
 [20143.975520] spi-ch341-usb 1-1.1:1.0: ch341_cfg_probe: input  autofd gpio=10 irq=10 &lt;br /&gt;
 [20143.975542] spi-ch341-usb 1-1.1:1.0: ch341_cfg_probe: input  addr gpio=11 irq=11 &lt;br /&gt;
 [20143.975564] spi-ch341-usb 1-1.1:1.0: ch341_cfg_probe: output ini gpio=12 irq=12 &lt;br /&gt;
 [20143.975585] spi-ch341-usb 1-1.1:1.0: ch341_cfg_probe: output write gpio=13 irq=13 &lt;br /&gt;
 [20143.975607] spi-ch341-usb 1-1.1:1.0: ch341_cfg_probe: output scl gpio=14 irq=14 &lt;br /&gt;
 [20143.975628] spi-ch341-usb 1-1.1:1.0: ch341_cfg_probe: output sda gpio=15 irq=15 &lt;br /&gt;
 [20143.975650] spi-ch341-usb 1-1.1:1.0: ch341_spi_probe: start&lt;br /&gt;
 [20143.975677] spi-ch341-usb 1-1.1:1.0: ch341_spi_probe: SPI master connected to SPI bus 1&lt;br /&gt;
 [20143.977831] spi-ch341-usb 1-1.1:1.0: ch341_spi_probe: SPI device /dev/spidev1.0 created&lt;br /&gt;
 [20143.978183] spi-ch341-usb 1-1.1:1.0: ch341_spi_probe: SPI device /dev/spidev1.1 created&lt;br /&gt;
 [20143.978552] spi-ch341-usb 1-1.1:1.0: ch341_spi_probe: SPI device /dev/spidev1.2 created&lt;br /&gt;
 [20143.978726] spi-ch341-usb 1-1.1:1.0: ch341_spi_probe: done&lt;br /&gt;
 [20143.978735] spi-ch341-usb 1-1.1:1.0: ch341_irq_probe: start&lt;br /&gt;
 [20143.979133] spi-ch341-usb 1-1.1:1.0: ch341_irq_probe: irq_base=103&lt;br /&gt;
 [20143.979154] spi-ch341-usb 1-1.1:1.0: ch341_irq_probe: done&lt;br /&gt;
 [20143.979162] spi-ch341-usb 1-1.1:1.0: ch341_gpio_probe: start&lt;br /&gt;
 [20143.979220] spi-ch341-usb 1-1.1:1.0: ch341_gpio_get_direction: gpio=cs0 dir=0&lt;br /&gt;
 [20143.979229] spi-ch341-usb 1-1.1:1.0: ch341_gpio_get_direction: gpio=cs1 dir=0&lt;br /&gt;
 [20143.979237] spi-ch341-usb 1-1.1:1.0: ch341_gpio_get_direction: gpio=cs2 dir=0&lt;br /&gt;
 [20143.979245] spi-ch341-usb 1-1.1:1.0: ch341_gpio_get_direction: gpio=gpio4 dir=1&lt;br /&gt;
 [20143.979253] spi-ch341-usb 1-1.1:1.0: ch341_gpio_get_direction: gpio=gpio6 dir=1&lt;br /&gt;
 [20143.979260] spi-ch341-usb 1-1.1:1.0: ch341_gpio_get_direction: gpio=err dir=1&lt;br /&gt;
 [20143.979268] spi-ch341-usb 1-1.1:1.0: ch341_gpio_get_direction: gpio=pemp dir=1&lt;br /&gt;
 [20143.979275] spi-ch341-usb 1-1.1:1.0: ch341_gpio_get_direction: gpio=int dir=1&lt;br /&gt;
 [20143.979283] spi-ch341-usb 1-1.1:1.0: ch341_gpio_get_direction: gpio=slct dir=1&lt;br /&gt;
 [20143.979290] spi-ch341-usb 1-1.1:1.0: ch341_gpio_get_direction: gpio=wait dir=1&lt;br /&gt;
 [20143.979298] spi-ch341-usb 1-1.1:1.0: ch341_gpio_get_direction: gpio=autofd dir=1&lt;br /&gt;
 [20143.979306] spi-ch341-usb 1-1.1:1.0: ch341_gpio_get_direction: gpio=addr dir=1&lt;br /&gt;
 [20143.979314] spi-ch341-usb 1-1.1:1.0: ch341_gpio_get_direction: gpio=ini dir=0&lt;br /&gt;
 [20143.979321] spi-ch341-usb 1-1.1:1.0: ch341_gpio_get_direction: gpio=write dir=0&lt;br /&gt;
 [20143.979329] spi-ch341-usb 1-1.1:1.0: ch341_gpio_get_direction: gpio=scl dir=0&lt;br /&gt;
 [20143.979337] spi-ch341-usb 1-1.1:1.0: ch341_gpio_get_direction: gpio=sda dir=0&lt;br /&gt;
 [20143.979831] spi-ch341-usb 1-1.1:1.0: ch341_gpio_probe: registered GPIOs from 496 to 511&lt;br /&gt;
 [20143.981152] spi-ch341-usb 1-1.1:1.0: ch341_gpio_probe: done&lt;br /&gt;
 [20143.981212] spi-ch341-usb 1-1.1:1.0: ch341_gpio_poll_function: start&lt;br /&gt;
 [20143.981291] spi-ch341-usb 1-1.1:1.0: ch341_usb_probe: connected&lt;br /&gt;
 [20144.756250] usbcore: registered new interface driver ch341&lt;br /&gt;
 [20144.756334] usbserial: USB Serial support registered for ch341-uart&lt;br /&gt;
&lt;br /&gt;
With kernel 5.16 and newer the output is shorter:&lt;br /&gt;
&lt;br /&gt;
 $ dmesg&lt;br /&gt;
 [ 6744.813564] usb 1-2.1.1: new full-speed USB device number 21 using xhci_hcd&lt;br /&gt;
 [ 6744.904377] usb 1-2.1.1: New USB device found, idVendor=1a86, idProduct=5512, bcdDevice= 3.04&lt;br /&gt;
 [ 6744.904383] usb 1-2.1.1: New USB device strings: Mfr=0, Product=2, SerialNumber=0&lt;br /&gt;
 [ 6744.904385] usb 1-2.1.1: Product: USB UART-LPT&lt;br /&gt;
 [ 6744.960243] spi-ch341-usb 1-2.1.1:1.0: ch341_cfg_probe: output cs0 SPI slave with cs=0&lt;br /&gt;
 [ 6744.960246] spi-ch341-usb 1-2.1.1:1.0: ch341_cfg_probe: output cs1 SPI slave with cs=1&lt;br /&gt;
 [ 6744.960247] spi-ch341-usb 1-2.1.1:1.0: ch341_cfg_probe: output cs2 SPI slave with cs=2&lt;br /&gt;
 [ 6744.960249] spi-ch341-usb 1-2.1.1:1.0: ch341_cfg_probe: input  gpio4 gpio=0 irq=0 (hwirq)&lt;br /&gt;
 [ 6744.960251] spi-ch341-usb 1-2.1.1:1.0: ch341_cfg_probe: input  gpio5 gpio=1 irq=1&lt;br /&gt;
 [ 6744.960302] spi-ch341-usb 1-2.1.1:1.0: ch341_spi_probe: SPI master connected to SPI bus 0&lt;br /&gt;
 [ 6744.960350] spi-ch341-usb 1-2.1.1:1.0: ch341_spi_probe: SPI device /dev/spidev0.0 created&lt;br /&gt;
 [ 6744.960398] spi-ch341-usb 1-2.1.1:1.0: ch341_spi_probe: SPI device /dev/spidev0.1 created&lt;br /&gt;
 [ 6744.960445] spi-ch341-usb 1-2.1.1:1.0: ch341_spi_probe: SPI device /dev/spidev0.2 created&lt;br /&gt;
 [ 6744.960583] spi-ch341-usb 1-2.1.1:1.0: ch341_usb_probe: connected&lt;br /&gt;
&lt;br /&gt;
=== Driver development === &lt;br /&gt;
=====Kernels 5.14 and older=====&lt;br /&gt;
&lt;br /&gt;
Once the module ''spi-ch341-usb'' is correctly loaded, here's how you can transfer data on the SPI bus (in C):&lt;br /&gt;
&lt;br /&gt;
 /* Open the SPI bus */&lt;br /&gt;
 int spi = open(&amp;quot;/dev/spidev1.0&amp;quot;, O_RDWR);&lt;br /&gt;
 uint8_t mmode = SPI_MODE_0;&lt;br /&gt;
 uint8_t lsb = 0;&lt;br /&gt;
 ioctl(spi, SPI_IOC_WR_MODE, &amp;amp;mmode);&lt;br /&gt;
 ioctl(spi, SPI_IOC_WR_LSB_FIRST, &amp;amp;lsb);&lt;br /&gt;
 &lt;br /&gt;
 /* Transfer data */&lt;br /&gt;
 /* TODO: Init buffer_out, buffer_in and size */&lt;br /&gt;
 const uint8_t *mosi = buffer_out; // output data&lt;br /&gt;
 uint8_t *miso = buffer_in; // input data&lt;br /&gt;
 &lt;br /&gt;
 struct spi_ioc_transfer spi_trans;&lt;br /&gt;
 memset(&amp;amp;spi_trans, 0, sizeof(spi_trans));&lt;br /&gt;
 &lt;br /&gt;
 spi_trans.tx_buf = (unsigned long) mosi;&lt;br /&gt;
 spi_trans.rx_buf = (unsigned long) miso;&lt;br /&gt;
 spi_trans.cs_change = true;&lt;br /&gt;
 spi_trans.len = size;&lt;br /&gt;
 &lt;br /&gt;
 int status = ioctl (spi, SPI_IOC_MESSAGE(1), &amp;amp;spi_trans);&lt;br /&gt;
&lt;br /&gt;
To access GPIOs, you first need to export them (to make them accessible via ''/sys/class/gpio''. As you can see in the dmesg output, GPIOs from 496 to 511 were registered, which means we can export 16 GPIOs. The mapping of these I/O is available in the [https://github.com/rogerjames99/spi-ch341-usb/blob/master/spi-ch341-usb.c#L148 source code of the driver]. For example, pin ''slct'' is the 12th, meaning we need to export GPIO 496+12 = 508.&lt;br /&gt;
&lt;br /&gt;
 int  fd;&lt;br /&gt;
 if ((fd = open(&amp;quot;/sys/class/gpio/export&amp;quot;, O_WRONLY)) == -1)   {&lt;br /&gt;
   perror(&amp;quot;open ini&amp;quot;);&lt;br /&gt;
   exit(-1);&lt;br /&gt;
 }&lt;br /&gt;
 &lt;br /&gt;
 if (write(fd, &amp;quot;508&amp;quot;, 3) == -1){&lt;br /&gt;
   perror (&amp;quot;write export 508&amp;quot;);&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
Once exported, the GPIO is available in ''/sys/class/gpio/sclt'' (the naming is specified by the driver). You can read the pin in C:&lt;br /&gt;
&lt;br /&gt;
 int  fd;&lt;br /&gt;
 if ((fd = open(&amp;quot;/sys/class/gpio/slct/value&amp;quot;, O_RDWR)) == -1)   {&lt;br /&gt;
   perror(&amp;quot;open&amp;quot;);&lt;br /&gt;
 }&lt;br /&gt;
 &lt;br /&gt;
 char buf;&lt;br /&gt;
 if (read(fd, &amp;amp;buf, 1) == -1) {&lt;br /&gt;
    perror(&amp;quot;read&amp;quot;);&lt;br /&gt;
 }&lt;br /&gt;
 &lt;br /&gt;
 int value = (buf == '0') ? 0 : 1;&lt;br /&gt;
&lt;br /&gt;
You can also write it:&lt;br /&gt;
&lt;br /&gt;
 int  fd; &lt;br /&gt;
 if ((fd = open(&amp;quot;/sys/class/gpio/ini/value&amp;quot;, O_RDWR)) == -1)   {&lt;br /&gt;
   perror(&amp;quot;open ini&amp;quot;);&lt;br /&gt;
 }&lt;br /&gt;
 &lt;br /&gt;
 if (write(fd, value ? &amp;quot;1&amp;quot; : &amp;quot;0&amp;quot;, 1) == -1) {&lt;br /&gt;
    perror (&amp;quot;write&amp;quot;);&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
=====Kernel 5.15 and newer=====&lt;br /&gt;
&lt;br /&gt;
We need some help documenting how these interfaces work!&lt;br /&gt;
&lt;br /&gt;
The driver creates these interfaces:&lt;br /&gt;
 {| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
  |Pin  ||SPI Function ||GPIO function ||GPIO name ||IRQ&lt;br /&gt;
  |-&lt;br /&gt;
  |15||CS0||-||-||-&lt;br /&gt;
  |-&lt;br /&gt;
  |16||CS1||-||-||-&lt;br /&gt;
  |-&lt;br /&gt;
  |17||CS2||-||-||-&lt;br /&gt;
  |-&lt;br /&gt;
  |19||-||Input||gpio4||hardware&lt;br /&gt;
  |-&lt;br /&gt;
  |21||-||Input||gpio5||software&lt;br /&gt;
 |}&lt;br /&gt;
&lt;br /&gt;
The dimich-dmb fork of spi-ch341-usb works with 5.15+ kernels, but as you can see above it is not configured for the needs of the Pinedio-USB by default. I have started a branch in my fork to work on getting the driver pre-configured for our needs. The branch can be [https://github.com/UncleGrumpy/spi-ch341-usb/tree/pinedio found here.] Please feel free to help! And open issues or discussions in the repo if you have problems or ideas how to help. Any improvements to the actual code beyond configuration should be pushed to the temporary [https://github.com/dimich-dmb/spi-ch341-usb/ upstream.]&lt;br /&gt;
&lt;br /&gt;
Since linux-5.15 binding to spidev driver is required to make slave devices available via /dev/, e.g. for slave 1 on bus 0 as real root (not with sudo):&lt;br /&gt;
&lt;br /&gt;
 # echo spidev &amp;gt; /sys/class/spi_master/spi0/spi0.1/driver_override&lt;br /&gt;
 # echo spi0.1 &amp;gt; /sys/bus/spi/drivers/spidev/bind&lt;br /&gt;
&lt;br /&gt;
For all devices handled by spi_ch341_usb driver (again, only as real root):&lt;br /&gt;
&lt;br /&gt;
 # for i in /sys/bus/usb/drivers/spi-ch341-usb/*/spi_master/spi*/spi*.*; do echo spidev &amp;gt; $i/driver_override; echo $(basename $i) &amp;gt; /sys/bus/spi/drivers/spidev/bind; done&lt;br /&gt;
&lt;br /&gt;
The documentation found at https://github.com/dimich-dmb/spi-ch341-usb/blob/master/README.md has more information.&lt;br /&gt;
&lt;br /&gt;
The 5.15+ driver is not ready yet. But if you are interested in testing, helping to get the configuration right, or working on application development you can build and test the current driver:&lt;br /&gt;
&lt;br /&gt;
 $ git clone -b pinedio https://github.com/UncleGrumpy/spi-ch341-usb.git &lt;br /&gt;
 $ cd spi-ch341-usb&lt;br /&gt;
 $ make&lt;br /&gt;
 $ sudo make install&lt;br /&gt;
&lt;br /&gt;
So far this will automatically set up the SPI slave device /dev/spi0.0. It names the ch341-usb device as &amp;quot;pinedio&amp;quot; this will allow application developers to find the correct gpiochip by name. I need help confirming the correct gpio pins but as of now the driver will setup the following configuration:&lt;br /&gt;
&lt;br /&gt;
The driver uses following CH341A pins for the SPI interface. &lt;br /&gt;
 {| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
  | Pin || Name || Direction || Function SPI (CH341A)&lt;br /&gt;
  |-&lt;br /&gt;
  | 18  || D3   || output    || SCK (DCK)             &lt;br /&gt;
  |-&lt;br /&gt;
  | 20  || D5   || output    || MOSI (DOUT)           &lt;br /&gt;
  |-&lt;br /&gt;
  | 22  || D7   || input     || MISO (DIN)            &lt;br /&gt;
  |-&lt;br /&gt;
  | 15  || D0   || output    || CS0                   &lt;br /&gt;
 |}&lt;br /&gt;
&lt;br /&gt;
The driver uses the following GPIO configuration.  I am not at all sure these are the correct pins to use! This is one area that I could really use some help with!!!&lt;br /&gt;
 {| class=&amp;quot;wikitable&lt;br /&gt;
  | CH341 Pin || CH341A Name || Function   || GPIO Name  || GPIO Configuration || SX1262 connection&lt;br /&gt;
  |-&lt;br /&gt;
  |  7        || INT#        || IRQ        || dio_irq    || Output             || DIO1 (IRQ)        &lt;br /&gt;
  |-&lt;br /&gt;
  |  8        || SLCT        || BUSY       || dio_busy   || Input              || BUSY              &lt;br /&gt;
  |-&lt;br /&gt;
  | 26        || RST#        || Hard Reset || dio_reset  || Output             || NRESET            &lt;br /&gt;
 |}&lt;br /&gt;
&lt;br /&gt;
The function of these pins can be changed from user space by using libgpiod. The command line tools installed with the library (gpioset, gpioget, gpiodetect, gpioinfo...) can be used for bash scripts, etc. and applications should all use the libgpiod interfaces. The /sys/class/gpio interface has been removed from the kernel in 5.15, so any apps using /sys/class/gpio to access gpio pins are broken, or will be as distos update their kernels to 5.15 and beyond.&lt;br /&gt;
&lt;br /&gt;
GPIO pins can be listed with gpioinfo:&lt;br /&gt;
 $ gpioinfo pinedio&lt;br /&gt;
&lt;br /&gt;
The output should look similar to:&lt;br /&gt;
 gpiochip1 - 3 lines:&lt;br /&gt;
         line   0:    &amp;quot;dio_irq&amp;quot;       unused   input  active-high&lt;br /&gt;
         line   1:   &amp;quot;dio_busy&amp;quot;       unused   input  active-high&lt;br /&gt;
         line   2:  &amp;quot;dio_reset&amp;quot;       unused  output  active-high&lt;br /&gt;
&lt;br /&gt;
The gpiochip# might be different.  The driver exposes the Pinedio with the gpio name &amp;quot;pinedio&amp;quot;, developers should use this name to interact with the gpiochip because the gpiochip# of the device is likely to be different from one system to the next, or depending on the order devices are initialized.&lt;br /&gt;
&lt;br /&gt;
=== Driver for the SX1262 LoRa module ===&lt;br /&gt;
Now that we can talk to the SX1262 via the CH341 USB converter chip, we need to send actual commands to make it emit or receive LoRa messages. To do this, you can implement the driver yourself using info from the datasheet, or use an existing driver (you can easily find drivers for the Arduino framework, for example. &lt;br /&gt;
I found [https://github.com/YukiWorkshop/sx126x_driver this C++ driver]. It's well written, lightweight and easily portable across many platforms. All you have to do is implement 3 HAL function : read GPIO, write GPIO and transfer data on SPI. I wrote a quick'n'dirty app that emits a LoRa frame. It's [https://gist.github.com/JF002/f1af5595874942427eea9d375c18fc73 available here]. &lt;br /&gt;
&lt;br /&gt;
As I don't have any 'raw' LoRa device on hands, I check that it was actually transmitting something using my SDR setup (simple TNT usb key and '''Gqrx''' software):&lt;br /&gt;
&lt;br /&gt;
[[File:pine64-lora-usb-adapter-sdr.png|500px]]&lt;br /&gt;
&lt;br /&gt;
== Other end nodes ==&lt;br /&gt;
&lt;br /&gt;
There are several end-node units planned:&lt;br /&gt;
* loRa back case for the PinePhone&lt;br /&gt;
* standalone USB dongle-type end-node adapter&lt;br /&gt;
* PineTab adapter&lt;br /&gt;
* as well as a SPI module (which can also be configured as a USB LoRa dongle)&lt;br /&gt;
* a LoRa stick powered by a single 18650 battery (using the [https://wiki.pine64.org/wiki/Nutcracker BL602], and can be fitted with GPS, an low-power OLED panel and additional sensors)&lt;br /&gt;
&lt;br /&gt;
All the end-nodes use the SX1262 chip. &lt;br /&gt;
&lt;br /&gt;
=== Pictures ===&lt;br /&gt;
&amp;lt;gallery&amp;gt;&lt;br /&gt;
File:Blog-april-USB-LoRa-1024x655.jpg&lt;br /&gt;
File:Blog-april-LoRa-something-839x1024.jpg&lt;br /&gt;
File:Discord_20210421_lora_usb_closeup.jpg&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Datasheets and schematics ==&lt;br /&gt;
=== Gateway ===&lt;br /&gt;
* [https://www.semtech.com/products/wireless-rf/lora-gateways/sx1302 SX1302 datasheets and resources]&lt;br /&gt;
* [https://docs.rakwireless.com/Product-Categories/WisLink/RAK2247/Overview/ RAK2287 datasheets and resources]&lt;br /&gt;
* [https://wiki.pine64.org/images/5/54/PINE64_LoRa_Gateway_Module_Adapter_Schematic-v1.0-20210308.pdf Pine64 LoRa Gateway module adapter schematic]&lt;br /&gt;
&lt;br /&gt;
=== End nodes ===&lt;br /&gt;
* [https://www.semtech.com/products/wireless-rf/lora-transceivers/sx1262 SX1262 datasheets and resources]&lt;br /&gt;
&lt;br /&gt;
=== Pinephone backplate ===&lt;br /&gt;
* [[File:Pinephone_LoRa_BackPanel_Schematic-v1.0-20210402.pdf]]&lt;br /&gt;
* [[File:CA-S01_LoRa_Chip_Antenna_in_Chinese.pdf]]&lt;br /&gt;
* [https://github.com/zschroeder6212/tiny-i2c-spi I2C SPI Bridge code running on ATtiny84]&lt;br /&gt;
&lt;br /&gt;
=== USB LoRa adapter ===&lt;br /&gt;
* [[File:USB_LoRa_adapter-PINE64_RFM90_SCH_2021_04_26.pdf]]&lt;br /&gt;
* CH341 datasheet : [[File:CH341DS1.pdf]]&lt;br /&gt;
* Semtech SX1262 datasheet : [https://semtech.my.salesforce.com/sfc/p/#E0000000JelG/a/2R000000HT76/7Nka9W5WgugoZe.xwIHJy6ebj1hW8UJ.USO_Pt2CLLo File on Semtech website (file is too big for the wiki)]&lt;br /&gt;
&lt;br /&gt;
=== PineDio Stack ===&lt;br /&gt;
* Schematic : [[File:PINEDIO_STACK_V1_0-2021_05_24C.pdf]]&lt;br /&gt;
&lt;br /&gt;
== Other resources ==&lt;br /&gt;
* [https://www.youtube.com/watch?v=cJ0wpANpbyc Video: A peek at Pine64's LoRa gateway and modules]&lt;br /&gt;
* [https://iotw.io/ IOTW - Blockchain-Enabled IoT Data Platform]&lt;br /&gt;
* [https://lupyuen.github.io/articles/pinedio PineDio Stack BL604 RISC-V Board: Testing The Prototype]&lt;br /&gt;
* [https://lupyuen.github.io/articles/lorawan2 LoRaWAN on PineDio Stack BL604 RISC-V Board]&lt;br /&gt;
* [https://lupyuen.github.io/articles/ttn The Things Network on PineDio Stack BL604 RISC-V Board]&lt;br /&gt;
* [https://lupyuen.github.io/articles/prometheus Monitor IoT Devices in The Things Network with Prometheus and Grafana]&lt;br /&gt;
* [https://lupyuen.github.io/articles/tsen Internal Temperature Sensor on BL602]&lt;br /&gt;
* [https://lupyuen.github.io/articles/roblox IoT Digital Twin with Roblox and The Things Network]&lt;br /&gt;
* [https://lupyuen.github.io/articles/gateway PineDio LoRa Gateway: Testing The Prototype]&lt;br /&gt;
* [https://lupyuen.github.io/articles/nuttx Apache NuttX OS on RISC-V BL602 and BL604]&lt;br /&gt;
* [https://lupyuen.github.io/articles/spi2 SPI on Apache NuttX OS]&lt;br /&gt;
* [https://lupyuen.github.io/articles/sx1262 LoRa SX1262 on Apache NuttX OS]&lt;br /&gt;
* [https://lupyuen.github.io/articles/lorawan3 LoRaWAN on Apache NuttX OS]&lt;br /&gt;
* [https://lupyuen.github.io/articles/rust2 Rust on Apache NuttX OS]&lt;br /&gt;
* [https://lupyuen.github.io/articles/ikea Connect IKEA Air Quality Sensor to Apache NuttX OS]&lt;br /&gt;
* [https://lupyuen.github.io/articles/pinedio2 PineDio Stack BL604 runs Apache NuttX RTOS]&lt;br /&gt;
* [https://lupyuen.github.io/articles/touch NuttX Touch Panel Driver for PineDio Stack BL604]&lt;br /&gt;
* [https://www.robertlipe.com/buttons-on-bl602-nuttx/ Buttons on BL602 NuttX]&lt;br /&gt;
* [https://lupyuen.github.io/articles/expander NuttX GPIO Expander for PineDio Stack BL604]&lt;/div&gt;</summary>
		<author><name>Lupyuen</name></author>
	</entry>
</feed>