[BH] Issues booting from eMMC with NON-BOOTABLE SD card inserted
#1
Hey all,
    I've scanned the forums and haven't seen this mentioned before, but apologies in advance if it has.
    I've flashed a distro to my eMMC flash and it's working great with one exception. Cold booting with a non-bootable (no OS installed) flash drive doesn't seem to work.
     In the past, booting from an SD card, I would insert the SD card, re-insert the battery and press+hold the power button for several seconds and I see the usual boot sequence starting; within a few seconds the status LED would cycle through it's colors and then I'd see a brief flash from the bootloader on commandline before my OS of choice's boot logo, etc...
     Now that I've installed to eMMC, when I power up with a non-bootable SD card inserted, none of the above occurs, not even the status LED cycle, which leads me to believe this is a hardware/firmware issue more than OS/software.
     From what I've read in the wiki, the firmware is set to scan the SD card before attempting to boot from onboard memory.  I've checked the drives I'm using and they are not flagged as bootable in gparted, so I'm wondering if the firmware isn't checking for a boot flag, but just the mere presence of an SD card?

     This isn't a terribly urgent issue for me, but I was wondering if others have experienced this as well. Perhaps it's only on the Braveheart edition? If so, does anyone know when PCB 1.2 will be available in the Pinephone store?
     Thanks in advance!
#2
I think it's looking for u-boot somewhere in the first MB or so of the card. If you had an OS on there and just deleted everything from the partitions u-boot might still be on there. You have to overwrite everything with zeroes, i think 8k from the start to the start of the first partition.
Something along the lines of
Code:
dd if=/dev/zero of=/dev/mmcblk0 bs=8k seek=1 count=64
will probably be enough.
#3
It should be enough to clear the first sector 8k in - as it is just looking for a special short header.
#4
(05-14-2020, 03:29 PM)Boern Wrote: I think it's looking for u-boot somewhere in the first MB or so of the card. If you had an OS on there and just deleted everything from the partitions u-boot might still be on there. You have to overwrite everything with zeroes, i think 8k from the start to the start of the first partition.
Something along the lines of
Code:
dd if=/dev/zero of=/dev/mmcblk0 bs=8k seek=1 count=64
will probably be enough.
I had used this drive as an OS drive prior, however it never occurred to me the boot sector might still be populated.  Thanks for the reminder that unflagged is not overwritten!

Unfortunately, even after using dd it still would not boot with the SD card inserted.  I even went so far as to set the count to 128, thus overwritting the entire 1st MB of the drive, to no avail.

After digging around in a few drawers I found an SD card I was sure had not ever been set to boot (I've been testing allot of distro/revs on the pinephone...) and it booted up perfectly!

So, thanks for the help!

I've checked the drive in question on serveral OS's (linux and windows) using different partition managers and I'm not seeing anything that would cause it to appear as a bootable device.  Is there anyone else that is booting off of internal storage that would be willing to test if a formerly-bootable SD card causes the same issues I'm seeing?
#5
I regularly flash new OSs to my SD card, while keeping my main on the EMMC. That's why I was pretty sure overwriting the boot sectors was enough. I usually keep all partitions and just zero out the boot sector.

Can you try zeroing out the entire SD card?
#6
(05-14-2020, 07:08 PM)Segfault Wrote:
(05-14-2020, 03:29 PM)Boern Wrote: I think it's looking for u-boot somewhere in the first MB or so of the card. If you had an OS on there and just deleted everything from the partitions u-boot might still be on there. You have to overwrite everything with zeroes, i think 8k from the start to the start of the first partition.
Something along the lines of
Code:
dd if=/dev/zero of=/dev/mmcblk0 bs=8k seek=1 count=64
will probably be enough.
I had used this drive as an OS drive prior, however it never occurred to me the boot sector might still be populated.  Thanks for the reminder that unflagged is not overwritten!

Unfortunately, even after using dd it still would not boot with the SD card inserted.  I even went so far as to set the count to 128, thus overwritting the entire 1st MB of the drive, to no avail.

After digging around in a few drawers I found an SD card I was sure had not ever been set to boot (I've been testing allot of distro/revs on the pinephone...) and it booted up perfectly!

So, thanks for the help!

I've checked the drive in question on serveral OS's (linux and windows) using different partition managers and I'm not seeing anything that would cause it to appear as a bootable device.  Is there anyone else that is booting off of internal storage that would be willing to test if a formerly-bootable SD card causes the same issues I'm seeing?

The boot stub is located outside partitions.
On the SD card, the partition sector is located at sector 0.
This partition sector locates the first partition at, for example, sector 128 (can be another value).
In the gap between sector 0 and sector 128, there is a boot stub. Removing partitions has no effect on the boot stub.
You have to erase the first sectors of the SD card to remove the boot stub.
#7
Got my phone today. Setting changes and reboots . After few hours switched  on , screen is dead, lcd backlight in on, led lights flashes, tried other os by flashing SD same result. Not sure whats going on.
#8
(06-24-2020, 04:07 PM)pokemanearth Wrote: Got my phone today. Setting changes and reboots . After few hours switched  on , screen is dead, lcd backlight in on, led lights flashes, tried other os by flashing SD same result. Not sure whats going on.

Moved your post - it didn't belong in the shipping thread.
You can find me on IRC, Discord and Twitter




Possibly Related Threads…
Thread Author Replies Views Last Post
  PinePhone Pro not booting (Cap error!, pctl timeout) jealda 2 1,202 11-16-2023, 05:03 AM
Last Post: DrYak
  eMMC upgrade EuvzO8 5 1,430 11-08-2023, 11:58 PM
Last Post: brken
  PinePhone Beta Edition will not boot from MicroSD card Timothy_Ecc 27 23,313 01-29-2023, 12:20 PM
Last Post: skandigraun
  RAM corruption, possible eMMC corruption alnyan 3 1,622 08-24-2022, 03:07 AM
Last Post: JeremyWadsworth
  Emmc yvan 1 1,314 07-07-2022, 08:16 AM
Last Post: Chief
  Issues with HDMI-out from convergence dock folgaran 1 1,135 06-16-2022, 04:35 PM
Last Post: alaraajavamma
  Pinephone won't boot from SD card arkadione 3 3,296 05-25-2022, 03:26 PM
Last Post: sfb
  Any experiences with hardware mod to improve eMMC speeds? kqlnut 9 5,711 04-19-2022, 02:36 PM
Last Post: kk22
  Largest supported micro SD card? zooidic 2 1,924 01-08-2022, 06:01 AM
Last Post: zooidic
  Red LED when trying to boot from SD card. Need advice. サーバント 5 4,070 10-20-2021, 09:40 AM
Last Post: biketool

Forum Jump:


Users browsing this thread: 1 Guest(s)