[Nano PC-T3] How to flashing the new Kernel from Uboot

Huy Le
Hi, 
I tried the changed my uImage on  SDCard but that's not good. I have tried
with http://wiki.friendlyarm.com/wiki/index.php/NanoPC-T3 following the
step  "Update Debian kernel file in eMMC" but doesn't work.

Regards,
HuyLe

davef
Did loading a SDcard image on to eMMC work when you tried their Debian
Jessie image?

Or do you think there is something wrong with "my Uimage"?

davef
Looks like there is some new information on booting the NanoPC-T3 from eMMC
and new images etc on the new forum.

I didn't have any trouble with the original images, but looks like I need
to investigate that posting.

Huy Le
Hi Davef, 
Yes, I also didn't have any trouble with the original images. I used the
Image s5p6818-debian-sd4g-20160913.img.zip from:
https://www.mediafire.com/folder/gg764iwvfm0mf/NanoPC-T3_Board that's work
fine. 
But when I recompile uImage as flowing:
git clone https://github.com/friendlyarm/linux-3.4.y.git
cd linux-3.4.y
git checkout nanopi2-lollipop-mr1
make nanopi3_linux_defconfig
touch .scmversion
make uImage
Copy my uImage into SDCard boot up to doesn't success.
Wonder how I can use the my uImage?

Regards,

davef
Did you cross-compile on a 64bit host?

Unfortunately, I haven't modified the kernel for this device and recompiled
it.

Are you looking at the boot messages when try to boot the SDcard?

Huy Le
Yes, Davef. I compiled in ubuntu xenial kernel 4.4 64bit.
└> uname -a
Linux nano 4.4.0-38-generic #57-Ubuntu SMP Tue Sep 6 15:42:33 UTC 2016
x86_64 x86_64 x86_64 GNU/Linux
Do you have a look in the logs boot.

U-Boot 2014.07 (Sep 23 2016 - 19:58:32)

I2C:   ready
DRAM:  256 MiB
BOARD= [nanopi3]    
LCD  = N/A (-1)
MMC:   NXP DWMMC: 0, NXP DWMMC: 1, NXP DWMMC: 2
In:    serial
Out:   serial
Err:   serial
switch to partitions #0, OK
mmc2(part 0) is current device
HDMI: display.0, preset 0 (1280 *  720)
HDMI: PHY Ready!!!
DONE: Logo bmp 800 by 480 (3bpp), len=1152056 
DRAW: 0x47000000 -> 0x46000000 
Net:   dwmac.c0060000
Hit any key to stop autoboot:  0 
## Booting kernel from Legacy Image at 48000000 ...
   Image Name:   Linux-3.4.39-s5p6818-g7b52660
   Image Type:   ARM Linux Kernel Image (uncompressed)
   Data Size:    4382288 Bytes = 4.2 MiB
   Load Address: 40008000
   Entry Point:  40008000
   Verifying Checksum ... OK
   Loading Kernel Image ... OK

Starting kernel ...

