1 1
TonyMac32

NanoPi K2 General Topics

Recommended Posts

Can you check the installation in eMMC on K2 ?

After recording the Armbian image for the TV box (add u-boot to SD card and DTB settings), you need to download and copy these two files to the /root directory on the SD card. After starting the system from SD card to K2, you need to run the script s905_install.sh from the user "root". The script should install the system on eMMC and create a new u-boot (special version for eMMC). I have on S905 this works (I installed in eMMC the latest armbian image with kernel 5.3.0).

Before starting the system SD card and run install on K2, to avoid side effects, you need to completely clean the eMMC.

 

If the u-boot installation does not work from the script, you can re-write the file (uboot_s905_emmc_1m. img) to eMMC after the script runs s905_install.sh two commands

 

dd if=uboot_s905_emmc_1m.img of=/dev/mmcblkX conv=fsync bs=1 count=442

dd if=uboot_s905_emmc_1m.img of=/dev/mmcblkX conv=fsync bs=512 skip=1 seek=1

 

https://yadi.sk/d/3RhEo60liJuTDw

 

 

For a quick check, you can immediately write uboot_s905_emmc_1m.img to eMMC with a single DD command and check the overall launch of the u-boot itself with eMMC. After writing u-boot to eMMC, there should be a partition table (two partitions) on eMMC.

Share this post


Link to post
Share on other sites
2 hours ago, balbes150 said:

For a quick check, you can immediately write uboot_s905_emmc_1m.img to eMMC

That is what I will do, because I've already working Armbian installed on the eMMC into a single partition, so I don't wish to erase it for now.

 

EDIT: It is a good step in the good direction, this U-Boot is now loaded from eMMC (wihout SD inserted) !

However, this U-Boot is far from the one from Armbian, it doesn't provide "ls", I had to do "ext4ls" instead, but this is not a big deal...

But it is also a bit buggy with sub-directories, since doing "ext4ls mmc 0 /boot" don't show any files, while doing "ext4ls mmc 0 /bin" is showing the files located in /boot ... :angry:

 

 


reset
resetting ...
GXBB:BL1:08dafd:0a8993;FEAT:EDFC318C;POC:3;RCY:0;EMMC:0;READ:0;CHK:0;
no sdio debug board detected
TE: 41139

BL2 Built : 12:06:06, Jun 13 2016.
gxb g176ecdb - laiyin.mo@droid12-sz

set vcck to 1100 mv
set vddee to 1000 mv
Board ID = 8
CPU clk: 1536MHz
DDR chl: Rank0+1 same @ 792MHz
DDR0: 2048MB(auto)-2T-11
DataBus test pass!
AddrBus test pass!
-s
Load fip header from eMMC, src: 0x0000c000, des: 0x01400000, size: 0x00004000
New fip structure!
Load bl30 from eMMC, src: 0x00010000, des: 0x01000000, size: 0x0000d460
Sending bl30......................................................OK.
Run bl30...
Load bl31 from eMMC, src: 0x00020000, des: 0x1010[000, size: 0x00013140
Image: gxb_v1.1.3134-b387442 2016-06-16 14:48:44 yun.cai@droid06]
OPS=0x13
ed 29 ad 5 1b 99 fa c9 82 86 5d Load bl33 from eMMC, src: 0x00034000, des: 0x01000000, size: 0x0006af00
4b [0.133626 Inits done]
secure task start!
high task start!
low task start!
NOTICE:  BL3-1: v1.0(debug):c813a61
NOTICE:  BL3-1: Built : 14:47:05, Jun 16 2016
INFO:    BL3-1: Initializing runtime services
WARNING: No OPTEE provided by BL2 boot loader
ERROR:   Error initializing runtime service opteed_fast
INFO:    BL3-1: Preparing for EL3 exit to normal world
INFO:    BL3-1: Next image address = 0x1000000
INFO:    BL3-1: Next image spsr = 0x3c9


U-Boot 2015.01-00018-g6c5824b-dirty (Oct 12 2017 - 18:36:33)

