2 2
wikrie

Armbian EMMC Image for NanoPi-K2

Recommended Posts

6 hours ago, TonyMac32 said:

dd if=$1/u-boot.bin bs=512 skip=1 of=$2 bs=512 skip=1 seek=1 conv=fsync > /dev/null 2>&1

Comparing that to original write_uboot_platform() doesn't show some relevant change since only "bs=512 skip=1" is repeated twice ... ;)

We don't have "u-boot.bin.sd.bin" installed in /usr/lib/linux-u-boot-dev-nanopik2-s905_5.89_arm64/, there is only "u-boot.bin" and "u-boot.img", but I will look again in the build tree itself.

 

I've also search in https://wiki.odroid.com/odroid-c2/software/building_u-boot , and they say for eMMC "sudo dd if=u-boot.bin of=/dev/mmcblk0 bs=512 seek=97", followed by "You must use the u-boot.bin binary under the folder, “u-boot/sd_fuse/u-boot.bin” . This is confusing me since Armbian build process is different ...

Share this post


Link to post
Share on other sites

In our sources file you will see we call out the .bin.sd.bin, and refer to it as u-boot.bin.

The extra skip lines up the data being written without having to find away to package the other binary

Sent from my Pixel using Tapatalk

Share this post


Link to post
Share on other sites
26 minutes ago, TonyMac32 said:

The extra skip lines up the data being written without having to find away to package the other binary

To my knowledge, providing multiple "skip" arguments will only override each others and only the last one will be taken into account ...

Share this post


Link to post
Share on other sites
27 minutes ago, martinayotte said:

To my knowledge, providing multiple "skip" arguments will only override each others and only the last one will be taken into account ...

ugh, skip vs seek, it was almost 3:00 when I typed that out. 

 

so this is the u-boot generated u-boot.bin vs the file we copy into u-boot.bin (u-boot.bin.sd.bin): 

tony@builder:~/build/cache/sources/u-boot/v2019.04$ hexdump -n1024 u-boot.bin
0000000 e5be f4ff 89b0 9291 3a8b bef4 66af 0a2e
0000010 4140 4c4d bff0 0000 0040 0001 0000 0000
0000020 0000 0000 0040 0000 0200 0000 0060 0000
0000030 0000 0000 0240 0000 0db0 0000 bf90 0000
0000040 0000 0000 0ff0 0000 b000 0000 0000 0000
0000050 6710 54f3 c008 31b0 44b9 9e1d 333c 2706
0000060 0787 6ef1 95cf 805a a72b f510 b357 c6a4
0000070 0000 0000 0000 0000 0000 0000 0000 0000
*
0000400
tony@builder:~/build/cache/sources/u-boot/v2019.04$ hexdump -n1024 u-boot.bin.sd.bin
0000000 0226 31da 9bca 83e5 53cd 4877 5c11 0548
0000010 d10d 9f97 d15d 1b93 f980 8a49 aadb 014a
0000020 24ac 7632 17bf 8cfa 716a 7cd5 1dce db81
0000030 18ee 4b7a 0de9 6967 b006 e1f4 3e5a 07e2
0000040 1462 227d 772c 96ae 83e9 b712 94a0 8f92
0000050 0cac 96da 4119 1fff f3f2 4c00 e231 9453
0000060 d1f6 22b6 6448 31b9 cbe8 88e8 7a5f 0c17
0000070 f286 9fa2 a133 25be be95 c672 c5a0 975a
0000080 1096 dfb9 7275 5d10 f93e 9de5 fd73 faa9
0000090 4bef 2299 58ed 8248 ba16 b748 a37f 164e
00000a0 07b3 28f5 057a b885 6bfe 7255 ff68 576c
00000b0 054a 3779 c15d 74b9 027b fb2b 79a5 5811
00000c0 0680 fa81 060b 0ab2 0871 d97c e807 5130
00000d0 aaed 4b89 426b e7bf ea44 e9e2 f363 e342
00000e0 c3f9 04de 90c9 3b0e 8a98 9f14 4572 60f1
00000f0 7aef 5aab 6abc 0141 2354 b7ea 2c16 0f9a
0000100 78ef b914 2209 a1f4 08ad 1f41 324d 3c7f
0000110 2aac 6897 d894 e869 54fc 129f 3a80 7022
0000120 36b2 bb29 1d58 055d 9e25 7325 a4d0 7caf
0000130 46cf 63e4 4e1f 1b4c eba2 222d 4f25 d892
0000140 bb85 de93 f0d8 fee3 088e 5e71 20ad 7cda
0000150 bf67 86df 2b0d afa1 ce17 3cd1 641e a314
0000160 a81f f881 6598 27f6 676d 1a85 6087 ee96
0000170 761f 2c74 15a1 b8db ace4 02f5 0910 30a5
0000180 27b1 4a28 1e8c f971 f685 0c14 aa56 75fb
0000190 6f20 c2a1 7c85 697a 6f29 396b 1079 2a69
00001a0 9137 c374 e5af 34bd d1dc 3241 3c7b 9ca8
00001b0 49ab 305e d8c6 ef99 0448 c128 9215 4ceb
00001c0 6023 d310 cd45 2107 489e 1954 fc84 30b5
00001d0 1345 0b60 faec 34fa 23fe 13f5 e0b5 d860
00001e0 7040 86ab b33d dba7 fbfb 80f4 aaf7 3db0
00001f0 10bd a948 430a 09dd d266 1b1c 7cb3 f3f3
0000200 e5be f4ff 89b0 9291 3a8b bef4 66af 0a2e
0000210 4140 4c4d bff0 0000 0040 0001 0000 0000
0000220 0000 0000 0040 0000 0200 0000 0060 0000
0000230 0000 0000 0240 0000 0db0 0000 bf90 0000
0000240 0000 0000 0ff0 0000 b000 0000 0000 0000
0000250 6710 54f3 c008 31b0 44b9 9e1d 333c 2706
0000260 0787 6ef1 95cf 805a a72b f510 b357 c6a4
0000270 0000 0000 0000 0000 0000 0000 0000 0000
*
0000400

