Power & Source of Big Ideas

How to make sd card for Android on NanoPi-M4V2

Moderators: chensy, FATechsupport

Hello, I was able to follow your wiki on how to build android nougat for NanoPi M4V2, but i am having trouble figuring out the steps to prepare the SD card ... which script do i run to create the sd card that will boot Android 7 for this board? Is there a clear list of the files needed, and how to make it? .. i did also purchase the eMMC module which should come today, and i would like to see if i can get the board to boot as soon as possible.
Follow this to use create an SD that you can write to the emmc. This can also be used to flash your own custom Android builds.

http://wiki.friendlyarm.com/wiki/index. ... nd_SD_card
...
Copy the final build outputs to the SD card. For Android 8.1, they go in the android8 directory. Just overwrite the old files.

Inserted into your board and power up. It will flash to the emmc. Then shutdown and reboot without the SD card.

All the information to build the Android source is under the wiki. The first build will take some time depending on your computer processing power and cores. Make sure you setup the cache option to save on subsequent builds.
Thank you .. the custom build went perfectly .. now i want to make the sd card flasher to write to the eMMC .. from this page: https://github.com/friendlyarm/sd-fuse_rk3399. it is not very clear .... in one place it says for android you have to make an eflasher sd card ... but then the rest does not seem to match what i want to do, except for thr android 8 explanation ... maybe it is similar for android 7?

"Copy the new image files to the exfat partition of the eflasher sd card" ... so, do i write an eflasher image to the card first, like from here: http://download.friendlyarm.com/NanoPi-M4V2 ? then i copy the image files from the custom build to the card? which files do i need exactly?
OK. Assuming you are using Android 8.1 build, locate the eflasher in the download and write this to your SD card.

It will create 2 partitions and one will be named FriendlyArm and have an android8 directory. Follow the instructons on the wiki. All the information on how to make the SD is there.

13.3.3 Update System with New Image
After compilation is done a new image file will be generated in the "rockdev/Image-nanopc_t4/" directory under Android 8.1's source code directory. You can follow the steps below to update the OS in NanoPi-M4V2:
1) Insert an SD card that is processed with EFlasher to an SD card reader and insert this reader to a PC running Ubuntu. The SD card's partitions will be automatically mounted;
2) Copy all the files under the "rockdev/Image-nanopc_t4/" directory to the SD card's android8 directory in the "FRIENDLYARM" partition;
3) Insert this SD card to NanoPi-M4V2 and reflash Android
thank you i will try that .. i am using android 7 but hopefully it is similar
Pretty much although the build system for 8.1 is really nice with the kernel and u-boot all included in the same directory and a very nice build script to deal with it. You can build u-boot and the kernel first and then Android. The script takes care of copying each kernel and u-boot images to the correct location.

Update your build to 8.1, it is rather good.

Good luck and let me know how you get on.

I am struggling with trying to get SPI working on the T4 under Android 8.1 I can open the device and sent ioctl commands etc, but when I try to write bytes to it, the debug output shows SPI CONTROLLER IS IN BUSY STATE. Oh the fun of working at the hardware level. :D
ok, i found the images under rockdev in the custom build directories .. after flashing the rk3399-eflasher-android7-20200324.img file to the sdcard, then inserting the sdcard again, i see the rootfs and Friendlyarm partitions .. this sounds right so far ... then i copied all the files from the rockdev/Image-nanopc_t4 directory to the FriendlyArm volume on the sdcard ... does this all sound correct so far? Once done, i put the sdcard back into the Nanopi M4V2 board and boot .. nothing happens ... i tried all sort of combinations of holding buttons down, but nothing works .. now i may have screwed up the eMMC by writing the wrong thing to it directly ... how can i reformat the eMMC module so that it is in the proper format? this could be why this is not working
Did you copy the files to the android7 or android8 directory in the FriendlyArm partition?

Do you have a serial debug cable? That will make testing a lot easier as you will see the boot process and why it is failing. Without this cable, you are totally blind.

Even if the image in the directory is wrong, you should still see a boot sequence with the FriendlyArm logo and then an interface to program the image to the emmc.
Thank you i am going to try again with an android 8 build
Below is the debug output .. it seems there are some sha mismatch errors .. what does that mean?

----

U-Boot 2014.10-RK3399-06 (Aug 06 2019 - 19:08:49)

CPU: rk3399
cpu version = 0
CPU's clock information:
aplll = 816000000HZ
apllb = 24000000HZ
gpll = 800000000HZ
aclk_periph_h = 133333333HZ, hclk_periph_h = 66666666HZ, pclk_periph_h = 33333333HZ
aclk_periph_l0 = 266666666HZ, hclk_periph_l0 = 88888888HZ, pclk_periph_l0 = 44444444HZ
hclk_periph_l1 = 100000000HZ, pclk_periph_l1 = 50000000HZ
cpll = 800000000HZ
dpll = 856000000HZ
vpll = 24000000HZ
npll = 24000000HZ
ppll = 676000000HZ
Board: Rockchip platform Board
Uboot as second level loader
DRAM: Found dram banks: 1
Adding bank:0000000000200000(00000000ffe00000)
Reserve memory for trust os.
dram reserve bank: base = 0x08400000, size = 0x01e00000
128 MiB
SdmmcInit = 0 0
SDCard Boot.
storage init OK!
Using default environment

