Difference between revisions of "User:Fxc/Software Draft"

From PINE64
Jump to navigation Jump to search
(New text)
Line 61: Line 61:
If the PinePhone Pro is not booting (either booting incompletely into a boot splash or tty or if the PinePhone Pro is showing no signs of life) this will typically have the following two reasons:
If the PinePhone Pro is not booting (either booting incompletely into a boot splash or tty or if the PinePhone Pro is showing no signs of life) this will typically have the following two reasons:


==== The battery got fully drained ====
==== The battery is fully drained ====
 
Due to a software bug in the pre-installed operating system on the PinePhone Pro, the bootloader ''U-Boot'' is booting into a boot loop if the battery is fully drained. In that case it is not possible to charge the phone. The battery can be charged by interrupting the boot loop by booting the PinePhone Pro into ''Maskrom mode'' or by charging the battery externally. To boot the PinePhone Pro into ''Maskrom mode'':
Due to a software bug in the pre-installed operating system on the PinePhone Pro, the bootloader ''U-Boot'' is booting in a boot loop if the battery is fully drained. In that case it is not possible to charge the phone. The battery can be charged by interrupting the boot loop by booting the PinePhone Pro into ''Maskrom mode'' or by charging the battery externally. To boot the PinePhone Pro into ''Maskrom mode'':


