After messing with eMMC partitions, PBP won't boot, even from SD card
#1
I tried to install Debian on my Pinebook Pro, because I don't really like Manjaro. I made the bootable SD with the Pinebook Pro build of Debian, booted into debian, and tried to write the debian disk image to the eMMC with gnome-disk-utility. I cleared all of the partitions before doing this, including the boot-manjaro partition. Perhaps that was my mistake, as now I can't boot at all, even with the SD card.

Is there any way to fix this?

Thanks!
#2
You would've needed to have removed all partitions, so you did that correctly. The older Debian build and Manjaro are quite different, and use different variations of the bootloader. That could've cause problems if you didn't.

When attempting to boot into the SD card what is the PBPs behavior?

If your problems are persistent you can boot from SD by removing the back panel, using the switch to disable the eMMC, boot from the SD, and if you'd like to use the SD to reformat your eMMC you have about 1 minute to flip the switch and re enable the eMMC when booting from your SD. I believe there may be some commands that could rebind if your OS is already booted, but I cannot recall them, and they haven't been added to the wiki yet.
#3
Messing with the partition layout is a bit dangerous, because the start of the eMMC/SD card is layed out in a specific way. 

The RK3399 SoC will read it's idbloader.img from byte 32768 (from the start of the device, sector 0x40). 
After that is the u-boot at the magic offset byte 8388608 (sector 0x4000). 
That's the reason why partitions are starting rather far into the device on the stock images, to make space for the bootloader and SPL.

You can find more information about the boot process in this wiki article from Rockchip:
http://opensource.rock-chips.com/wiki_Boot_option

In short: Don't touch the first ~16-32 MiB of the device and you'll be fine. 
Otherwise, you'll need to dd the bootloader and idbloader back onto the partition after your actions: 
Code:
dd if=idbloader.img of=/dev/sdb seek=64
dd if=u-boot.itb of=/dev/sdb seek=16384
(as root, these files are probably in /boot)

Tobias
#4
Thanks, disabling the eMMC let me boot from SD. Now I'm running into another issue: the OS can't seem to detect the eMMC at all now, even when I re-enabled the switch. I experimented with enabling the eMMC during different times: during boot, before login, after login, and it still won't be listed.
Code:
rock@Debian-Desktop:~$ lsblk
NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT
mmcblk0 179:0 0 59.5G 0 disk
|-mmcblk0p1 179:1 0 64M 0 part /boot
`-mmcblk0p2 179:2 0 59.4G 0 part /

It is only listing one disk, which is the SD card I booted from.

Is there any way to fix this, or will I need to wait until I get the eMMC USB adapter to flash an OS that way?

Thank you
#5
You need to enable the eMMC sooner during boot. I would advise, once I see the LEDs turn on during boot, immediately flip that switch back to enabled.
#6
@imij,
If you have re-enabled the eMMC via the physical switch, (while still booted from  SD card), you can force the OS to recognize the eMMC again using;

Code:
echo fe330000.sdhci >/sys/bus/platform/drivers/sdhci-arasan/unbind
echo fe330000.sdhci >/sys/bus/platform/drivers/sdhci-arasan/bind

This is necessary if you missed the short window where it's booting the SD card, but the SD card OS has not come up completely. It's literally a few seconds, so pretty hard. Easier with the 2 commands above.

I use the following for my partition table so I KNOW where the 3 parts of the boot loader exist. Note that for some reason, "/boot" needs to be partition 1, so the partitions are out of order. But, hey it works for me.

Code:
Device            Start      End  Sectors  Size Type
/dev/mmcblk1p1    32768  1056767  1024000  500M Linux filesystem
/dev/mmcblk1p2       64    16383    16320    8M Linux reserved
/dev/mmcblk1p3    16384    24575     8192    4M Linux reserved
/dev/mmcblk1p4    24576    32767     8192    4M Linux reserved
/dev/mmcblk1p5  1056768 13639679 12582912    6G Linux swap
/dev/mmcblk1p6 13639680 61497310 47857631 22.8G Linux filesystem
--
Arwen Evenstar
Princess of Rivendale
#7
(06-03-2020, 10:33 PM)Arwen Wrote:
Code:
echo fe330000.sdhci >/sys/bus/platform/drivers/sdhci-arasan/unbind
echo fe330000.sdhci >/sys/bus/platform/drivers/sdhci-arasan/bind

Ah, yes! These are the lines to rebind the eMMC I couldn't remember/find. @Arwen, do you know if these commands should work in any distro? They would be a great addition to the eMMC section of the wiki.
#8
(06-04-2020, 06:21 AM)tophneal Wrote:
(06-03-2020, 10:33 PM)Arwen Wrote:
Code:
echo fe330000.sdhci >/sys/bus/platform/drivers/sdhci-arasan/unbind
echo fe330000.sdhci >/sys/bus/platform/drivers/sdhci-arasan/bind

Ah, yes! These are the lines to rebind the eMMC I couldn't remember/find. @Arwen, do you know if these commands should work in any distro? They would be a great addition to the eMMC section of the wiki.

Yes, they should work for any Linux distro, since it's in the kernel. It's already in the Wiki, though perhaps not where people are looking;

Wiki - Pinebook Pro - Bootable Storage
--
Arwen Evenstar
Princess of Rivendale
#9
Thanks for pointing that out and giving a link! I'd much rather refer people to that than quickly flipping the switch on when booting.
#10
I got it working, thanks so much for your help!


Possibly Related Threads…
Thread Author Replies Views Last Post
  Pinebook pro won't boot after bootloader installation jwensouls 4 941 08-21-2024, 04:17 AM
Last Post: KC9UDX
  Help installing Manjaro on eMMC of Pinebook Pro pine4546464 4 3,221 12-13-2023, 07:22 PM
Last Post: trillobite
  Need Help Recovering Manjaro /boot Contents on Pinebook Pro calinb 6 3,511 12-11-2023, 03:47 AM
Last Post: calinb
  Manjaro 20.04 not loading from SD (with Manjaro on eMMC) zaius 1 881 12-07-2023, 03:11 PM
Last Post: wdt
  Boot Order in Pinebook Pro food 8 2,698 11-23-2023, 07:37 AM
Last Post: KC9UDX
  [Manjaro] u-boot won't boot from eMMC with (unbootable) SD card present zackw 1 2,492 08-21-2023, 09:08 PM
Last Post: vanessadonald
  2TB SD Card Write Errors jiacovelli 3 1,633 06-02-2023, 06:13 PM
Last Post: KC9UDX
  Emergency Mode Boot Hotkey? jiacovelli 20 7,492 06-02-2023, 01:32 PM
Last Post: wdt
  Blank screen after Armbian 20.04 install to emmc? psychoacoustic 3 4,351 04-01-2023, 03:22 PM
Last Post: TRS-80
  Fix for Armbian not booting on PBP from eMMC agreenbhm 7 5,287 04-01-2023, 02:58 PM
Last Post: TRS-80

Forum Jump:


Users browsing this thread: 1 Guest(s)