DRAM:  2 GiB
Relocation Offset is: 76f3b000
register usb cfg[1][0] = 0000000077f96ac0
register usb cfg[0][1] = 0000000077f96ae0
register usb cfg[2][0] = 0000000077f96b00
vpu: error: vpu: check dts: FDT_ERR_BADMAGIC, load default parameters
vpu: clk_level = 7
vpu: set clk: 666667000Hz, readback: 666660000Hz(0x300)
MMC:   SDIO Port C: 0, SDIO Port B: 1
emmc/sd response timeout, cmd8, status=0x3ff2800
emmc/sd response timeout, cmd55, status=0x3ff2800
[mmc_startup] mmc refix success
[mmc_init] mmc init success
In:    serial
Out:   serial
Err:   serial
reboot_mode=watchdog_reboot
hpd_state=0
cvbs performance type = 4, table = 0
Net:   Meson_Ethernet
** File not found nanopi-k2.dtb **
libfdt fdt_check_header(): FDT_ERR_BADMAGIC
[OSD]check dts: FDT_ERR_BADMAGIC, load default fb_addr parameters
[OSD]fb_addr for logo: 0x3d800000
[OSD]check dts: FDT_ERR_BADMAGIC, load default fb_addr parameters
[OSD]fb_addr for logo: 0x3d800000
[CANVAS]addr=0x3d800000 width=5760, height=2160

** File not found logo.bmp **
There is no valid bmp file at the given address
Hit Enter or space or Ctrl+C key to stop autoboot -- :  0
Device: SDIO Port C
Manufacturer ID: 15
OEM: 100
Name: AJTD4
Tran Speed: 52000000
Rd Block Len: 512
MMC version 4.0
High Capacity: Yes
Capacity: 14.6 GiB
mmc clock: 40000000
Bus Width: 8-bit DDR
** Unrecognized filesystem type **
(Re)start USB...
USB0:   dwc_usb driver version: 2.94 6-June-2012
USB (1) peri reg base: c0000020
USB (1) use clock source: XTAL input, div: 1
USB (1) base addr: 0xc9100000
Force id mode: Host
dwc_otg: Highspeed device found !

scanning bus 0 for devices... 2 USB Device(s) found
       scanning usb for storage devices... 1 Storage Device(s) found
reading s905_autoscript
** Unable to read file s905_autoscript **
** Bad device usb 1 **
** Bad device usb 2 **
** Bad device usb 3 **
emmc/sd response timeout, cmd8, status=0x1ff2800
emmc/sd response timeout, cmd55, status=0x1ff2800
emmc/sd response timeout, cmd1, status=0x1ff2800
** Bad device mmc 1 **
## Error: "storeboot" not defined
nanopi-k2#    
nanopi-k2#printenv
baudrate=115200
bloader=ext4load mmc 0:1
bootcmd=run start_autoscript; run storeboot
bootdelay=3
consoleargs=console=ttyS0,115200 no_console_suspend earlyprintk=aml-uart,0xc81004c0
cvbs_drv=0
cvbsmode=576cvbs
display_bpp=24
display_color_bg=0
display_color_fg=0xffff
display_color_index=24
display_height=576
display_layer=osd0
display_width=720
droidargs=androidboot.console=ttyS0 androidboot.hardware=nanopi-k2
dtb_mem_addr=0x1000000
dtb_name=nanopi-k2.dtb
ethact=Meson_Ethernet
ethaddr=00:16:0F:A0:10:22
fb_addr=0x3d800000
fb_height=1080
fb_width=1920
fdt_high=0x20000000
firstboot=1
gatewayip=192.168.102.1
hdmimode=1080p60hz
hostname=nanopi-k2-u1
init_bootargs=setenv bootargs ${consoleargs} ${droidargs} hdmimode=${hdmimode} hdmitx=cecf logo=osd1,loaded,${fb_addr},${hdmimode} initrd=${initrd_start},${initrd_size}
init_display=osd open; osd clear; ${bloader} 0x20000000 logo.bmp; bmp display 0x20000000
initrd_high=0x40000000
initrd_name=ramdisk.img
initrd_size=0x200000
initrd_start=0x39000000
ipaddr=192.168.102.39
loadaddr=0x1080000
loadbootimg=${bloader} 0x20000000 boot.img
loaddtb=${bloader} ${dtb_mem_addr} ${dtb_name}; fdt addr ${dtb_mem_addr}
loadinitrd=${bloader} ${initrd_start} ${initrd_name}; setenv initrd_size 0x${filesize}
loadkernel=${bloader} ${loadaddr} Image
netmask=255.255.255.0
outputmode=576cvbs
preboot=run loaddtb; run init_display
reboot_mode=watchdog_reboot
serial#=fe2017a905b20003
serverip=192.168.102.30
start_autoscript=if mmcinfo; then run start_mmc_autoscript; fi; if usb start; then run start_usb_autoscript; fi; run start_emmc_autoscript
start_emmc_autoscript=if fatload mmc 1 1020000 emmc_autoscript; then autoscr 1020000; fi;
start_mmc_autoscript=if fatload mmc 0 1020000 s905_autoscript; then autoscr 1020000; fi;
start_usb_autoscript=for usbdev in 0 1 2 3; do if fatload usb ${usbdev} 1020000 s905_autoscript; then autoscr 1020000; fi; done
stderr=serial
stdin=serial
stdout=serial
upgrade_step=2

