Jump to content
  • 0

OrangePI PC+ not booting from eMMC after an update


gerotmf
 Share

Question

Hi,

 

Is there a way to fix emmc booting problem from uboot itself, i've updated armbian and now orangepi pc+ doesn't boot, i've connected uart and i see that it reads /boot/boot.scr from mmc 1, but then tries to load stuff from mmc 0, so i guess my boot.scr got overwritten by default one .. or something.

 

boot shows this

 

=> boot
switch to partitions #0, OK
mmc1(part 0) is current device
Scanning mmc 1:1...
Found U-Boot script /boot/boot.scr
3565 bytes read in 6 ms (580.1 KiB/s)
## Executing script at 43100000
U-boot loaded from eMMC or secondary SD
Boot script loaded from mmc
MMC: no card present
** Bad device mmc 0 **
MMC: no card present
 

...

 

and then BOOTP load 

 

If it's possible to fix from uart console, it would be nice, but i guess i'll have to go search for some sd card or usb key to boot :(

 

 

 

 

 

Link to comment
Share on other sites

Recommended Posts

  • 0

Dear friends, my system has come back to life. As I explained before, I had an armbian 5.14 Debian Jessy Desktop, and after a september 2018 update, when I rebooted the sistem, it didn't boot again. Before trying anything, I booted from a µSD and made an image of my system ( dd if=/dev/mmblck1  bs=10M  of=/mnt/pendrive/image.img ). Then I tried the solutions proposed here, but didn't work for my system. I tried copying /boot files from 5.14 distribution and from new distributions.. I tried with the files that I found on the installation without being updated and also with the updated versions, but any combination worked for me.

 

I don't have much idea about these issues.. but I have a friend ;) and he's a master.

 

My friend's first plan was related with downgrading the u-boot to an older version, but it didn't work, so I won't spent time on it.

 

The second plan worked! The result is not a clean installation.. but it boots.. and lets me access all my services. My server is working.. I'll install a new server on other machine with a clean installation.

 

The idea was :

1) Boot wit a µSD card with a new installation of 5.14 Armbian Jessy Desktop on my OrangePiPlus2

2) Move the installation to the emmc

nand-sata-install

3) Boot from emmc

4) Mark as 'hold' the packages related with the boot process (to perform an apt-get update && apt-get upgrade without affecting to these packages, because it's upgrade makes my system fail - we tried and we confirm it)

apt-mark hold linux-u-boot-orangepiplus-default
apt-mark hold uboot-tols
apt-mark hold linux-image-sun8i

5) Now yes, we can update the system

apt-get update && apt-get upgrade

6) The system is now updated (not the packages marked as hold) and boots properly

 

7) Boot from the µSD in order to have complete acces to the emmc files

 

8) Mount the image we made at the beginning, with the old system (with all our info, but with the /boot damaged)

losetup -o 1048576 /dev/loop0 /mnt/pendrive/image.img
mnt /dev/loop0 /img/

8) And now, with rsync, we copy all the files from our old system to the new one, which is upgraded  (emmc is mounted on /media)