[    0.000000] Booting Linux on physical CPU 0
[    0.000000] Initializing cgroup subsys cpuset
[    0.000000] Initializing cgroup subsys cpu
[    0.000000] Linux version 3.4.39-s5p6818-g7b52660 (root@nano) (gcc
version 4.9.3 (ctng-1.21.0-229g-FA) ) #1 SMP PREEMPT Fri Sep 23 21:22:38
ICT 2016
[    0.000000] CPU: ARMv7 Processor [410fd033] revision 3 (ARMv7),
cr=10c5387d
[    0.000000] CPU: PIPT / VIPT nonaliasing data cache, VIPT aliasing
instruction cache
[    0.000000] Machine: NANOPI3
[    0.000000] nxp_reserve_mem: reserve CMA: size 159100928
[    0.000000] NXP/CMA: Reserved 0x65e45000/0x097bb000 for 'ion'
[    0.000000] NXP/CMA: success register cma region for 'ion'
[    0.000000] Memory policy: ECC disabled, Data cache writealloc
[    0.000000] CPU : iomap[ 0]: p 0xc0000000 -> v 0xf0000000 len=0x300000
[    0.000000] CPU : iomap[ 1]: p 0xe0000000 -> v 0xf0300000 len=0x100000
[    0.000000] CPU : iomap[ 2]: p 0xfff00000 -> v 0xf0400000 len=0x100000
[    0.000000] CPU : iomap[ 3]: p 0x2c000000 -> v 0xf0500000 len=0x100000
[    0.000000] CPU : iomap[ 4]: p 0x00000000 -> v 0xf0600000 len=0x100000
[    0.000000] CPU : DMA Zone Size =16M, CORE 8
[    0.000000] s5p6818-NanoPi3: Board initialized
[    0.000000] CPU : Clock Generator= 58 EA, DVFS = support, PLL.1
[    0.000000] PLL : [0] =  800000000, [1] =  800000000, [2] =  614394000,
[3] =  800000000
[    0.000000] (0) PLL1: CPU  FCLK =  800000000, HCLK = 200000000 (G0)
[    0.000000] (7) PLL1: CPU  FCLK =  800000000, HCLK = 200000000 (G1)
[    0.000000] (2) PLL3: MEM  FCLK =  800000000, DCLK = 800000000, BCLK =
400000000, PCLK = 200000000
[    0.000000] (1) PLL0: BUS  BCLK =  400000000, PCLK = 200000000
[    0.000000] (8) PLL0: CCI4 BCLK =  400000000, PCLK = 200000000
[    0.000000] (3) PLL0: G3D  BCLK =  400000000
[    0.000000] (4) PLL0: CODA BCLK =  400000000, PCLK = 200000000
[    0.000000] (5) PLL0: DISP BCLK =  400000000, PCLK = 200000000
[    0.000000] (6) PLL0: HDMI PCLK =  100000000
[    0.000000] PERCPU: Embedded 9 pages/cpu @c118a000 s12608 r8192 d16064
u36864
[    0.000000] Built 1 zonelists in Zone order, mobility grouping on. 
Total pages: 260096
[    0.000000] Kernel command line: console=ttySAC0,115200n8
androidboot.console=ttySAC0 androidboot.serialno=0123456789abcdef
initrd=0x49000000,0x100000 init=/init
[    0.000000] PID hash table entries: 4096 (order: 2, 16384 bytes)
[    0.000000] Dentry cache hash table entries: 131072 (order: 7, 524288
bytes)
[    0.000000] Inode-cache hash table entries: 65536 (order: 6, 262144
bytes)
[    0.000000] allocated 2097152 bytes of page_cgroup
[    0.000000] please try 'cgroup_disable=memory' option if you don't want
memory cgroups
[    0.000000] Memory: 1024MB = 1024MB total
[    0.000000] Memory: 871076k/871076k available, 177500k reserved, 272384K
highmem
[    0.000000] Virtual kernel memory layout:
[    0.000000]     vector  : 0xffff0000 - 0xffff1000   (   4 kB)
[    0.000000]     fixmap  : 0xfff00000 - 0xfffe0000   ( 896 kB)
[    0.000000]     vmalloc : 0xef800000 - 0xfee00000   ( 246 MB)
[    0.000000]     lowmem  : 0xc0000000 - 0xef600000   ( 758 MB)
[    0.000000]     pkmap   : 0xbfe00000 - 0xc0000000   (   2 MB)
[    0.000000]     modules : 0xbf000000 - 0xbfe00000   (  14 MB)
[    0.000000]       .text : 0xc0008000 - 0xc07dccf8   (8020 kB)
[    0.000000]       .init : 0xc07dd000 - 0xc0814140   ( 221 kB)
[    0.000000]       .data : 0xc0816000 - 0xc0897d78   ( 520 kB)
[    0.000000]        .bss : 0xc0897d9c - 0xc097c048   ( 913 kB)
[    0.000000] SLUB: Genslabs=11, HWalign=64, Order=0-3, MinObjects=0,
CPUs=8, Nodes=1
[    0.000000] Preemptible hierarchical RCU implementation.
[    0.000000] NR_IRQS:272
[    0.000000] GIC   @f0009000: start   0 (gic 31)
[    0.000000] GPIO  @f001a000: start 106, mask 0xffffffff (gpio 85)
[    0.000000] GPIO  @f001b000: start 138, mask 0xffffffff (gpio 86)
[    0.000000] GPIO  @f001c000: start 170, mask 0xffffffff (gpio 87)
[    0.000000] GPIO  @f001d000: start 202, mask 0xffffffff (gpio 88)
[    0.000000] GPIO  @f001e000: start 234, mask 0xffffffff (gpio 89)
[    0.000000] ALIVE @f0010800: start 266, mask 0x000000ff (alive 36, num
6)
[    0.000000] timer.0: source,  10000000(HZ:250), mult:3355443200
[    0.000000] timer.1: event ,  10000000(HZ:250), mult:42949673
[    0.000000] sched_clock: 32 bits at 250 Hz, resolution 4000000ns, wraps
every 4294967292ms
[    0.000000] Console: colour dummy device 80x30
[    0.000000] Calibrating delay loop... 1594.36 BogoMIPS (lpj=3188736)
[    0.048000] pid_max: default: 32768 minimum: 301
[    0.048000] Security Framework initialized
[    0.048000] SELinux:  Initializing.
[    0.048000] Mount-cache hash table entries: 512
[    0.048000] Initializing cgroup subsys cpuacct
[    0.048000] Initializing cgroup subsys memory
[    0.048000] Initializing cgroup subsys devices
[    0.048000] Initializing cgroup subsys freezer
[    0.048000] CPU: Testing write buffer coherency: ok
[    0.048000] CPU0: thread -1, cpu 0, socket 0, mpidr 80000000
[    0.048000] hw perfevents: no hardware support available
[    0.048000] Setting up static identity map for 0x405d64b8 - 0x405d6510
[    0.096000] CPU1: thread -1, cpu 1, socket 0, mpidr 80000001
[    0.136000] CPU2: thread -1, cpu 2, socket 0, mpidr 80000002
[    0.176000] CPU3: thread -1, cpu 3, socket 0, mpidr 80000003
[    0.216000] CPU4: thread -1, cpu 0, socket 4, mpidr 80040400
[    0.256000] CPU5: thread -1, cpu 1, socket 4, mpidr 80040401
[    0.296000] CPU6: thread -1, cpu 2, socket 4, mpidr 80040402
[    0.336000] CPU7: thread -1, cpu 3, socket 4, mpidr 80040403
[    0.336000] Brought up 8 CPUs
[    0.336000] SMP: Total of 8 processors activated (12754.94 BogoMIPS).
[    0.336000] devtmpfs: initialized
[    0.344000] VFP support v0.3: implementor 41 architecture 3 part 40
variant 3 rev 3
[    0.344000] pwm: max = 50000000 hz
[    0.348000] prepare_gpio_suspend:
[    0.348000]   alfn[0][0]: 0x00000000, alfn[0][1]: 0x00000000
[    0.348000]   alfn[1][0]: 0x66800000, alfn[1][1]: 0x55555566
[    0.348000]   alfn[2][0]: 0x55555555, alfn[2][1]: 0x00555555
[    0.348000]   alfn[3][0]: 0x00000000, alfn[3][1]: 0x00000000
[    0.348000]   alfn[4][0]: 0x00000000, alfn[4][1]: 0x55540000
[    0.348000] dummy: 
[    0.348000] NET: Registered protocol family 16
[    0.348000] [Register machine platform devices]
[    0.348000] mach: add amba device pl08xdmac.0 
[    0.348000] mach: add amba device pl08xdmac.1 
[    0.348000] mach: add device uart0
[    0.348000] mach: add device uart1
[    0.348000] mach: add device uart3
[    0.348000] mach: add device uart4
[    0.352000] mach: add device syncgen [2]
[    0.352000] mach: add device hdmi 
[    0.352000] mach: add device i2c bus (array:3) 
[    0.352000] mach: add device Real Time Clock  
[    0.352000] mach: add device generic pwm (array:4)
[    0.352000] mach: add device generic gpio (array:6)
[    0.352000] mach: add device i2s (array:1) 
[    0.352000] mach: add device spdif tx
[    0.352000] mach: add device usb_ehci
[    0.352000] mach: add device usb_ohci
[    0.352000] mach: add device usb otg
[    0.352000] mach: add device ion-nxp
[    0.352000] mach: add graphic device opengl|es
[    0.352000] mach: add device spi0 
[    0.352000] [Register board platform devices]
[    0.352000] plat: board revision 1
[    0.352000] plat: add dynamic frequency (pll.1)
[    0.352000] plat: add device TMU
[    0.352000] plat: add framebuffer
[    0.352000] plat: boot from mmc.0
[    0.352000] plat: add device sdmmc [0]
[    0.352000] plat: add device sdmmc [1]
[    0.356000] plat: add device sdmmc [2]
[    0.356000] plat: add backlight pwm device
[    0.356000] plat: add device keypad
[    0.356000] plat: add device spdif playback
[    0.356000] plat: add device asoc-es8316
[    0.356000] plat: add device nxp-v4l2
[    0.360000] plat: register spidev
[    0.360000] plat: add touch(ft5x0x) device
[    0.360000] plat: add touch(it7260) device
[    0.360000] plat: add onewire ts device
[    0.360000] plat: add adxl34x device
[    0.360000] plat: add bmp085 device
[    0.360000] plat: add ds1307 device
[    0.360000] plat: add pcf8591 device
[    0.360000] plat: add device nxp-gmac
[    0.360000] plat: add device gpio_led
[    0.360000] plat: add device pwm_led
[    0.360000] 
[    0.360000] hw-breakpoint: found 5 (+1 reserved) breakpoint and 4
watchpoint registers.
[    0.360000] hw-breakpoint: maximum watchpoint size is 8 bytes.
[    0.380000] bio: create slab <bio-0> at 0
[    0.384000] gpiochip_add: registered GPIOs 0 to 31 on device: GPIOA
[    0.384000] gpiochip_add: registered GPIOs 32 to 63 on device: GPIOB
[    0.384000] gpiochip_add: registered GPIOs 64 to 95 on device: GPIOC
[    0.384000] gpiochip_add: registered GPIOs 96 to 127 on device:
GPIOD
...stripped-down