Environment size: 2051/65532 bytes
nanopi-k2#ext4ls mmc 0
<DIR>       4096 .
<DIR>       4096 ..
<DIR>       4096 bin
<DIR>          0 boot
<DIR>       4096 dev
<DIR>          0 etc
<DIR>       4096 home
<DIR>          0 lib
<DIR>       4096 lost+found
<DIR>       4096 media
<DIR>       4096 mnt
<DIR>          0 opt
<DIR>          0 proc
<DIR>       4096 root
<DIR>          0 run
<DIR>       4096 sbin
<DIR>       4096 selinux
<DIR>       4096 srv
<DIR>          0 sys
<DIR>       4096 tmp
<DIR>          0 usr
<DIR>          0 var
nanopi-k2#
nanopi-k2#ext4ls mmc 0 /boot
nanopi-k2#ext4ls mmc 0 /bin
Unknown command 'ext4ls' - try 'help'
nanopi-k2#ext4ls mmc 0 /bin
<DIR>          0 .
<DIR>       4096 ..
<SYM>          0 Image
<SYM>          0 dtb
<SYM>          0 uInitrd
<SYM>          0 zImage
               0 .next
               0 System.map-5.3.3-meson64
               0 armbian_first_run.txt.template
               0 boot-desktop.png
               0 boot.bmp
               0 boot.cmd
               0 boot.scr
               0 config-5.3.3-meson64
               0 initrd.img-5.3.3-meson64
               0 uImage
               0 uInitrd-5.3.3-meson64
               0 vmlinuz-5.3.3-meson64
               0 armbianEnv.txt~
               0 armbianEnv.txt
               0 armbianEnv.txt-ORIG
<SYM>          0 dtb.old
<DIR>          0 dtb-5.3.7-meson64
nanopi-k2#
 

 

 

I will now try to see if placing files in root will help, and try to adjust boot.scr to use ext4load instead of load like in Armbian U-Boot ...

 

EDIT2: Strangely, the bug about sub-directory with boot/bin confusing doesn't exist if done one the SDCard inserted :

 

 


ext4ls mmc 1 /boot
<DIR>       4096 .
<DIR>       4096 ..
<SYM>         21 Image
<SYM>         17 dtb
<SYM>         21 uInitrd
<SYM>         21 zImage
<DIR>       4096 dtb-5.3.3-meson64
           38518 boot.bmp
               0 .next
            1536 armbian_first_run.txt.template
         3414756 System.map-5.3.3-meson64
             269 armbianEnv.txt
          171264 config-5.3.3-meson64
            4882 boot-desktop.png
            2993 boot.cmd
            3065 boot.scr
        16296008 uImage
         4737692 initrd.img-5.3.3-meson64
             254 armbianEnv.txt~
         4737756 uInitrd-5.3.3-meson64
        16295944 vmlinuz-5.3.3-meson64
             203 armbianEnv.txt-ORIG
