Complete flashing on NanoPC-T2

Ron
Hello,

I am likely to add this board to OpenWRT as it's distro is far more suited
for my deployment scenario.  

How can I completely flash the EMMC including bootloader?  I would also
like to have uboot be able to load and flash via tftp and not SDcard.

jjm
Boot NanoPC-T2 from eMMC
Download RAW Image 

Get the image file: nanopi2-eflasher-sd4g.img.zip and the Windows utility:
win32diskimager.rar; 

Flash RAW Image to SD Card 

Insert an SD card(at least 4G) into a Windows PC and run the
win32diskimager utility as administrator. On the utility's main window
select your SD card's drive, the wanted image file and click on "write" to
start flashing the SD card 

Prepare RAW image 
Go to this link [http://wiki.friendlyarm.com/wiki/nanopi2/download/] to
download Android and Debian image files(System-image-files-for-eMMC). After
download untar the ".tgz" ball and copy the files to your SD card. 

OS  Image  Files  Copy to...  
Android 5.1  android-lollipop-images.tgz 
android-lollipop-images.tgz.hash.md5  boot.img 
system.img 
userdata.img 
cache.img 
partmap.txt 
 images\android  
Debian (Jessie)  debian-jessie-images.tgz 
debian-jessie-images.tgz.hash.md5  boot.img 
rootfs.img 
partmap.txt 
 images\debian  

Specify OS
By default the SD card's configuration file "images\FriendlyARM.ini"
specifies Android to be flashed to eMMC. If you want to install Debian make
the following change: 

OS = Debian"#" is a comment 

Flash Image to NanoPC-T2's eMMC
Insert this card into your NanoPC-T2, connect the board to an HDMI monitor
or an LCD, press and hold the boot key and power on (with a 5V/2A power
source) the board to start installation. You can watch the whole
installation process from the HDMI monitor or LCD. If the following
messages pop up it means the installation has succeeded. 

Android is fused successfully. 
All done.After installation is done do "reset" or power off and on the
board to boot the board from eMMC. 

http://wiki.friendlyarm.com/wiki/index.php/NanoPC-T2#Boot_NanoPC-T2_from...
You can read this rink.

Ron
This is an odd case where there isn't a JTAG or another way to program the
EMMC flash should something error.

I'm assuming there is a backup bootloader somewhere in there? NOR perhaps?

jjm
1、You can use FriendlyARM prepared's ROM for eMMC .

2、Using SD card to start NanoPC-T2, and use
https://github.com/friendlyarm/sd-fuse_nanopi2 to write eMMC.

3、Using SD card to start NanoPC-T2 enter uboot, and fuse by uboot,
eMMC's device  is mmc2,using update_mmc can update eMMC, you can read the
source code of uboot .

Ron
Okay... but this is not standard process.

I have a custom uboot - now I want to boot my own kernel.  If I use
fastboot to flash my image either uImage or zImage, I get messages like the
bellow.

sudo fastboot flash boot bin/nanopct2/uImage

OR 

sudo fastboot flash boot bin/nanopct2/zImage

s5p4418# run bootcmd
Failed to mount ext2 filesystem...
** Unrecognized filesystem type **
Failed to mount ext2 filesystem...
** Unrecognized filesystem type **
Wrong Image Format for bootm command
ERROR: can't get kernel image!
s5p4418# run bootd
## Error: "bootd" not defined


s5p4418# printenv
baudrate=115200
bloader=ext4load mmc 2:1
bootargs=console=ttyAMA0,115200n8 androidboot.console=ttyAMA0
androidboot.serialno=0123456789abcdef initrd=0x49000000,0x100000
lcd=HDMI720P60 bootdev=2
bootcmd=$bloader 0x48000000 $kernel;$bloader 0x49000000 root.img.gz;bootm
0x48000000
bootdelay=1
bootfile=uImage
ethaddr=00:e2:1c:ba:e8:60
fastboot=2ndboot:2nd:0x200,0x4000;bootloader:boot:0x8000,0x70000;boot:ext4:0x001
00000,0x04000000;system:ext4:0x04100000,0x02F200000;cache:ext4:0x33300000,0x1AC0
0000;misc:emmc:0x4;
fastbootdev=flash=mmc,2:parts
filesize=119438
gatewayip=192.168.1.254
ipaddr=192.168.1.165
kernel=uImage.hdmi
netmask=255.255.255.0
serverip=192.168.1.164
stderr=serial
stdin=serial
stdout=serial

I realize that you are going to redirect me to your already defined tools -
this won't work for us as we are writing our own ROMS (sorry China - its
not stable, not modern/updated nor can we account for what is inside your
fw).  Tell me how and what with your ancient version of uboot please.

Ron
Now, I've gotten this far, but don't get output or a hang

## Booting kernel from Legacy Image at 48000000 ...
   Image Name:   ARM OpenWrt NanoPC-T2 Linux-3.4.
   Image Type:   ARM Linux Kernel Image (uncompressed)
   Data Size:    3692516 Bytes = 3.5 MiB
   Load Address: 48000000
   Entry Point:  48000000
   Verifying Checksum ... OK
   Loading Kernel Image ... OK

Ron
After reverting and porting in the old 3.4.39 kernel, I get a message like:

�[    2.916000] VFS: Cannot open root device "(null)" or
unknown-block(0,0): error -6
[    2.924000] Please append a correct "root=" boot option; here are the
available partitions:
[    2.932000] b300         7634944 mmcblk0  driver: mmcblk
[    2.936000]   b301           65536 mmcblk0p1
00000000-0000-0000-0000-000000000000
[    2.944000]   b302          772096 mmcblk0p2
00000000-0000-0000-0000-000000000000
[    2.952000]   b303          438272 mmcblk0p3
00000000-0000-0000-0000-000000000000
[    2.960000]   b304               1 mmcblk0p4
00000000-0000-0000-0000-000000000000
[    2.968000]   b305            8192 mmcblk0p5
00000000-0000-0000-0000-000000000000
[    2.976000]   b306           22528 mmcblk0p6
00000000-0000-0000-0000-000000000000
[    2.984000]   b307         6324224 mmcblk0p7
00000000-0000-0000-0000-000000000000
[    2.988000] b310            4096 mmcblk0boot1  (driver?)
[    2.996000] b308            4096 mmcblk0boot0  (driver?)


Even if I use the fuse tools - where are the boot args looking for the
rootfs?  To which partition can I flash it too with fastboot?

Sean
Hey Ron, did you ever get this solved? I am in a similar situation where I
would like to flash my own version of u-boot and my own kernel directly.

Thanks!

Huy Le
The same issue. We needing the solution for the flashing new Kernel Image?

Regards,
HuyLe