Skip to content

Commit

Permalink
Merge branch 'main' of https://github.com/pine64/website
Browse files Browse the repository at this point in the history
  • Loading branch information
x1y committed May 17, 2024
2 parents 304a030 + 7836f5e commit c488270
Show file tree
Hide file tree
Showing 6 changed files with 83 additions and 48 deletions.
14 changes: 7 additions & 7 deletions content/documentation/Ox64/Software/Building.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ menu:
weight: 2
---

Start the buinding process cloning both the upstream Buildroot repository and the Buildroot Bouffalo overlay repository:
Start the building process cloning both the upstream Buildroot repository and the Buildroot Bouffalo overlay repository:

[source,console]
----
Expand Down Expand Up @@ -49,19 +49,19 @@ $ make menuconfig

Within `menuconfig`, configure the following:

* Navigate to `Target Options`
* Select `Target Options`
* Enable `Integer Multiplication and Division (M)`
* Enable `Atomic Instructions (A)`
* Enable `Atomic Instructions (A)` using space key
* Enable `Single-precision Floating-point (F)`
* Enable `Double-precision Floating-point (D)`
* Set `Target ABI` to `lp64d`
* Under `Toolchain`, enable `Fortran support` and `OpenMP support`
* Select `Target ABI`, set it to `lp64d` and `press Exit`
* Select `Toolchain`, enable `Fortran support`, enable `OpenMP support`, and Save & Exit

Initiate the build process, but first make sure that your `PATH` variable contains no spaces:
Initiate the build process, but first make sure that your `PATH` variable contains no spaces. For Arch Linux distrubution you may also need to install extra-packages with `sudo pacman -S cpio rsync bc`.

[source,console]
----
$ make
----

Buildroot will output to the `~/ox64/buildroot/output/images` directory.
Buildroot will output the needed files to the `~/ox64/buildroot/output/images` directory in about 1 hour, according to your computer processing resources and internet connection speed.
99 changes: 67 additions & 32 deletions content/documentation/Ox64/Software/Flashing.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -52,16 +52,16 @@ $ cd ~/ox64/openbouffalo/firmware # if you downloaded pre-built images
# or
$ cd ~/ox64/buildroot/output/images # if you built your own images
$ ls *808*.bin *.img
$ ls -1 *808*.bin *.img
----

Expected files:

* `sdcard.img` -- Kernel and root filesystem. Runs on the D0 core.
* `m0_lowload_bl808_m0.bin` -- Startup code for the M0 core.
* `d0_lowload_bl808_d0.bin` -- Startup code for the D0 core.
* `bl808-combined.bin` -- If you created the combined image.
* `bl808-firmware.bin` -- OpenSBI and UBoot DTB files. Runs on the D0 core.
* `bl808-combined.bin` -- if you created the combined image
* `d0_lowload_bl808_d0.bin` -- Startup code for the D0 core.
* `m0_lowload_bl808_m0.bin` -- Startup code for the M0 core.
* `sdcard.img` -- Kernel and root filesystem. Runs on the D0 core.

== Set up your UART adapter

Expand Down Expand Up @@ -146,11 +146,29 @@ The Bluepill is an affordable STM32 development board, based on the STM32F103C8T
====
The one catch is that you already need a serial adapter in order to program your Bluepill board. The good news is that you serial adapter does **not** have to be one from from the link:/documentation/Ox64/Further_information/Compatible_UARTs/[Compatible UARTs] list. These programming instructions have been tested with a FT232RL adapter (which, notably, is listed as _not_ supported on that list).
If you own an SWD-capable debugger (ST-Link, J-link, etc.) you can use that for programming the Bluepill as well, although instead of `stm32flash` you would be using https://openocd.org/[openocd] or other suitable software.
If you own an SWD-capable debugger (ST-Link, J-link, etc.) you can use that for programming the Bluepill as well, although instead of `stm32flash` console command you would be using https://openocd.org/[openocd] or other suitable software.
====

WARNING: Your serial adapter must use 3.3V logic levels.

Install software to flash Bluepill. For Debian-based systems just install package from repository:

[source,console]
----
$ sudo apt install stm32flash
----

For Arch Linux systems, use the AUR repository:

[source,console]
----
$ mkdir -p ~/ox64/bluepill
$ cd ~/ox64/bluepill
$ git clone https://aur.archlinux.org/stm32flash.git
$ cd ~/ox64/bluepill/stm32flash
$ makepkg -si
----

Download the https://github.com/r2axz/bluepill-serial-monster[Bluepill Serial Monster] firmware:

[source,console]
Expand All @@ -170,9 +188,8 @@ Find your USB serial adapter's device path with `ls /dev/ttyUSB* /dev/ttyACM*` (

[source,console]
----
$ sudo apt install stm32flash
$ cd ~/ox64/bluepill
$ stm32flash -w bluepill-serial-monster.hex /dev/tty[DEVICE]
$ sudo stm32flash -w bluepill-serial-monster.hex /dev/tty[DEVICE]
----

