Jump to content

Install to EMMC


lonix

Recommended Posts

Armbian & Khadas are rewarding contributors

I ran the nand-sata-install from git, presuming it was the latest, on an Orange Pi+.  It doesn't quite work, no lights nor anything after removing the SD card and rebooting.  I can, however, boot from SD and use the EMMC partition for the rootfs.  This required rebuilding boot.scr from boot.cmd, changing the root= argument.  What do I have to do to fix the EMMC so it doesn't need the SD card for initial image?  I'm guessing I just failed to update the .fex boot sector before running the script.

Link to comment
Share on other sites

If you download just a script it can't work. Not possible, since you also need a proper boot loader which script takes from system. 

 

You need a freshly self build image - at least installed / updated boot loader .deb with enabled eMMC support.

Link to comment
Share on other sites

I did an apt-get upgrade and now i'm on 5.1. Did nand-sata-install, all to emmc. But after that system boots from sd (mmcblk0p1 is mounted as /, fstab isnt changed), if i try without sd there is nothing, no boot, no led.

Maybe i need to install u-boot manually to emmc? How did i manage that?

Link to comment
Share on other sites

OK, the script runs fine, except the uboot file was missing, I compiled it from source easily enough.

 

this is orangePi Plus version download here

 

https://mega.nz/#!nEhzARbL!b4GCocqV_DlikufwdB_ajrSFwIjF1QS5BA57K0MCbm4

 

flash with 

 

sudo dd if=u-boot-sunxi-with-spl.bin of=/dev/mmcblk1 bs=1024 seek=8

 

immediately after running

 

$ sudo nand-sata-install

 

Thanks so much Igor, love your work.

Link to comment
Share on other sites

OK, the script runs fine, except the uboot file was missing, I compiled it from source easily enough.

 

this is orangePi Plus version download here

 

https://mega.nz/#!nEhzARbL!b4GCocqV_DlikufwdB_ajrSFwIjF1QS5BA57K0MCbm4

 

flash with 

 

sudo dd if=u-boot-sunxi-with-spl.bin of=/dev/mmcblk1 bs=1024 seek=8

 

immediately after running

 

$ sudo nand-sata-install

 

Thanks so much Igor, love your work

I installed uboot from repository and flashed it to mmcblk1, will test later. I installed linux-u-boot-orangepiplus-default, is that the correct version, patched for use with emmc?

Link to comment
Share on other sites

Ok, next issue...

 

When booting from eMMC the sdcard reader is not usable for some reason.

 

The reason is simple. If you insert a card when the board boots the H3 will always search for a bootloader there. If you insert the card later it won't be recognized (which might be able to be fixed by playing around with /proc/driver/sunxi-mmc.x/insert).

 

So to boot with inserted SD card the bootloader has to remain there and point to the rootfs on the eMMC (the numbering of devices will then also change!). This can be done by using our nand-sata-install.sh script and then not wiping out the SD card but keep the 1st MB intact and only adjust the partition table so that the SD card can be used for data.

Link to comment
Share on other sites

Hi,

I am a newbie with u-boot, Armbian and Orange Pi. This is my first post in this forum. I want to thank everyone involved in the development of Armbian!

 

I am running Armbian on a Orange pi plus 2 from SD card. That works fine, but I would like to install the OS on the internal 16GB eMMC memory. 

I tried to perform the instructions that were posted on http://forum.armbian.com/index.php/topic/1070-install-to-emmc/?p=8433:
 
- Update Armbian (using apt-get update / upgrade). 
- Download the U-boot file provided by lonix for the orangePi Plus version from https://mega.nz/#!nEhzARbL!b4GCocqV_DlikufwdB_ajrSFwIjF1QS5BA57K0MCbm4 
- Flash the u-boot file:
root@orangepiplus2:# sudo dd if=u-boot-sunxi-with-spl.bin of=/dev/mmcblk1 bs=1024 seek=8
- Immediately after I performed:
root@orangepiplus2:# sudo nand-sata-install
nand.png
 
- After the nand-sata-install I performed a reboot.