nanopi-k2#ext4ls mmc 0 /boot
nanopi-k2#ext4ls mmc 0 /bin
<DIR>          0 .
<DIR>       4096 ..
<SYM>          0 Image
<SYM>          0 dtb
<SYM>          0 uInitrd
<SYM>          0 zImage
               0 .next
               0 System.map-5.3.3-meson64
               0 armbian_first_run.txt.template
               0 boot-desktop.png
               0 boot.bmp
               0 boot.cmd
               0 boot.scr
               0 config-5.3.3-meson64
               0 initrd.img-5.3.3-meson64
               0 uImage
               0 uInitrd-5.3.3-meson64
               0 vmlinuz-5.3.3-meson64
               0 armbianEnv.txt~
               0 armbianEnv.txt
               0 armbianEnv.txt-ORIG
<SYM>          0 dtb.old
<DIR>          0 dtb-5.3.7-meson64
 

 

 

EDIT3: filesystem functions are really buggy ... Now, from SDCard, I can do "ext4ls mmc 1 /boot/dtb/amlogic" but can't do "ext4ls mmc 1 /boot/dtb/amlogic/meson-gxbb-nanopi-k2.dtb", so I presume I won't be able to do "ext4load" ...

 



nanopi-k2#ext4ls mmc 1 /boot/dtb/amlogic
<DIR>       4096 .
<DIR>       4096 ..
           63276 meson-g12a-sei510.dtb
           48318 meson-axg-s400.dtb
           62359 meson-g12a-x96-max.dtb
           60202 meson-g12a-u200.dtb
           35233 meson-gxbb-nexbox-a95x.dtb
           62457 meson-g12b-odroid-n2.dtb
           37443 meson-gxbb-nanopi-k2.dtb
           34637 meson-gxbb-vega-s95-meta.dtb
           36104 meson-gxbb-odroidc2.dtb
           36662 meson-gxbb-p200.dtb
           35613 meson-gxbb-p201.dtb
           34641 meson-gxbb-vega-s95-telos.dtb
           34637 meson-gxbb-vega-s95-pro.dtb
           35699 meson-gxbb-wetek-play2.dtb
           35302 meson-gxbb-wetek-hub.dtb
           34876 meson-gxl-s905x-hwacom-amazetv.dtb
           35895 meson-gxl-s805x-libretech-ac.dtb
           35482 meson-gxl-s805x-p241.dtb
           37343 meson-gxl-s905d-p230.dtb
           36313 meson-gxl-s905d-p231.dtb
           37485 meson-gxl-s905d-phicomm-n1.dtb
           36179 meson-gxl-s905w-p281.dtb
           36151 meson-gxl-s905w-tx3-mini.dtb
<DIR>       4096 overlay
           38279 meson-gxl-s905x-khadas-vim.dtb
           37146 meson-gxl-s905x-libretech-cc.dtb
           35905 meson-gxl-s905x-nexbox-a95x.dtb
           36322 meson-gxl-s905x-p212.dtb
           40066 meson-gxm-khadas-vim2.dtb
           36581 meson-gxm-nexbox-a1.dtb
           38350 meson-gxm-q200.dtb
           37515 meson-gxm-q201.dtb
           36396 meson-gxm-rbox-pro.dtb
           37578 meson-gxm-vega-s96.dtb
nanopi-k2#ext4ls mmc 1 /boot/dtb/amlogic/meson-gxbb-nanopi-k2.dtb
** Can not find directory. **

Share this post


Link to post
Share on other sites
11 hours ago, martinayotte said:

filesystem functions are really buggy ... Now, from SDCard, I can do "ext4ls mmc 1 /boot/dtb/amlogic" but can't do "ext4ls mmc 1 /boot/dtb/amlogic/meson-gxbb-nanopi-k2.dtb", so I presume I won't be able to do "ext4load" ...

I check the work, only together with the script s905_install. After using it, the system normally starts automatically from eMMC.

 

Important. The eMMC device number changes when the SD card is connected. With SD card, the eMMC number will be mmcblk1. Without SD card number mmcblk0. This should be considered when creating a startup script from eMMC.

 

Also in this u-boot "built" MBR partition table with two partitions, the first FAT and the second EXT4.

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