After upload, set boot jumpers for boot from flash: Boot0=0, Boot1=0. Disconnect the USB serial adapter from both the PC and Bluepill board.
Expand Down Expand Up @@ -259,20 +276,6 @@ You have a choice of flashing software:
* DevCube: GUI-based closed source flashing tool
* CLI (`bflb-iot-tool`): command line open source flashing tool

=== CLI packages installation

Install `bflb-iot-tool` using your preferred method of managing PIP packages. One option is to set up a Python virtual environment as follows:

[source,console]
----
$ sudo apt install python3-venv
$ python3 -m venv ~/ox64_venv
$ . ~/ox64_venv/bin/activate
$ pip install bflb-iot-tool # we are *not* using bflb-mcu-tool
----

NOTE: Each time you open a new terminal window you will need to re-run `. ~/ox64_venv/bin/activate` to reactivate the virtual environment.

=== DevCube installation

Download the latest DevCube flashing tool from BouffaloLab's website:
Expand All @@ -298,6 +301,26 @@ Verify that your copy of `BouffaloLabDevCube-v1.8.3.zip` matches the hashes belo
* SHA1: `0f2619e87d946f936f63ae97b0efd674357b1166`
* SHA256: `e6e6db316359da40d29971a1889d41c9e97d5b1ff1a8636e9e6960b6ff960913`

=== CLI packages installation

Install `bflb-iot-tool` using your preferred method of managing PIP packages. One option is to set up a Python virtual environment as follows:

[source,console]
----
$ sudo apt install pipenv # for Debian-based systems
# or
$ sudo pacman -S python-pipenv # for Arch Linux systems
$ cd ~/ox64/
$ pipenv install setuptools # install prerequisite of CLI flash tool
$ pipenv install bflb-iot-tool # install CLI flash tool
$ pipenv shell # activate virtual environment
$ # bflb-iot-tool --help # return info about the tool
----

NOTE: Each time you open a new terminal window you will need to `cd ~/ox64/` and re-run `pipenv shell` to reactivate the virtual environment.

== Flashing the Ox64

Put the Ox64 into programming mode:
Expand All @@ -310,19 +333,14 @@ Put the Ox64 into programming mode:

Set up some environment variables to save typing them out later:

[source,console]
----
$ PORT=/dev/ttyACM1
$ BAUD=230400 # safe value for macOS, set to 2000000 for faster flashing on Linux
----

Change directory to the location of your image files:

[source,console]
----
$ cd ~/ox64/openbouffalo/firmware # if you downloaded pre-built images
# or
$ cd ~/ox64/buildroot/output/images # if you built your own images
$ PORT=/dev/ttyACM1
$ BAUD=230400 # safe value for macOS, set to 2000000 for faster flashing on Linux
----

Finally, flash the Ox64. If you created a link:#optional_create_a_combined_soc_image[combined image] then run the command below:
Expand All @@ -347,7 +365,7 @@ $ bflb-iot-tool --chipname bl808 --interface uart --port $PORT --baudrate $BAUD
> --addr 0x800000 --firmware bl808-firmware.bin --single
----

If you get permission errors when running any of the commands above, you may need to add your user to the `dialout` group, using `sudo usermod -a -G dialout $USER`. Running the commands as `root` is not recommended since this will make `bflb-iot-tool` create root-owned files in your home directory.
If you get permission errors when running any of the commands above, run `ls -l /dev/tty[DEVICE]`, to find out which group is allowed to talk to serial ports and add your user to that group, with `sudo usermod -a -G [GROUP] $USER` (i.e. `dialout` for Debian or `uucp` for Arch Linux). Make sure you re-login. Running the commands as `root` is not recommended since this will make `bflb-iot-tool` create root-owned files in your home directory. You can now run `exit` from virtual environment.

=== BLDevCube flashing method

Expand All @@ -361,7 +379,6 @@ $ ./BLDevCube-ubuntu

Select chip [BL808], press Finish, and configure BOTH the [MCU] and [IOT] tabs as follows. When you switch between tabs double check that they still match the settings below:


[cols="~,~"]
|===
|Interface
Expand Down Expand Up @@ -394,6 +411,24 @@ Then, switch to the [IOT] tab:
* Click 'Create & Download' again and wait until it's done
* Close DevCube

== Erasing the microSD card

Make sure there are no signatures or partitions left, and overwrite the first sectors with zeroes. You can find the target device under `lsblk` command.

[source,console]
----
$ sudo wipefs /dev/[DEVICE]
$ sudo wipefs --all --force /dev/[DEVICE]*
$ sudo dd if=/dev/zero of=/dev/[DEVICE] status=progress bs=32768 count=1
----

Optionally you can zeroes the whole device:

[source,console]
----
$ sudo dd if=/dev/zero of=/dev/[DEVICE] status=progress bs=32768 count=$(expr $(lsblk -bno SIZE /dev/[DEVICE] | head -1) \/ 32768)
----

== Flashing the microSD card

