<?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=Pavlos1</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=Pavlos1"/>
	<link rel="alternate" type="text/html" href="https://wiki.pine64.org/wiki/Special:Contributions/Pavlos1"/>
	<updated>2026-04-26T06:37:08Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.37.1</generator>
	<entry>
		<id>https://wiki.pine64.org/index.php?title=Talk:Ox64&amp;diff=21398</id>
		<title>Talk:Ox64</title>
		<link rel="alternate" type="text/html" href="https://wiki.pine64.org/index.php?title=Talk:Ox64&amp;diff=21398"/>
		<updated>2024-01-19T03:57:20Z</updated>

		<summary type="html">&lt;p&gt;Pavlos1: /* Does DevCube 1.8.8 work? */ new section&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Flash memory producer ==&lt;br /&gt;
&lt;br /&gt;
Hello. On this page I see datasheets for Gigadevice flash memory, but on my boards placed Winbond flash. Maybe we need to update datasheets?--[[User:ElektroNIK|ElektroNIK]] ([[User talk:ElektroNIK|talk]]) 11:58, 20 January 2023 (UTC)&lt;br /&gt;
&lt;br /&gt;
== I disagree with the name of section 10 ==&lt;br /&gt;
&lt;br /&gt;
[Placeholder for the initial message by [[User:Pavlos1]]]&lt;br /&gt;
&lt;br /&gt;
: Hello!  Did you mean that the &amp;quot;Flashing Ox64 SBC and SD Card for Newbies&amp;quot; section title should be reworded?  I'd agree about that, and I'd suggest that the &amp;quot;for Newbies&amp;quot; part is simply dropped. -- [[User:Dsimic|Dsimic]] ([[User talk:Dsimic|talk]]) 17:00, 4 January 2024 (UTC)&lt;br /&gt;
&lt;br /&gt;
:: Went ahead and implemented [https://wiki.pine64.org/index.php?title=Ox64&amp;amp;type=revision&amp;amp;diff=21262&amp;amp;oldid=21257 this edit]. -- [[User:Dsimic|Dsimic]] ([[User talk:Dsimic|talk]]) 17:55, 4 January 2024 (UTC)&lt;br /&gt;
&lt;br /&gt;
== Regarding PIP and --break-system-packages ==&lt;br /&gt;
&lt;br /&gt;
To [[User:Giorez]] and other editors:&lt;br /&gt;
&lt;br /&gt;
The instructions in the [https://wiki.pine64.org/wiki/Ox64#Open-Source_Flashing_Using_CLI Open-Source Flashing Using CLI] section involve installing a PIP package. Doing so is a bit awkward due to conflicts with system packages. I used to do it as follows, but for whatever reason that doesn't work anymore (at least on Gentoo and Arch).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
pip install --user $PACKAGE&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In the article itself I suggested creating a virtual environment as follows. That seems to be the &amp;quot;preferred&amp;quot; way of managing a separate set of Python packages to the ones installed by the OS package manager.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
python -m venv ~/ox64_venv&lt;br /&gt;
. ~/ox64_venv/bin/activate&lt;br /&gt;
pip install $PACKAGE&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Note that when you run &amp;lt;code&amp;gt;pip install&amp;lt;/code&amp;gt; with the virtual environment activated, it installs the package ''to'' the virtual environment. So you need to re-activate the virtual environment each time you open a new terminal window; otherwise &amp;lt;code&amp;gt;bflb-iot-tool&amp;lt;/code&amp;gt; will not be in your &amp;lt;code&amp;gt;PATH&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
The following is not recommended since it is instructing PIP to potentially introduce conflicts with system packages. And to be clear: running the command below is *not* necessary if you have already set up the virtual environment as described above.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
sudo pip install $PACKAGE --break-system-packages&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
-- [[User:Pavlos1|Pavlos1]] ([[User talk:Pavlos1|talk]]) 03:22, 6 January 2024 (UTC)&lt;br /&gt;
&lt;br /&gt;
: I agree with the way you described it above. -- [[User:Dsimic|Dsimic]] ([[User talk:Dsimic|talk]]) 17:13, 6 January 2024 (UTC)&lt;br /&gt;
&lt;br /&gt;
I agree, sorry for keep editing my original post. I'm not expert in linux system. I just started this article, because i has been really frustrated to find a full tutorial for newbies. And i usually look for newbie tips to share/get help from expert people like you. thank for your contribution. -- [[User:Giorez|Giorez]] ([[User talk:Giorez|talk]]) 10:53, 7 January 2024 (UTC)&lt;br /&gt;
&lt;br /&gt;
: That's all good. Thanks for testing out my flashing instructions &amp;amp;mdash; these things don't always work the same way across different Linux systems. -- [[User:Pavlos1|Pavlos1]] ([[User talk:Pavlos1|talk]]) 12:12, 7 January 2024 (UTC)&lt;br /&gt;
&lt;br /&gt;
== Does DevCube 1.8.8 work? ==&lt;br /&gt;
&lt;br /&gt;
If so, we don't have to have a direct-download link (or SHA hashes) to any particular version; we can just instruct users to download the latest release. But please confirm that DevCube 1.8.8 does in fact successfully flash OpenBouffalo images before doing so. -- [[User:Pavlos1|Pavlos1]] ([[User talk:Pavlos1|talk]]) 03:57, 19 January 2024 (UTC)&lt;/div&gt;</summary>
		<author><name>Pavlos1</name></author>
	</entry>
	<entry>
		<id>https://wiki.pine64.org/index.php?title=Ox64&amp;diff=21397</id>
		<title>Ox64</title>
		<link rel="alternate" type="text/html" href="https://wiki.pine64.org/index.php?title=Ox64&amp;diff=21397"/>
		<updated>2024-01-19T03:43:30Z</updated>

		<summary type="html">&lt;p&gt;Pavlos1: /* Build */ menuconfig navigation fix&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;
Open the terminal and create a new directory for the build:&lt;br /&gt;
&lt;br /&gt;
 cd ~/Downloads/ox64&lt;br /&gt;
 mkdir buildroot_bouffalo &amp;amp;&amp;amp; cd buildroot_bouffalo&lt;br /&gt;
&lt;br /&gt;
Clone the primary Buildroot repository and the specific Buildroot Bouffalo repository:&lt;br /&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;
&lt;br /&gt;
Define an environment variable for the Buildroot Bouffalo overlay path:&lt;br /&gt;
&lt;br /&gt;
 export BR_BOUFFALO_OVERLAY_PATH=$(pwd)/buildroot_bouffalo&lt;br /&gt;
&lt;br /&gt;
Change directory into the cloned Buildroot folder:&lt;br /&gt;
&lt;br /&gt;
 cd ~/Downloads/ox64/buildroot_bouffalo/buildroot&lt;br /&gt;
&lt;br /&gt;
Apply the default configuration for Pine64 Ox64:&lt;br /&gt;
&lt;br /&gt;
 make BR2_EXTERNAL=$BR_BOUFFALO_OVERLAY_PATH pine64_ox64_defconfig&lt;br /&gt;
 # make clean # deletes all the already compiled object files&lt;br /&gt;
&lt;br /&gt;
Use the &amp;lt;code&amp;gt;menuconfig&amp;lt;/code&amp;gt; tool to adjust the build settings:&lt;br /&gt;
&lt;br /&gt;
 make menuconfig&lt;br /&gt;
&lt;br /&gt;
[[File:target ABI setting.png|thumb|right|200px|target ABI setting]]&lt;br /&gt;
[[File:toolchain setting.png|thumb|right|200px|toolchain setting]]&lt;br /&gt;
&lt;br /&gt;
Within &amp;lt;code&amp;gt;menuconfig&amp;lt;/code&amp;gt;, configure the following:&lt;br /&gt;
* Navigate to &amp;lt;code&amp;gt;Target Options&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;
* 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;
&lt;br /&gt;
Initiate the build process, but make sure first that your &amp;lt;code&amp;gt;PATH&amp;lt;/code&amp;gt; variable contains no spaces:&lt;br /&gt;
&lt;br /&gt;
 make&lt;br /&gt;
&lt;br /&gt;
You will get the image files required for flashing in the &amp;lt;code&amp;gt;output/images&amp;lt;/code&amp;gt; directory&lt;br /&gt;
&lt;br /&gt;
== Flashing Ox64 SBC and microSD Card ==&lt;br /&gt;
This section explains how to flash an Ox64 board and a microSD card to boot the system.&lt;br /&gt;
&lt;br /&gt;
=== Prepare the Environment === &lt;br /&gt;
You need a Linux machine, a Raspberry Pi Pico to act as a UART adapter, the Ox64 board, and a microSD card.&lt;br /&gt;
&lt;br /&gt;
Start a terminal session and set the working directory to download some files.&lt;br /&gt;
&lt;br /&gt;
 cd ~/Downloads&lt;br /&gt;
 mkdir ox64 ox64/pico&lt;br /&gt;
 cd ~/Downloads/ox64/pico&lt;br /&gt;
 wget https://github.com/Kris-Sekula/Pine64_Ox64_SBC/blob/main/uart/picoprobe.uf2&lt;br /&gt;
&lt;br /&gt;
 cd ~/Downloads/ox64&lt;br /&gt;
 mkdir ox64/devcube&lt;br /&gt;
 cd ~/Downloads/ox64/devcube&lt;br /&gt;
&lt;br /&gt;
Get the DevCube 1.8.8 flasher from one of mirror servers listed below.&lt;br /&gt;
&lt;br /&gt;
* https://dev.bouffalolab.com/media/upload/download/BouffaloLabDevCube-v1.8.8.zip&lt;br /&gt;
&lt;br /&gt;
Verify the file hashes listed below.&lt;br /&gt;
&lt;br /&gt;
* SHA1: &amp;lt;code&amp;gt;0f2619e87d946f936f63ae97b0efd674357b1166&amp;lt;/code&amp;gt;&lt;br /&gt;
* SHA256: &amp;lt;code&amp;gt;e6e6db316359da40d29971a1889d41c9e97d5b1ff1a8636e9e6960b6ff960913&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Finally, uncompress the downloaded archive; for example:&lt;br /&gt;
&lt;br /&gt;
 wget https://dev.bouffalolab.com/media/upload/download/BouffaloLabDevCube-v1.8.8.zip&lt;br /&gt;
 sha256sum BouffaloLabDevCube-v1.8.8.zip&lt;br /&gt;
 unzip BouffaloLabDevCube-v1.8.8.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 need the following files for the flashing process.&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code&amp;gt;m0_lowload_bl808_m0.bin&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;d0_lowload_bl808_d0.bin&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;bl808-firmware.bin&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;sdcard.img&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Establish Serial Communication from PC to Ox64 using Pi Pico ===&lt;br /&gt;
Open a terminal and check the connected USB serial devices.&lt;br /&gt;
&lt;br /&gt;
 ls /dev/ttyACM*&lt;br /&gt;
&lt;br /&gt;
Set the Raspberry Pi Pico board into programming mode.&lt;br /&gt;
&lt;br /&gt;
* Press the BootSel button&lt;br /&gt;
* Apply power by plugging the USB cable to PC&lt;br /&gt;
* Release the BootSel button&lt;br /&gt;
&lt;br /&gt;
''Note: you could also ground pin28 to TP6 while powering.''&lt;br /&gt;
&lt;br /&gt;
Copy &amp;lt;code&amp;gt;picoprobe.uf2&amp;lt;/code&amp;gt; file into the new device &amp;lt;code&amp;gt;/media/&amp;lt;user&amp;gt;/RPI-RP2&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
 cp ~/Downloads/ox64/pico/picoprobe.uf2 /media/&amp;lt;user&amp;gt;/RPI-RP2&lt;br /&gt;
&lt;br /&gt;
After flashing, the device will auto-set in serial UART communication mode according to the following wiring diagram.&lt;br /&gt;
&lt;br /&gt;
[[File:Pine Serial v2.png|thumb|right|Wiring Raspberry Pi Pico to Pine64 Ox64 SBC]]&lt;br /&gt;
&lt;br /&gt;
 OX64                      PI PICO&lt;br /&gt;
 uart0_Tx_GPIO14_pin1 &amp;lt;-&amp;gt;  uart0_Rx_pin17&lt;br /&gt;
 uart0_Rx_GPIO15_pin2 &amp;lt;-&amp;gt;  uart0_Tx_pin16&lt;br /&gt;
 Rxd_GPIO17_pin31     &amp;lt;-&amp;gt;  uart1_Tx_pin6&lt;br /&gt;
 Txd_GPIO16_pin32     &amp;lt;-&amp;gt;  uart1_Rx_pin7 &lt;br /&gt;
 gnd_pin38            &amp;lt;-&amp;gt;  gnd_pin38/3    &lt;br /&gt;
 vbus5v_pin40         &amp;lt;-&amp;gt;  vbus5v_pin40&lt;br /&gt;
&lt;br /&gt;
=== Flash Your Ox64 === &lt;br /&gt;
There are two new ports to choose from, &amp;lt;code&amp;gt;/dev/ttyACM0&amp;lt;/code&amp;gt; for serial console and &amp;lt;code&amp;gt;/dev/ttyACM1&amp;lt;/code&amp;gt; for DevCube flashing.&lt;br /&gt;
&lt;br /&gt;
 minicom -b 2000000 -D /dev/ttyACM0&lt;br /&gt;
&lt;br /&gt;
Set the Ox64 board into programming mode.&lt;br /&gt;
&lt;br /&gt;
* Press the BOOT button&lt;br /&gt;
* Apply power or re-plug the USB cable&lt;br /&gt;
* Release the BOOT button&lt;br /&gt;
&lt;br /&gt;
Close &amp;lt;code&amp;gt;minicom&amp;lt;/code&amp;gt;. Open a new terminal window to run the DevCube flasher.&lt;br /&gt;
&lt;br /&gt;
 cd ~/Downloads/ox64/devcube&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 (make sure you don't use /dev/ttyACM0, it's used by the minicom console)&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 the [IOT] tab.&lt;br /&gt;
&lt;br /&gt;
 Enable 'Single Download', set Address with 0x800000, choose [PATH to bl808-firmware.bin]&lt;br /&gt;
 Port/SN: /dev/ttyACM1 (make sure you don't use ACM0, it's used by minicom console)&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;
==== Open-Source Flashing Using CLI ====&lt;br /&gt;
For those who do not want to use the DevCube, BouffaloLab provides open-source flashing packages &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;
First, install &amp;lt;code&amp;gt;bflb-iot-tool&amp;lt;/code&amp;gt; using your preferred method of managing PIP packages. One option is to set up a Python virtual environment as follows.&lt;br /&gt;
&lt;br /&gt;
 sudo apt install virtualenv python3-virtualenv python3.11-venv&lt;br /&gt;
 python3 -m venv ~/ox64_venv&lt;br /&gt;
 . ~/ox64_venv/bin/activate&lt;br /&gt;
 pip install bflb-iot-tool ''# we are *not* using bflb-mcu-tool''&lt;br /&gt;
&lt;br /&gt;
Note that each time you open a new terminal window you will need to re-run &amp;lt;code&amp;gt;. ~/ox64_venv/bin/activate&amp;lt;/code&amp;gt; to reactivate the virtual environment.&lt;br /&gt;
&lt;br /&gt;
Next, put Ox64 in programming mode (press the BOOT button when first applying power) and flash the BL808.&lt;br /&gt;
&lt;br /&gt;
 PORT=/dev/ttyACM1 ''# this will depend on which serial adapter you use''&lt;br /&gt;
 BAUD=115200       ''# safe value for macOS, if using Linux set to 2000000 for faster flashing''&lt;br /&gt;
 cd ~/Downloads/ox64/buildroot_bouffalo/buildroot/output/images&lt;br /&gt;
 &lt;br /&gt;
 bflb-iot-tool --chipname bl808 --interface uart --port $PORT --baudrate $BAUD --addr 0x000000 --firmware m0_lowload_bl808_m0.bin --single&lt;br /&gt;
 bflb-iot-tool --chipname bl808 --interface uart --port $PORT --baudrate $BAUD --addr 0x100000 --firmware d0_lowload_bl808_d0.bin --single&lt;br /&gt;
 bflb-iot-tool --chipname bl808 --interface uart --port $PORT --baudrate $BAUD --addr 0x800000 --firmware bl808-firmware.bin --single&lt;br /&gt;
&lt;br /&gt;
If you get permission errors when running the commands above, you may need to add your user to the &amp;lt;code&amp;gt;dialout&amp;lt;/code&amp;gt; group. Running the commands as &amp;lt;code&amp;gt;root&amp;lt;/code&amp;gt; is not recommended since this will make &amp;lt;code&amp;gt;bflb-iot-tool&amp;lt;/code&amp;gt; create &amp;lt;code&amp;gt;root&amp;lt;/code&amp;gt;-owned files in your home directory.&lt;br /&gt;
&lt;br /&gt;
==== BL808 Address Details ====&lt;br /&gt;
Note that the addresses are different according to the flashing method, DevCube or CLI.&lt;br /&gt;
&lt;br /&gt;
              DevCube      CLI   &lt;br /&gt;
 M0 address   0x58000000   0x000000&lt;br /&gt;
 D0 address   0x58100000   0x100000&lt;br /&gt;
 LP address   0x58200000   0x200000&lt;br /&gt;
&lt;br /&gt;
=== Flash Your microSD Card ===&lt;br /&gt;
Insert microSD card into PC, locate its device file (&amp;lt;code&amp;gt;/dev/sdb&amp;lt;/code&amp;gt;, for example), erase the start of the card and proceed to flashing.&lt;br /&gt;
&lt;br /&gt;
 cd ~/Downloads/ox64/buildroot_bouffalo/buildroot/output/images&lt;br /&gt;
 sudo dd if=/dev/zero of=/dev/sdb count=1 bs=32768 &lt;br /&gt;
 sudo dd if=sdcard.img of=/dev/sdb bs=1M status=progress conv=fsync&lt;br /&gt;
&lt;br /&gt;
=== Booting for the First Time ===&lt;br /&gt;
Insert microSD card into Ox64 and set a UART connection to the Ox64 board, using the following parameters.&lt;br /&gt;
&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 rate is 2000000&lt;br /&gt;
&lt;br /&gt;
Choose from serial devices &amp;lt;code&amp;gt;/dev/ttyACM0&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;/dev/ttyACM1&amp;lt;/code&amp;gt;, using the lower number.&lt;br /&gt;
&lt;br /&gt;
 minicom -b 2000000 -D /dev/ttyACM0&lt;br /&gt;
&lt;br /&gt;
Re-apply power to the Ox64 and enjoy the booting!&lt;br /&gt;
&lt;br /&gt;
[[Category:Ox64]]&lt;br /&gt;
[[Category:Bouffalo BL808]]&lt;/div&gt;</summary>
		<author><name>Pavlos1</name></author>
	</entry>
	<entry>
		<id>https://wiki.pine64.org/index.php?title=Ox64&amp;diff=21396</id>
		<title>Ox64</title>
		<link rel="alternate" type="text/html" href="https://wiki.pine64.org/index.php?title=Ox64&amp;diff=21396"/>
		<updated>2024-01-19T03:36:19Z</updated>

		<summary type="html">&lt;p&gt;Pavlos1: /* Build */ `make new` is not a valid buildroot target&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;
Open the terminal and create a new directory for the build:&lt;br /&gt;
&lt;br /&gt;
 cd ~/Downloads/ox64&lt;br /&gt;
 mkdir buildroot_bouffalo &amp;amp;&amp;amp; cd buildroot_bouffalo&lt;br /&gt;
&lt;br /&gt;
Clone the primary Buildroot repository and the specific Buildroot Bouffalo repository:&lt;br /&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;
&lt;br /&gt;
Define an environment variable for the Buildroot Bouffalo overlay path:&lt;br /&gt;
&lt;br /&gt;
 export BR_BOUFFALO_OVERLAY_PATH=$(pwd)/buildroot_bouffalo&lt;br /&gt;
&lt;br /&gt;
Change directory into the cloned Buildroot folder:&lt;br /&gt;
&lt;br /&gt;
 cd ~/Downloads/ox64/buildroot_bouffalo/buildroot&lt;br /&gt;
&lt;br /&gt;
Apply the default configuration for Pine64 Ox64:&lt;br /&gt;
&lt;br /&gt;
 make BR2_EXTERNAL=$BR_BOUFFALO_OVERLAY_PATH pine64_ox64_defconfig&lt;br /&gt;
 # make clean # deletes all the already compiled object files&lt;br /&gt;
&lt;br /&gt;
Use the &amp;lt;code&amp;gt;menuconfig&amp;lt;/code&amp;gt; tool to adjust the build settings:&lt;br /&gt;
&lt;br /&gt;
 make menuconfig&lt;br /&gt;
&lt;br /&gt;
[[File:target ABI setting.png|thumb|right|200px|target ABI setting]]&lt;br /&gt;
[[File:toolchain setting.png|thumb|right|200px|toolchain setting]]&lt;br /&gt;
&lt;br /&gt;
Within &amp;lt;code&amp;gt;menuconfig&amp;lt;/code&amp;gt;, configure the following:&lt;br /&gt;
* Navigate to &amp;lt;code&amp;gt;Target Options &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;
* 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;
&lt;br /&gt;
Initiate the build process, but make sure first that your &amp;lt;code&amp;gt;PATH&amp;lt;/code&amp;gt; variable contains no spaces:&lt;br /&gt;
&lt;br /&gt;
 make&lt;br /&gt;
&lt;br /&gt;
You will get the image files required for flashing in the &amp;lt;code&amp;gt;output/images&amp;lt;/code&amp;gt; directory&lt;br /&gt;
&lt;br /&gt;
== Flashing Ox64 SBC and microSD Card ==&lt;br /&gt;
This section explains how to flash an Ox64 board and a microSD card to boot the system.&lt;br /&gt;
&lt;br /&gt;
=== Prepare the Environment === &lt;br /&gt;
You need a Linux machine, a Raspberry Pi Pico to act as a UART adapter, the Ox64 board, and a microSD card.&lt;br /&gt;
&lt;br /&gt;
Start a terminal session and set the working directory to download some files.&lt;br /&gt;
&lt;br /&gt;
 cd ~/Downloads&lt;br /&gt;
 mkdir ox64 ox64/pico&lt;br /&gt;
 cd ~/Downloads/ox64/pico&lt;br /&gt;
 wget https://github.com/Kris-Sekula/Pine64_Ox64_SBC/blob/main/uart/picoprobe.uf2&lt;br /&gt;
&lt;br /&gt;
 cd ~/Downloads/ox64&lt;br /&gt;
 mkdir ox64/devcube&lt;br /&gt;
 cd ~/Downloads/ox64/devcube&lt;br /&gt;
&lt;br /&gt;
Get the DevCube 1.8.8 flasher from one of mirror servers listed below.&lt;br /&gt;
&lt;br /&gt;
* https://dev.bouffalolab.com/media/upload/download/BouffaloLabDevCube-v1.8.8.zip&lt;br /&gt;
&lt;br /&gt;
Verify the file hashes listed below.&lt;br /&gt;
&lt;br /&gt;
* SHA1: &amp;lt;code&amp;gt;0f2619e87d946f936f63ae97b0efd674357b1166&amp;lt;/code&amp;gt;&lt;br /&gt;
* SHA256: &amp;lt;code&amp;gt;e6e6db316359da40d29971a1889d41c9e97d5b1ff1a8636e9e6960b6ff960913&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Finally, uncompress the downloaded archive; for example:&lt;br /&gt;
&lt;br /&gt;
 wget https://dev.bouffalolab.com/media/upload/download/BouffaloLabDevCube-v1.8.8.zip&lt;br /&gt;
 sha256sum BouffaloLabDevCube-v1.8.8.zip&lt;br /&gt;
 unzip BouffaloLabDevCube-v1.8.8.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 need the following files for the flashing process.&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code&amp;gt;m0_lowload_bl808_m0.bin&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;d0_lowload_bl808_d0.bin&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;bl808-firmware.bin&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;sdcard.img&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Establish Serial Communication from PC to Ox64 using Pi Pico ===&lt;br /&gt;
Open a terminal and check the connected USB serial devices.&lt;br /&gt;
&lt;br /&gt;
 ls /dev/ttyACM*&lt;br /&gt;
&lt;br /&gt;
Set the Raspberry Pi Pico board into programming mode.&lt;br /&gt;
&lt;br /&gt;
* Press the BootSel button&lt;br /&gt;
* Apply power by plugging the USB cable to PC&lt;br /&gt;
* Release the BootSel button&lt;br /&gt;
&lt;br /&gt;
''Note: you could also ground pin28 to TP6 while powering.''&lt;br /&gt;
&lt;br /&gt;
Copy &amp;lt;code&amp;gt;picoprobe.uf2&amp;lt;/code&amp;gt; file into the new device &amp;lt;code&amp;gt;/media/&amp;lt;user&amp;gt;/RPI-RP2&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
 cp ~/Downloads/ox64/pico/picoprobe.uf2 /media/&amp;lt;user&amp;gt;/RPI-RP2&lt;br /&gt;
&lt;br /&gt;
After flashing, the device will auto-set in serial UART communication mode according to the following wiring diagram.&lt;br /&gt;
&lt;br /&gt;
[[File:Pine Serial v2.png|thumb|right|Wiring Raspberry Pi Pico to Pine64 Ox64 SBC]]&lt;br /&gt;
&lt;br /&gt;
 OX64                      PI PICO&lt;br /&gt;
 uart0_Tx_GPIO14_pin1 &amp;lt;-&amp;gt;  uart0_Rx_pin17&lt;br /&gt;
 uart0_Rx_GPIO15_pin2 &amp;lt;-&amp;gt;  uart0_Tx_pin16&lt;br /&gt;
 Rxd_GPIO17_pin31     &amp;lt;-&amp;gt;  uart1_Tx_pin6&lt;br /&gt;
 Txd_GPIO16_pin32     &amp;lt;-&amp;gt;  uart1_Rx_pin7 &lt;br /&gt;
 gnd_pin38            &amp;lt;-&amp;gt;  gnd_pin38/3    &lt;br /&gt;
 vbus5v_pin40         &amp;lt;-&amp;gt;  vbus5v_pin40&lt;br /&gt;
&lt;br /&gt;
=== Flash Your Ox64 === &lt;br /&gt;
There are two new ports to choose from, &amp;lt;code&amp;gt;/dev/ttyACM0&amp;lt;/code&amp;gt; for serial console and &amp;lt;code&amp;gt;/dev/ttyACM1&amp;lt;/code&amp;gt; for DevCube flashing.&lt;br /&gt;
&lt;br /&gt;
 minicom -b 2000000 -D /dev/ttyACM0&lt;br /&gt;
&lt;br /&gt;
Set the Ox64 board into programming mode.&lt;br /&gt;
&lt;br /&gt;
* Press the BOOT button&lt;br /&gt;
* Apply power or re-plug the USB cable&lt;br /&gt;
* Release the BOOT button&lt;br /&gt;
&lt;br /&gt;
Close &amp;lt;code&amp;gt;minicom&amp;lt;/code&amp;gt;. Open a new terminal window to run the DevCube flasher.&lt;br /&gt;
&lt;br /&gt;
 cd ~/Downloads/ox64/devcube&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 (make sure you don't use /dev/ttyACM0, it's used by the minicom console)&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 the [IOT] tab.&lt;br /&gt;
&lt;br /&gt;
 Enable 'Single Download', set Address with 0x800000, choose [PATH to bl808-firmware.bin]&lt;br /&gt;
 Port/SN: /dev/ttyACM1 (make sure you don't use ACM0, it's used by minicom console)&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;
==== Open-Source Flashing Using CLI ====&lt;br /&gt;
For those who do not want to use the DevCube, BouffaloLab provides open-source flashing packages &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;
First, install &amp;lt;code&amp;gt;bflb-iot-tool&amp;lt;/code&amp;gt; using your preferred method of managing PIP packages. One option is to set up a Python virtual environment as follows.&lt;br /&gt;
&lt;br /&gt;
 sudo apt install virtualenv python3-virtualenv python3.11-venv&lt;br /&gt;
 python3 -m venv ~/ox64_venv&lt;br /&gt;
 . ~/ox64_venv/bin/activate&lt;br /&gt;
 pip install bflb-iot-tool ''# we are *not* using bflb-mcu-tool''&lt;br /&gt;
&lt;br /&gt;
Note that each time you open a new terminal window you will need to re-run &amp;lt;code&amp;gt;. ~/ox64_venv/bin/activate&amp;lt;/code&amp;gt; to reactivate the virtual environment.&lt;br /&gt;
&lt;br /&gt;
Next, put Ox64 in programming mode (press the BOOT button when first applying power) and flash the BL808.&lt;br /&gt;
&lt;br /&gt;
 PORT=/dev/ttyACM1 ''# this will depend on which serial adapter you use''&lt;br /&gt;
 BAUD=115200       ''# safe value for macOS, if using Linux set to 2000000 for faster flashing''&lt;br /&gt;
 cd ~/Downloads/ox64/buildroot_bouffalo/buildroot/output/images&lt;br /&gt;
 &lt;br /&gt;
 bflb-iot-tool --chipname bl808 --interface uart --port $PORT --baudrate $BAUD --addr 0x000000 --firmware m0_lowload_bl808_m0.bin --single&lt;br /&gt;
 bflb-iot-tool --chipname bl808 --interface uart --port $PORT --baudrate $BAUD --addr 0x100000 --firmware d0_lowload_bl808_d0.bin --single&lt;br /&gt;
 bflb-iot-tool --chipname bl808 --interface uart --port $PORT --baudrate $BAUD --addr 0x800000 --firmware bl808-firmware.bin --single&lt;br /&gt;
&lt;br /&gt;
If you get permission errors when running the commands above, you may need to add your user to the &amp;lt;code&amp;gt;dialout&amp;lt;/code&amp;gt; group. Running the commands as &amp;lt;code&amp;gt;root&amp;lt;/code&amp;gt; is not recommended since this will make &amp;lt;code&amp;gt;bflb-iot-tool&amp;lt;/code&amp;gt; create &amp;lt;code&amp;gt;root&amp;lt;/code&amp;gt;-owned files in your home directory.&lt;br /&gt;
&lt;br /&gt;
==== BL808 Address Details ====&lt;br /&gt;
Note that the addresses are different according to the flashing method, DevCube or CLI.&lt;br /&gt;
&lt;br /&gt;
              DevCube      CLI   &lt;br /&gt;
 M0 address   0x58000000   0x000000&lt;br /&gt;
 D0 address   0x58100000   0x100000&lt;br /&gt;
 LP address   0x58200000   0x200000&lt;br /&gt;
&lt;br /&gt;
=== Flash Your microSD Card ===&lt;br /&gt;
Insert microSD card into PC, locate its device file (&amp;lt;code&amp;gt;/dev/sdb&amp;lt;/code&amp;gt;, for example), erase the start of the card and proceed to flashing.&lt;br /&gt;
&lt;br /&gt;
 cd ~/Downloads/ox64/buildroot_bouffalo/buildroot/output/images&lt;br /&gt;
 sudo dd if=/dev/zero of=/dev/sdb count=1 bs=32768 &lt;br /&gt;
 sudo dd if=sdcard.img of=/dev/sdb bs=1M status=progress conv=fsync&lt;br /&gt;
&lt;br /&gt;
=== Booting for the First Time ===&lt;br /&gt;
Insert microSD card into Ox64 and set a UART connection to the Ox64 board, using the following parameters.&lt;br /&gt;
&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 rate is 2000000&lt;br /&gt;
&lt;br /&gt;
Choose from serial devices &amp;lt;code&amp;gt;/dev/ttyACM0&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;/dev/ttyACM1&amp;lt;/code&amp;gt;, using the lower number.&lt;br /&gt;
&lt;br /&gt;
 minicom -b 2000000 -D /dev/ttyACM0&lt;br /&gt;
&lt;br /&gt;
Re-apply power to the Ox64 and enjoy the booting!&lt;br /&gt;
&lt;br /&gt;
[[Category:Ox64]]&lt;br /&gt;
[[Category:Bouffalo BL808]]&lt;/div&gt;</summary>
		<author><name>Pavlos1</name></author>
	</entry>
	<entry>
		<id>https://wiki.pine64.org/index.php?title=Ox64&amp;diff=21395</id>
		<title>Ox64</title>
		<link rel="alternate" type="text/html" href="https://wiki.pine64.org/index.php?title=Ox64&amp;diff=21395"/>
		<updated>2024-01-19T03:06:00Z</updated>

		<summary type="html">&lt;p&gt;Pavlos1: Undo revision 21394 by Giorez (talk); addresses are incorrect&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;
Open the terminal and create a new directory for the build:&lt;br /&gt;
&lt;br /&gt;
 cd ~/Downloads/ox64&lt;br /&gt;
 mkdir buildroot_bouffalo &amp;amp;&amp;amp; cd buildroot_bouffalo&lt;br /&gt;
&lt;br /&gt;
Clone the primary Buildroot repository and the specific Buildroot Bouffalo repository:&lt;br /&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;
&lt;br /&gt;
Define an environment variable for the Buildroot Bouffalo overlay path:&lt;br /&gt;
&lt;br /&gt;
 export BR_BOUFFALO_OVERLAY_PATH=$(pwd)/buildroot_bouffalo&lt;br /&gt;
&lt;br /&gt;
Change directory into the cloned Buildroot folder:&lt;br /&gt;
&lt;br /&gt;
 cd ~/Downloads/ox64/buildroot_bouffalo/buildroot&lt;br /&gt;
&lt;br /&gt;
Apply the default configuration for Pine64 Ox64:&lt;br /&gt;
&lt;br /&gt;
 make BR2_EXTERNAL=$BR_BOUFFALO_OVERLAY_PATH pine64_ox64_defconfig&lt;br /&gt;
 # make clean # deletes all the already compiled object files&lt;br /&gt;
 # make new # and it will recompile everything again&lt;br /&gt;
&lt;br /&gt;
Use the &amp;lt;code&amp;gt;menuconfig&amp;lt;/code&amp;gt; tool to adjust the build settings:&lt;br /&gt;
&lt;br /&gt;
 make menuconfig&lt;br /&gt;
&lt;br /&gt;
[[File:target ABI setting.png|thumb|right|200px|target ABI setting]]&lt;br /&gt;
[[File:toolchain setting.png|thumb|right|200px|toolchain setting]]&lt;br /&gt;
&lt;br /&gt;
Within &amp;lt;code&amp;gt;menuconfig&amp;lt;/code&amp;gt;, configure the following:&lt;br /&gt;
* Navigate to &amp;lt;code&amp;gt;Target Options &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;
* 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;
&lt;br /&gt;
Initiate the build process, but make sure first that your &amp;lt;code&amp;gt;PATH&amp;lt;/code&amp;gt; variable contains no spaces:&lt;br /&gt;
&lt;br /&gt;
 make&lt;br /&gt;
&lt;br /&gt;
You will get the image files required for flashing in the &amp;lt;code&amp;gt;output/images&amp;lt;/code&amp;gt; directory&lt;br /&gt;
&lt;br /&gt;
== Flashing Ox64 SBC and microSD Card ==&lt;br /&gt;
This section explains how to flash an Ox64 board and a microSD card to boot the system.&lt;br /&gt;
&lt;br /&gt;
=== Prepare the Environment === &lt;br /&gt;
You need a Linux machine, a Raspberry Pi Pico to act as a UART adapter, the Ox64 board, and a microSD card.&lt;br /&gt;
&lt;br /&gt;
Start a terminal session and set the working directory to download some files.&lt;br /&gt;
&lt;br /&gt;
 cd ~/Downloads&lt;br /&gt;
 mkdir ox64 ox64/pico&lt;br /&gt;
 cd ~/Downloads/ox64/pico&lt;br /&gt;
 wget https://github.com/Kris-Sekula/Pine64_Ox64_SBC/blob/main/uart/picoprobe.uf2&lt;br /&gt;
&lt;br /&gt;
 cd ~/Downloads/ox64&lt;br /&gt;
 mkdir ox64/devcube&lt;br /&gt;
 cd ~/Downloads/ox64/devcube&lt;br /&gt;
&lt;br /&gt;
Get the DevCube 1.8.8 flasher from one of mirror servers listed below.&lt;br /&gt;
&lt;br /&gt;
* https://dev.bouffalolab.com/media/upload/download/BouffaloLabDevCube-v1.8.8.zip&lt;br /&gt;
&lt;br /&gt;
Verify the file hashes listed below.&lt;br /&gt;
&lt;br /&gt;
* SHA1: &amp;lt;code&amp;gt;0f2619e87d946f936f63ae97b0efd674357b1166&amp;lt;/code&amp;gt;&lt;br /&gt;
* SHA256: &amp;lt;code&amp;gt;e6e6db316359da40d29971a1889d41c9e97d5b1ff1a8636e9e6960b6ff960913&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Finally, uncompress the downloaded archive; for example:&lt;br /&gt;
&lt;br /&gt;
 wget https://dev.bouffalolab.com/media/upload/download/BouffaloLabDevCube-v1.8.8.zip&lt;br /&gt;
 sha256sum BouffaloLabDevCube-v1.8.8.zip&lt;br /&gt;
 unzip BouffaloLabDevCube-v1.8.8.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 need the following files for the flashing process.&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code&amp;gt;m0_lowload_bl808_m0.bin&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;d0_lowload_bl808_d0.bin&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;bl808-firmware.bin&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;sdcard.img&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Establish Serial Communication from PC to Ox64 using Pi Pico ===&lt;br /&gt;
Open a terminal and check the connected USB serial devices.&lt;br /&gt;
&lt;br /&gt;
 ls /dev/ttyACM*&lt;br /&gt;
&lt;br /&gt;
Set the Raspberry Pi Pico board into programming mode.&lt;br /&gt;
&lt;br /&gt;
* Press the BootSel button&lt;br /&gt;
* Apply power by plugging the USB cable to PC&lt;br /&gt;
* Release the BootSel button&lt;br /&gt;
&lt;br /&gt;
''Note: you could also ground pin28 to TP6 while powering.''&lt;br /&gt;
&lt;br /&gt;
Copy &amp;lt;code&amp;gt;picoprobe.uf2&amp;lt;/code&amp;gt; file into the new device &amp;lt;code&amp;gt;/media/&amp;lt;user&amp;gt;/RPI-RP2&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
 cp ~/Downloads/ox64/pico/picoprobe.uf2 /media/&amp;lt;user&amp;gt;/RPI-RP2&lt;br /&gt;
&lt;br /&gt;
After flashing, the device will auto-set in serial UART communication mode according to the following wiring diagram.&lt;br /&gt;
&lt;br /&gt;
[[File:Pine Serial v2.png|thumb|right|Wiring Raspberry Pi Pico to Pine64 Ox64 SBC]]&lt;br /&gt;
&lt;br /&gt;
 OX64                      PI PICO&lt;br /&gt;
 uart0_Tx_GPIO14_pin1 &amp;lt;-&amp;gt;  uart0_Rx_pin17&lt;br /&gt;
 uart0_Rx_GPIO15_pin2 &amp;lt;-&amp;gt;  uart0_Tx_pin16&lt;br /&gt;
 Rxd_GPIO17_pin31     &amp;lt;-&amp;gt;  uart1_Tx_pin6&lt;br /&gt;
 Txd_GPIO16_pin32     &amp;lt;-&amp;gt;  uart1_Rx_pin7 &lt;br /&gt;
 gnd_pin38            &amp;lt;-&amp;gt;  gnd_pin38/3    &lt;br /&gt;
 vbus5v_pin40         &amp;lt;-&amp;gt;  vbus5v_pin40&lt;br /&gt;
&lt;br /&gt;
=== Flash Your Ox64 === &lt;br /&gt;
There are two new ports to choose from, &amp;lt;code&amp;gt;/dev/ttyACM0&amp;lt;/code&amp;gt; for serial console and &amp;lt;code&amp;gt;/dev/ttyACM1&amp;lt;/code&amp;gt; for DevCube flashing.&lt;br /&gt;
&lt;br /&gt;
 minicom -b 2000000 -D /dev/ttyACM0&lt;br /&gt;
&lt;br /&gt;
Set the Ox64 board into programming mode.&lt;br /&gt;
&lt;br /&gt;
* Press the BOOT button&lt;br /&gt;
* Apply power or re-plug the USB cable&lt;br /&gt;
* Release the BOOT button&lt;br /&gt;
&lt;br /&gt;
Close &amp;lt;code&amp;gt;minicom&amp;lt;/code&amp;gt;. Open a new terminal window to run the DevCube flasher.&lt;br /&gt;
&lt;br /&gt;
 cd ~/Downloads/ox64/devcube&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 (make sure you don't use /dev/ttyACM0, it's used by the minicom console)&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 the [IOT] tab.&lt;br /&gt;
&lt;br /&gt;
 Enable 'Single Download', set Address with 0x800000, choose [PATH to bl808-firmware.bin]&lt;br /&gt;
 Port/SN: /dev/ttyACM1 (make sure you don't use ACM0, it's used by minicom console)&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;
==== Open-Source Flashing Using CLI ====&lt;br /&gt;
For those who do not want to use the DevCube, BouffaloLab provides open-source flashing packages &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;
First, install &amp;lt;code&amp;gt;bflb-iot-tool&amp;lt;/code&amp;gt; using your preferred method of managing PIP packages. One option is to set up a Python virtual environment as follows.&lt;br /&gt;
&lt;br /&gt;
 sudo apt install virtualenv python3-virtualenv python3.11-venv&lt;br /&gt;
 python3 -m venv ~/ox64_venv&lt;br /&gt;
 . ~/ox64_venv/bin/activate&lt;br /&gt;
 pip install bflb-iot-tool ''# we are *not* using bflb-mcu-tool''&lt;br /&gt;
&lt;br /&gt;
Note that each time you open a new terminal window you will need to re-run &amp;lt;code&amp;gt;. ~/ox64_venv/bin/activate&amp;lt;/code&amp;gt; to reactivate the virtual environment.&lt;br /&gt;
&lt;br /&gt;
Next, put Ox64 in programming mode (press the BOOT button when first applying power) and flash the BL808.&lt;br /&gt;
&lt;br /&gt;
 PORT=/dev/ttyACM1 ''# this will depend on which serial adapter you use''&lt;br /&gt;
 BAUD=115200       ''# safe value for macOS, if using Linux set to 2000000 for faster flashing''&lt;br /&gt;
 cd ~/Downloads/ox64/buildroot_bouffalo/buildroot/output/images&lt;br /&gt;
 &lt;br /&gt;
 bflb-iot-tool --chipname bl808 --interface uart --port $PORT --baudrate $BAUD --addr 0x000000 --firmware m0_lowload_bl808_m0.bin --single&lt;br /&gt;
 bflb-iot-tool --chipname bl808 --interface uart --port $PORT --baudrate $BAUD --addr 0x100000 --firmware d0_lowload_bl808_d0.bin --single&lt;br /&gt;
 bflb-iot-tool --chipname bl808 --interface uart --port $PORT --baudrate $BAUD --addr 0x800000 --firmware bl808-firmware.bin --single&lt;br /&gt;
&lt;br /&gt;
If you get permission errors when running the commands above, you may need to add your user to the &amp;lt;code&amp;gt;dialout&amp;lt;/code&amp;gt; group. Running the commands as &amp;lt;code&amp;gt;root&amp;lt;/code&amp;gt; is not recommended since this will make &amp;lt;code&amp;gt;bflb-iot-tool&amp;lt;/code&amp;gt; create &amp;lt;code&amp;gt;root&amp;lt;/code&amp;gt;-owned files in your home directory.&lt;br /&gt;
&lt;br /&gt;
==== BL808 Address Details ====&lt;br /&gt;
Note that the addresses are different according to the flashing method, DevCube or CLI.&lt;br /&gt;
&lt;br /&gt;
              DevCube      CLI   &lt;br /&gt;
 M0 address   0x58000000   0x000000&lt;br /&gt;
 D0 address   0x58100000   0x100000&lt;br /&gt;
 LP address   0x58200000   0x200000&lt;br /&gt;
&lt;br /&gt;
=== Flash Your microSD Card ===&lt;br /&gt;
Insert microSD card into PC, locate its device file (&amp;lt;code&amp;gt;/dev/sdb&amp;lt;/code&amp;gt;, for example), erase the start of the card and proceed to flashing.&lt;br /&gt;
&lt;br /&gt;
 cd ~/Downloads/ox64/buildroot_bouffalo/buildroot/output/images&lt;br /&gt;
 sudo dd if=/dev/zero of=/dev/sdb count=1 bs=32768 &lt;br /&gt;
 sudo dd if=sdcard.img of=/dev/sdb bs=1M status=progress conv=fsync&lt;br /&gt;
&lt;br /&gt;
=== Booting for the First Time ===&lt;br /&gt;
Insert microSD card into Ox64 and set a UART connection to the Ox64 board, using the following parameters.&lt;br /&gt;
&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 rate is 2000000&lt;br /&gt;
&lt;br /&gt;
Choose from serial devices &amp;lt;code&amp;gt;/dev/ttyACM0&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;/dev/ttyACM1&amp;lt;/code&amp;gt;, using the lower number.&lt;br /&gt;
&lt;br /&gt;
 minicom -b 2000000 -D /dev/ttyACM0&lt;br /&gt;
&lt;br /&gt;
Re-apply power to the Ox64 and enjoy the booting!&lt;br /&gt;
&lt;br /&gt;
[[Category:Ox64]]&lt;br /&gt;
[[Category:Bouffalo BL808]]&lt;/div&gt;</summary>
		<author><name>Pavlos1</name></author>
	</entry>
	<entry>
		<id>https://wiki.pine64.org/index.php?title=Talk:Ox64&amp;diff=21316</id>
		<title>Talk:Ox64</title>
		<link rel="alternate" type="text/html" href="https://wiki.pine64.org/index.php?title=Talk:Ox64&amp;diff=21316"/>
		<updated>2024-01-07T12:12:27Z</updated>

		<summary type="html">&lt;p&gt;Pavlos1: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Flash memory producer ==&lt;br /&gt;
&lt;br /&gt;
Hello. On this page I see datasheets for Gigadevice flash memory, but on my boards placed Winbond flash. Maybe we need to update datasheets?--[[User:ElektroNIK|ElektroNIK]] ([[User talk:ElektroNIK|talk]]) 11:58, 20 January 2023 (UTC)&lt;br /&gt;
&lt;br /&gt;
== I disagree with the name of section 10 ==&lt;br /&gt;
&lt;br /&gt;
[Placeholder for the initial message by [[User:Pavlos1]]]&lt;br /&gt;
&lt;br /&gt;
: Hello!  Did you mean that the &amp;quot;Flashing Ox64 SBC and SD Card for Newbies&amp;quot; section title should be reworded?  I'd agree about that, and I'd suggest that the &amp;quot;for Newbies&amp;quot; part is simply dropped. -- [[User:Dsimic|Dsimic]] ([[User talk:Dsimic|talk]]) 17:00, 4 January 2024 (UTC)&lt;br /&gt;
&lt;br /&gt;
:: Went ahead and implemented [https://wiki.pine64.org/index.php?title=Ox64&amp;amp;type=revision&amp;amp;diff=21262&amp;amp;oldid=21257 this edit]. -- [[User:Dsimic|Dsimic]] ([[User talk:Dsimic|talk]]) 17:55, 4 January 2024 (UTC)&lt;br /&gt;
&lt;br /&gt;
== Regarding PIP and --break-system-packages ==&lt;br /&gt;
&lt;br /&gt;
To [[User:Giorez]] and other editors:&lt;br /&gt;
&lt;br /&gt;
The instructions in the [https://wiki.pine64.org/wiki/Ox64#Open-Source_Flashing_Using_CLI Open-Source Flashing Using CLI] section involve installing a PIP package. Doing so is a bit awkward due to conflicts with system packages. I used to do it as follows, but for whatever reason that doesn't work anymore (at least on Gentoo and Arch).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
pip install --user $PACKAGE&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In the article itself I suggested creating a virtual environment as follows. That seems to be the &amp;quot;preferred&amp;quot; way of managing a separate set of Python packages to the ones installed by the OS package manager.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
python -m venv ~/ox64_venv&lt;br /&gt;
. ~/ox64_venv/bin/activate&lt;br /&gt;
pip install $PACKAGE&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Note that when you run &amp;lt;code&amp;gt;pip install&amp;lt;/code&amp;gt; with the virtual environment activated, it installs the package ''to'' the virtual environment. So you need to re-activate the virtual environment each time you open a new terminal window; otherwise &amp;lt;code&amp;gt;bflb-iot-tool&amp;lt;/code&amp;gt; will not be in your &amp;lt;code&amp;gt;PATH&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
The following is not recommended since it is instructing PIP to potentially introduce conflicts with system packages. And to be clear: running the command below is *not* necessary if you have already set up the virtual environment as described above.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
sudo pip install $PACKAGE --break-system-packages&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
-- [[User:Pavlos1|Pavlos1]] ([[User talk:Pavlos1|talk]]) 03:22, 6 January 2024 (UTC)&lt;br /&gt;
&lt;br /&gt;
: I agree with the way you described it above. -- [[User:Dsimic|Dsimic]] ([[User talk:Dsimic|talk]]) 17:13, 6 January 2024 (UTC)&lt;br /&gt;
&lt;br /&gt;
-- [[User:Giorez|Giorez]] ([[User talk:Giorez|talk]]) 10:53, 7 January 2024 (UTC) I agree, sorry for keep editing my original post. I'm not expert in linux system. I just started this article, because i has been really frustrated to find a full tutorial for newbies. And i usually look for newbie tips to share/get help from expert people like you. thank for your contribution.&lt;br /&gt;
&lt;br /&gt;
: That's all good. Thanks for testing out my flashing instructions &amp;amp;mdash; these things don't always work the same way across different Linux systems. -- [[User:Pavlos1|Pavlos1]] ([[User talk:Pavlos1|talk]]) 12:12, 7 January 2024 (UTC)&lt;/div&gt;</summary>
		<author><name>Pavlos1</name></author>
	</entry>
	<entry>
		<id>https://wiki.pine64.org/index.php?title=User_talk:Pavlos1&amp;diff=21296</id>
		<title>User talk:Pavlos1</title>
		<link rel="alternate" type="text/html" href="https://wiki.pine64.org/index.php?title=User_talk:Pavlos1&amp;diff=21296"/>
		<updated>2024-01-06T11:48:07Z</updated>

		<summary type="html">&lt;p&gt;Pavlos1: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;how do i reply to pavlos1 comment.&lt;br /&gt;
&lt;br /&gt;
: You have to edit the talk page in the same way you edit a normal article. Use &amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;:&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt; to create an indentation, and &amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;-- ~~~~&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt; to sign off. -- [[User:Pavlos1|Pavlos1]] ([[User talk:Pavlos1|talk]]) 11:48, 6 January 2024 (UTC)&lt;/div&gt;</summary>
		<author><name>Pavlos1</name></author>
	</entry>
	<entry>
		<id>https://wiki.pine64.org/index.php?title=Talk:Ox64&amp;diff=21294</id>
		<title>Talk:Ox64</title>
		<link rel="alternate" type="text/html" href="https://wiki.pine64.org/index.php?title=Talk:Ox64&amp;diff=21294"/>
		<updated>2024-01-06T03:22:53Z</updated>

		<summary type="html">&lt;p&gt;Pavlos1: /* Regarding PIP and --break-system-packages */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Flash memory producer ==&lt;br /&gt;
&lt;br /&gt;
Hello. On this page I see datasheets for Gigadevice flash memory, but on my boards placed Winbond flash. Maybe we need to update datasheets?--[[User:ElektroNIK|ElektroNIK]] ([[User talk:ElektroNIK|talk]]) 11:58, 20 January 2023 (UTC)&lt;br /&gt;
&lt;br /&gt;
== I disagree with the name of section 10 ==&lt;br /&gt;
&lt;br /&gt;
[Placeholder for the initial message by [[User:Pavlos1]]]&lt;br /&gt;
&lt;br /&gt;
: Hello!  Did you mean that the &amp;quot;Flashing Ox64 SBC and SD Card for Newbies&amp;quot; section title should be reworded?  I'd agree about that, and I'd suggest that the &amp;quot;for Newbies&amp;quot; part is simply dropped. -- [[User:Dsimic|Dsimic]] ([[User talk:Dsimic|talk]]) 17:00, 4 January 2024 (UTC)&lt;br /&gt;
&lt;br /&gt;
:: Went ahead and implemented [https://wiki.pine64.org/index.php?title=Ox64&amp;amp;type=revision&amp;amp;diff=21262&amp;amp;oldid=21257 this edit]. -- [[User:Dsimic|Dsimic]] ([[User talk:Dsimic|talk]]) 17:55, 4 January 2024 (UTC)&lt;br /&gt;
&lt;br /&gt;
== Regarding PIP and --break-system-packages ==&lt;br /&gt;
&lt;br /&gt;
To [[User:Giorez]] and other editors:&lt;br /&gt;
&lt;br /&gt;
The instructions in the [https://wiki.pine64.org/wiki/Ox64#Open-Source_Flashing_Using_CLI Open-Source Flashing Using CLI] section involve installing a PIP package. Doing so is a bit awkward due to conflicts with system packages. I used to do it as follows, but for whatever reason that doesn't work anymore (at least on Gentoo and Arch).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
pip install --user $PACKAGE&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In the article itself I suggested creating a virtual environment as follows. That seems to be the &amp;quot;preferred&amp;quot; way of managing a separate set of Python packages to the ones installed by the OS package manager.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
python -m venv ~/ox64_venv&lt;br /&gt;
. ~/ox64_venv/bin/activate&lt;br /&gt;
pip install $PACKAGE&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Note that when you run &amp;lt;code&amp;gt;pip install&amp;lt;/code&amp;gt; with the virtual environment activated, it installs the package ''to'' the virtual environment. So you need to re-activate the virtual environment each time you open a new terminal window; otherwise &amp;lt;code&amp;gt;bflb-iot-tool&amp;lt;/code&amp;gt; will not be in your &amp;lt;code&amp;gt;PATH&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
The following is not recommended since it is instructing PIP to potentially introduce conflicts with system packages. And to be clear: running the command below is *not* necessary if you have already set up the virtual environment as described above.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
sudo pip install $PACKAGE --break-system-packages&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
-- [[User:Pavlos1|Pavlos1]] ([[User talk:Pavlos1|talk]]) 03:22, 6 January 2024 (UTC)&lt;/div&gt;</summary>
		<author><name>Pavlos1</name></author>
	</entry>
	<entry>
		<id>https://wiki.pine64.org/index.php?title=Talk:Ox64&amp;diff=21293</id>
		<title>Talk:Ox64</title>
		<link rel="alternate" type="text/html" href="https://wiki.pine64.org/index.php?title=Talk:Ox64&amp;diff=21293"/>
		<updated>2024-01-06T03:02:24Z</updated>

		<summary type="html">&lt;p&gt;Pavlos1: /* Regarding PIP and --break-system-packages */ new section&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Flash memory producer ==&lt;br /&gt;
&lt;br /&gt;
Hello. On this page I see datasheets for Gigadevice flash memory, but on my boards placed Winbond flash. Maybe we need to update datasheets?--[[User:ElektroNIK|ElektroNIK]] ([[User talk:ElektroNIK|talk]]) 11:58, 20 January 2023 (UTC)&lt;br /&gt;
&lt;br /&gt;
== I disagree with the name of section 10 ==&lt;br /&gt;
&lt;br /&gt;
[Placeholder for the initial message by [[User:Pavlos1]]]&lt;br /&gt;
&lt;br /&gt;
: Hello!  Did you mean that the &amp;quot;Flashing Ox64 SBC and SD Card for Newbies&amp;quot; section title should be reworded?  I'd agree about that, and I'd suggest that the &amp;quot;for Newbies&amp;quot; part is simply dropped. -- [[User:Dsimic|Dsimic]] ([[User talk:Dsimic|talk]]) 17:00, 4 January 2024 (UTC)&lt;br /&gt;
&lt;br /&gt;
:: Went ahead and implemented [https://wiki.pine64.org/index.php?title=Ox64&amp;amp;type=revision&amp;amp;diff=21262&amp;amp;oldid=21257 this edit]. -- [[User:Dsimic|Dsimic]] ([[User talk:Dsimic|talk]]) 17:55, 4 January 2024 (UTC)&lt;br /&gt;
&lt;br /&gt;
== Regarding PIP and --break-system-packages ==&lt;br /&gt;
&lt;br /&gt;
To [[User:Giorez]] and other editors:&lt;br /&gt;
&lt;br /&gt;
The instructions in the [https://wiki.pine64.org/wiki/Ox64#Open-Source_Flashing_Using_CLI Open-Source Flashing Using CLI] section involve installing a PIP package. Doing so is a bit awkward due to conflicts with system packages. I used to do it as follows, but for whatever reason that doesn't work anymore (at least on Gentoo and Arch).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
pip install --user $PACKAGE&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In the article itself I suggested creating a virtual environment as follows. That seems to be the &amp;quot;preferred&amp;quot; way of managing a separate set of Python packages to the ones installed by the OS package manager.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
python -m venv ~/ox64_venv&lt;br /&gt;
. ~/ox64_venv/bin/activate&lt;br /&gt;
pip install $PACKAGE&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Note that when you run &amp;lt;code&amp;gt;pip install&amp;lt;/code&amp;gt; with the virtual environment activated, it installs the package ''to'' the virtual environment. So you need to re-activate the virtual environment each time you open a new terminal window; otherwise &amp;lt;code&amp;gt;bflb-iot-tool&amp;lt;/code&amp;gt; will not be in your &amp;lt;code&amp;gt;PATH&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
The following is not recommended since it is instructing PIP to potentially introduce conflicts with system packages. And to be clear: running the command below is *not* necessary if you have already set up the virtual environment as described above.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
sudo pip install $PACKAGE --break-system-packages&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;/div&gt;</summary>
		<author><name>Pavlos1</name></author>
	</entry>
	<entry>
		<id>https://wiki.pine64.org/index.php?title=Ox64&amp;diff=21292</id>
		<title>Ox64</title>
		<link rel="alternate" type="text/html" href="https://wiki.pine64.org/index.php?title=Ox64&amp;diff=21292"/>
		<updated>2024-01-06T02:13:52Z</updated>

		<summary type="html">&lt;p&gt;Pavlos1: /* Open-Source Flashing Using CLI */&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;
Open the terminal and create a new directory for the build:&lt;br /&gt;
&lt;br /&gt;
 mkdir buildroot_bouffalo &amp;amp;&amp;amp; cd buildroot_bouffalo&lt;br /&gt;
&lt;br /&gt;
Clone the primary Buildroot repository and the specific Buildroot Bouffalo repository:&lt;br /&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;
&lt;br /&gt;
Define an environment variable for the Buildroot Bouffalo overlay path:&lt;br /&gt;
&lt;br /&gt;
 export BR_BOUFFALO_OVERLAY_PATH=$(pwd)/buildroot_bouffalo&lt;br /&gt;
&lt;br /&gt;
Change directory into the cloned Buildroot folder:&lt;br /&gt;
&lt;br /&gt;
 cd buildroot&lt;br /&gt;
&lt;br /&gt;
Apply the default configuration for Pine64 Ox64:&lt;br /&gt;
&lt;br /&gt;
 make BR2_EXTERNAL=$BR_BOUFFALO_OVERLAY_PATH pine64_ox64_defconfig&lt;br /&gt;
&lt;br /&gt;
Use the &amp;lt;code&amp;gt;menuconfig&amp;lt;/code&amp;gt; tool to adjust the build settings:&lt;br /&gt;
&lt;br /&gt;
 make menuconfig&lt;br /&gt;
&lt;br /&gt;
[[File:target ABI setting.png|thumb|right|200px|target ABI setting]]&lt;br /&gt;
[[File:toolchain setting.png|thumb|right|200px|toolchain setting]]&lt;br /&gt;
&lt;br /&gt;
Within &amp;lt;code&amp;gt;menuconfig&amp;lt;/code&amp;gt;, configure the following:&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;
* 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;
&lt;br /&gt;
Initiate the build process, but make sure first that your &amp;lt;code&amp;gt;PATH&amp;lt;/code&amp;gt; variable contains no spaces:&lt;br /&gt;
&lt;br /&gt;
 make&lt;br /&gt;
&lt;br /&gt;
You will get the image files required for flashing in the &amp;lt;code&amp;gt;output/images&amp;lt;/code&amp;gt; directory&lt;br /&gt;
&lt;br /&gt;
== Flashing Ox64 SBC and microSD Card ==&lt;br /&gt;
This section explains how to flash an Ox64 board and a microSD card to boot the system.&lt;br /&gt;
&lt;br /&gt;
=== Prepare the Environment === &lt;br /&gt;
You need a Linux machine, a Raspberry Pi Pico to act as a UART adapter, the Ox64 board, and a microSD card.&lt;br /&gt;
&lt;br /&gt;
Start a terminal session and set the working directory to download some files.&lt;br /&gt;
&lt;br /&gt;
 cd ~/Downloads&lt;br /&gt;
 mkdir ox64 ox64/pico&lt;br /&gt;
 cd ~/Downloads/ox64/pico&lt;br /&gt;
 wget https://github.com/Kris-Sekula/Pine64_Ox64_SBC/blob/main/uart/picoprobe.uf2&lt;br /&gt;
&lt;br /&gt;
 cd ~/Downloads/ox64&lt;br /&gt;
 mkdir ox64/devcube183&lt;br /&gt;
 cd ~/Downloads/ox64/devcube183&lt;br /&gt;
&lt;br /&gt;
Get the DevCube 1.8.3 flasher from one of mirror servers listed below.&lt;br /&gt;
&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;
Verify the file hashes listed below.&lt;br /&gt;
&lt;br /&gt;
* SHA1: &amp;lt;code&amp;gt;0f2619e87d946f936f63ae97b0efd674357b1166&amp;lt;/code&amp;gt;&lt;br /&gt;
* SHA256: &amp;lt;code&amp;gt;e6e6db316359da40d29971a1889d41c9e97d5b1ff1a8636e9e6960b6ff960913&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Finally, uncompress the downloaded archive; for example:&lt;br /&gt;
&lt;br /&gt;
 wget https://openbouffalo.org/static-assets/bldevcube/BouffaloLabDevCube-v1.8.3.zip&lt;br /&gt;
 sha256sum 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 need the following files for the flashing process.&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code&amp;gt;m0_lowload_bl808_m0.bin&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;d0_lowload_bl808_d0.bin&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;bl808-firmware.bin&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;sdcard.img&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Establish Serial Communication from PC to Ox64 using Pi Pico ===&lt;br /&gt;
Open a terminal and check the connected USB serial devices.&lt;br /&gt;
&lt;br /&gt;
 ls /dev/ttyACM*&lt;br /&gt;
&lt;br /&gt;
Set the Raspberry Pi Pico board into programming mode.&lt;br /&gt;
&lt;br /&gt;
* Press the BootSel button&lt;br /&gt;
* Apply power by plugging the USB cable to PC&lt;br /&gt;
* Release the BootSel button&lt;br /&gt;
&lt;br /&gt;
''Note: you could also ground pin28 to TP6 while powering.''&lt;br /&gt;
&lt;br /&gt;
Copy &amp;lt;code&amp;gt;picoprobe.uf2&amp;lt;/code&amp;gt; file into the new device &amp;lt;code&amp;gt;/media/&amp;lt;user&amp;gt;/RPI-RP2&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
 cp ~/Downloads/ox64/pico/picoprobe.uf2 /media/&amp;lt;user&amp;gt;/RPI-RP2&lt;br /&gt;
&lt;br /&gt;
After flashing, the device will auto-set in serial UART communication mode according to the following wiring diagram.&lt;br /&gt;
&lt;br /&gt;
[[File:Pine Serial v2.png|thumb|right|Wiring Raspberry Pi Pico to Pine64 Ox64 SBC]]&lt;br /&gt;
&lt;br /&gt;
 OX64                      PI PICO&lt;br /&gt;
 uart0_Tx_GPIO14_pin1 &amp;lt;-&amp;gt;  uart0_Rx_pin17&lt;br /&gt;
 uart0_Rx_GPIO15_pin2 &amp;lt;-&amp;gt;  uart0_Tx_pin16&lt;br /&gt;
 Rxd_GPIO17_pin31     &amp;lt;-&amp;gt;  uart1_Tx_pin6&lt;br /&gt;
 Txd_GPIO16_pin32     &amp;lt;-&amp;gt;  uart1_Rx_pin7 &lt;br /&gt;
 gnd_pin38            &amp;lt;-&amp;gt;  gnd_pin38/3    &lt;br /&gt;
 vbus5v_pin40         &amp;lt;-&amp;gt;  vbus5v_pin40&lt;br /&gt;
&lt;br /&gt;
=== Flash Your Ox64 === &lt;br /&gt;
There are two new ports to choose from, &amp;lt;code&amp;gt;/dev/ttyACM0&amp;lt;/code&amp;gt; for serial console and &amp;lt;code&amp;gt;/dev/ttyACM1&amp;lt;/code&amp;gt; for DevCube flashing.&lt;br /&gt;
&lt;br /&gt;
 minicom -b 2000000 -D /dev/ttyACM0&lt;br /&gt;
&lt;br /&gt;
Set the Ox64 board into programming mode.&lt;br /&gt;
&lt;br /&gt;
* Press the BOOT button&lt;br /&gt;
* Apply power or re-plug the USB cable&lt;br /&gt;
* Release the BOOT button&lt;br /&gt;
&lt;br /&gt;
Close &amp;lt;code&amp;gt;minicom&amp;lt;/code&amp;gt;. Open a new terminal window to run the 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 (make sure you don't use /dev/ttyACM0, it's used by the minicom console)&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 the [IOT] tab.&lt;br /&gt;
&lt;br /&gt;
 Enable 'Single Download', set Address with 0x800000, choose [PATH to bl808-firmware.bin]&lt;br /&gt;
 Port/SN: /dev/ttyACM1 (make sure you don't use ACM0, it's used by minicom console)&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;
==== Open-Source Flashing Using CLI ====&lt;br /&gt;
For those who do not want to use the DevCube, BouffaloLab provides open-source flashing packages &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;
First, install &amp;lt;code&amp;gt;bflb-iot-tool&amp;lt;/code&amp;gt; using your preferred method of managing PIP packages. One option is to set up a Python virtual environment as follows.&lt;br /&gt;
&lt;br /&gt;
 sudo apt install virtualenv python3-virtualenv&lt;br /&gt;
 python3 -m venv ~/ox64_venv&lt;br /&gt;
 . ~/ox64_venv/bin/activate&lt;br /&gt;
 pip install bflb-iot-tool ''# we are *not* using bflb-mcu-tool''&lt;br /&gt;
&lt;br /&gt;
Note that each time you open a new terminal window you will need to re-run &amp;lt;code&amp;gt;. ~/ox64_venv/bin/activate&amp;lt;/code&amp;gt; to reactivate the virtual environment.&lt;br /&gt;
&lt;br /&gt;
Next, put Ox64 in programming mode (press the BOOT button when first applying power) and flash the BL808.&lt;br /&gt;
&lt;br /&gt;
 PORT=/dev/ttyACM1 ''# this will depend on which serial adapter you use''&lt;br /&gt;
 BAUD=115200       ''# safe value for macOS, if using Linux set to 2000000 for faster flashing''&lt;br /&gt;
 cd ~/Downloads/ox64/buildroot_bouffalo/buildroot/output/images&lt;br /&gt;
 &lt;br /&gt;
 bflb-iot-tool --chipname bl808 --interface uart --port $PORT --baudrate $BAUD --addr 0x000000 --firmware m0_lowload_bl808_m0.bin --single&lt;br /&gt;
 bflb-iot-tool --chipname bl808 --interface uart --port $PORT --baudrate $BAUD --addr 0x100000 --firmware d0_lowload_bl808_d0.bin --single&lt;br /&gt;
 bflb-iot-tool --chipname bl808 --interface uart --port $PORT --baudrate $BAUD --addr 0x800000 --firmware bl808-firmware.bin --single&lt;br /&gt;
&lt;br /&gt;
If you get permission errors when running the commands above, you may need to add your user to the &amp;lt;code&amp;gt;dialout&amp;lt;/code&amp;gt; group. Running the commands as &amp;lt;code&amp;gt;root&amp;lt;/code&amp;gt; is not recommended since this will make &amp;lt;code&amp;gt;bflb-iot-tool&amp;lt;/code&amp;gt; create &amp;lt;code&amp;gt;root&amp;lt;/code&amp;gt;-owned files in your home directory.&lt;br /&gt;
&lt;br /&gt;
==== BL808 Address Details ====&lt;br /&gt;
Note that addresses are different according the flashing method: DevCube or CLI.&lt;br /&gt;
&lt;br /&gt;
              DevCube         CLI   &lt;br /&gt;
 M0 address = 0x58000000 or = 0x000000&lt;br /&gt;
 D0 address = 0x58100000 or = 0x100000&lt;br /&gt;
 LP address = 0x58200000 or = 0x200000&lt;br /&gt;
&lt;br /&gt;
=== Flash Your microSD Card ===&lt;br /&gt;
Insert microSD card into PC, locate its device file (&amp;lt;code&amp;gt;/dev/sdb&amp;lt;/code&amp;gt;, for example), erase the start of the card and proceed to flashing.&lt;br /&gt;
&lt;br /&gt;
 cd ~/Downloads/ox64/buildroot_bouffalo/buildroot/output/images&lt;br /&gt;
 sudo dd if=/dev/zero of=/dev/sdb count=1 bs=32768 &lt;br /&gt;
 sudo dd if=sdcard.img of=/dev/sdb bs=1M status=progress conv=fsync&lt;br /&gt;
&lt;br /&gt;
=== Booting for the First Time ===&lt;br /&gt;
Insert microSD card into Ox64 and set a UART connection to the Ox64 board, using the following parameters.&lt;br /&gt;
&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 rate is 2000000&lt;br /&gt;
&lt;br /&gt;
Choose from serial devices &amp;lt;code&amp;gt;/dev/ttyACM0&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;/dev/ttyACM1&amp;lt;/code&amp;gt;, using the lower number.&lt;br /&gt;
&lt;br /&gt;
 minicom -b 2000000 -D /dev/ttyACM0&lt;br /&gt;
&lt;br /&gt;
Re-apply power to the Ox64 and enjoy the booting!&lt;br /&gt;
&lt;br /&gt;
[[Category:Ox64]]&lt;br /&gt;
[[Category:Bouffalo BL808]]&lt;/div&gt;</summary>
		<author><name>Pavlos1</name></author>
	</entry>
	<entry>
		<id>https://wiki.pine64.org/index.php?title=Ox64&amp;diff=21284</id>
		<title>Ox64</title>
		<link rel="alternate" type="text/html" href="https://wiki.pine64.org/index.php?title=Ox64&amp;diff=21284"/>
		<updated>2024-01-05T01:38:31Z</updated>

		<summary type="html">&lt;p&gt;Pavlos1: /* Flashing Ox64 SBC and microSD Card */&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;
[[File:target ABI setting.png|thumb|right|200px|target ABI setting]]&lt;br /&gt;
[[File:toolchain setting.png|thumb|right|200px|toolchain setting]]&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;
* 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;
&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;
You will get the flashing files into the &amp;quot;/output/images/&amp;quot; directory&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Flashing Ox64 SBC and microSD Card ==&lt;br /&gt;
This section explains how to flash an Ox64 board and a microSD card to boot the system.&lt;br /&gt;
&lt;br /&gt;
=== Prepare the Environment === &lt;br /&gt;
You need a Linux machine, a Raspberry Pi Pico to act as a UART adapter, the Ox64 board, and a microSD card.&lt;br /&gt;
&lt;br /&gt;
Start a terminal session and set the working directory to download some files.&lt;br /&gt;
&lt;br /&gt;
 cd ~/Downloads&lt;br /&gt;
 mkdir ox64 ox64/pico&lt;br /&gt;
 cd ~/Downloads/ox64/pico&lt;br /&gt;
 wget https://github.com/Kris-Sekula/Pine64_Ox64_SBC/blob/main/uart/picoprobe.uf2&lt;br /&gt;
&lt;br /&gt;
 cd ~/Downloads/ox64&lt;br /&gt;
 mkdir ox64/devcube183&lt;br /&gt;
 cd ~/Downloads/ox64/devcube183&lt;br /&gt;
&lt;br /&gt;
Get the DevCube 1.8.3 flasher from one of mirrored servers, verify the hashes listed below, and decompress it.&lt;br /&gt;
&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: &amp;lt;code&amp;gt;0f2619e87d946f936f63ae97b0efd674357b1166&amp;lt;/code&amp;gt;&lt;br /&gt;
* SHA256: &amp;lt;code&amp;gt;e6e6db316359da40d29971a1889d41c9e97d5b1ff1a8636e9e6960b6ff960913&amp;lt;/code&amp;gt;&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 need following files for the flashing process.&lt;br /&gt;
 &lt;br /&gt;
  m0_lowload_bl808_m0.bin&lt;br /&gt;
  d0_lowload_bl808_d0.bin&lt;br /&gt;
  bl808-firmware.bin&lt;br /&gt;
  sdcard.img&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Establish Serial Communication from PC to Ox64 using Pi Pico ===&lt;br /&gt;
&lt;br /&gt;
Open a terminal and check the connected USB serial devices.&lt;br /&gt;
&lt;br /&gt;
 ls /dev/ttyACM*&lt;br /&gt;
&lt;br /&gt;
Set the Raspberry Pi Pico board into programming mode.&lt;br /&gt;
&lt;br /&gt;
* Press the BootSel button&lt;br /&gt;
* Apply power by plugging the USB cable to PC&lt;br /&gt;
* Release the BootSel button&lt;br /&gt;
&lt;br /&gt;
''Note: you could also ground pin28 to TP6 while powering.''&lt;br /&gt;
&lt;br /&gt;
Copy &amp;lt;code&amp;gt;picoprobe.uf2&amp;lt;/code&amp;gt; file into the new device &amp;lt;code&amp;gt;/media/&amp;lt;user&amp;gt;/RPI-RP2&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
 cp ~/Downloads/ox64/pico/picoprobe.uf2 /media/&amp;lt;user&amp;gt;/RPI-RP2&lt;br /&gt;
&lt;br /&gt;
After flashing, the device will auto-set in serial UART communication mode according to the following wiring diagram.&lt;br /&gt;
&lt;br /&gt;
[[File:Pine Serial v2.png|thumb|right|Wiring Raspberry Pi Pico to Pine64 Ox64 SBC]]&lt;br /&gt;
&lt;br /&gt;
 OX64                      PI PICO&lt;br /&gt;
 uart0_Tx_GPIO14_pin1 &amp;lt;-&amp;gt;  uart0_Rx_pin17&lt;br /&gt;
 uart0_Rx_GPIO15_pin2 &amp;lt;-&amp;gt;  uart0_Tx_pin16&lt;br /&gt;
 Rxd_GPIO17_pin31     &amp;lt;-&amp;gt;  uart1_Tx_pin6&lt;br /&gt;
 Txd_GPIO16_pin32     &amp;lt;-&amp;gt;  uart1_Rx_pin7 &lt;br /&gt;
 gnd_pin38            &amp;lt;-&amp;gt;  gnd_pin38/3    &lt;br /&gt;
 vbus5v_pin40         &amp;lt;-&amp;gt;  vbus5v_pin40&lt;br /&gt;
&lt;br /&gt;
=== Flash Your Ox64 === &lt;br /&gt;
There are two new ports to choose from, &amp;lt;code&amp;gt;/dev/ttyACM0&amp;lt;/code&amp;gt; for serial console and &amp;lt;code&amp;gt;/dev/ttyACM1&amp;lt;/code&amp;gt; for DevCube flashing.&lt;br /&gt;
&lt;br /&gt;
 minicom -b 2000000 -D /dev/ttyACM0&lt;br /&gt;
&lt;br /&gt;
Set the Ox64 board into programming mode.&lt;br /&gt;
&lt;br /&gt;
* Press the BOOT button&lt;br /&gt;
* Apply power or re-plug the USB cable&lt;br /&gt;
* Release the BOOT button&lt;br /&gt;
&lt;br /&gt;
Close &amp;lt;code&amp;gt;minicom&amp;lt;/code&amp;gt;. Open a new terminal window to run the 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 (make sure you don't use /dev/ttyACM0, it's used by the minicom console)&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;
&lt;br /&gt;
 Enable 'Single Download', set Address with 0x800000, choose [PATH to bl808-firmware.bin]&lt;br /&gt;
 Port/SN: /dev/ttyACM1 (make sure you don't use ACM0, it's used by minicom console)&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;
==== Open-Source Flashing Using CLI ====&lt;br /&gt;
&lt;br /&gt;
For those who do not want to use the DevCube, BouffaloLab provides open-source flashing packages &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;
First, install &amp;lt;code&amp;gt;bflb-iot-tool&amp;lt;/code&amp;gt; using your preferred method of managing PIP packages. One option is to set up a Python virtual environment as follows.&lt;br /&gt;
&lt;br /&gt;
 sudo apt install virtualenv python3-virtualenv&lt;br /&gt;
 python3 -m venv ~/ox64_venv&lt;br /&gt;
 . ~/ox64_venv/bin/activate&lt;br /&gt;
 pip install bflb-iot-tool # ''we are *not* using bflb-mcu-tool''&lt;br /&gt;
&lt;br /&gt;
Note that each time you open a new terminal window you will need to re-run &amp;lt;code&amp;gt;. ~/ox64_venv/bin/activate&amp;lt;/code&amp;gt; to reactivate the virtual environment.&lt;br /&gt;
&lt;br /&gt;
Next, put Ox64 in programming mode (press the BOOT button when first applying power) and flash the BL808.&lt;br /&gt;
&lt;br /&gt;
 PORT=/dev/ttyACM1 ''# this will depend on which serial adapter you use''&lt;br /&gt;
 BAUD=115200       ''# safe value for macOS, if using Linux set to 2000000 for faster flashing''&lt;br /&gt;
 cd ~/Downloads/ox64/buildroot_bouffalo/buildroot/output/images&lt;br /&gt;
 &lt;br /&gt;
 bflb-iot-tool --chipname bl808 --interface uart --port $PORT --baudrate $BAUD --addr 0x000000 --firmware m0_lowload_bl808_m0.bin --single&lt;br /&gt;
 bflb-iot-tool --chipname bl808 --interface uart --port $PORT --baudrate $BAUD --addr 0x100000 --firmware d0_lowload_bl808_d0.bin --single&lt;br /&gt;
 bflb-iot-tool --chipname bl808 --interface uart --port $PORT --baudrate $BAUD --addr 0x800000 --firmware bl808-firmware.bin --single&lt;br /&gt;
&lt;br /&gt;
If you get permission errors when running the commands above, you may need to add your user to the &amp;lt;code&amp;gt;dialout&amp;lt;/code&amp;gt; group. Running the commands as &amp;lt;code&amp;gt;root&amp;lt;/code&amp;gt; is not recommended since this will make &amp;lt;code&amp;gt;bflb-iot-tool&amp;lt;/code&amp;gt; create &amp;lt;code&amp;gt;root&amp;lt;/code&amp;gt;-owned files in your home directory.&lt;br /&gt;
&lt;br /&gt;
==== BL808 Address Details ====&lt;br /&gt;
&lt;br /&gt;
Note that addresses are different according the flashing method: DevCube or CLI.&lt;br /&gt;
&lt;br /&gt;
                      DevCube         CLI   &lt;br /&gt;
 For M0 set address = 0x58000000 or = 0x000000&lt;br /&gt;
 For D0 set address = 0x58100000 or = 0x100000&lt;br /&gt;
 For LP set address = 0x58200000 or = 0x200000&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Flash Your MicroSD Card ===&lt;br /&gt;
&lt;br /&gt;
Insert microSD card into PC, locate its device file (&amp;lt;code&amp;gt;/dev/sdb&amp;lt;/code&amp;gt;, for example), erase the start of the card and proceed to flashing.&lt;br /&gt;
&lt;br /&gt;
 cd ~/Downloads/ox64/buildroot_bouffalo/buildroot/output/images&lt;br /&gt;
 sudo dd if=/dev/zero of=/dev/sdb count=1 bs=32768 &lt;br /&gt;
 sudo dd if=sdcard.img of=/dev/sdb bs=1M status=progress conv=fsync&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== First Booting ===&lt;br /&gt;
Insert microSD card into Ox64 and set a UART connection to the Ox64 board.&lt;br /&gt;
&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;
Choose from serial devices &amp;lt;code&amp;gt;/dev/ttyACM0&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;/dev/ttyACM1&amp;lt;/code&amp;gt;, using the lower number.&lt;br /&gt;
&lt;br /&gt;
 minicom -b 2000000 -D /dev/ttyACM0&lt;br /&gt;
&lt;br /&gt;
Re-apply power to the Ox64 and enjoy the booting!&lt;br /&gt;
&lt;br /&gt;
[[Category:Ox64]]&lt;br /&gt;
[[Category:Bouffalo BL808]]&lt;/div&gt;</summary>
		<author><name>Pavlos1</name></author>
	</entry>
	<entry>
		<id>https://wiki.pine64.org/index.php?title=Ox64&amp;diff=21283</id>
		<title>Ox64</title>
		<link rel="alternate" type="text/html" href="https://wiki.pine64.org/index.php?title=Ox64&amp;diff=21283"/>
		<updated>2024-01-05T01:37:18Z</updated>

		<summary type="html">&lt;p&gt;Pavlos1: --break-system-packages is a bad idea; the whole point of setting up the venv was to avoid it&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;
[[File:target ABI setting.png|thumb|right|200px|target ABI setting]]&lt;br /&gt;
[[File:toolchain setting.png|thumb|right|200px|toolchain setting]]&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;
* 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;
&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;
You will get the flashing files into the &amp;quot;/output/images/&amp;quot; directory&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Flashing Ox64 SBC and microSD Card ==&lt;br /&gt;
This section explains how to flash an Ox64 board and a microSD card to boot the system. The required skill levels are fit even for newbies.&lt;br /&gt;
&lt;br /&gt;
=== Prepare the Environment === &lt;br /&gt;
You need a Linux machine, a Raspberry Pi Pico to act as a UART adapter, the Ox64 board, and a microSD card.&lt;br /&gt;
&lt;br /&gt;
Start a terminal session and set the working directory to download some files.&lt;br /&gt;
&lt;br /&gt;
 cd ~/Downloads&lt;br /&gt;
 mkdir ox64 ox64/pico&lt;br /&gt;
 cd ~/Downloads/ox64/pico&lt;br /&gt;
 wget https://github.com/Kris-Sekula/Pine64_Ox64_SBC/blob/main/uart/picoprobe.uf2&lt;br /&gt;
&lt;br /&gt;
 cd ~/Downloads/ox64&lt;br /&gt;
 mkdir ox64/devcube183&lt;br /&gt;
 cd ~/Downloads/ox64/devcube183&lt;br /&gt;
&lt;br /&gt;
Get the DevCube 1.8.3 flasher from one of mirrored servers, verify the hashes listed below, and decompress it.&lt;br /&gt;
&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: &amp;lt;code&amp;gt;0f2619e87d946f936f63ae97b0efd674357b1166&amp;lt;/code&amp;gt;&lt;br /&gt;
* SHA256: &amp;lt;code&amp;gt;e6e6db316359da40d29971a1889d41c9e97d5b1ff1a8636e9e6960b6ff960913&amp;lt;/code&amp;gt;&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 need following files for the flashing process.&lt;br /&gt;
 &lt;br /&gt;
  m0_lowload_bl808_m0.bin&lt;br /&gt;
  d0_lowload_bl808_d0.bin&lt;br /&gt;
  bl808-firmware.bin&lt;br /&gt;
  sdcard.img&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Establish Serial Communication from PC to Ox64 using Pi Pico ===&lt;br /&gt;
&lt;br /&gt;
Open a terminal and check the connected USB serial devices.&lt;br /&gt;
&lt;br /&gt;
 ls /dev/ttyACM*&lt;br /&gt;
&lt;br /&gt;
Set the Raspberry Pi Pico board into programming mode.&lt;br /&gt;
&lt;br /&gt;
* Press the BootSel button&lt;br /&gt;
* Apply power by plugging the USB cable to PC&lt;br /&gt;
* Release the BootSel button&lt;br /&gt;
&lt;br /&gt;
''Note: you could also ground pin28 to TP6 while powering.''&lt;br /&gt;
&lt;br /&gt;
Copy &amp;lt;code&amp;gt;picoprobe.uf2&amp;lt;/code&amp;gt; file into the new device &amp;lt;code&amp;gt;/media/&amp;lt;user&amp;gt;/RPI-RP2&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
 cp ~/Downloads/ox64/pico/picoprobe.uf2 /media/&amp;lt;user&amp;gt;/RPI-RP2&lt;br /&gt;
&lt;br /&gt;
After flashing, the device will auto-set in serial UART communication mode according to the following wiring diagram.&lt;br /&gt;
&lt;br /&gt;
[[File:Pine Serial v2.png|thumb|right|Wiring Raspberry Pi Pico to Pine64 Ox64 SBC]]&lt;br /&gt;
&lt;br /&gt;
 OX64                      PI PICO&lt;br /&gt;
 uart0_Tx_GPIO14_pin1 &amp;lt;-&amp;gt;  uart0_Rx_pin17&lt;br /&gt;
 uart0_Rx_GPIO15_pin2 &amp;lt;-&amp;gt;  uart0_Tx_pin16&lt;br /&gt;
 Rxd_GPIO17_pin31     &amp;lt;-&amp;gt;  uart1_Tx_pin6&lt;br /&gt;
 Txd_GPIO16_pin32     &amp;lt;-&amp;gt;  uart1_Rx_pin7 &lt;br /&gt;
 gnd_pin38            &amp;lt;-&amp;gt;  gnd_pin38/3    &lt;br /&gt;
 vbus5v_pin40         &amp;lt;-&amp;gt;  vbus5v_pin40&lt;br /&gt;
&lt;br /&gt;
=== Flash Your Ox64 === &lt;br /&gt;
There are two new ports to choose from, &amp;lt;code&amp;gt;/dev/ttyACM0&amp;lt;/code&amp;gt; for serial console and &amp;lt;code&amp;gt;/dev/ttyACM1&amp;lt;/code&amp;gt; for DevCube flashing.&lt;br /&gt;
&lt;br /&gt;
 minicom -b 2000000 -D /dev/ttyACM0&lt;br /&gt;
&lt;br /&gt;
Set the Ox64 board into programming mode.&lt;br /&gt;
&lt;br /&gt;
* Press the BOOT button&lt;br /&gt;
* Apply power or re-plug the USB cable&lt;br /&gt;
* Release the BOOT button&lt;br /&gt;
&lt;br /&gt;
Close &amp;lt;code&amp;gt;minicom&amp;lt;/code&amp;gt;. Open a new terminal window to run the 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 (make sure you don't use /dev/ttyACM0, it's used by the minicom console)&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;
&lt;br /&gt;
 Enable 'Single Download', set Address with 0x800000, choose [PATH to bl808-firmware.bin]&lt;br /&gt;
 Port/SN: /dev/ttyACM1 (make sure you don't use ACM0, it's used by minicom console)&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;
==== Open-Source Flashing Using CLI ====&lt;br /&gt;
&lt;br /&gt;
For those who do not want to use the DevCube, BouffaloLab provides open-source flashing packages &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;
First, install &amp;lt;code&amp;gt;bflb-iot-tool&amp;lt;/code&amp;gt; using your preferred method of managing PIP packages. One option is to set up a Python virtual environment as follows.&lt;br /&gt;
&lt;br /&gt;
 sudo apt install virtualenv python3-virtualenv&lt;br /&gt;
 python3 -m venv ~/ox64_venv&lt;br /&gt;
 . ~/ox64_venv/bin/activate&lt;br /&gt;
 pip install bflb-iot-tool # ''we are *not* using bflb-mcu-tool''&lt;br /&gt;
&lt;br /&gt;
Note that each time you open a new terminal window you will need to re-run &amp;lt;code&amp;gt;. ~/ox64_venv/bin/activate&amp;lt;/code&amp;gt; to reactivate the virtual environment.&lt;br /&gt;
&lt;br /&gt;
Next, put Ox64 in programming mode (press the BOOT button when first applying power) and flash the BL808.&lt;br /&gt;
&lt;br /&gt;
 PORT=/dev/ttyACM1 ''# this will depend on which serial adapter you use''&lt;br /&gt;
 BAUD=115200       ''# safe value for macOS, if using Linux set to 2000000 for faster flashing''&lt;br /&gt;
 cd ~/Downloads/ox64/buildroot_bouffalo/buildroot/output/images&lt;br /&gt;
 &lt;br /&gt;
 bflb-iot-tool --chipname bl808 --interface uart --port $PORT --baudrate $BAUD --addr 0x000000 --firmware m0_lowload_bl808_m0.bin --single&lt;br /&gt;
 bflb-iot-tool --chipname bl808 --interface uart --port $PORT --baudrate $BAUD --addr 0x100000 --firmware d0_lowload_bl808_d0.bin --single&lt;br /&gt;
 bflb-iot-tool --chipname bl808 --interface uart --port $PORT --baudrate $BAUD --addr 0x800000 --firmware bl808-firmware.bin --single&lt;br /&gt;
&lt;br /&gt;
If you get permission errors when running the commands above, you may need to add your user to the &amp;lt;code&amp;gt;dialout&amp;lt;/code&amp;gt; group. Running the commands as &amp;lt;code&amp;gt;root&amp;lt;/code&amp;gt; is not recommended since this will make &amp;lt;code&amp;gt;bflb-iot-tool&amp;lt;/code&amp;gt; create &amp;lt;code&amp;gt;root&amp;lt;/code&amp;gt;-owned files in your home directory.&lt;br /&gt;
&lt;br /&gt;
==== BL808 Address Details ====&lt;br /&gt;
&lt;br /&gt;
Note that addresses are different according the flashing method: DevCube or CLI.&lt;br /&gt;
&lt;br /&gt;
                      DevCube         CLI   &lt;br /&gt;
 For M0 set address = 0x58000000 or = 0x000000&lt;br /&gt;
 For D0 set address = 0x58100000 or = 0x100000&lt;br /&gt;
 For LP set address = 0x58200000 or = 0x200000&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Flash Your MicroSD Card ===&lt;br /&gt;
&lt;br /&gt;
Insert microSD card into PC, locate its device file (&amp;lt;code&amp;gt;/dev/sdb&amp;lt;/code&amp;gt;, for example), erase the start of the card and proceed to flashing.&lt;br /&gt;
&lt;br /&gt;
 cd ~/Downloads/ox64/buildroot_bouffalo/buildroot/output/images&lt;br /&gt;
 sudo dd if=/dev/zero of=/dev/sdb count=1 bs=32768 &lt;br /&gt;
 sudo dd if=sdcard.img of=/dev/sdb bs=1M status=progress conv=fsync&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== First Booting ===&lt;br /&gt;
Insert microSD card into Ox64 and set a UART connection to the Ox64 board.&lt;br /&gt;
&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;
Choose from serial devices &amp;lt;code&amp;gt;/dev/ttyACM0&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;/dev/ttyACM1&amp;lt;/code&amp;gt;, using the lower number.&lt;br /&gt;
&lt;br /&gt;
 minicom -b 2000000 -D /dev/ttyACM0&lt;br /&gt;
&lt;br /&gt;
Re-apply power to the Ox64 and enjoy the booting!&lt;br /&gt;
&lt;br /&gt;
[[Category:Ox64]]&lt;br /&gt;
[[Category:Bouffalo BL808]]&lt;/div&gt;</summary>
		<author><name>Pavlos1</name></author>
	</entry>
	<entry>
		<id>https://wiki.pine64.org/index.php?title=Talk:Ox64&amp;diff=21259</id>
		<title>Talk:Ox64</title>
		<link rel="alternate" type="text/html" href="https://wiki.pine64.org/index.php?title=Talk:Ox64&amp;diff=21259"/>
		<updated>2024-01-04T15:44:51Z</updated>

		<summary type="html">&lt;p&gt;Pavlos1: /* I disagree with the name of section 10 */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Flash memory producer ==&lt;br /&gt;
&lt;br /&gt;
Hello. On this page I see datasheets for Gigadevice flash memory, but on my boards placed Winbond flash. Maybe we need to update datasheets?--[[User:ElektroNIK|ElektroNIK]] ([[User talk:ElektroNIK|talk]]) 11:58, 20 January 2023 (UTC)&lt;br /&gt;
&lt;br /&gt;
== I disagree with the name of section 10 ==&lt;br /&gt;
&lt;br /&gt;
 :)&lt;/div&gt;</summary>
		<author><name>Pavlos1</name></author>
	</entry>
	<entry>
		<id>https://wiki.pine64.org/index.php?title=Talk:Ox64&amp;diff=21258</id>
		<title>Talk:Ox64</title>
		<link rel="alternate" type="text/html" href="https://wiki.pine64.org/index.php?title=Talk:Ox64&amp;diff=21258"/>
		<updated>2024-01-04T15:43:52Z</updated>

		<summary type="html">&lt;p&gt;Pavlos1: /* I disagree with the name of section 10 */ new section&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Flash memory producer ==&lt;br /&gt;
&lt;br /&gt;
Hello. On this page I see datasheets for Gigadevice flash memory, but on my boards placed Winbond flash. Maybe we need to update datasheets?--[[User:ElektroNIK|ElektroNIK]] ([[User talk:ElektroNIK|talk]]) 11:58, 20 January 2023 (UTC)&lt;br /&gt;
&lt;br /&gt;
== I disagree with the name of section 10 ==&lt;br /&gt;
&lt;br /&gt;
:)&lt;/div&gt;</summary>
		<author><name>Pavlos1</name></author>
	</entry>
	<entry>
		<id>https://wiki.pine64.org/index.php?title=Ox64&amp;diff=21255</id>
		<title>Ox64</title>
		<link rel="alternate" type="text/html" href="https://wiki.pine64.org/index.php?title=Ox64&amp;diff=21255"/>
		<updated>2024-01-04T15:20:40Z</updated>

		<summary type="html">&lt;p&gt;Pavlos1: Clarified open source flashing instructions&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;
[[File:target ABI setting.png|thumb|right|200px|target ABI setting]]&lt;br /&gt;
[[File:toolchain setting.png|thumb|right|200px|toolchain setting]]&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;
* 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;
&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. The required skills are very basic and fit for newbies.&lt;br /&gt;
&lt;br /&gt;
=== Prepare the Environment === &lt;br /&gt;
You need a Linux machine, a Raspberry Pi Pico to act as a UART adapter, the Ox64 board, and a microSD card.&lt;br /&gt;
&lt;br /&gt;
Start a terminal session and set the working directory to download some files&lt;br /&gt;
&lt;br /&gt;
 cd ~/Downloads&lt;br /&gt;
 mkdir ox64 ox64/pico&lt;br /&gt;
 cd ~/Downloads/ox64/pico&lt;br /&gt;
 wget https://github.com/Kris-Sekula/Pine64_Ox64_SBC/blob/main/uart/picoprobe.uf2&lt;br /&gt;
&lt;br /&gt;
 cd ~/Downloads/ox64&lt;br /&gt;
 mkdir ox64/devcube183&lt;br /&gt;
 cd ~/Downloads/ox64/devcube183&lt;br /&gt;
&lt;br /&gt;
Get the DevCube 1.8.3 flasher from one of mirrored servers, verify the hashes listed below, and decompress it:&lt;br /&gt;
&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: &amp;lt;code&amp;gt;0f2619e87d946f936f63ae97b0efd674357b1166&amp;lt;/code&amp;gt;&lt;br /&gt;
* SHA256: &amp;lt;code&amp;gt;e6e6db316359da40d29971a1889d41c9e97d5b1ff1a8636e9e6960b6ff960913&amp;lt;/code&amp;gt;&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 the following file and directory structure:&lt;br /&gt;
&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;
=== Establish Serial Communication from PC to Ox64 using Pi Pico ===&lt;br /&gt;
Open a terminal and check the connected USB serial devices:&lt;br /&gt;
&lt;br /&gt;
 ls /dev/ttyACM*&lt;br /&gt;
&lt;br /&gt;
Set the Raspberry Pi Pico board into programming mode:&lt;br /&gt;
&lt;br /&gt;
* Press the BootSel button&lt;br /&gt;
* Apply power by plugging the USB cable to PC&lt;br /&gt;
* Release the BootSel button&lt;br /&gt;
&lt;br /&gt;
''Note: you could also ground pin28 to TP6 while powering.''&lt;br /&gt;
&lt;br /&gt;
Copy &amp;lt;code&amp;gt;picoprobe.uf2&amp;lt;/code&amp;gt; file into the new device &amp;lt;code&amp;gt;/media/&amp;lt;user&amp;gt;/RPI-RP2&amp;lt;/code&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
 cp ~/Downloads/ox64/pico/picoprobe.uf2 /media/&amp;lt;user&amp;gt;/RPI-RP2&lt;br /&gt;
&lt;br /&gt;
After flashing, the device will auto-set in serial UART communication mode according to the following wiring diagram.&lt;br /&gt;
&lt;br /&gt;
[[File:Pine Serial v2.png|thumb|right|Wiring Raspberry Pi Pico to Pine64 Ox64 SBC]]&lt;br /&gt;
&lt;br /&gt;
 OX64                      PI PICO&lt;br /&gt;
 uart0_Tx_GPIO14_pin1 &amp;lt;-&amp;gt;  uart0_Rx_pin17&lt;br /&gt;
 uart0_Rx_GPIO15_pin2 &amp;lt;-&amp;gt;  uart0_Tx_pin16&lt;br /&gt;
 Rxd_GPIO17_pin31     &amp;lt;-&amp;gt;  uart1_Tx_pin6&lt;br /&gt;
 Txd_GPIO16_pin32     &amp;lt;-&amp;gt;  uart1_Rx_pin7 &lt;br /&gt;
 gnd_pin38            &amp;lt;-&amp;gt;  gnd_pin38/3    &lt;br /&gt;
 vbus5v_pin40         &amp;lt;-&amp;gt;  vbus5v_pin40&lt;br /&gt;
&lt;br /&gt;
=== Flash Your Ox64 === &lt;br /&gt;
There are two new ports to choose from, &amp;lt;code&amp;gt;/dev/ttyACM0&amp;lt;/code&amp;gt; for serial console and &amp;lt;code&amp;gt;/dev/ttyACM1&amp;lt;/code&amp;gt; for DevCube flashing.&lt;br /&gt;
&lt;br /&gt;
 minicom -b 2000000 -D /dev/ttyACM0&lt;br /&gt;
&lt;br /&gt;
Set the Ox64 board into programming mode:&lt;br /&gt;
&lt;br /&gt;
* Press the BOOT button&lt;br /&gt;
* Apply power or re-plug the USB cable&lt;br /&gt;
* Release the BOOT button&lt;br /&gt;
&lt;br /&gt;
Close &amp;lt;code&amp;gt;minicom&amp;lt;/code&amp;gt;. Open a new terminal window to run the 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 (make sure you don't use /dev/ttyACM0, it's used by the minicom console)&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;
&lt;br /&gt;
 Enable 'Single Download', set Address with 0x800000, choose [PATH to bl808-firmware.bin]&lt;br /&gt;
 Port/SN: /dev/ttyACM1 (make sure you don't use ACM0, it's used by minicom console)&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;
==== Open-Source Flashing via CLI ====&lt;br /&gt;
For those who do not want to use the DevCube, BouffaloLab provides open-source flashing packages &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;
First, install &amp;lt;code&amp;gt;bflb-iot-tool&amp;lt;/code&amp;gt; using your preferred method of managing PIP packages. One option is to set up a Python virtual environment:&lt;br /&gt;
&lt;br /&gt;
 python -m venv ~/ox64_venv&lt;br /&gt;
 . ~/ox64_venv/bin/activate&lt;br /&gt;
 pip install bflb-iot-tool # we are *not* using bflb-mcu-tool&lt;br /&gt;
&lt;br /&gt;
Note that each time you open a new terminal window you will need to re-run the second command above to reactivate the virtual environment.&lt;br /&gt;
&lt;br /&gt;
Next, 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;
&lt;br /&gt;
 PORT=/dev/ttyACM0 # this will depend on which serial adapter you use&lt;br /&gt;
 BAUD=115200 # safe value for macOS, if using Linux set to 2000000 for faster flashing&lt;br /&gt;
 &lt;br /&gt;
 bflb-iot-tool --chipname bl808 --interface uart --port $PORT --baudrate $BAUD --addr 0x000000 --firmware ~/Downloads/ox64/firmware/m0_lowload_bl808_m0.bin --single&lt;br /&gt;
 bflb-iot-tool --chipname bl808 --interface uart --port $PORT --baudrate $BAUD --addr 0x100000 --firmware ~/Downloads/ox64/firmware/d0_lowload_bl808_d0.bin --single&lt;br /&gt;
 bflb-iot-tool --chipname bl808 --interface uart --port $PORT --baudrate $BAUD --addr 0x800000 --firmware ~/Downloads/ox64/firmware/bl808-firmware.bin --single&lt;br /&gt;
&lt;br /&gt;
If you get permission errors on Linux, you may need to add your user to the &amp;lt;code&amp;gt;dialout&amp;lt;/code&amp;gt; group. Running the commands as &amp;lt;code&amp;gt;root&amp;lt;/code&amp;gt; is not recommended since this will make &amp;lt;code&amp;gt;bflb-iot-tool&amp;lt;/code&amp;gt; create &amp;lt;code&amp;gt;root&amp;lt;/code&amp;gt;-owned files in your home directory.&lt;br /&gt;
&lt;br /&gt;
==== Details on board addresses ====&lt;br /&gt;
You can use &amp;lt;code&amp;gt;make flash&amp;lt;/code&amp;gt; to flash the firmware from the command line instead of using BLDevCube. The default configuration is to flash to the M0 core, but you can specify the destination core for flashing by modifying the &amp;lt;code&amp;gt;flash_prog_cfg.ini&amp;lt;/code&amp;gt; file in the project root.&lt;br /&gt;
&lt;br /&gt;
 For M0 set address = 0x000000&lt;br /&gt;
 For D0 set address = 0x100000&lt;br /&gt;
 For LP set address = 0x200000&lt;br /&gt;
&lt;br /&gt;
If you are flashing from BLDevCube, set the CPU to &amp;lt;code&amp;gt;Group0&amp;lt;/code&amp;gt; and use the following addresses for the different cores:&lt;br /&gt;
&lt;br /&gt;
 For M0 set address = 0x58000000&lt;br /&gt;
 For D0 set address = 0x58100000&lt;br /&gt;
 For LP set address = 0x58200000&lt;br /&gt;
&lt;br /&gt;
=== Flash Your SD Card ===&lt;br /&gt;
Insert microSD card into PC, locate its device file (&amp;lt;code&amp;gt;/dev/sdb&amp;lt;/code&amp;gt;, for example), erase the start of the card, and flash the SD card &amp;lt;code&amp;gt;xxx.img&amp;lt;/code&amp;gt; file:&lt;br /&gt;
&lt;br /&gt;
 cd ~/Downloads/ox64/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/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;
Insert SD card into Ox64 and set a UART connection to the Ox64 board:&lt;br /&gt;
&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;
Choose from serial devices &amp;lt;code&amp;gt;/dev/ttyACM0&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;/dev/ttyACM1&amp;lt;/code&amp;gt;, using the lower number.&lt;br /&gt;
&lt;br /&gt;
 minicom -b 2000000 -D /dev/ttyACM0&lt;br /&gt;
&lt;br /&gt;
Re-apply power to the Ox64 and enjoy the booting!&lt;br /&gt;
&lt;br /&gt;
[[Category:Ox64]]&lt;br /&gt;
[[Category:Bouffalo BL808]]&lt;/div&gt;</summary>
		<author><name>Pavlos1</name></author>
	</entry>
	<entry>
		<id>https://wiki.pine64.org/index.php?title=Ox64&amp;diff=21050</id>
		<title>Ox64</title>
		<link rel="alternate" type="text/html" href="https://wiki.pine64.org/index.php?title=Ox64&amp;diff=21050"/>
		<updated>2023-10-30T13:45:15Z</updated>

		<summary type="html">&lt;p&gt;Pavlos1: Updated buildroot config (see: https://github.com/openbouffalo/buildroot_bouffalo/pull/71)&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;
* 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>Pavlos1</name></author>
	</entry>
	<entry>
		<id>https://wiki.pine64.org/index.php?title=Ox64&amp;diff=21048</id>
		<title>Ox64</title>
		<link rel="alternate" type="text/html" href="https://wiki.pine64.org/index.php?title=Ox64&amp;diff=21048"/>
		<updated>2023-10-30T11:59:56Z</updated>

		<summary type="html">&lt;p&gt;Pavlos1: Added Winbond flash datasheet&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 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;
* 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;Single-precision Floating-point&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;Double-precision Floating-point&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>Pavlos1</name></author>
	</entry>
	<entry>
		<id>https://wiki.pine64.org/index.php?title=File:W25Q128JW_RevB_11042019-1761358.pdf&amp;diff=21047</id>
		<title>File:W25Q128JW RevB 11042019-1761358.pdf</title>
		<link rel="alternate" type="text/html" href="https://wiki.pine64.org/index.php?title=File:W25Q128JW_RevB_11042019-1761358.pdf&amp;diff=21047"/>
		<updated>2023-10-30T11:51:37Z</updated>

		<summary type="html">&lt;p&gt;Pavlos1: Datasheet: W25Q128JWSQ found on (some) Ox64 boards&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Summary ==&lt;br /&gt;
Datasheet: W25Q128JWSQ found on (some) Ox64 boards&lt;br /&gt;
== Licensing ==&lt;br /&gt;
{{subst:Unknown_copyright}}&lt;/div&gt;</summary>
		<author><name>Pavlos1</name></author>
	</entry>
	<entry>
		<id>https://wiki.pine64.org/index.php?title=Ox64&amp;diff=20808</id>
		<title>Ox64</title>
		<link rel="alternate" type="text/html" href="https://wiki.pine64.org/index.php?title=Ox64&amp;diff=20808"/>
		<updated>2023-10-08T13:39:06Z</updated>

		<summary type="html">&lt;p&gt;Pavlos1: Added instructions for open-source flashing&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 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;
== 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 (English Auto-Translation)]&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 480MHz 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 320MHz 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 150MHz 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.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 (only 128Mb 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, 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;
* Microphone (optional, on camera module)&lt;br /&gt;
* Speaker (optional, on 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: 51mm x 21mm x 19mm x 3.5mm (Breadboard friendly)&lt;br /&gt;
* Input Power: 5V 0.5A microUSB or USB-C port&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;
&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;
* 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;Single-precision Floating-point&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;Double-precision Floating-point&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;
&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>Pavlos1</name></author>
	</entry>
</feed>