https://wiki.pine64.org/api.php?action=feedcontributions&user=Jwillikers&feedformat=atomPINE64 - User contributions [en]2024-03-28T21:01:39ZUser contributionsMediaWiki 1.37.1https://wiki.pine64.org/index.php?title=Pinebook_Pro_SPI&diff=12728Pinebook Pro SPI2022-04-06T13:28:41Z<p>Jwillikers: Make sure to power off / on the Pinebook Pro when entering Maskrom mode (reliable method)</p>
<hr />
<div>The Pinebook Pro comes equipped with two non-volatile storage components, the eMMC and the SPI. The capacity of the SPI is 128Mbit (16MiB) and it may be used in the boot process.<br />
<br />
Boot data can be written to the SPI via two methods: either from within PBP or from a second machine connected to the PBP by USB.<br />
<br />
= Writing to SPI from within PBP =<br />
<br />
[https://forum.pine64.org/member.php?action=profile&uid=15527 Forum user pcm720] showed an example of writing to the SPI from within PBP in [https://github.com/pcm720/u-boot-build-scripts/releases their self-published version of U-Boot] that offers boot functionality for NVMe drives. It involves use of <code>flash_erase</code> command (available in the mtd-utils package on Arch/Manjaro) and the <code>dd</code> command.<br />
<br />
= Writing to SPI from a second machine =<br />
<br />
Writing to the SPI from a second machine is more complicated than the other method, but it is the only option when troubleshooting an SPI flash gone wrong. This method works by bringing the PBP into <code>maskrom mode</code> and issuing commands on the second machine that download the flash image onto the PBP.<br />
<br />
Upon entering <code>maskrom mode</code>, the power LED on your PBP won't light up and neither will the display. Instead, your second machine, the one connected to your PBP via USB, will indicate <code>maskrom mode</code> by logging to <code>journalctl</code>.<br />
<br />
There are two ways to reach <code>maskrom mode</code>, but the first tends to be less reliable.<br />
<br />
== Maskrom mode (unreliable method) ==<br />
<br />
According to Rockchip documentation, these steps should work; unfortunately, many users have reported them to be unsuccessful. You may need to repeat these steps several times for them to work.<br />
<br />
# Press and hold recovery button.<br />
# Short press reset.<br />
# Release recovery button after about 3 seconds.<br />
<br />
Why this procedure is unreliable is not clear, but there are two suspicions:<br />
<br />
* The button is not working correctly or is just prone to failures.<br />
* The problem occurs only when the SPI was previously flashed.<br />
<br />
The button works by shorting two pins in the SPI device. But in some cases it just does nothing. Fortunately, the two pins can shorted by hand, as described in the next method.<br />
<br />
== Maskrom mode (reliable method) ==<br />
<br />
# Build and install <code>rkdeveloptool</code> (see [https://github.com/rockchip-linux/rkdeveloptool project repository] for instructions)<br />
# Verify successful installation. Running <code>rkdeveloptool --version</code> should output: <code>rkdeveloptool ver 1.3</code><br />
# Run <code>journalctl -f</code> and keep it running. Once the Pinebook Pro is connected and maskrom mode is reached it will produce additional output.<br />
# Power off the Pinebook Pro.<br />
# Unscrew the bottom cover.<br />
# Remove the metal shield surrounding the main CPU. The shield is held in place by a tape and micro clamps on the board. The clamps can be released with a pry tool and some force. [https://forum.pine64.org/showthread.php?tid=11073&pid=75096#pid75096 This forum post with photos] shows how it can be done.<br />
# Disconnect all (!!!) boot devices (emmc, sdcard, usb).<br />
# Locate SPI flash (component number 29 on [https://wiki.pine64.org/images/4/45/PBPL_S.jpg this photo of the Pinebook Pro internals]).<br />
# Connect your PBP with USB-C - USB-A cable to second machine (PBP on USB-C side)<br />
# Short pins CLK and VSS (see chip diagram to the right for the names of pins). This can be done with a pair of tweezers when short on tools. [[File:Spi.png|right]]<br />
# Power on the Pinebook Pro.<br />
# Press the reset button (component number 28).<br />
# Check if there is new output from <code>journalctl</code> program.<br />
# Check if the PBP connected by running <code>rkdeveloptool ld</code>. If successful, the output should be like: <code>DevNo=1 Vid=0x2207,Pid=0x330c,LocationID=1401 Maskrom</code><br />
<br />
== After entering maskrom mode ==<br />
<br />
Now that the PBP is in <code>maskrom mode</code>, you can use <code>rkdeveloptool</code> to write data to the SPI. To do so you'll need the binary file you'll be writing to SPI, which will be referred to as <code>SPI_new.bin</code>, and a helper file named [https://dl.radxa.com/rockpi4/images/loader/spi/rk3399_loader_spinor_v1.15.114.bin rk3399_loader_spinor_v1.15.114.bin].<br />
<br />
# Flash the flash helper db file: <code>rkdeveloptool db rk3399_loader_spinor_v1.15.114.bin</code>. If successful, the output should read <code>Downloading bootloader succeeded</code>.<br />
# Flash the new SPI binary: <code>rkdeveloptool wl 0 SPI_new.bin</code>. If successful, the output should read: <code>Write LBA from file (100%)</code>.<br />
# Test the installation: <code>rkdeveloptool td</code>. If successful, output should read <code>Reset Device OK</code>.<br />
# Run <code>rkdeveloptool rd</code> to reboot your Pinebook Pro.<br />
<br />
== Zeroing out the SPI ==<br />
<br />
In case, you wrote something bad to your SPI, it's helpful to wipe away that data with zeros. To do that, you follow the same steps above to enter <code>maskrom mode</code> and then write an binary file that consists of all zeros.<br />
<br />
# Create the binary file <code>dd if=/dev/zero of=zero.bin bs=1M count=16</code><br />
# Flash the flash helper db file: <code>rkdeveloptool db rk3399_loader_spinor_v1.15.114.bin</code>. If successful, the output should read <code>Downloading bootloader succeeded</code>.<br />
# Flash the new SPI binary: <code>rkdeveloptool wl 0 zero.bin</code>. If successful, the output should read: <code>Write LBA from file (100%)</code>.<br />
# Test the installation: <code>rkdeveloptool td</code>. If successful, output should read <code>Reset Device OK</code>.<br />
# Run <code>rkdeveloptool rd</code> to reboot your Pinebook Pro.<br />
<br />
[[Category:PineBook Pro]]</div>Jwillikershttps://wiki.pine64.org/index.php?title=PinePhone_Pro&diff=12572PinePhone Pro2022-02-20T18:02:05Z<p>Jwillikers: Clarify that the boot sequence details link refers to the RK3399 in general and not specifically to the PinePhone Pro</p>
<hr />
<div>[[File:Pinephone_double.png|400px|thumb|right|Rendering of the PinePhone Pro]]<br />
<br />
The '''PinePhone Pro''' is PINE64's flagship smartphone announced on October 15, 2021. It features 4GB of RAM, an 128GB eMMC and is using an Rockchip RK3399S SoC, which is a specialized version of the RK3399 made specifically for the PinePhone Pro.<br />
<br />
== Introduction ==<br />
<br />
The PinePhone Pro is PINE64’s second smartphone and a successor to the original PinePhone. It does not, however, replace the original PinePhone. It should also not be considered a second generation PinePhone; it is a higher-end device, with much better specs, aimed at those who wish to daily-drive a open system stack. Achieving this goal will, however, take time as the software and overall smartphone software ecosystem needs to mature.<br />
<br />
More information about the PinePhone Pro can be found on the device [https://www.pine64.org/pinephonepro/ main page].<br />
<br />
=== State of the software ===<br />
<br />
Presently, at the time of writing (late 2021), the PinePhone Pro is aimed solely at early adopters and developers. It will take time for all the PinePhone Pro’s functionality to reach software parity with the original PinePhone and for mobile operating systems, in more general, to reach a higher degree of maturity.<br />
<br />
Bear in mind that the software for these smartphones is still in a very early stage, with most of the software being in alpha or beta state. That's especially also the case for scalability of applications, their availability and practicability, any hardware function implementations and the firmware. The software is provided as is. There is no warranty for the software, not even for merchantability or fitness for a particular purpose.<br />
<br />
If you have any questions regarding the current state of the software or of specific features working, please don't hesitate to ask in the community chat (see [[Main Page#Community and Support]])!<br />
<br />
=== Editions and revisions ===<br />
Similarly to the original PinePhone, various PinePhone Pro editions are planned, the first of which is the Developer Edition (aimed at developers, as the name entails) followed by the Explorer Edition, which is aimed at early adopters.<br />
<br />
* [[PinePhone Pro Developer Edition]]<br />
* [[PinePhone Pro Explorer Edition]]<br />
<br />
=== Help and support ===<br />
<br />
Still have any questions regarding software, shipping, or ordering after reading this Wiki? Please don't hesitate to contact the community in the bridged community channels for detailed answers or simply to chat with friendly people in the community! See [[Main Page#Community and Support]].<br />
<br />
Please keep in mind that PINE64 is not like a regular company (see [https://www.pine64.org/philosophy/ PINE64 philosophy]), and currently that support resources are sparse - the best way to get support quickly is to ask in the community chat! Please only contact PINE64 directly if questions couldn't be solved via the community chat or this wiki.<br />
<br />
== First time setup ==<br />
Before the PinePhone Pro is taken into operation, the following information have to be considered:<br />
<br />
* When shipped the battery is isolated from the mainboard contacts using a protective plastic tab, which is required to be removed before using the phone. The battery '''will not''' charge until it is removed and some of the device’s functionality may not function properly.<br />
* The PinePhone Pro's SIM slot only accepts a micro SIM, please '''do not insert an empty micro SIM adapter or a nano SIM''' without an adapter into the phone, as the adapter will get stuck on the contact pins and the loose nano SIM will short the device! The SIM card has to be placed in the lower slot, while the microSD has to be placed in the upper slot. An adapter from a nano to a micro SIM is included in the box.<br />
<br />
To remove the sticker after unboxing the phone:<br />
<br />
# Carefully remove the back panel using the notch in the corner of the back cover without overbending it<br />
# Remove the battery<br />
# Peel off the clear plastic sticker below it, which isolates the charging contacts<br />
# Reinsert the battery<br />
<br />
<gallery mode="nolines" widths="400px" heights="400px"><br />
Image:Pinephone_warning.png|A protection foil isolates the battery for the shipping.<br />
Image:Pinephone_backside.png|The microSD belongs in the upper slot, the micro SIM in the lower slot.<br />
</gallery><br />
<br />
== Software ==<br />
<br />
At the time of the release, in late 2021, the PinePhone Pro is in an early development stage. That said, the device has benefited greatly from work done on the original PinePhone, which means that even early development images feature all core functionality, such as: functional UI, sensors and even the modem (to a degree).<br />
<br />
The development is expected to proceed very quickly compared to progress done on the original PinePhone as much of the fundamental work can carry over to the new device.<br />
You can follow development efforts on [https://xnux.eu/log/ Megi's blog], the dedicated [[PinePhone Pro Development]] section as well as on individual project’s Wiki’s and repositories.<br />
<br />
=== Boot order ===<br />
On the PinePhone Pro the eMMC (the internal storage of the phone) has a higher boot priority than the microSD card (see [[RK3399 boot sequence#Boot sequence details|RK3399 boot sequence details]] for details regarding the boot sequence). That behavior is in contrast to the original PinePhone with the Allwinner A64 SoC, where the microSD card has a higher boot priority.<br />
<br />
The '''Explorer Edition''' comes with a modified U-Boot pointing to the microSD card pre-installed to the eMMC. The microSD card can be (temporarily) booted instead of the pre-installed operating system, when the power key is shortly held at boot. To always boot from the microSD card it is recommended to wipe U-Boot from the eMMC. When the pre-installed bootloader was overwritten with a bootloader without such a configuration, the ''RE'' button underneath the back cover of the phone can also be used to temporarily bypass the eMMC. The button may however only be pressed shortly for a few seconds during boot, otherwise the eMMC won't be initialized in the operating system.<br />
<br />
The '''Developer Edition''', which was an earlier revision intended for development, was coming with an Android factory OS preinstalled. For details regarding how to remove the bootloader and the preinstalled OS of the eMMC for Developer Edition, please see the relevant wiki [[PinePhone Pro Developer Edition#Nuking the factory AOSP installation|article]]. The eMMC on the Developer Edition can be bypassed by shorting two specific contact points, please join the community chat for any questions regarding the process.<br />
<br />
=== Installation instructions ===<br />
<br />
{{Template:note|Due to the specific [[PinePhone Pro#Boot order|boot order]] it is currently '''strongly recommended''' to boot from the '''microSD card only'''. Please ask in the [[Main Page#Chat Platforms|community chat]] if you have any questions regarding the installation.}}<br />
<br />
As explained in the [[PinePhone Pro#Boot order|boot order]] section, the eMMC has a higher boot priority than the microSD card. On the '''Explorer Edition''' the default installation of U-Boot shipped by the factory points to the microSD card when holding the power key at boot. If the default installation was corrupted or overwritten by a differently configured bootloader, the eMMC may have to be bypassed to boot from microSD card and to alter the eMMC contents.<br />
<br />
{{hint|If the '''battery is fully drained''' U-Boot might fail to boot any installed operating system on the eMMC and microSD card due to a bug. <br />
<br />
If that's the case please start your phone in Maskrom mode and let it charge in that for a few hours. To do that:<br />
<br />
* Remove any microSD card from the phone and keep it removed for the below procedure<br />
* Remove the battery, any USB cable and any serial cable<br />
* Reinsert the battery<br />
* Hold the "RE" button underneath the back cover of your '''Explorer Edition''' (or shorting the bypass contact points on the '''Developer Edition''') <br />
* Connect the phone to an USB port of a computer, while still holding the button for some time<br />
* Check if the phone in Maskrom mode appears in the output of the Linux command <code>lsusb</code> on the computer<br />
* Let the phone charge for multiple hours<br />
<br />
Note: If the procedure doesn't work please try again with a different known '''good USB-C cable''' make sure that there is no microSD card in the phone.<br />
}}<br />
<br />
==== Flashing to microSD card ====<br />
To install an image to the microSD card:<br />
<br />
# Download your chosen image from [[PinePhone Pro Software Releases]]<br />
# Extract the compressed file<br />
# Write the image to your microSD card using your favorite method, examples:<br />
#* Using ''dd'': On the device you're flashing the microSD card from, find the correct device under <code>lsblk</code> and then flash the image to the microSD card using <code>sudo dd if=pine.img of=/dev/'''[DEVICE]''' bs=1M status=progress conv=fsync</code>. Make sure the target is the whole microSD card and not its first partition (''sdc1'' or ''mmcblk0p1'' are wrong!).<br />
#* Using ''bmaptool'': Make sure to select the correct device using <code>lsblk</code>. Then run bmaptool with the correct device: Download the ''.img.xz'' and the ''.img.bmap'' files, then run <code>bmaptool copy --bmap image.bmap image.xz /dev/'''[DEVICE]'''</code>. This takes around 2.5 minutes to flash a 4 GB file.<br />
#* Using ''a graphical tool'': A graphical tool such as Gnome Disks under Linux or Etcher under Windows may also be used.<br />
# Insert the microSD card into the top slot of the phone<br />
# Boot the phone. If there is an '''existing bootloader on the eMMC''' (the eMMC has a [[PinePhone Pro#Boot order|higher boot priority]]) you need to [[PinePhone Pro#Bypassing the eMMC|bypass the eMMC]] at boot and you can [[PinePhone Pro#Wipe U-Boot from the eMMC|wipe the bootloader from the eMMC]] to default boot from the microSD card by default in the freshly booted installation.<br />
<br />
==== Flashing to the eMMC ====<br />
<br />
{{warning|Installing to the eMMC is currently '''not recommended''' due to installations breaking commonly, as flashing to the eMMC will complicate the recovery process considerably.}}<br />
<br />
Flashing to the eMMC can be simply done by booting an operating system from the microSD and to flash the eMMC from there:<br />
<br />
# Boot an operating system from the microSD card. If there is already a bootloader on the eMMC installed see the section [[PinePhone Pro#Bypassing the eMMC|bypassing the eMMC]] to bypass it<br />
# Download or copy the new image to the microSD card<br />
# Check if the eMMC appears under <code>lsblk</code>. If it doesn't appear there you held the ''RE'' button in the eMMC bypass for too long (the eMMC didn't initialize then)<br />
# Extract the image<br />
# Flash the extracted image using <code>sudo dd if='''IMAGE.img''' of=/dev/mmcblk2 bs=1M status=progress conv=fsync</code><br />
# Reboot the phone<br />
<br />
==== Bypassing the eMMC ====<br />
<br />
The eMMC can always be temporarily bypassed at boot to be able to boot from a microSD card:<br />
<br />
On the '''Explorer Edition''' hold the ''RE'' button underneath the cover for a few seconds, while powering on the device (holding it too long will cause the eMMC to not get initialized after the boot).<br />
<br />
On the '''Developer Edition''' short the eMMC bypass contacts while booting.<br />
<br />
For details see the section [[PinePhone Pro#Boot order|boot order]].<br />
<br />
==== Wipe U-Boot from the eMMC ====<br />
To boot from microSD card permanently, one of the methods is to wipe the bootloader from the eMMC. If no bootloader is found on the eMMC, the phone will boot to the microSD card instead. To wipe U-Boot from the microSD card:<br />
<br />
* Boot a GNU/Linux operating system from the microSD card by holding power at boot (or using the above bypass method if the bootloader was altered or the Developer Edition is used)<br />
* Type <code>lsblk</code> in a terminal on the phone to list the devices<br />
* Wipe the bootloader using <code>sudo dd if=/dev/zero of=/dev/mmcblk2 seek=64 count=400 conv=fsync</code><br />
<br />
The phone should now default to the microSD card at boot.<br />
<br />
If there are any issues please join the bridged [[Main Page#Community and Support|community PinePhone channel]] and explain your issue and what you've tried so far.<br />
<br />
=== Software releases ===<br />
<br />
The [[PinePhone Pro Software Releases]] page has a complete list of currently supported phone-optimized operating system images that work with the PinePhone Pro.<br />
<br />
== Privacy switch configuration ==<br />
<br />
[[File:PinePhone Kill Interruptors de Maquinari del PinePhone 4529.jpg|320px|thumb|right|Detail of DIP switch]]<br />
<br />
The PinePhone features six switches that can be used to configure its hardware. They are numbered 1-6, with switch 1 located nearest to the modem. Their "on" position is toward the top of the phone.<br />
<br />
{| class="wikitable"<br />
|-<br />
! Number<br />
! Name<br />
! Description<br />
|-<br />
| 1<br />
| Modem<br />
| "On" enables 2G/3G/4G communication and GNSS hardware, "off" disables it.<br />
|-<br />
| 2<br />
| WiFi / Bluetooth<br />
| "On" enables WiFi and Bluetooth communication hardware, "off" disables it.<br />
|-<br />
| 3<br />
| Microphone<br />
| "On" enables audio input from on-board microphones (not 3.5 mm jack), "off" disables it.<br />
|-<br />
| 4<br />
| Rear camera<br />
| "On" enables the rear camera, "off" disables it.<br />
|-<br />
| 5<br />
| Front camera<br />
| "On" enables the front camera, "off" disables it.<br />
|-<br />
| 6<br />
| Headphone<br />
| "On" enables audio input and output via the 3.5 mm audio jack, "off" switches the jack to hardware UART¹ mode.<br />
|}<br />
<br />
¹ Note: The baud rate may be 1500000 instead of 115200.<br />
<br />
== Specifications ==<br />
<br />
* '''Dimensions:''' 160.8 x 76.6 x 11.1mm<br />
* '''Weight:''' Approx. 220g<br />
* '''SIM Card:''' Micro-SIM<br />
* '''Display:'''<br />
** '''Size:''' 6 inches (151mm) diagonal<br />
** '''Type:''' 1440 x 720 in-cell IPS with Gorilla Glass 4™<br />
** '''Resolution:''' 1440x720, 18:9 ratio<br />
* '''System on Chip:''' Rockchip RK3399S 64bit SoC – 2x A72 and 4x A53 CPU cores @ 1.5GHz<br />
* '''RAM:''' 4GB LPDDR4 @ 800MHz<br />
* '''Internal Storage:''' 128GB eMMC, extendable up to 2TB via microSD, supports SDHC and SDXC<br />
* '''Back [[#Camera|Camera]]:''' 13MP Sony IMX258 with Gorilla Glass 4™ protective layer, LED Flash<br />
* '''Front Camera:''' 8MP, OmniVision OV8858 front-facing camera<br />
* '''Sound:''' Loudspeaker, 3.5mm jack & mic (jack doubles as hardware UART if hardware switch 6 is deactivated)<br />
* '''Communication:'''<br />
** '''[[#Modem|Modem]]:''' [https://www.quectel.com/product/lte-eg25-g/ Quectel EG25-G]<br />
** '''LTE-FDD''': B1, B2, B3, B4, B5, B7, B8, B12, B13, B18, B19, B20, B25, B26, B28<br />
** '''LTE-TDD''': B38, B39, B40, B41<br />
** '''WCDMA''': B1, B2, B4, B5, B6, B8, B19<br />
** '''GSM''': B2, B3, B5, B8 (850, 900, 1800, 1900 MHz)<br />
** '''WLAN & Bluetooth:''' Wi-Fi 802.11AC, hotspot capable + Bluetooth V5.0<br />
** '''GNSS:''' GPS/GLONASS/BeiDou/Galileo/QZSS, with A-GPS<br />
* '''Sensors:''' Accelerometer, gyroscope, proximity, ambient light, compass<br />
* '''Privacy switches:''' Modem, WiFi & Bluetooth, Microphone, Cameras<br />
* '''[[#Battery|Battery]]:''' Lithium-ion, rated capacity 2800mAh (10.64Wh), typical capacity 3000mAh (11.40Wh) (nominally replaceable with any Samsung J7 form-factor battery)<br />
* '''I/O:''' USB Type-C, USB Host, DisplayPort Alternate Mode output, 15W 5V 3A Quick Charge, follows USB PD specification<br />
<br />
== Components ==<br />
<br />
{| class="wikitable"<br />
! Component<br />
! Model<br />
|-<br />
| Touchscreen<br />
| Goodix GT917S<br />
|-<br />
| LCD<br />
| Himax HX8394 compatible<br />
|-<br />
| Rear camera<br />
| IMX258<br />
|-<br />
| Front camera<br />
| OV8858<br />
|-<br />
| Camera flash<br />
| AW3641EDNR<br />
|-<br />
| WiFi + Bluetooth<br />
| [https://www.azurewave.com/img/wireless-modules/AW_CM256SM_DS_Rev15_CYW.pdf AzureWave AW-CM256SM]<br />
|-<br />
| Modem<br />
| [http://static.abstore.pl/design/accounts/soyter/img/dokumentacje/quectel_eg25-g.pdf Quectel EG25-G]<br />
|-<br />
| GNSS/GPS<br />
| [http://static.abstore.pl/design/accounts/soyter/img/dokumentacje/quectel_eg25-g.pdf Quectel EG25-G]<br />
|-<br />
| 3 Axis Magnetometer<br />
| [https://www.st.com/en/mems-and-sensors/lis3mdl.html ST LIS3MDL]<br />
|-<br />
| Geo Magnetic Sensor<br />
| [http://www.voltafield.com/products01.html Voltafield AF8133J]<br />
|-<br />
| Ambient light / Proximity<br />
| STK3311-A<br />
|-<br />
| Accelerometer / Gyroscope<br />
| [https://invensense.tdk.com/products/motion-tracking/6-axis/mpu-6500/ TDK MPU-6500]<br />
|-<br />
| Vibration motor<br />
| <br />
|-<br />
| Notification LED<br />
| LED0603RGB<br />
|-<br />
| Audio Codec<br />
| ALC5616 and ALC5640<br />
|-<br />
| Volume buttons<br />
| Buttons connected to the KEYADC<br />
|-<br />
| Power button<br />
| <br />
|-<br />
| Battery fuel gauge<br />
| [https://rockchip.fr/RK818%20datasheet%20V1.0.pdf RK818]<br />
|}<br />
<br />
== Datasheets, schematics and certifications ==<br />
<br />
* PinePhone Pro mainboard schematic:<br />
** [https://files.pine64.org/doc/PinePhonePro/PinephonePro-Schematic-V1.0-20211127.pdf PinePhone Pro mainboard Explorer Edition Released Schematic ver 1.0 20211127]<br />
** [https://files.pine64.org/doc/PinePhonePro/PinephonePro_PCB_Component_Placement-V02_20211127-top.pdf PinePhone Pro mainboard Explorer Edition component top placement ver 1.0 20211127]<br />
** [https://files.pine64.org/doc/PinePhonePro/PinephonePro_PCB_Component_Placement-V02_20211127-bottom.pdf PinePhone Pro mainboard Explorer Edition component bottom placement ver 1.0 20211127]<br />
<br />
* PinePhone Pro USB-C small board schematic:<br />
** TBD<br />
<br />
* Certifications:<br />
** [https://files.pine64.org/doc/cert/PinePhone%20Pro%20FCC%20Certificate-S21101902805001.pdf PinePhone Pro FCC Certificate]<br />
** [https://files.pine64.org/doc/cert/PinePhonePro%20SAR%20Evaluation%20Report-S21101902806001.pdf PinePhone Pro SAR Evaluation Report]<br />
** [https://files.pine64.org/doc/cert/PinePhone%20Pro%20CE%20RED%20Certificate-S21101902802-R1.pdf PinePhone Pro CE RED Certificate]<br />
** [https://files.pine64.org/doc/cert/PinePhonePro%20RoHS%20Test%20Report.pdf PinePhone Pro ROHS Test Report]<br />
<br />
== Press ==<br />
<br />
For an overview about media of the PinePhone Pro you can use for the news, blogs, or similar see [[PinePhone Pro Press]].<br />
<br />
== External links ==<br />
* [https://www.pine64.org/pinephonepro/ Product Page]<br />
* [https://www.youtube.com/watch?v=wP2-6Z74W44 Announcement video]<br />
* [https://www.pine64.org/2021/10/15/october-update-introducing-the-pinephone-pro/ Blog post] with the announcement<br />
<br />
[[Category:PinePhone Pro]][[Category:Rockchip RK3399]]</div>Jwillikershttps://wiki.pine64.org/index.php?title=PinePhone_Pro&diff=12571PinePhone Pro2022-02-20T18:00:36Z<p>Jwillikers: Reference partition of mmcblk instead of nvme when referring to the SD card for clarity</p>
<hr />
<div>[[File:Pinephone_double.png|400px|thumb|right|Rendering of the PinePhone Pro]]<br />
<br />
The '''PinePhone Pro''' is PINE64's flagship smartphone announced on October 15, 2021. It features 4GB of RAM, an 128GB eMMC and is using an Rockchip RK3399S SoC, which is a specialized version of the RK3399 made specifically for the PinePhone Pro.<br />
<br />
== Introduction ==<br />
<br />
The PinePhone Pro is PINE64’s second smartphone and a successor to the original PinePhone. It does not, however, replace the original PinePhone. It should also not be considered a second generation PinePhone; it is a higher-end device, with much better specs, aimed at those who wish to daily-drive a open system stack. Achieving this goal will, however, take time as the software and overall smartphone software ecosystem needs to mature.<br />
<br />
More information about the PinePhone Pro can be found on the device [https://www.pine64.org/pinephonepro/ main page].<br />
<br />
=== State of the software ===<br />
<br />
Presently, at the time of writing (late 2021), the PinePhone Pro is aimed solely at early adopters and developers. It will take time for all the PinePhone Pro’s functionality to reach software parity with the original PinePhone and for mobile operating systems, in more general, to reach a higher degree of maturity.<br />
<br />
Bear in mind that the software for these smartphones is still in a very early stage, with most of the software being in alpha or beta state. That's especially also the case for scalability of applications, their availability and practicability, any hardware function implementations and the firmware. The software is provided as is. There is no warranty for the software, not even for merchantability or fitness for a particular purpose.<br />
<br />
If you have any questions regarding the current state of the software or of specific features working, please don't hesitate to ask in the community chat (see [[Main Page#Community and Support]])!<br />
<br />
=== Editions and revisions ===<br />
Similarly to the original PinePhone, various PinePhone Pro editions are planned, the first of which is the Developer Edition (aimed at developers, as the name entails) followed by the Explorer Edition, which is aimed at early adopters.<br />
<br />
* [[PinePhone Pro Developer Edition]]<br />
* [[PinePhone Pro Explorer Edition]]<br />
<br />
=== Help and support ===<br />
<br />
Still have any questions regarding software, shipping, or ordering after reading this Wiki? Please don't hesitate to contact the community in the bridged community channels for detailed answers or simply to chat with friendly people in the community! See [[Main Page#Community and Support]].<br />
<br />
Please keep in mind that PINE64 is not like a regular company (see [https://www.pine64.org/philosophy/ PINE64 philosophy]), and currently that support resources are sparse - the best way to get support quickly is to ask in the community chat! Please only contact PINE64 directly if questions couldn't be solved via the community chat or this wiki.<br />
<br />
== First time setup ==<br />
Before the PinePhone Pro is taken into operation, the following information have to be considered:<br />
<br />
* When shipped the battery is isolated from the mainboard contacts using a protective plastic tab, which is required to be removed before using the phone. The battery '''will not''' charge until it is removed and some of the device’s functionality may not function properly.<br />
* The PinePhone Pro's SIM slot only accepts a micro SIM, please '''do not insert an empty micro SIM adapter or a nano SIM''' without an adapter into the phone, as the adapter will get stuck on the contact pins and the loose nano SIM will short the device! The SIM card has to be placed in the lower slot, while the microSD has to be placed in the upper slot. An adapter from a nano to a micro SIM is included in the box.<br />
<br />
To remove the sticker after unboxing the phone:<br />
<br />
# Carefully remove the back panel using the notch in the corner of the back cover without overbending it<br />
# Remove the battery<br />
# Peel off the clear plastic sticker below it, which isolates the charging contacts<br />
# Reinsert the battery<br />
<br />
<gallery mode="nolines" widths="400px" heights="400px"><br />
Image:Pinephone_warning.png|A protection foil isolates the battery for the shipping.<br />
Image:Pinephone_backside.png|The microSD belongs in the upper slot, the micro SIM in the lower slot.<br />
</gallery><br />
<br />
== Software ==<br />
<br />
At the time of the release, in late 2021, the PinePhone Pro is in an early development stage. That said, the device has benefited greatly from work done on the original PinePhone, which means that even early development images feature all core functionality, such as: functional UI, sensors and even the modem (to a degree).<br />
<br />
The development is expected to proceed very quickly compared to progress done on the original PinePhone as much of the fundamental work can carry over to the new device.<br />
You can follow development efforts on [https://xnux.eu/log/ Megi's blog], the dedicated [[PinePhone Pro Development]] section as well as on individual project’s Wiki’s and repositories.<br />
<br />
=== Boot order ===<br />
On the PinePhone Pro the eMMC (the internal storage of the phone) has a higher boot priority than the microSD card (see [[RK3399 boot sequence#Boot sequence details|boot sequence details]] for details regarding the boot sequence). That behavior is in contrast to the original PinePhone with the Allwinner A64 SoC, where the microSD card has a higher boot priority.<br />
<br />
The '''Explorer Edition''' comes with a modified U-Boot pointing to the microSD card pre-installed to the eMMC. The microSD card can be (temporarily) booted instead of the pre-installed operating system, when the power key is shortly held at boot. To always boot from the microSD card it is recommended to wipe U-Boot from the eMMC. When the pre-installed bootloader was overwritten with a bootloader without such a configuration, the ''RE'' button underneath the back cover of the phone can also be used to temporarily bypass the eMMC. The button may however only be pressed shortly for a few seconds during boot, otherwise the eMMC won't be initialized in the operating system.<br />
<br />
The '''Developer Edition''', which was an earlier revision intended for development, was coming with an Android factory OS preinstalled. For details regarding how to remove the bootloader and the preinstalled OS of the eMMC for Developer Edition, please see the relevant wiki [[PinePhone Pro Developer Edition#Nuking the factory AOSP installation|article]]. The eMMC on the Developer Edition can be bypassed by shorting two specific contact points, please join the community chat for any questions regarding the process.<br />
<br />
=== Installation instructions ===<br />
<br />
{{Template:note|Due to the specific [[PinePhone Pro#Boot order|boot order]] it is currently '''strongly recommended''' to boot from the '''microSD card only'''. Please ask in the [[Main Page#Chat Platforms|community chat]] if you have any questions regarding the installation.}}<br />
<br />
As explained in the [[PinePhone Pro#Boot order|boot order]] section, the eMMC has a higher boot priority than the microSD card. On the '''Explorer Edition''' the default installation of U-Boot shipped by the factory points to the microSD card when holding the power key at boot. If the default installation was corrupted or overwritten by a differently configured bootloader, the eMMC may have to be bypassed to boot from microSD card and to alter the eMMC contents.<br />
<br />
{{hint|If the '''battery is fully drained''' U-Boot might fail to boot any installed operating system on the eMMC and microSD card due to a bug. <br />
<br />
If that's the case please start your phone in Maskrom mode and let it charge in that for a few hours. To do that:<br />
<br />
* Remove any microSD card from the phone and keep it removed for the below procedure<br />
* Remove the battery, any USB cable and any serial cable<br />
* Reinsert the battery<br />
* Hold the "RE" button underneath the back cover of your '''Explorer Edition''' (or shorting the bypass contact points on the '''Developer Edition''') <br />
* Connect the phone to an USB port of a computer, while still holding the button for some time<br />
* Check if the phone in Maskrom mode appears in the output of the Linux command <code>lsusb</code> on the computer<br />
* Let the phone charge for multiple hours<br />
<br />
Note: If the procedure doesn't work please try again with a different known '''good USB-C cable''' make sure that there is no microSD card in the phone.<br />
}}<br />
<br />
==== Flashing to microSD card ====<br />
To install an image to the microSD card:<br />
<br />
# Download your chosen image from [[PinePhone Pro Software Releases]]<br />
# Extract the compressed file<br />
# Write the image to your microSD card using your favorite method, examples:<br />
#* Using ''dd'': On the device you're flashing the microSD card from, find the correct device under <code>lsblk</code> and then flash the image to the microSD card using <code>sudo dd if=pine.img of=/dev/'''[DEVICE]''' bs=1M status=progress conv=fsync</code>. Make sure the target is the whole microSD card and not its first partition (''sdc1'' or ''mmcblk0p1'' are wrong!).<br />
#* Using ''bmaptool'': Make sure to select the correct device using <code>lsblk</code>. Then run bmaptool with the correct device: Download the ''.img.xz'' and the ''.img.bmap'' files, then run <code>bmaptool copy --bmap image.bmap image.xz /dev/'''[DEVICE]'''</code>. This takes around 2.5 minutes to flash a 4 GB file.<br />
#* Using ''a graphical tool'': A graphical tool such as Gnome Disks under Linux or Etcher under Windows may also be used.<br />
# Insert the microSD card into the top slot of the phone<br />
# Boot the phone. If there is an '''existing bootloader on the eMMC''' (the eMMC has a [[PinePhone Pro#Boot order|higher boot priority]]) you need to [[PinePhone Pro#Bypassing the eMMC|bypass the eMMC]] at boot and you can [[PinePhone Pro#Wipe U-Boot from the eMMC|wipe the bootloader from the eMMC]] to default boot from the microSD card by default in the freshly booted installation.<br />
<br />
==== Flashing to the eMMC ====<br />
<br />
{{warning|Installing to the eMMC is currently '''not recommended''' due to installations breaking commonly, as flashing to the eMMC will complicate the recovery process considerably.}}<br />
<br />
Flashing to the eMMC can be simply done by booting an operating system from the microSD and to flash the eMMC from there:<br />
<br />
# Boot an operating system from the microSD card. If there is already a bootloader on the eMMC installed see the section [[PinePhone Pro#Bypassing the eMMC|bypassing the eMMC]] to bypass it<br />
# Download or copy the new image to the microSD card<br />
# Check if the eMMC appears under <code>lsblk</code>. If it doesn't appear there you held the ''RE'' button in the eMMC bypass for too long (the eMMC didn't initialize then)<br />
# Extract the image<br />
# Flash the extracted image using <code>sudo dd if='''IMAGE.img''' of=/dev/mmcblk2 bs=1M status=progress conv=fsync</code><br />
# Reboot the phone<br />
<br />
==== Bypassing the eMMC ====<br />
<br />
The eMMC can always be temporarily bypassed at boot to be able to boot from a microSD card:<br />
<br />
On the '''Explorer Edition''' hold the ''RE'' button underneath the cover for a few seconds, while powering on the device (holding it too long will cause the eMMC to not get initialized after the boot).<br />
<br />
On the '''Developer Edition''' short the eMMC bypass contacts while booting.<br />
<br />
For details see the section [[PinePhone Pro#Boot order|boot order]].<br />
<br />
==== Wipe U-Boot from the eMMC ====<br />
To boot from microSD card permanently, one of the methods is to wipe the bootloader from the eMMC. If no bootloader is found on the eMMC, the phone will boot to the microSD card instead. To wipe U-Boot from the microSD card:<br />
<br />
* Boot a GNU/Linux operating system from the microSD card by holding power at boot (or using the above bypass method if the bootloader was altered or the Developer Edition is used)<br />
* Type <code>lsblk</code> in a terminal on the phone to list the devices<br />
* Wipe the bootloader using <code>sudo dd if=/dev/zero of=/dev/mmcblk2 seek=64 count=400 conv=fsync</code><br />
<br />
The phone should now default to the microSD card at boot.<br />
<br />
If there are any issues please join the bridged [[Main Page#Community and Support|community PinePhone channel]] and explain your issue and what you've tried so far.<br />
<br />
=== Software releases ===<br />
<br />
The [[PinePhone Pro Software Releases]] page has a complete list of currently supported phone-optimized operating system images that work with the PinePhone Pro.<br />
<br />
== Privacy switch configuration ==<br />
<br />
[[File:PinePhone Kill Interruptors de Maquinari del PinePhone 4529.jpg|320px|thumb|right|Detail of DIP switch]]<br />
<br />
The PinePhone features six switches that can be used to configure its hardware. They are numbered 1-6, with switch 1 located nearest to the modem. Their "on" position is toward the top of the phone.<br />
<br />
{| class="wikitable"<br />
|-<br />
! Number<br />
! Name<br />
! Description<br />
|-<br />
| 1<br />
| Modem<br />
| "On" enables 2G/3G/4G communication and GNSS hardware, "off" disables it.<br />
|-<br />
| 2<br />
| WiFi / Bluetooth<br />
| "On" enables WiFi and Bluetooth communication hardware, "off" disables it.<br />
|-<br />
| 3<br />
| Microphone<br />
| "On" enables audio input from on-board microphones (not 3.5 mm jack), "off" disables it.<br />
|-<br />
| 4<br />
| Rear camera<br />
| "On" enables the rear camera, "off" disables it.<br />
|-<br />
| 5<br />
| Front camera<br />
| "On" enables the front camera, "off" disables it.<br />
|-<br />
| 6<br />
| Headphone<br />
| "On" enables audio input and output via the 3.5 mm audio jack, "off" switches the jack to hardware UART¹ mode.<br />
|}<br />
<br />
¹ Note: The baud rate may be 1500000 instead of 115200.<br />
<br />
== Specifications ==<br />
<br />
* '''Dimensions:''' 160.8 x 76.6 x 11.1mm<br />
* '''Weight:''' Approx. 220g<br />
* '''SIM Card:''' Micro-SIM<br />
* '''Display:'''<br />
** '''Size:''' 6 inches (151mm) diagonal<br />
** '''Type:''' 1440 x 720 in-cell IPS with Gorilla Glass 4™<br />
** '''Resolution:''' 1440x720, 18:9 ratio<br />
* '''System on Chip:''' Rockchip RK3399S 64bit SoC – 2x A72 and 4x A53 CPU cores @ 1.5GHz<br />
* '''RAM:''' 4GB LPDDR4 @ 800MHz<br />
* '''Internal Storage:''' 128GB eMMC, extendable up to 2TB via microSD, supports SDHC and SDXC<br />
* '''Back [[#Camera|Camera]]:''' 13MP Sony IMX258 with Gorilla Glass 4™ protective layer, LED Flash<br />
* '''Front Camera:''' 8MP, OmniVision OV8858 front-facing camera<br />
* '''Sound:''' Loudspeaker, 3.5mm jack & mic (jack doubles as hardware UART if hardware switch 6 is deactivated)<br />
* '''Communication:'''<br />
** '''[[#Modem|Modem]]:''' [https://www.quectel.com/product/lte-eg25-g/ Quectel EG25-G]<br />
** '''LTE-FDD''': B1, B2, B3, B4, B5, B7, B8, B12, B13, B18, B19, B20, B25, B26, B28<br />
** '''LTE-TDD''': B38, B39, B40, B41<br />
** '''WCDMA''': B1, B2, B4, B5, B6, B8, B19<br />
** '''GSM''': B2, B3, B5, B8 (850, 900, 1800, 1900 MHz)<br />
** '''WLAN & Bluetooth:''' Wi-Fi 802.11AC, hotspot capable + Bluetooth V5.0<br />
** '''GNSS:''' GPS/GLONASS/BeiDou/Galileo/QZSS, with A-GPS<br />
* '''Sensors:''' Accelerometer, gyroscope, proximity, ambient light, compass<br />
* '''Privacy switches:''' Modem, WiFi & Bluetooth, Microphone, Cameras<br />
* '''[[#Battery|Battery]]:''' Lithium-ion, rated capacity 2800mAh (10.64Wh), typical capacity 3000mAh (11.40Wh) (nominally replaceable with any Samsung J7 form-factor battery)<br />
* '''I/O:''' USB Type-C, USB Host, DisplayPort Alternate Mode output, 15W 5V 3A Quick Charge, follows USB PD specification<br />
<br />
== Components ==<br />
<br />
{| class="wikitable"<br />
! Component<br />
! Model<br />
|-<br />
| Touchscreen<br />
| Goodix GT917S<br />
|-<br />
| LCD<br />
| Himax HX8394 compatible<br />
|-<br />
| Rear camera<br />
| IMX258<br />
|-<br />
| Front camera<br />
| OV8858<br />
|-<br />
| Camera flash<br />
| AW3641EDNR<br />
|-<br />
| WiFi + Bluetooth<br />
| [https://www.azurewave.com/img/wireless-modules/AW_CM256SM_DS_Rev15_CYW.pdf AzureWave AW-CM256SM]<br />
|-<br />
| Modem<br />
| [http://static.abstore.pl/design/accounts/soyter/img/dokumentacje/quectel_eg25-g.pdf Quectel EG25-G]<br />
|-<br />
| GNSS/GPS<br />
| [http://static.abstore.pl/design/accounts/soyter/img/dokumentacje/quectel_eg25-g.pdf Quectel EG25-G]<br />
|-<br />
| 3 Axis Magnetometer<br />
| [https://www.st.com/en/mems-and-sensors/lis3mdl.html ST LIS3MDL]<br />
|-<br />
| Geo Magnetic Sensor<br />
| [http://www.voltafield.com/products01.html Voltafield AF8133J]<br />
|-<br />
| Ambient light / Proximity<br />
| STK3311-A<br />
|-<br />
| Accelerometer / Gyroscope<br />
| [https://invensense.tdk.com/products/motion-tracking/6-axis/mpu-6500/ TDK MPU-6500]<br />
|-<br />
| Vibration motor<br />
| <br />
|-<br />
| Notification LED<br />
| LED0603RGB<br />
|-<br />
| Audio Codec<br />
| ALC5616 and ALC5640<br />
|-<br />
| Volume buttons<br />
| Buttons connected to the KEYADC<br />
|-<br />
| Power button<br />
| <br />
|-<br />
| Battery fuel gauge<br />
| [https://rockchip.fr/RK818%20datasheet%20V1.0.pdf RK818]<br />
|}<br />
<br />
== Datasheets, schematics and certifications ==<br />
<br />
* PinePhone Pro mainboard schematic:<br />
** [https://files.pine64.org/doc/PinePhonePro/PinephonePro-Schematic-V1.0-20211127.pdf PinePhone Pro mainboard Explorer Edition Released Schematic ver 1.0 20211127]<br />
** [https://files.pine64.org/doc/PinePhonePro/PinephonePro_PCB_Component_Placement-V02_20211127-top.pdf PinePhone Pro mainboard Explorer Edition component top placement ver 1.0 20211127]<br />
** [https://files.pine64.org/doc/PinePhonePro/PinephonePro_PCB_Component_Placement-V02_20211127-bottom.pdf PinePhone Pro mainboard Explorer Edition component bottom placement ver 1.0 20211127]<br />
<br />
* PinePhone Pro USB-C small board schematic:<br />
** TBD<br />
<br />
* Certifications:<br />
** [https://files.pine64.org/doc/cert/PinePhone%20Pro%20FCC%20Certificate-S21101902805001.pdf PinePhone Pro FCC Certificate]<br />
** [https://files.pine64.org/doc/cert/PinePhonePro%20SAR%20Evaluation%20Report-S21101902806001.pdf PinePhone Pro SAR Evaluation Report]<br />
** [https://files.pine64.org/doc/cert/PinePhone%20Pro%20CE%20RED%20Certificate-S21101902802-R1.pdf PinePhone Pro CE RED Certificate]<br />
** [https://files.pine64.org/doc/cert/PinePhonePro%20RoHS%20Test%20Report.pdf PinePhone Pro ROHS Test Report]<br />
<br />
== Press ==<br />
<br />
For an overview about media of the PinePhone Pro you can use for the news, blogs, or similar see [[PinePhone Pro Press]].<br />
<br />
== External links ==<br />
* [https://www.pine64.org/pinephonepro/ Product Page]<br />
* [https://www.youtube.com/watch?v=wP2-6Z74W44 Announcement video]<br />
* [https://www.pine64.org/2021/10/15/october-update-introducing-the-pinephone-pro/ Blog post] with the announcement<br />
<br />
[[Category:PinePhone Pro]][[Category:Rockchip RK3399]]</div>Jwillikershttps://wiki.pine64.org/index.php?title=Pinebook_Pro_SPI&diff=11547Pinebook Pro SPI2021-09-29T17:02:37Z<p>Jwillikers: Fix typo updating URL</p>
<hr />
<div>The Pinebook Pro comes equipped with two non-volatile storage components, the eMMC and the SPI. The capacity of the SPI is 128Mbit (16MiB) and it may be used in the boot process.<br />
<br />
Boot data can be written to the SPI via two methods: either from within PBP or from a second machine connected to the PBP by USB.<br />
<br />
= Writing to SPI from within PBP =<br />
<br />
[https://forum.pine64.org/member.php?action=profile&uid=15527 Forum user pcm720] showed an example of writing to the SPI from within PBP in [https://github.com/pcm720/u-boot-build-scripts/releases their self-published version of U-Boot] that offers boot functionality for NVMe drives. It involves use of <code>flash_erase</code> command (available in the mtd-utils package on Arch/Manjaro) and the <code>dd</code> command.<br />
<br />
= Writing to SPI from a second machine =<br />
<br />
Writing to the SPI from a second machine is more complicated than the other method, but it is the only option when troubleshooting an SPI flash gone wrong. This method works by bringing the PBP into <code>maskrom mode</code> and issuing commands on the second machine that download the flash image onto the PBP.<br />
<br />
Upon entering <code>maskrom mode</code>, the power LED on your PBP won't light up and neither will the display. Instead, your second machine, the one connected to your PBP via USB, will indicate <code>maskrom mode</code> by logging to <code>journalctl</code>.<br />
<br />
There are two ways to reach <code>maskrom mode</code>, but the first tends to be less reliable.<br />
<br />
== Maskrom mode (unreliable method) ==<br />
<br />
According to Rockchip documentation, these steps should work; unfortunately, many users have reported them to be unsuccessful. You may need to repeat these steps several times for them to work.<br />
<br />
# Press and hold recovery button.<br />
# Short press reset.<br />
# Release recovery button after about 3 seconds.<br />
<br />
Why this procedure is unreliable is not clear, but there are two suspicions:<br />
<br />
* The button is not working correctly or is just prone to failures.<br />
* The problem occurs only when the SPI was previously flashed.<br />
<br />
The button works by shorting two pins in the SPI device. But in some cases it just does nothing. Fortunately, the two pins can shorted by hand, as described in the next method.<br />
<br />
== Maskrom mode (reliable method) ==<br />
<br />
# Build and install <code>rkdeveloptool</code> (see [https://github.com/rockchip-linux/rkdeveloptool project repository] for instructions)<br />
# Verify successful installation. Running <code>rkdeveloptool --version</code> should output: <code>rkdeveloptool ver 1.3</code><br />
# Run <code>journalctl -f</code> and keep it running. Once maskrom mode is reached it will produce additional output.<br />
# Unscrew bottom cover.<br />
# Remove the metal shield surrounding main CPU. The shield is held in place by a tape and micro clamps on the board. The clamps can be released with a pry tool and some force. [https://forum.pine64.org/showthread.php?tid=11073&pid=75096#pid75096 This forum post with photos] shows how it can be done.<br />
# Disconnect all (!!!) boot devices (emmc, sdcard, usb).<br />
# Locate SPI flash (component number 29 on [https://wiki.pine64.org/images/4/45/PBPL_S.jpg this photo of the Pinebook Pro internals]).<br />
# Connect your PBP with USB-C - USB-A cable to second machine (PBP on USB-C side)<br />
# Short pins CLK and VSS (see chip diagram to the right for the names of pins). This can be done with a pair of tweezers when short on tools. [[File:Spi.png|right]]<br />
# Press the reset button (component number 28)<br />
# Check if there is new output from <code>journalctl</code> program.<br />
# Check if the PBP connected by running <code>rkdeveloptool ld</code>. If successful, the output should be like: <code>DevNo=1 Vid=0x2207,Pid=0x330c,LocationID=1401 Maskrom</code><br />
<br />
== After entering maskrom mode ==<br />
<br />
Now that the PBP is in <code>maskrom mode</code>, you can use <code>rkdeveloptool</code> to write data to the SPI. To do so you'll need the binary file you'll be writing to SPI, which will be referred to as <code>SPI_new.bin</code>, and a helper file named [https://dl.radxa.com/rockpi4/images/loader/spi/rk3399_loader_spinor_v1.15.114.bin rk3399_loader_spinor_v1.15.114.bin].<br />
<br />
# Flash the flash helper db file: <code>rkdeveloptool db rk3399_loader_spinor_v1.15.114.bin</code>. If successful, the output should read <code>Downloading bootloader succeeded</code>.<br />
# Flash the new SPI binary: <code>rkdeveloptool wl 0 SPI_new.bin</code>. If successful, the output should read: <code>Write LBA from file (100%)</code>.<br />
# Test the installation: <code>rkdeveloptool td</code>. If successful, output should read <code>Reset Device OK</code>.<br />
# Run <code>rkdeveloptool rd</code> to reboot your Pinebook Pro.<br />
<br />
== Zeroing out the SPI ==<br />
<br />
In case, you wrote something bad to your SPI, it's helpful to wipe away that data with zeros. To do that, you follow the same steps above to enter <code>maskrom mode</code> and then write an binary file that consists of all zeros.<br />
<br />
# Create the binary file <code>dd if=/dev/zero of=zero.bin bs=1M count=16</code><br />
# Flash the flash helper db file: <code>rkdeveloptool db rk3399_loader_spinor_v1.15.114.bin</code>. If successful, the output should read <code>Downloading bootloader succeeded</code>.<br />
# Flash the new SPI binary: <code>rkdeveloptool wl 0 zero.bin</code>. If successful, the output should read: <code>Write LBA from file (100%)</code>.<br />
# Test the installation: <code>rkdeveloptool td</code>. If successful, output should read <code>Reset Device OK</code>.<br />
# Run <code>rkdeveloptool rd</code> to reboot your Pinebook Pro.<br />
<br />
[[Category:PineBook Pro]]</div>Jwillikershttps://wiki.pine64.org/index.php?title=Pinebook_Pro_SPI&diff=11546Pinebook Pro SPI2021-09-29T16:59:46Z<p>Jwillikers: Update broken URL to rk3399_loader_spinor_v1.15.114.bin</p>
<hr />
<div>The Pinebook Pro comes equipped with two non-volatile storage components, the eMMC and the SPI. The capacity of the SPI is 128Mbit (16MiB) and it may be used in the boot process.<br />
<br />
Boot data can be written to the SPI via two methods: either from within PBP or from a second machine connected to the PBP by USB.<br />
<br />
= Writing to SPI from within PBP =<br />
<br />
[https://forum.pine64.org/member.php?action=profile&uid=15527 Forum user pcm720] showed an example of writing to the SPI from within PBP in [https://github.com/pcm720/u-boot-build-scripts/releases their self-published version of U-Boot] that offers boot functionality for NVMe drives. It involves use of <code>flash_erase</code> command (available in the mtd-utils package on Arch/Manjaro) and the <code>dd</code> command.<br />
<br />
= Writing to SPI from a second machine =<br />
<br />
Writing to the SPI from a second machine is more complicated than the other method, but it is the only option when troubleshooting an SPI flash gone wrong. This method works by bringing the PBP into <code>maskrom mode</code> and issuing commands on the second machine that download the flash image onto the PBP.<br />
<br />
Upon entering <code>maskrom mode</code>, the power LED on your PBP won't light up and neither will the display. Instead, your second machine, the one connected to your PBP via USB, will indicate <code>maskrom mode</code> by logging to <code>journalctl</code>.<br />
<br />
There are two ways to reach <code>maskrom mode</code>, but the first tends to be less reliable.<br />
<br />
== Maskrom mode (unreliable method) ==<br />
<br />
According to Rockchip documentation, these steps should work; unfortunately, many users have reported them to be unsuccessful. You may need to repeat these steps several times for them to work.<br />
<br />
# Press and hold recovery button.<br />
# Short press reset.<br />
# Release recovery button after about 3 seconds.<br />
<br />
Why this procedure is unreliable is not clear, but there are two suspicions:<br />
<br />
* The button is not working correctly or is just prone to failures.<br />
* The problem occurs only when the SPI was previously flashed.<br />
<br />
The button works by shorting two pins in the SPI device. But in some cases it just does nothing. Fortunately, the two pins can shorted by hand, as described in the next method.<br />
<br />
== Maskrom mode (reliable method) ==<br />
<br />
# Build and install <code>rkdeveloptool</code> (see [https://github.com/rockchip-linux/rkdeveloptool project repository] for instructions)<br />
# Verify successful installation. Running <code>rkdeveloptool --version</code> should output: <code>rkdeveloptool ver 1.3</code><br />
# Run <code>journalctl -f</code> and keep it running. Once maskrom mode is reached it will produce additional output.<br />
# Unscrew bottom cover.<br />
# Remove the metal shield surrounding main CPU. The shield is held in place by a tape and micro clamps on the board. The clamps can be released with a pry tool and some force. [https://forum.pine64.org/showthread.php?tid=11073&pid=75096#pid75096 This forum post with photos] shows how it can be done.<br />
# Disconnect all (!!!) boot devices (emmc, sdcard, usb).<br />
# Locate SPI flash (component number 29 on [https://wiki.pine64.org/images/4/45/PBPL_S.jpg this photo of the Pinebook Pro internals]).<br />
# Connect your PBP with USB-C - USB-A cable to second machine (PBP on USB-C side)<br />
# Short pins CLK and VSS (see chip diagram to the right for the names of pins). This can be done with a pair of tweezers when short on tools. [[File:Spi.png|right]]<br />
# Press the reset button (component number 28)<br />
# Check if there is new output from <code>journalctl</code> program.<br />
# Check if the PBP connected by running <code>rkdeveloptool ld</code>. If successful, the output should be like: <code>DevNo=1 Vid=0x2207,Pid=0x330c,LocationID=1401 Maskrom</code><br />
<br />
== After entering maskrom mode ==<br />
<br />
Now that the PBP is in <code>maskrom mode</code>, you can use <code>rkdeveloptool</code> to write data to the SPI. To do so you'll need the binary file you'll be writing to SPI, which will be referred to as <code>SPI_new.bin</code>, and a helper file named [https://dl.radxa.com/rockpi4/images/loader/spi/rk3399_loader_spinor_v1.15.114.bin].<br />
<br />
# Flash the flash helper db file: <code>rkdeveloptool db rk3399_loader_spinor_v1.15.114.bin</code>. If successful, the output should read <code>Downloading bootloader succeeded</code>.<br />
# Flash the new SPI binary: <code>rkdeveloptool wl 0 SPI_new.bin</code>. If successful, the output should read: <code>Write LBA from file (100%)</code>.<br />
# Test the installation: <code>rkdeveloptool td</code>. If successful, output should read <code>Reset Device OK</code>.<br />
# Run <code>rkdeveloptool rd</code> to reboot your Pinebook Pro.<br />
<br />
== Zeroing out the SPI ==<br />
<br />
In case, you wrote something bad to your SPI, it's helpful to wipe away that data with zeros. To do that, you follow the same steps above to enter <code>maskrom mode</code> and then write an binary file that consists of all zeros.<br />
<br />
# Create the binary file <code>dd if=/dev/zero of=zero.bin bs=1M count=16</code><br />
# Flash the flash helper db file: <code>rkdeveloptool db rk3399_loader_spinor_v1.15.114.bin</code>. If successful, the output should read <code>Downloading bootloader succeeded</code>.<br />
# Flash the new SPI binary: <code>rkdeveloptool wl 0 zero.bin</code>. If successful, the output should read: <code>Write LBA from file (100%)</code>.<br />
# Test the installation: <code>rkdeveloptool td</code>. If successful, output should read <code>Reset Device OK</code>.<br />
# Run <code>rkdeveloptool rd</code> to reboot your Pinebook Pro.<br />
<br />
[[Category:PineBook Pro]]</div>Jwillikers