So if the result is only different as far as removing the first command with the 442, we need to know what was in the first sector of the eMMC to restore it somehow.

 

I guess it's time to dump the first couple sectors of an SD vs an eMMC image from FE

 

Share this post


Link to post
Share on other sites

ok, so the friendlyElec eMMC image has the data written write onto sector 0:

 

image.png.c45540906f1f32537813a081b477b0aa.png

 

while SD image:

image.png.3a07ad0d2b4b5f99c8c15b0c6829bfb2.png

 

So try

 

dd if=$1/u-boot.bin of=$2 bs=512 skip=1 conv=fsync

 

$2 obviously being the eMMC, we're just not skipping 512 on the eMMC, so no seek=1, and only 1 dd command, forget about the one with teh 442 in it.

 

Share this post


Link to post
Share on other sites
13 minutes ago, TonyMac32 said:

ok, so the friendlyElec eMMC image has the data written write onto sector 0:

This sector 0 dump is coming from which image ?

Maybe it should be written on the eMMC first ?

 

13 minutes ago, TonyMac32 said:

dd if=$1/u-boot.bin of=$2 bs=512 skip=1 conv=fsync

This didn't work either ...

 

Maybe also @balbes150 has some clues ?

 

Share this post


Link to post
Share on other sites
13 minutes ago, martinayotte said:

This sector 0 dump is coming from which image ?

Maybe it should be written on the eMMC first ?

 

http://wiki.friendlyarm.com/wiki/index.php/NanoPi_K2#Make_an_Installation_TF_Card.2FeMMC_Module

 

It's been too long since I messed with the boot sectors on Amlogic, I remember one of these (S905 or S905X) was way pickier than the other, I actually just booted the u-boot.bin on the SD when it shouldn't have worked at first...  I'm guessing that's the S905 given the snapshot above (empty first sector), but what makes the eMMC happy I'm uncertain.

 

[edit] @Neil Armstrong wasn't there some documentation on that linux-meson wiki?  I can't find a damned thing about the Amlogic boot process anymore.

Share this post


Link to post
Share on other sites

@martinayotte

 

https://github.com/u-boot/u-boot/blob/bdf97b5d393fc94666a847e9bac1c358b2c63c59/board/amlogic/p200/README.nanopi-k2#L99

 

for NanoPi K2

 

vs

 

https://github.com/u-boot/u-boot/blob/bdf97b5d393fc94666a847e9bac1c358b2c63c59/board/amlogic/p212/README.libretech-cc#L101

 

for S905X

 

 

The C2 is not a valid comparison because of special firmware.  See the process for it:

 

https://github.com/u-boot/u-boot/blob/bdf97b5d393fc94666a847e9bac1c358b2c63c59/board/amlogic/p200/README.odroid-c2#L63

 