But I am pretty sure that I did not carry out the instructions in the correct way, because I am still running the OS from the 8GB SD card :-(
root@orangepiplus2:# mount | grep mmc
/dev/mmcblk0p1 on / type ext4 (rw,noatime,nodiratime,errors=remount-ro,commit=600)     <= 8GB SD card
root@orangepiplus2:# fdisk /dev/mmcblk0


Welcome to fdisk (util-linux 2.25.2).
Changes will remain in memory only, until you decide to write them.
Be careful before using the write command.

Command (m for help): p
Disk /dev/mmcblk0: 7.4 GiB, 7948206080 bytes, 15523840 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: dos
Disk identifier: 0x00007b95

Device         Boot Start      End  Sectors  Size Id Type
/dev/mmcblk0p1       4096 15523839 15519744  7.4G 83 Linux

Do I run the correct OS version?

root@orangepiplus2:# uname -a
Linux orangepiplus2 3.4.112-sun8i #30 SMP PREEMPT Sat Apr 30 19:49:10 CEST 2016 armv7l GNU/Linux

Do I use the correct U-boot  package version?

root@orangepiplus2:# apt-cache show linux-u-boot-orangepiplus-default
Package: linux-u-boot-orangepiplus-default
Priority: optional
Section: kernel
Installed-Size: 1
Maintainer: Igor Pecovnik <igor.pecovnik@****l.com>
Architecture: armhf
Version: 5.10
Filename: pool/main/l/linux-u-boot-orangepiplus-default/linux-u-boot-orangepiplus_5.10_armhf.deb
Size: 148442
MD5sum: bf318d539042f35719b424905f84e684
SHA1: 25170bda821a25c622de78d21639431b8363f6d7
SHA256: de598174315ab52a7d45047fbaf7fdf1a2f6eab41dbd5530be9f4c0721005e50
SHA512: 5cd0c275384ac26b8888a180fbf41c60ea9f3ead559f2e840e8bc1db59b8a68037083d70a26545259cb2328d73710161f1d55e9fa7117af5b619b6c55c16e955
Description: Uboot loader 3.4.112
Description-md5: d63394bdd198156c5cbd3a84467017ea

Is my assumption correct: Can I use the U-boot file that was build from source by lonix for the orangePi Plus for my orange Pi Plus 2? Or should I build my own version from source? How?

 
Is my partition layout correct?
root@orangepiplus2:# ls -l /dev/mmc*
brw-rw---- 1 root disk 179,  0 May  6 17:50 /dev/mmcblk0         (8GB SD card)
brw-rw---- 1 root disk 179,  1 May  6 17:50 /dev/mmcblk0p1
brw-rw---- 1 root disk 179, 16 May  6 20:34 /dev/mmcblk1         (16GB eMMC internal memory)
brw-rw---- 1 root disk 179, 32 May  6 17:50 /dev/mmcblk1boot0
brw-rw---- 1 root disk 179, 48 May  6 18:22 /dev/mmcblk1boot1
brw-rw---- 1 root disk 179, 17 May  6 20:34 /dev/mmcblk1p1

My /boot/boot.cmd is still pointing to my 8GB SD card instead of my 16GB eMMC internal memory:

root@orangepiplus2:/boot# cat boot.cmd | grep setenv
setenv bootargs "console=tty1 root=/dev/mmcblk0p1 rootwait rootfstype=ext4 cgroup_enable=memory swapaccount=1 sunxi_ve_mem_reserve=0 sunxi_g2d_mem_reserve=0 sunxi_no_mali_mem_reserve sunxi_fb_mem_reserve=16 panic=10 consoleblank=0 enforcing=0 loglevel=${verbosity}"

Where did I went wrong? I hope someone can help me out.

Link to comment
Share on other sites

When your SD is inserted, you can't boot from eMMC. The rest looks ok ... if you did an update and upgrade, you don't need to download any 3rd party boot loader. I don't know if it's ok but let's assume it is.

Link to comment
Share on other sites

My aim is to have the Armbian system on the eMMC-storage and boot from it and use the SD-Card as a big data storage, to have it all in the case (no external HDD, no USB-drive). The partition on the card should be formatted with NTFS or EXT4.

So I installed the Armbian 5.10 just via the nand-sata-install script on eMMC of my Orange Pi Plus, but didn't used the U-boot file provided by lonix .

 

So, am i right in saying, that with a inserted and completely NTFS-formatted SD-Card (and the system on eMMC) the Orange Pi Plus, doesn't boot or reboot because it needs the bootloader on it? An this is because of the hardware and can't be handled by pressing the U-boot button (SW 3) or something else?

 

And can someone explain, what's the difference between just installing it with the nand-sata-install scrip and using the U-boot file provided by lonix before using the script?

Link to comment
Share on other sites

my problem is that I'm working with Armbian but in my internal EMMC 16 Gb I have debian jessie.

With the SD card inserted I sould start with Armbian , but not always .Sometime the system start on debian and not Armbian .....strange to understand :(

I think the SD is K.O ...

Link to comment
Share on other sites

With the SD card inserted I sould start with Armbian , but not always .Sometime the system start on debian and not Armbian .....strange to understand :(

 

The boot priority on all currently known H3 boards is always: SD card first then eMMC. That means that H3 checks for the presence of an SD card and then for the presence of a bootloader there. If for example your card shows random read errors on the first blocks then exactly that might happen what you experienced: Sometimes boot from SD card (bootloader found/loaded), sometimes from eMMC. Only way to know what's going on: Attach a serial console and watch for the output. And check your SD card as outlined in out user documentation.

 

With the eMMC equipped boards another funny thing might happen. Start the board without SD card and insert SD card after a few seconds. Now the bootloader might be read from eMMC but starts then the real OS on the SD card with sometimes weird results (kernel command line taken from the wrong OS installation leading to all sort of strange symptoms). I discovered the latter a few days ago since I tried to debug weird symptoms a user was telling just to realize that weird things might happen when you insert the SD card within 10 seconds after boot.

Link to comment
Share on other sites

the same issue with the new SD card. I'm doing some experiments with hostapd and interfaces to be independent the AP 

Maybe some mistake and when I reboot start debian and not armbian 

Also other big trouble , after insall the igorpecvnik go.sh ....if I start wicd the system crashes 

Link to comment
Share on other sites

Yesterday I installed armbian on my emmc of my Banana pi m2+. After this I found this thread, that there are limits when I would use the emmc for the system an the sd card for data. Now I can use the emmc without problems. But I don´t know what I have to do to use the sd card? I don´t understand how I could use the linked Information to https://github.com/igorpecovnik/lib/blob/master/config/fex/orangepiplus.fex#L693-L696 ??

Could someone explain me detailed what I should do?

 

I don´t know if it matters: at this time my sd card is formated with ext4.

Link to comment
Share on other sites

 

Does Armbian have something like this?

install_to_emmc

 

Armbian has even a user documentation ;) https://github.com/igorpecovnik/lib/blob/master/documentation/user-faq.md#how-to-install-to-emmc-nand-sata--usb(no worries, I added eMMC info just yesterday and it seems documentation is not updated at the usual documentation link)

 

There's one caveat though! In case you use any Armbian release prior to 5.13 (BPi M2+) or 5.14 (OPi PC Pius, Plus 2E) then transferring the OS image to eMMC might work but booting not (missing capabilities in the boot loader).

 

In general all Armbian pre-releases for H3 boards are not expected to be sane upgradeable in every fashion since we started with one 'single OS image for all H3 boards' approach that we had to give up on later and now older installations think they would be orangepih3 while we now differentiate between each and every model (that means the wrong 'board support package' and u-boot package might be upgraded)

 

In other words, please do an apt-get update/upgrade, try the nand_sata_install script, shutdown, remove SD card, reboot and get back to us :)

Link to comment
Share on other sites

Can i do boot from emmc on orange pi pc plus using Armbian_5.14_Orangepih3_Debian_jessie_3.4.112 ?

 

What are you referring to? The last unified Armbian image for all H3 boards was Armbian_5.10_Orangepih3_Debian_jessie_3.4.112 (please check http://mirror.igorpecovnik.com if in doubt). In case you used this image and upgraded it to 5.14 recently then most probably it won't work as I already tried to explain to @xwalter (but in his case there's a chance he will be able to upgrade and successfully boot from eMMC later -- I will later explain why).

 

@tkaiser

I will wait when Armbain will have this function well , no problem 

 

Armbian has this function since a long time! But regarding H3 boards there exists the following problem: All the Armbian pre-releases (please keep in mind that this applies even to 5.14 --> "Prebuild" http://www.armbian.com/orange-pi-pc-plus/) were built in a way that we had only 2 H3 'boards': orangepih3 (boards with 10/100Mbits/sec Ethernet) and orangepiplus (Gbit Ethernet). We tried to rely on auto detection to do further differentiation between all the different boards on 1st boot but that didn't work out (for reasons see here please).

 

Therefore we removed all this auto detection stuff in the meantime (in many many small steps trying to break as less as possible) and end up now with the following 8 more board definitions:

  • bananapim2plus
  • beelinkx2
  • nanopim1
  • orangepi2
  • orangepilite
  • orangepione
  • orangepipc
  • orangepipcplus (used also for OPi+ 2)
  • orangepiplus
  • orangepiplus2e

This means while users of Orange Pi Plus (and Plus 2) are able to upgrade their pre-release OS images (NOT recommended) any users of Fast Ethernet equipped Oranges can't due to orangepipcplus being a different board than the 'unified' orangepih3 before.

 

Both of you please post the output of the following from your installations

dpkg -l | egrep "armbian| linux-"

I will explain afterwards what exactly will happen when upgrading our pre-releases in both cases.

Link to comment
Share on other sites

 

Both of you please post the output of the following from your installations


I will explain afterwards what exactly will happen when upgrading our pre-releases in both cases.

 

 

Sorry.

I use Armbian_5.14_Orangepipc_Debian_jessie_3.4.112.

 

$ dpkg -l | egrep "armbian| linux-"
ii  armbian-hostapd                 5.14                      armhf        Patched hostapd
ii  armbian-tools                   5.14                      armhf        Armbian tools, sunxi, temper
ii  linux-firmware-image-sun8i      5.14                      armhf        Linux kernel firmware, version 3.4.112-sun8i
ii  linux-headers-sun8i             5.14                      armhf        Linux kernel headers for 3.4.112-sun8i on armhf
ii  linux-image-sun8i               5.14                      armhf        Linux kernel, version 3.4.112-sun8i
ii  linux-jessie-root-orangepipc    5.14                      armhf        Root file system tweaks for orangepipc
ii  linux-libc-dev:armhf            3.16.7-ckt25-2            armhf        Linux support headers for userspace development
ii  linux-u-boot-orangepipc-default 5.14                      armhf        Uboot loader 2016.05
Link to comment
Share on other sites

This thread is quite old. Please consider starting a new thread rather than reviving this one.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...

Important Information

Terms of Use - Privacy Policy - Guidelines