Huy Le
With the new uImage trace the logs, I don't know why?

[    2.548000] write to read-only section trapped, success
[    2.576000] mmc_host mmc2: Bus speed (slot 0) = 100000000Hz (slot req
400000Hz, actual 400000HZ div = 125)
[    2.596000] mmc_host mmc2: device is being hw reset
[    2.636000] mmc_host mmc2: Bus speed (slot 0) = 100000000Hz (slot req
52000000Hz, actual 50000000HZ div = 1)
[    2.644000] mmc2: new high speed MMC card at address 0001
[    2.648000] mmcblk1: mmc2:0001 8WMB3R 7.28 GiB 
[    2.652000] type=1403 audit(1451635432.672:2): policy loaded
auid=4294967295 ses=4294967295
[    2.652000] mmcblk1boot0: mmc2:0001 8WMB3R partition 1 4.00 MiB
[    2.652000] mmcblk1boot1: mmc2:0001 8WMB3R partition 2 4.00 MiB
[    2.652000] type=1400 audit(1451635432.672:3): avc:  denied  { create }
for  pid=38 comm="kdevtmpfs" name="mmcblk1" scontext=u:r:kernel:s0
tcontext=u:object_r:dee
[    2.652000] type=1400 audit(1451635432.672:4): avc:  denied  { setattr }
for  pid=38 comm="kdevtmpfs" name="mmcblk1" dev="devtmpfs" ino=4114
scontext=u:r:kernel:e
[    2.656000]  mmcblk1: p1 p2 p3 p4 < p5 p6 p7 >
[    2.664000]  mmcblk1boot1: unknown partition table
[    2.672000]  mmcblk1boot0: unknown partition table
[    2.724000] type=1404 audit(1451635432.744:5): enforcing=1
old_enforcing=0 auid=4294967295 ses=4294967295
[    2.988000] init: /dev/hw_random not found
[    3.088000] init: /dev/hw_random not found
[    3.104000] EXT4-fs (mmcblk0p2): mounted filesystem with ordered data
mode. Opts: (null)
[    3.108000] fs_mgr:
__mount(source=/dev/block/platform/dw_mmc.0/by-num/p2,target=/system,type=ext4)=
0