These are all just SD though, so I'm not sure since I can't find whatever I used before as documentation

Share this post


Link to post
Share on other sites

Hi Everybody,

 

I try to follow your conversation but I cannot see where to help or to test anything, seams to be a bigger problem with the boot from EMMC.

So I'm not sure if it helps in any case but I extract the working boot parition from the existing NANOPIK2 image and if anybody like ot could be downloaded from:

https://my.pcloud.com/publink/show?code=XZKKTa7ZnglxwkfmdHHoR35AbYpwW0QYTQBk

And I also attached it to that post.

If I could test anything please let me know.

 

br wikrie

 

 

boot-emmc-k2.zip

Share this post


Link to post
Share on other sites

Hi Folks,

 

seams that there is no Solution for this issue, so the cost for the emmc was a little waste of money.

If anybody has any idea please let us know, we will test / try all.

 

bet regards

wikrie

Share this post


Link to post
Share on other sites
57 minutes ago, wikrie said:

seams that there is no Solution for this issue, so the cost for the emmc was a little waste of money.

We didn't found a solution to boot from eMMC without SD, but you can still use eMMC as ROOTFS if you leave the SD inserted for the U-Boot itself.

We didn't throw the towel yet, maybe a solution will be found in the future.

Share this post


Link to post
Share on other sites

Hi Folks,

 

 

I try to run the following issue , boot from SD and use EMMC for rootfs.

But I cannot get it to boot, is there any tutorial how to handle it?

 

br

wikrie

 

Share this post


Link to post
Share on other sites
10 minutes ago, wikrie said:

But I cannot get it to boot, is there any tutorial how to handle it?

There is not such tutorial, but only knowledge from people familiar ... :P

 

If you've already ran nand-sata-install, do a "blkid" to figure out the UUID of the eMMC.

Then you can edit the /boot/armbianEnv.txt of the SDCard and change the "rootfs=UUID=<some_partition_uuid>" with the good eMMC partition UUID, so that the change will be permanent and reboot.

Share this post


Link to post
Share on other sites

Thanks @ martinayotte

 

I will try it and give you a feedback !!

 

And it works !!!! Booting from SD and working from EMMC, that is half the way I want!

But at the end much more than nothing!!!!

1mil Thnaks @martinayotte

 

wikrie@nanopik2:~$ mount | grep mmc
/dev/mmcblk0p1 on / type ext4 (rw,noatime,nodiratime,errors=remount-ro,commit=600)
/dev/mmcblk1p1 on /media/mmcboot type ext4 (rw,noatime,nodiratime,errors=remount-ro,commit=600,x-gvfs-hide)
/dev/mmcblk1p1 on /boot type ext4 (rw,noatime,nodiratime,errors=remount-ro,commit=600)
wikrie@nanopik2:~$ sudo blkid
/dev/mmcblk0p1: UUID="8c928f56-9de2-4e7b-91ab-2144bb0e42d3" TYPE="ext4" PARTUUID="567b6072-01"
/dev/mmcblk1p1: UUID="bbeb1faa-8bba-463c-a3e2-3722d68654af" TYPE="ext4" PARTUUID="567b6072-01"

 

br wikrie

Share this post


Link to post
Share on other sites
9 hours ago, TonyMac32 said:

I am still confused by this, for GXL nand-sata-install works just fine (just ran it on Le Potato)

What do you mean @TonyMac32 ? Do you mean your LePatato is able to start U-Boot directly from eMMC (without any SD) ?

For me, it still doesn't on NanoPi-K2, but I didn't invest much time recently to figure that out, I was in vacation ...

Share this post


Link to post
Share on other sites

Yes, both Le Potato and the new CSC for Khadas' VIM (both Meson-GXL) can boot directly from eMMC without any special effort out of the box. I don't have an eMMC for K2 or C2, but will review the u-boot image building process and see if anything is amiss and the boards are simply "dealing" with the issue on SD.

Sent from my Pixel using Tapatalk

Share this post


Link to post
Share on other sites

now I'm confused, the last statement I got was, EMMC BOOT on a NANOPI-K2 is impossible.

Is this information outdated?

is there a  chance to boot from EMMC directly?

br wikrie

Share this post


Link to post
Share on other sites

so we are at the same point as before, boot from SD and rootfs from EMMC is working, boot and work from EMMC isn't.

Did I understand this correctly?

 

 

Share this post


Link to post
Share on other sites

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...
2 2