GetParam
Load FDT from resource image.
no key node
can't find dts node for fixed
usb bc: can find node by path: /dwc-control-usb/usb_bc
pmic:rk808
can't find dts node for pwm1
set pwm voltage ok,pwm_id =2 vol=1000000,pwm_value=33
Can't find dts node for fuel guage cw201x
can't find dts node for ec-battery
Can't find dts node for charger bq25700
invalide header tag
ca head not found
SecureBootEn = 0, SecureBootLock = 0

#Boot ver: 2019-08-06#1.09
empty serial no.
normal boot.
checkKey
vbus = 1
no fuel gauge found
no fuel gauge found
Rockchip UBOOT DRM driver version: develop-v1.0.0
failed to find panel driver
delay prepare[20] unprepare[0] enable[20] disable[0]
read logo on state from dts [1]
no fuel gauge found
rockchip_panel_deinit: failed to find panel deinit funcs
failed to find display timing
Hit any key to stop autoboot: 0
boot or recovery image sha mismatch!
Unable to boot:boot
try to start recovery
'recovery' does not seem to be a partition nor an address
Unable to boot:recovery
try to start backup
'backup' does not seem to be a partition nor an address
Unable to boot:backup
try to start rockusb
Recovery and backup partitions seem to be missing as well ... i burned the card fresh with the android 8 flasher image .. then copied all files from rockdev/Image-xxx/ into the android8 folder on the se card ... again, this is for the M4V2 board but the repo was referencing the nanopc-T2 board ... i assume out of the box no changes are needed for the M4V2? That is the repo referenced for this board
The NanoPC-T2 is a 32 bit build. The M4 needs a 64 bit build so probably explains why it fails to boot.

Did you clone the correct repository?

https://gitlab.com/friendlyelec/rk3399-android-8.1 --depth 1 -b master
that is the one .. the script to run there is build-nanopc-t4.sh per the info on the wiki .. is this correct? i meant to say t4

build is almost done trying now
build is complete .. followed instructions for android 8 ... copied all files to android 8 folder on sdcard flasher ... same thing .. does not boot, no green lights .. i also used a brand new eMMc i got today
What does the debug output look like?

Very strange. I've been building Android 5.1 for the NanoPC T3 Plus and now Android 8.1 for NanoPC T4 and not had any boot issues unless I screw up the build.

If you are just compiling the source without any changes, it should just work.

What are you using for display? Do you see the software interface to program Android to the eMMC when you boot from the SD Card. Can you show also the boot sequence from the SD Card?
>> What are you using for display?

i have a keyboard and mouse connected and my tv via hdmi

>> Do you see the software interface to program Android to the eMMC when you boot from the SD Card.

No just the FriendlyElec logo and nothing else

>> Can you show also the boot sequence from the SD Card?

i need to do it again i will post the debug output


I have not changed a thing and you followed the instructions exactly .. new nanopi-m4v2 board and new eMMC module .. i followed the android8.1 instructions
After the FriendyElec logo, does it go blank?

This happens for about 30 seconds on my machine and the debug shows some kind of network search. After this the FA interface appears and you can select the OS to install.
it stays on that screen forever
boot or recovery image sha mismatch!
Unable to boot:boot
try to start recovery
'recovery' does not seem to be a partition nor an address
Unable to boot:recovery
try to start backup
'backup' does not seem to be a partition nor an address
Unable to boot:backup
try to start rockusb
I think I may have figured it out. It seems like the speed of the SD card was the problem. I put in another card with a faster speed and it seemed to work ... i did see the flasher program for the first time ... trying now
The current situation is that I am now able to run the flasher program (it seems you have to hold the power button for a couple seconds), but flashing only works with the vanilla images ... when i make a new android build that is successful, and copy all the files to the flasher sd card, that does not work .. the flasher program dies when trying to copy system.img and just hangs there .. i am going to try it again now .. at least i am getting somewhere now
I believe this time it worked. I had to remake the flasher SD card, rebuild android eight, figure out the boot sequence button press,and had no issues with the flasher program ... Android booted just fine although I didn’t do anything custom so I’ll have to try that next but it looks promising thanks a lot for the help
You're welcome. Glad you got it working.

One of the things I did for a custom build was to remove the icons from the desktop and all add on demo software from FA.

I also added a custom boot image and bootanimation file.

Good luck with it.

Who is online

In total there are 4 users online :: 0 registered, 0 hidden and 4 guests (based on users active over the past 5 minutes)
Most users ever online was 5185 on Wed Jan 22, 2020 1:44 pm

Users browsing this forum: No registered users and 4 guests