rsync -avpAHX --numeric-ids /img/bin/*  /media/bin

Important: don't use the -delete modifier.. we need to keep the 3.4.112 files from the new installation (the old installation was upgraded and these files were deleted!)

Repeat this rsync command with all these directories:

   bin  -   etc  -   home  -   lib  -   opt  -   root  -   sbin  -   selinux  -   srv  -   usr   -   var   -   mnt  -   media

(in other words: all but     dev  -   proc  -   run  -   sys  -   tmp)

 

9) Unmount everything (you'll need to execute first

losetup -d /dev/loop0

10) My friend edited the file etc/fstab file on the emmc, and he changed the mmblck1 on the first line for mmblck0     (I'm not sure it's necessary.. but he changed)

 

 

-- Added later BEGIN --

 

11) It's important to repeat the hold operations in order to protect the packages we don't want to be updated (the packages database has been replaced with the rsync copy)

apt-mark hold linux-u-boot-orangepiplus-default
apt-mark hold uboot-tols
apt-mark hold linux-image-sun8i

-- Added later END --

 

 

And ... it worked !

 

I was really worried.. it was a pitty to loose my server..  My current installation is not clean at all.. but it works, and it allows me to run all the services to be able to do a manual migration process to a new installation.

 

I appreciate so much all the support you gave me on this thread.. Thanks !

 

Jordi, from Barcelona

Link to comment
Share on other sites

Armbian is a community driven open source project. Do you like to contribute your code?

  • 0
55 minutes ago, Tonydee said:

I do not understand why putting an update without testing it first.

 

There was a lot of testings but they sadly didn't discover this problem.  You can improve this by joining and help testing + improve protocols + developing the project in general https://www.armbian.com/get-involved or by sponsoring https://www.armbian.com/donate and we will hire professionals (few hundred hours/release) to conduct profound testings. Nothing comes out of thin air.

Link to comment
Share on other sites

  • 0

Well i've finally found time to fiddle with emmc storage. Upgrade did corrupt boot script, so what i did is basically just copied everything from my usb flash to /dev/mmcblk1p1 including /boot  .. then fixed /boot/armbianEnv.txt so that root points to correct uuid and also /etc/fstab so that root fs can be mounted rw.. I also removed usbstoragequirks=0x2537:0x1066:u,0x2537:0x1068:u line from armbianEnv.txt (not sure what that does, but it was not on sd card and i guess emmc isn't usb so .. ). 

 

so basically, boot up with sd card or usb flash (i had running system on flash drive)

 

do 

blkid

..
/dev/mmcblk1p1: UUID="c93833b4-8c9a-46b2-ad43-46d286ba9a10" TYPE="ext4" PARTUUID="e0788fc1-01"
..

 

to get UUID of mmcblk1p1

 

mkdir /tmp/mmc

mount /dev/mmcblk1p1 /tmp/mmc

 

rsync -avx / /tmp/mmc

 

vi /tmp/mmc/boot/armbianEnv.txt

change root UUID to the one of /dev/mmcblk1p1 from blkid command

save changes

 

vi /tmp/mmc/etc/fstab

change first line, use same UUID as above

save changes

 

umount /mnt/tmp

 

poweroff

 

then remove usb flash (for me) i guess sd card for you, and press reset button ..

 

I can confirm that 5.59 works on orangepi pc plus from emmc.

 

 

Link to comment
Share on other sites

  • 0

Dear All,

 

Does anybody have the IMAGE like one listed above: Armbian_5.30_Orangepipcplus_Debian_jessie_default_3.4.113 and could share it with me anyhow? 

I have got exactly the same issue like described by  gerotm and had the very same (very old) version installed,   but i do not have the genuine image to burn it to the SD card... I have searched over the Armbian website but it seems that such old archives are not available anymore.

Normally i would not mind installing new version, but all three currently available for Orange Pi Plus result in immediate crash when I set up hostapd AP on wlan0 (integrated wifi). My OrangePi Plus serves as MPD/Shairport player and router/access point and now i cannot use it as I fail to fix the MMC boot (i tried copying the /boot from SD installed Xenial Legacy Kernel 3.4 image and changing the boot device UUID but with no success) and on the other hand I fail to configure any of new versions as wifi immediately crashes (and I mean crashes, the system reboots almost immediately)...

 

So please... help, if anyone has the old image of Jessie for Orange Pi Plus, please share.  It would be much appreciated. Thanks in advance :)

Edited by lukaszbzyk
added crash description
Link to comment
Share on other sites

  • 0
8 hours ago, lukaszbzyk said:

So please... help, if anyone has the old image of Jessie for Orange Pi Plus, please share.  It would be much appreciated. Thanks in advance


Scrapped from tapes :) https://dl.armbian.com/orangepipcplus/archive/Armbian_5.30_Orangepipcplus_Debian_jessie_default_3.4.113.7z

Link to comment
Share on other sites

  • 0

Igor, Sir... Thank you very much... You can call me an irritating idiot but I copied & pasted like a dumb and i did Armbian_5.30_Orangepipcplus_Debian_jessie_default_3.4.113 whereas i mean Armbian_5.30_Orangepiplus_Debian_jessie_default_3.4.113... for Orange Pi Plus, not Orange Pi PC Plus...  And i even wrote a word "exactly"... What a shame...

Would it be too much to ask you to take a look on tapes once again? I am very sorry...  Thanks a lot in advance... 

Link to comment
Share on other sites

  • 0

Thank You very much! I have managed to re-install it and use successfully. I have not managed to fix the mmc boot error but at least i could mount it and copy all the config files and data, and the hostapd does not crash on this old image. Thanks a lot again!

Link to comment
Share on other sites

  • 0

Same issue I got today when upgrade to Armbian 5.60

As recommend I've loaded from SD card (same content as eMMC) copied /boot folder from SD to eMMC, changed rootdev UUID in armbianEnv.txt. It doesn't help.

Do I need to recompile boot.scr or something like this?

Link to comment
Share on other sites

  • 0

Hello!

 

error in build-master\config\bootscripts\boot-sunxi.cmd

missing string=setenv devnum "0"

 

Info take from this

http://4pda.ru/forum/index.php?showtopic=668774&view=findpost&p=78434168

 

good file is this (see down)

 

Igor!

Please make good boot-sunxi.cmd and recompile core for orange pi pc plus and pust core to repository jessy!

 

******************

# DO NOT EDIT THIS FILE
#
# Please edit /boot/armbianEnv.txt to set supported parameters
#

setenv load_addr "0x44000000"
setenv overlay_error "false"
# default values
setenv verbosity "1"
setenv console "both"
setenv disp_mem_reserves "off"
setenv disp_mode "1920x1080p60"
setenv rootfstype "ext4"
setenv docker_optimizations "on"
setenv devnum "0"
setenv rootdev "/dev/mmcblk${devnum}p1"

# Print boot source
itest.b *0x28 == 0x00 && echo "U-boot loaded from SD"
itest.b *0x28 == 0x02 && echo "U-boot loaded from eMMC or secondary SD"
itest.b *0x28 == 0x03 && echo "U-boot loaded from SPI"

# get PARTUUID of first partition on SD/eMMC it was loaded from
if test "${devtype}" = "mmc"; then
  part uuid mmc ${devnum}:1 partuuid;
  setenv devnum ${mmc_bootdev}
  setenv rootdev "/dev/mmcblk${mmc_bootdev}p1"
fi

echo "Boot script loaded from ${devtype}"

if test -e ${devtype} ${devnum} ${prefix}armbianEnv.txt; then
load ${devtype} ${devnum} ${load_addr} ${prefix}armbianEnv.txt
env import -t ${load_addr} ${filesize}
fi

if test "${logo}" = "disabled"; then setenv logo "logo.nologo"; fi

if test "${console}" = "display" || test "${console}" = "both"; then setenv consoleargs "console=tty1"; fi
if test "${console}" = "serial" || test "${console}" = "both"; then setenv consoleargs "${consoleargs} console=ttyS0,115200"; fi

setenv bootargs "root=${rootdev} rootwait rootfstype=${rootfstype} ${consoleargs} hdmi.audio=EDID:0 disp.screen0_output_mode=${disp_mode} panic=10 consoleblank=0 loglevel=${verbosity} ubootpart=${partuuid} ubootsource=${devtype} ${extraargs} ${extraboardargs}"

if test "${disp_mem_reserves}" = "off"; then setenv bootargs "${bootargs} sunxi_ve_mem_reserve=0 sunxi_g2d_mem_reserve=0 sunxi_fb_mem_reserve=16"; fi
if test "${docker_optimizations}" = "on"; then setenv bootargs "${bootargs} cgroup_enable=memory swapaccount=1"; fi

load ${devtype} ${devnum} ${ramdisk_addr_r} ${prefix}uInitrd
load ${devtype} ${devnum} ${kernel_addr_r} ${prefix}zImage

if test -e ${devtype} ${devnum} "${prefix}.next"; then
echo "Found mainline kernel configuration"
load ${devtype} ${devnum} ${fdt_addr_r} ${prefix}dtb/${fdtfile}
fdt addr ${fdt_addr_r}
fdt resize 65536
for overlay_file in ${overlays}; do
if load ${devtype} ${devnum} ${load_addr} ${prefix}dtb/overlay/${overlay_prefix}-${overlay_file}.dtbo; then
echo "Applying kernel provided DT overlay ${overlay_prefix}-${overlay_file}.dtbo"
fdt apply ${load_addr} || setenv overlay_error "true"
fi
done
for overlay_file in ${user_overlays}; do
if load ${devtype} ${devnum} ${load_addr} ${prefix}overlay-user/${overlay_file}.dtbo; then
echo "Applying user provided DT overlay ${overlay_file}.dtbo"
fdt apply ${load_addr} || setenv overlay_error "true"
fi
done
if test "${overlay_error}" = "true"; then
echo "Error applying DT overlays, restoring original DT"
load ${devtype} ${devnum} ${fdt_addr_r} ${prefix}dtb/${fdtfile}
else
if load ${devtype} ${devnum} ${load_addr} ${prefix}dtb/overlay/${overlay_prefix}-fixup.scr; then
echo "Applying kernel provided DT fixup script (${overlay_prefix}-fixup.scr)"
source ${load_addr}
fi
if test -e ${devtype} ${devnum} ${prefix}fixup.scr; then
load ${devtype} ${devnum} ${load_addr} ${prefix}fixup.scr
echo "Applying user provided fixup script (fixup.scr)"
source ${load_addr}
fi
fi
bootz ${kernel_addr_r} ${ramdisk_addr_r} ${fdt_addr_r}
else
echo "Found legacy kernel configuration"
load ${devtype} ${devnum} ${fdt_addr_r} ${prefix}script.bin
bootz ${kernel_addr_r} ${ramdisk_addr_r}
fi

# Recompile with:
# mkimage -C none -A arm -T script -d /boot/boot.cmd /boot/boot.scr

***************

Edited by pentagon
Link to comment
Share on other sites

  • 0
1 hour ago, pentagon said:

Please make good boot-sunxi.cmd and recompile core for orange pi pc plus and pust core to repository jessy!


Implemented on the build level, but for updating the repository ... we don't update boot scripts via packages updating, at least not out of the box. This part has to be done manually atm by replacing the boot script.


Thanks!

Link to comment
Share on other sites

  • 0
46 minutes ago, Igor said:


Implemented on the build level, but for updating the repository ... we don't update boot scripts via packages updating, at least not out of the box. This part has to be done manually atm by replacing the boot script.


Thanks!

 

Can any one here put the pre compiled .scr file for OPi+2E ? Thanks in advance...

Link to comment
Share on other sites

  • 0
On 9/22/2018 at 8:26 PM, Igor said:

make and boot from SD card, mount eMMC and copy /boot/boot.* to your eMMC /boot section.

I can't mount the eMMC :

root@orangepiplus:~# lsblk -o model,name,type,fstype,size,label
MODEL NAME         TYPE FSTYPE  SIZE LABEL
      mmcblk1boot0 disk           4M 
      mmcblk1boot1 disk           4M 
      mmcblk0      disk          60G 
      └─mmcblk0p1  part ext4     60G <- @ SDCard
      mmcblk1      disk         7.3G 
      └─mmcblk1p1  part ext4    7.2G <- eMM

#mount /dev/mmcblk1p1 /mnt/mountpoint

[34182.366277] EXT4-fs (mmcblk1p1): couldn't mount RDWR because of unsupported optional features (400)

 

Is there a reason for that?

Link to comment
Share on other sites

  • 0
2 hours ago, y52 said:

#mount /dev/mmcblk1p1 /mnt/mountpoint

[34182.366277] EXT4-fs (mmcblk1p1): couldn't mount RDWR because of unsupported optional features (400)

 

Is there a reason for that?


None caused by Armbian / never seen such thing. If you can't make a filesystem on eMMC, it can simply be dead.

Link to comment
Share on other sites

  • 0

It seems linux-u-boot-${BOARD}-next for H3 still doesn't work. I am using nanopi neo air. The logs of the default branch and the next branch are:

 

1. linux-u-boot-nanopiair-next (U-Boot 2019.04-armbian) can not boot from emmc. 

U-Boot 2019.04-armbian (May 04 2019 - 09:12:53 +0200) Allwinner Technology

CPU:   Allwinner H3 (SUN8I 1680)
Model: FriendlyARM NanoPi NEO Air
DRAM:  512 MiB
MMC:   mmc@1c0f000: 0, mmc@1c10000: 1
Loading Environment from EXT4... MMC: no card present
In:    serial
Out:   serial
Err:   serial
Net:   No ethernet found.
MMC: no card present
MMC: no card present
starting USB...
No controllers found
Autoboot in 1 seconds, press <Space> to stop
Card did not respond to voltage select!
MMC: no card present
starting USB...
No controllers found
USB is stopped. Please issue 'usb start' first.
starting USB...
No controllers found
No ethernet found.
missing environment variable: pxeuuid
missing environment variable: bootfile
Retrieving file: pxelinux.cfg/00000000
No ethernet found.
missing environment variable: bootfile
Retrieving file: pxelinux.cfg/0000000
No ethernet found.
missing environment variable: bootfile
Retrieving file: pxelinux.cfg/000000
No ethernet found.
missing environment variable: bootfile
Retrieving file: pxelinux.cfg/00000
No ethernet found.
missing environment variable: bootfile
Retrieving file: pxelinux.cfg/0000
No ethernet found.
missing environment variable: bootfile
Retrieving file: pxelinux.cfg/000
No ethernet found.
missing environment variable: bootfile
Retrieving file: pxelinux.cfg/00
No ethernet found.
missing environment variable: bootfile
Retrieving file: pxelinux.cfg/0
No ethernet found.
missing environment variable: bootfile
Retrieving file: pxelinux.cfg/default-arm-sunxi
No ethernet found.
missing environment variable: bootfile
Retrieving file: pxelinux.cfg/default-arm
No ethernet found.
missing environment variable: bootfile
Retrieving file: pxelinux.cfg/default
No ethernet found.
Config file not found
starting USB...
No controllers found
No ethernet found.
No ethernet found.
=> <INTERRUPT>
=>

 

2.  linux-u-boot-nanopiair-default (U-Boot 2018.05-armbian) does work.

 

U-Boot 2018.05-armbian (Sep 19 2018 - 12:03:31 +0200) Allwinner Technology

CPU:   Allwinner H3 (SUN8I 1680)
Model: FriendlyARM NanoPi NEO Air
DRAM:  512 MiB
MMC:   SUNXI SD/MMC: 0, SUNXI SD/MMC: 1
Loading Environment from EXT4... MMC: no card present
** Bad device mmc 0 **
Failed (-5)
In:    serial
Out:   serial
Err:   serial
Net:   No ethernet found.
MMC: no card present
** Bad device mmc 0 **
MMC: no card present
** Bad device mmc 0 **
starting USB...
No controllers found
Autoboot in 1 seconds, press <Space> to stop
switch to partitions #0, OK
mmc1(part 0) is current device
Scanning mmc 1:1...
Found U-Boot script /boot/boot.scr
3708 bytes read in 8 ms (452.1 KiB/s)
## Executing script at 43100000
U-boot loaded from eMMC or secondary SD
Boot script loaded from mmc
289 bytes read in 4 ms (70.3 KiB/s)
MMC: no card present
** Bad device mmc 0 **
8141541 bytes read in 634 ms (12.2 MiB/s)
7322968 bytes read in 574 ms (12.2 MiB/s)
Found mainline kernel configuration
 
Link to comment
Share on other sites

Guest
This topic is now closed to further replies.
 Share

×
×
  • Create New...