Hello

I have some questions, 1st one: Have anybody discover what are the points to short in order to enter MASKROM mode? I have enter it booting the M4 without sdcard or emmc, just to test that I can connect to the M4 via rkflashkit through the USB-C bus... and it does. So, I would need to to the same but with the emmc connected to the M4 and short the EMMC_CLK to GND (I guess). Have anybody discovered these points in the M4 PCB and willing to show them at hi-res image? :-)

This would help a lot, since I could backup directly the rootfs partitions with rkflashkit, mount it in my linux box, modify it and flash it back to the emmc again with rkflashkit. Very straight forward!

But, If these MASKROM points are too complicated for trying even with 2 needles (connected with wire) then I will explain further my problem. Since maybe there is another solution to my problem.

Some time ago I have flashed to the M4 the image rk3399-eflasher-friendlydesktop-bionic-4.4-arm64-20181219 to my emmc (16GB) and well... M4 is still with Ubuntu Core OS

I have 1 external HD connected to the nanopi M4 and added to /etc/fstab (by UUID) for automount on boot (sadly I didn't add the param nofail). HD now died. Boot process gets stuck. No matter how much I wait, I get permanent blank screen, no sshd, nor any other way to interact with the OS (tried pushing every key in the keyboard with any change).

Ok, 1st thing I backed emmc to an image (dd)

Then I started to try to access the rootfs partition, in order to modify the /etc/fstab ... without success!

The emmc should have this structure:

Code: Select all

FIRMWARE_VER: 6.0.1
MACHINE_MODEL: RK3399
MACHINE_ID: 007
MANUFACTURER: RK3399
MAGIC: 0x5041524B
ATAG: 0x00200800
MACHINE: 3399
CHECK_MASK: 0x80
PWR_HLD: 0,0,A,0,1
#KERNEL_IMG: 0x00280000
#FDT_NAME: rk-kernel.dtb
#RECOVER_KEY: 1,1,0,20,0
#in section; per section 512(0x200) bytes
CMDLINE: root=/dev/mmcblk1p7 rw rootfstype=ext4 mtdparts=rk29xxnand:

0x00002000@0x00002000(uboot),
0x00002000@0x00004000(trust),
0x00002000@0x00006000(misc),
0x00006000@0x00008000(resource),
0x00010000@0x0000e000(kernel),
0x00010000@0x0001e000(boot),
-@0x00030000(rootfs) consoleblank=0

So, I tried mounting from backup image:

mount -t ext4 m4-image /media/img/ -o loop,offset=100663296 (offset for rootfs should be 0x30000 * 512)

and fails with "wrong fs type"

then I list the image's structure with: fdisk -l m4-image

Code: Select all

Device         Boot   Start      End  Sectors  Size Id Type
m4-image1           3342336 15234373 11892038  5.7G 83 Linux
m4-image2            196608  3342335  3145728  1.5G 83 Linux

So... I try m4-image1 partition instead:

mount -t ext4 m4-image /media/img/ -o loop,offset=1811939328 (offset for rootfs should be 3342336 * 512 + 0x30000 * 512, in case rootfs is inside m4-image1 partition?)

same error as before, "wrong fs type"

This make me think that I would need some kind of tool for extracting the data from m4-image. Here is my 2nd question: Does that tool exists, can I download from somewhere? ..or the reason for these mount failures is that I am calculating wrongly the offsets? if so, what the correct offset for rootfs in m4-image is?

I have also tried entering the M4 with the original rk3399-eflasher-friendlydesktop-bionic-4.4-arm64-20181219 image flashed the sdcard (and booting from sdcard. so, emmc as storage).

I connect to sshd (user:root/pass:fa) I can access the device. But, what I see there is:

Code: Select all

root@NanoPi-M4:/dev# ls -al | grep mmc
brw-rw----  1 root disk    179, 128 Apr 14 08:54 mmcblk0
brw-rw----  1 root disk    179, 129 Apr 14 08:54 mmcblk0p1             <--- mounted at /mnt/sdcard
brw-rw----  1 root disk    179, 130 Apr 14 08:54 mmcblk0p2             <--- mounted at /
brw-rw----  1 root disk    179,   0 Apr 14 08:54 mmcblk1
brw-rw----  1 root disk    179,  32 Apr 14 08:54 mmcblk1boot0
brw-rw----  1 root disk    179,  64 Apr 14 08:54 mmcblk1boot1
brw-rw----  1 root disk    179,   1 Apr 14 08:54 mmcblk1p1             <--- this seems to be same as m4-image1 backed up with dd
brw-rw----  1 root disk    179,   2 Apr 14 08:54 mmcblk1p2             <--- this seems to be same as m4-image2 backed up with dd
brw-rw----  1 root disk    179,  96 Apr 14 08:54 mmcblk1rpmb


I can not see the other mmcblk devices, So, I am missing the devices that actually I would know how to mount. These are the devices when Ubuntu Core OS (flashed with image rk3399-eflasher-friendlydesktop-bionic-4.4-arm64-20181219) is booted:

Code: Select all

root@NanoPi-M4:/dev# ls -al | grep mmc
brw-rw----  1 root disk    179,   0 Jan 28  2018 mmcblk1
brw-rw----  1 root disk    179,  32 Jan 28  2018 mmcblk1boot0
brw-rw----  1 root disk    179,  64 Jan 28  2018 mmcblk1boot1
brw-rw----  1 root disk    179,   1 Jan 28  2018 mmcblk1p1             <--- uboot (Not the same as when booted with eflasher sdcard image)
brw-rw----  1 root disk    179,   2 Jan 28  2018 mmcblk1p2             <--- trust (Not the same as when booted with eflasher sdcard image)
brw-rw----  1 root disk    179,   3 Jan 28  2018 mmcblk1p3             <--- misc
brw-rw----  1 root disk    179,   4 Jan 28  2018 mmcblk1p4             <--- resource
brw-rw----  1 root disk    179,   5 Jan 28  2018 mmcblk1p5             <--- kernel
brw-rw----  1 root disk    179,   6 Jan 28  2018 mmcblk1p6             <--- boot
brw-rw----  1 root disk    179,   7 Jan 28  2018 mmcblk1p7             <--- rootfs *** This one I'd like to mount
brw-rw----  1 root disk    179,  96 Jan 28  2018 mmcblk1rpmb

So, my 3rd question, Is there a way to populate mmcblk1p7 from eflasher so I can mount it, so I can modify the /etc/fstab?

Any reply to any of the 3 questions would help greatly.

For more explanations the 3 questions could be be answered, that would be awesome. I am very interested in the info about the MASKROM mode points :-)

Btw, here http://wiki.friendlyarm.com/wiki/images ... ematic.pdf I could see the MASKROM points... I guess the one to short is the one at page 7 of 25 under the symbol: EMMC_CLKO, right on R194 33R or R0201.

It looks more likely to me (after reading about the MASKROM mode) that EMMC_CLKO is the one to put to GND while boot (shorting for 3 or 4 seconds just after connecting the USB-C). No matter which ones are the correct ones, my question is: where they would be in the board?

Thanks!