Orange pi: Difference between revisions

From 太極
Jump to navigation Jump to search
Line 57: Line 57:


== SPI flash, non-volatile memory ==
== SPI flash, non-volatile memory ==
<ul>
<li>Prime for SPI flash
* SPI Flash in a Single Board Computer (SBC) refers to a type of flash memory that uses the Serial Peripheral Interface (SPI) for communication. This is a common type of [https://en.wikipedia.org/wiki/Non-volatile_memory non-volatile memory] used in SBCs and other embedded systems.
* SPI Flash in a Single Board Computer (SBC) refers to a type of flash memory that uses the Serial Peripheral Interface (SPI) for communication. This is a common type of [https://en.wikipedia.org/wiki/Non-volatile_memory non-volatile memory] used in SBCs and other embedded systems.
* Many embedded systems, including SBCs, use non-volatile memory to store boot code, configuration parameters, and other data that persist when the system is powered down. Common Flash technologies include Parallel or SPI NOR flash, SLC NAND, and eMMC devices.
* Many embedded systems, including SBCs, use non-volatile memory to store boot code, configuration parameters, and other data that persist when the system is powered down. Common Flash technologies include Parallel or SPI NOR flash, SLC NAND, and eMMC devices.
Line 62: Line 64:
* If a NOR Flash device is used to store the bootloader, the processor can directly run off the Flash device. This method is commonly called eXecute In Place (XIP). If a NAND or eMMC device is used, boot code first needs to be copied to the system’s RAM. Then the processor can jump to the RAM space and execute. This method is called shadowing or Store-and-Download (SnD).
* If a NOR Flash device is used to store the bootloader, the processor can directly run off the Flash device. This method is commonly called eXecute In Place (XIP). If a NAND or eMMC device is used, boot code first needs to be copied to the system’s RAM. Then the processor can jump to the RAM space and execute. This method is called shadowing or Store-and-Download (SnD).
* For example, the [https://www.pine64.org/rockpro64/ ROCKPro64 SBC] has a 128Mbit SPI Flash, and the Odroid N2+ SBC features an 8MB SPI flash with a boot select switch and Petitboot app.
* For example, the [https://www.pine64.org/rockpro64/ ROCKPro64 SBC] has a 128Mbit SPI Flash, and the Odroid N2+ SBC features an 8MB SPI flash with a boot select switch and Petitboot app.
<li>Orange Pi 5
* [https://youtu.be/JL-K7n_2raI?si=TvhNaQHzVI-9BquI&t=452 NVMe boot . Orange Pi 5 computer Setup from Scratch HOWTO . Batocera JELOS Armbian downloaded].
:<syntaxhighlight lang='bash'>
# Put Armbian onto SD card
lsblk
sudo dd if=/dev/zero of=/dev/sdd bs=4M count=5
sudo sync
sudo dd if=Armbian*.img of=/dev/sdd bs=1M status=progress
sudo sync
lsblk
sudo eject /dev/sdd
lsblk
# Back up img files to a flash drive
sudo dd if=/dev/zero of=/dev/sdc bs=4M count=5
sudo sync
sudo fdisk /dev/sdc  # g, n, ENTER, ENTER, ENTER, w
sudo sync
sudo mkfs.ext4 /dev/sdc1
sudo sync
lsblk
mkdir hey
sudo mount /dev/sdc1 hey
sudo cp *.img hey/
sudo umount /dev/sdc1
sudo eject /dev/sdc
# Mount a flash drive, back up SPI firmware (optional)
lsblk
mkdir hey
sudo mount /dev/sda1 hey
cd hey
lsblk
sudo dd if=/dev/mtdblock0 of=orangepi5_SPI.img status=progress
sudo sync
sudo cp /usr/lib/linux-u-boot-legacy-orangepi5_23.05.0-trunk_arm64/rkspi_loader.img ./
sync
# Upgrade SPI
sudo dd if=rkspi_loader.img of=/dev/mtdblock0 status=progress
sudo sync
lsblk # look at the size of mtdblock0
</syntaxhighlight>
: At this point, we are ready to put Linux images (eg Batocera) on nvme
:<syntaxhighlight lang='bash'>
lsblk
sudo dd if=/dev/zero of=/dev/nvme0n1 bs=4M count=5
sudo sync
sudo dd if=batocera.img of=/dev/nvme0n1 bs=4M status=progress
sudo sync
</syntaxhighlight>
</li>
</ul>


= Android OS =
= Android OS =

Revision as of 19:59, 17 December 2023

Orange pi 5 plus

Booting from eMMC

  • Enable to boot from eMMC is more convenient since it asks to clear SPIflash. Therefore, we can easily to switch to boot from eMMC or SD card.
    • By default SD card has a higher priority to boot than eMMC.
    • I can use eMMC as the main OS storage and use SD card to play with different OSs.
    • Even I follow the instruction to use RKDevTool to put a Linux image onto eMMC, I still cannot boot from eMMC until I clear SPIflash.
    • eMMC is /dev/mmcblk1, speed is 271 MB/s (sudo hdparm -t --direct /dev/mmcblk1p2 )
    • SD is /dev/mmcblk0, speed is 62 MB/s (sudo hdparm -t --direct /dev/mmcblk0p2 )
  • From Linux
$ ls -l /dev/mtdblock0
brw-rw---- 1 root disk 31, 0 Dec 10 06:00 /dev/mtdblock0
sudo dd bs=1M if=/dev/zero of=/dev/mmcblk1 count=1000 status=progress
sudo sync

sudo dd bs=1M if=Orangepi5plus_x.x.x_debian_bullseye_desktop_xfce_linux5.10.110.img \
  of=/dev/mmcblk1 status=progress
sudo sync
  • If you want to boot from eMMC on the Orange Pi 5 Plus, you would need to clear the /dev/mtdblock0 partition. This is because the /dev/mtdblock0 partition typically contains the bootloader, and clearing it allows you to install a new bootloader that can boot from the eMMC.
    • Here is a general guide on how you can do this: Boot Armbian from an SD card.
    • Clear the SPI flash memory by running the following command in the terminal: sudo dd if=/dev/zero of=/dev/mtdblock0 bs=1M count=1

Booting from NVME

SPI flash, non-volatile memory

  • Prime for SPI flash
    • SPI Flash in a Single Board Computer (SBC) refers to a type of flash memory that uses the Serial Peripheral Interface (SPI) for communication. This is a common type of non-volatile memory used in SBCs and other embedded systems.
    • Many embedded systems, including SBCs, use non-volatile memory to store boot code, configuration parameters, and other data that persist when the system is powered down. Common Flash technologies include Parallel or SPI NOR flash, SLC NAND, and eMMC devices.
    • In the context of system booting, the processor starts executing at the reset vector and attempts to execute the first code. Some processors have a small internal boot ROM that can be programmed at manufacturing time. The boot ROM can also detect where the bootloader was stored; for example, in an external NOR or NAND flash device.
    • If a NOR Flash device is used to store the bootloader, the processor can directly run off the Flash device. This method is commonly called eXecute In Place (XIP). If a NAND or eMMC device is used, boot code first needs to be copied to the system’s RAM. Then the processor can jump to the RAM space and execute. This method is called shadowing or Store-and-Download (SnD).
    • For example, the ROCKPro64 SBC has a 128Mbit SPI Flash, and the Odroid N2+ SBC features an 8MB SPI flash with a boot select switch and Petitboot app.
  • Orange Pi 5
    # Put Armbian onto SD card
    lsblk
    sudo dd if=/dev/zero of=/dev/sdd bs=4M count=5
    sudo sync
    sudo dd if=Armbian*.img of=/dev/sdd bs=1M status=progress
    sudo sync
    lsblk
    sudo eject /dev/sdd
    lsblk
    
    # Back up img files to a flash drive
    sudo dd if=/dev/zero of=/dev/sdc bs=4M count=5
    sudo sync
    sudo fdisk /dev/sdc  # g, n, ENTER, ENTER, ENTER, w
    sudo sync
    sudo mkfs.ext4 /dev/sdc1
    sudo sync
    lsblk
    mkdir hey
    sudo mount /dev/sdc1 hey
    sudo cp *.img hey/
    sudo umount /dev/sdc1
    sudo eject /dev/sdc
    
    # Mount a flash drive, back up SPI firmware (optional)
    lsblk
    mkdir hey
    sudo mount /dev/sda1 hey
    cd hey
    lsblk
    sudo dd if=/dev/mtdblock0 of=orangepi5_SPI.img status=progress
    sudo sync
    sudo cp /usr/lib/linux-u-boot-legacy-orangepi5_23.05.0-trunk_arm64/rkspi_loader.img ./
    sync
    
    # Upgrade SPI
    sudo dd if=rkspi_loader.img of=/dev/mtdblock0 status=progress
    sudo sync
    lsblk # look at the size of mtdblock0
    At this point, we are ready to put Linux images (eg Batocera) on nvme
    lsblk
    sudo dd if=/dev/zero of=/dev/nvme0n1 bs=4M count=5
    sudo sync
    sudo dd if=batocera.img of=/dev/nvme0n1 bs=4M status=progress
    sudo sync

Android OS

  • For enhanced security, it is recommended to install the SDDiskTool on a virtual machine or a non-critical Windows system. This precautionary measure can help mitigate potential security risks. I experienced a blue screen error during my initial use of the software, which underscores the importance of this safety advice..
  • The instructions provided for installing onto an SD card work. However, to successfully boot from the SD card, it is necessary to remove the eMMC first.
  • The Android OS image is not optimized for a large screen. So it is better to use Orange Pi OS (Droid) instead.

Armbian

  • Orange Pi 5 Plus review with Armbian (4k) 12/13/2023
    • How to build armbian
    • Use 'Disks' utility to write an image to SD card
    • Game testing
    • box64 was used to run x86_64 Linux programs (such as games) on non-x86_64 Linux systems, like ARM. H-craft, Colin McRae Rally, GTA3.
    • wine, TrackMania Nations Forever
    • RetroPie/emulationstation

JELOS

https://jelos.org/devices/orange-pi/orange-pi-5/

Tips