Insert the microSD card into your PC, locate its device under `lsblk` and write the image:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ $ #NameUrl[uboot]=https://megous.com/dl/tmp/ppp.tar.gz # test build
$ NameUrl[arch]=https://github.com/dreemurrs-embedded/Pine64-Arch/releases/download/20240326/archlinux-pinephone-pro-phosh-20240326.img.xz
$ NameUrl[manjaro]=https://github.com/manjaro-pinephone/phosh/releases/download/beta37/Manjaro-ARM-phosh-pinephonepro-beta37.img.xz
$ NameUrl[mobian]=https://images.mobian.org/pinephonepro/weekly/mobian-rockchip-phosh-20240324.img.xz
$ NameUrl[pmos]=https://images.postmarketos.org/bpo/v23.12/pine64-pinephonepro/phosh/20240403-0443/20240403-0443-postmarketOS-v23.12-phosh-22.3-pine64-pinephonepro.img.xz
$ NameUrl[pmos]=https://images.postmarketos.org/bpo/v23.12/pine64-pinephonepro/phosh/20240501-0425/20240501-0425-postmarketOS-v23.12-phosh-22.3-pine64-pinephonepro.img.xz
$ NameUrl[sailfish]=https://gitlab.com/sailfishos-porters-ci/dont_be_evil-ci/-/jobs/artifacts/master/download?job=pinephonepro-rootfs
$ NameUrl[ut]=https://ci.ubports.com/job/focal-hybris-rootfs-arm64/job/master/lastSuccessfulBuild/artifact/ubuntu-touch-pinephone-pro-img-arm64.raw.xz
$ NameUrl[extra]=
Expand Down Expand Up @@ -339,23 +339,23 @@ menu label $NAME
#kernel /boot/Image
## uncomment next 3 lines for MOBIAN
#linux /boot/vmlinuz-6.6-rockchip
#initrd /boot/initrd.img-6.6-rockchip
#fdtdir /boot/dtb-6.6-rockchip/
#initrd /boot/initrd.img-6.6-rockchip
#linux /boot/vmlinuz-6.6-rockchip
## uncomment next 3 lines for PMOS
#fdtdir /boot/dtbs-pine64-pinephonepro/
#linux /boot/vmlinuz
#initrd /boot/initramfs-extra
#linux /boot/vmlinuz
## uncomment next 2 lines for SAILFISH
#fdt /boot/rockchip/rk3399-pinephone-pro.dtb
#kernel /boot/Image
## uncomment next 3 lines for UT
#linux /boot/vmlinuz-6.5.0-okpine-ut
#initrd /boot/initrd.img-6.5.0-okpine-ut
#fdtdir /boot/dtb-6.5.0-okpine-ut/
#initrd /boot/initrd.img-6.5.0-okpine-ut
#linux /boot/vmlinuz-6.5.0-okpine-ut
## uncomment next line for all distros, excluding UT
#append root=PARTLABEL=$BASE-$NAME console=ttyS2,115200 console=tty0 loglevel=7 rw rootwait
Expand Down
2 changes: 1 addition & 1 deletion content/documentation/Pinebook_Pro/Software/Releases.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -527,7 +527,7 @@ You can follow the ongoing discussion about NixOS on the https://forum.pine64.or

*Installation*

* This is instructions to install NixOS on the Pinebook Pro: https://nixos.wiki/wiki/NixOS_on_ARM/PINE64_Pinebook_Pro
* This is instructions to install NixOS on the Pinebook Pro: https://wiki.nixos.org/wiki/NixOS_on_ARM/PINE64_Pinebook_Pro
* Please pull the latest https://github.com/samueldr/wip-pinebook-pro[samueldr's repository ] from the project's GitHub.

=== SkiffOS
Expand Down
2 changes: 1 addition & 1 deletion content/documentation/ROCKPro64/Software/Releases.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@ Download:

image:/documentation/images/NixOS.webp[width=100]

*NixOS* is a Linux distribution built on top of the Nix package manager using declarative configuration to allow reliable system upgrades. More information can be found on the https://nixos.wiki/wiki/NixOS_on_ARM/PINE64_ROCKPro64[NixOS wiki].
*NixOS* is a Linux distribution built on top of the Nix package manager using declarative configuration to allow reliable system upgrades. More information can be found on the https://wiki.nixos.org/wiki/NixOS_on_ARM/PINE64_ROCKPro64[NixOS wiki].

Download:

Expand Down
2 changes: 1 addition & 1 deletion themes/pinetheme/layouts/partials/header.html
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@

<!-- Search -->
<div id="search">
<form action="/search" method="GET">
<form action="/search/" method="GET">
<input type="search" name="q" id="search-query" placeholder="Search...."><button type="submit" aria-label="Search button">
<svg width="22" height="14" viewBox="0 -0.5 21 21" xmlns="http://www.w3.org/2000/svg">
<path d="m5.94 12.929 1.485 1.414L1.485 20 0 18.586l5.94-5.657ZM13.65 12C10.755 12 8.4 9.757 8.4 7s2.355-5 5.25-5 5.25 2.243 5.25 5-2.355 5-5.25 5Zm0-12C9.59 0 6.3 3.134 6.3 7s3.29 7 7.35 7S21 10.866 21 7s-3.29-7-7.35-7Z" fill="#fff" fill-rule="evenodd"/>
Expand Down

0 comments on commit c488270

Please sign in to comment.