* Remove any microSD card from the phone and keep it removed for the below procedure
* Remove any microSD card from the phone and keep it removed for the below procedure
Line 75: Line 74:
{{Info|If the device doesn't appear under ''lsusb'' please try again with a different known good USB-C cable and make sure that there is no microSD card in the phone inserted.}}
{{Info|If the device doesn't appear under ''lsusb'' please try again with a different known good USB-C cable and make sure that there is no microSD card in the phone inserted.}}


==== The installation got corrupted ====
==== The installation is corrupted ====
The PinePhone Pro won't be able to boot if the installation on the SPI flash, the eMMC or the microSD card got corrupted. To boot a working operating system:
 
* Prepare a microSD card as explained in the section [[PinePhone Pro#Flashing to microSD card|Flashing to microSD card]]
* Remove any USB-C cable or device or add-on case from the PinePhone Pro
* Make sure the device is powered off by shortly removing the battery for a second
* Insert the microSD card into the top slot of the PinePhone Pro. Make sure the microSD card is inserted all the way and that the notch of the right side of the microSD card is not visible anymore.
* Power on the device while bypassing the SPI and eMMC as explained under [[PinePhone Pro#Boot order]]
 
The device should now boot from the microSD card. If the phone does not boot from the microSD card the microSD card was flashed with an incompatible image or the battery got drained as explained above.

Revision as of 11:21, 12 April 2022

Software

The software section explains how to install available software releases for the PinePhone Pro to the external or the internal memory and how to boot them and addresses common problems with booting the phone.

Note: Images of the regular PinePhone are not compatible with the PinePhone Pro.

Software releases

The PinePhone Pro Software Releases page has a complete list of currently supported phone-optimized operating system images that work with the PinePhone Pro.

Boot order

The RK3399S in the PinePhone Pro searches for the bootloader (for example the U-Boot SPL) in the following order:

  1. SPI flash
  2. eMMC (the internal memory)
  3. MicroSD card

The bootloader on the corresponding storage devices (for example the U-Boot SPL) can deviate from that fixed hardware boot order in software.

The SPI flash and the eMMC can be temporarily bypassed at boot by disconnecting them temporarily using the following method, for example in case of the installation on the SPI flash or the eMMC being corrupted:

  • On the Explorer Edition hold the RE button underneath the cover for a few seconds, while powering on the device.
  • On the Developer Edition, which was an earlier revision intended for developers only, the SPI and the eMMC can be bypassed by shorting the bypass contact points while booting. The process is explained in the article PinePhone Pro Developer Edition. Please join the community chat for any questions regarding the process.

The bypass disconnects the SPI and the eMMC while being held and the PinePhone Pro will try to boot from the next available boot medium, which is the microSD card. Note: When holding the RE button (or when shorting the contact points in case of the Developer Edition) for a longer time at boot the operating system will not initialize the SPI and eMMC and it will not be possible to write to these storage mediums until the next reboot.

Note: The bootloader (such as U-Boot) resides in the free space in front of the first partition. Wiping the bootloader from the eMMC to make the PinePhone Pro boot from microSD card can be done using sudo dd if=/dev/zero of=/dev/mmcblk2 seek=64 count=400 conv=fsync. Formatting the drive or deleting the partition table is not sufficient to wipe the bootloader.

See RK3399 boot sequence for details regarding the boot sequence.

Installation instructions

The software releases can be installed (the process is being referred to as flashing) to the eMMC or to an microSD card.

Flashing to microSD card

To install an image to the microSD card:

  1. Download a compatible image from PinePhone Pro Software Releases
  2. Extract the compressed image
  3. Write the image to your microSD card using your favorite method, examples:
    • Using dd: On the device you're flashing the microSD card from, find the correct device under lsblk and then flash the image to the microSD card using sudo dd if=IMAGE.img of=/dev/[DEVICE] bs=1M status=progress conv=fsync. Make sure the target is the whole microSD card and not its first partition (sdc1 or mmcblk0p1 are wrong!).
    • Using bmaptool: Make sure to select the correct device using lsblk. Then run bmaptool with the correct device: Download the IMAGE.xz and the IMAGE.bmap files, then run bmaptool copy --bmap IMAGE.bmap IMAGE.xz /dev/[DEVICE]. This takes around 2.5 minutes to flash a 4 GB file.
    • Using a graphical tool: A graphical tool such as Gnome Disks under Linux or Etcher under Windows may also be used.
  4. Insert the microSD card into the top slot of the PinePhone Pro. Make sure the microSD card is inserted all the way and that the notch of the right side of the microSD card is not visible anymore.
  5. Power on the PinePhone Pro. If there is an existing bootloader on the eMMC already you need to bypass or wipe the bootloader on the eMMC as explained in the section PinePhone Pro#Boot order

Flashing to the eMMC

Flashing to the eMMC can be done by booting an operating system from the microSD and by writing to the eMMC directly from there:

  1. Boot an operating system from the microSD card. If there is already a bootloader on the eMMC installed see the section PinePhone Pro#Boot order to bypass it
  2. Download or copy the desired image to the microSD card as file
  3. Check if the eMMC appears under lsblk. If it doesn't appear in the output of the command, the eMMC wasn't initialized due to applying the above explained bypass method for a too long time during the boot
  4. Extract the image
  5. Flash the extracted image using sudo dd if=IMAGE.img of=/dev/mmcblk2 bs=1M status=progress conv=fsync
  6. Reboot the PinePhone Pro

Troubleshooting

If the PinePhone Pro is not booting (either booting incompletely into a boot splash or tty or if the PinePhone Pro is showing no signs of life) this will typically have the following two reasons:

The battery is fully drained

Due to a software bug in the pre-installed operating system on the PinePhone Pro, the bootloader U-Boot is booting into a boot loop if the battery is fully drained. In that case it is not possible to charge the phone. The battery can be charged by interrupting the boot loop by booting the PinePhone Pro into Maskrom mode or by charging the battery externally. To boot the PinePhone Pro into Maskrom mode:

  • Remove any microSD card from the phone and keep it removed for the below procedure
  • Remove the battery, any USB cable and any serial cable
  • Reinsert the battery
  • Hold the RE button underneath the back cover of your Explorer Edition (or short the bypass contact points on the Developer Edition)
  • Connect the phone to an USB port of a computer, while still holding the button for some time
  • Check if the phone in Maskrom mode appears in the output of the terminal command lsusb on the computer, the expected VID:PID of the device is 2207:330c (under Windows this can be checked using the Device Manager and checking the VID and PID of an appearing Unknown device)
  • Let the phone charge for at least two hours
Note: If the device doesn't appear under lsusb please try again with a different known good USB-C cable and make sure that there is no microSD card in the phone inserted.

The installation is corrupted

The PinePhone Pro won't be able to boot if the installation on the SPI flash, the eMMC or the microSD card got corrupted. To boot a working operating system:

  • Prepare a microSD card as explained in the section Flashing to microSD card
  • Remove any USB-C cable or device or add-on case from the PinePhone Pro
  • Make sure the device is powered off by shortly removing the battery for a second
  • Insert the microSD card into the top slot of the PinePhone Pro. Make sure the microSD card is inserted all the way and that the notch of the right side of the microSD card is not visible anymore.
  • Power on the device while bypassing the SPI and eMMC as explained under PinePhone Pro#Boot order

The device should now boot from the microSD card. If the phone does not boot from the microSD card the microSD card was flashed with an incompatible image or the battery got drained as explained above.