jjm
Flash image to eMMC with eflasher

Download eflasher 

Get the eflasher utility s5p6818-eflasher-sd8g-xxx-full.img.7z
This package includes a Ubuntu Core, Debian, Android 5 and Android 4.4
image files;
Get the Windows utility: win32diskimager.rar;


Flash eflasher Image 

Extract the .7z package and you will get .img files.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.
If your PC runs Linux you can use the dd command to flash a .img file to
the SD card;


Flash image to eMMC
Insert this card into your NanoPC-T3, 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. After your board is powered on you will see multiple OS
options and you can select an OS to start installation.

Huy Le
Thanks JJM,
But one question? How can I create the
s5p6818-eflasher-sd8g-xxx-full.img.7z as your. Because I need to recompile
uImage, and run it ?

Regards,
HuyLe

Huy Le
Any answers?

jjm
Hello,
   If you want to use yourself image ,you can make .img file for yourself.

   a. If you want to make image you can use mkimage.sh &#65288;its use dd
command directly&#65289;&#65292;you can read the script file and modify the
file to specific
size&#65306;https://github.com/friendlyarm/sd-fuse_nanopi2/blob/master/mkimage.sh.

    b.If you want to make image for eflasher , you need use debian_nanopi2:
1.Get ready Ubuntu Core image which named uImage.hdmi
2.Get ready Ubuntu Core rootfs 
3.According to the actually situation to modify build.sh&#65292;and then
run ./build.sh that you can get boot.img and rootfs.img
  
    c.Actually making boot.img and rootfs.img need use tools/make_ext4fs
tool which is in debian_nanopi2 github, you can read build.sh sscript to
know about command parameter .

Huy Le
Good great, 
Thanks JJm I'll to excute the your step. 
If issue, I'll say to you in topic.

Regards,