Jump to content

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





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.

Link to comment
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:



resetting ...
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!
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]
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
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
bloader=ext4load mmc 0:1
bootcmd=run start_autoscript; run storeboot
consoleargs=console=ttyS0,115200 no_console_suspend earlyprintk=aml-uart,0xc81004c0
droidargs=androidboot.console=ttyS0 androidboot.hardware=nanopi-k2
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
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
preboot=run loaddtb; run init_display
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

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#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



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

Link to comment
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.

Link to comment
Share on other sites

  • Igor unpinned this topic

Hi everyone, I'm kind new on linux, but I have some idea. I was running before another linux distribution and ethernet was working. Today I changed the SD because last one was not working fine, and I decided to installed the new armbian images. 
Wifi worked perfect, but I can't get eth0 working. When I try to activate it from ntmui, is showing this: 

Some info here: 


nanopik2:~:% sudo ethtool eth0
Settings for eth0:
Cannot get device settings: Device or resource busy
Cannot get wake-on-lan settings: Device or resource busy
Cannot get message level: Device or resource busy
Cannot get link status: Device or resource busy
No data available

nanopik2:~:% dmesg | grep eth
[    0.000000] psci: probing for conduit method from DT.
[    2.372867] meson8b-dwmac c9410000.ethernet: IRQ eth_wake_irq not found
[    2.372879] meson8b-dwmac c9410000.ethernet: IRQ eth_lpi not found
[    2.372999] meson8b-dwmac c9410000.ethernet: PTP uses main clock
[    2.373799] meson8b-dwmac c9410000.ethernet: User ID: 0x11, Synopsys ID: 0x37
[    2.373814] meson8b-dwmac c9410000.ethernet:         DWMAC1000
[    2.373819] meson8b-dwmac c9410000.ethernet: DMA HW capability register supported
[    2.373823] meson8b-dwmac c9410000.ethernet: RX Checksum Offload Engine supported
[    2.373828] meson8b-dwmac c9410000.ethernet: COE Type 2
[    2.373832] meson8b-dwmac c9410000.ethernet: TX Checksum insertion supported
[    2.373835] meson8b-dwmac c9410000.ethernet: Wake-Up On Lan supported
[    2.373924] meson8b-dwmac c9410000.ethernet: Normal descriptors
[    2.373928] meson8b-dwmac c9410000.ethernet: Ring mode enabled
[    2.373933] meson8b-dwmac c9410000.ethernet: Enable RX Mitigation via HW Watchdog Timer
[    2.373943] meson8b-dwmac c9410000.ethernet: device MAC address ca:6e:40:ff:62:6b
[   14.681861] meson8b-dwmac c9410000.ethernet eth0: no phy at addr -1
[   14.682506] meson8b-dwmac c9410000.ethernet eth0: stmmac_open: Cannot attach to PHY (error: -19)

nanopik2:~:% cat /proc/device-tree/model
FriendlyARM NanoPi K2%  

nanopik2:~:% uname -a
Linux nanopik2 5.10.21-meson64 #21.02.3 SMP PREEMPT Mon Mar 8 07:22:00 UTC 2021 aarch64 aarch64 aarch64 GNU/Linux

Thanks in advance. 

Edited by Muadiv
Link to comment
Share on other sites

I tried the latest version of the firmware and


None of them enable K2 to run eth0 to connect to the local network.

I'm in the same situation as Muadiv above. Is there any solutions?

Much appreciated!

Link to comment
Share on other sites


I know this is an old thread. A few years ago i bought two NanoPi K2's

I used these as kodi boxes for a while, but eventually stopped using them when i got an nvidia shield and other android tv boxes

Recently i have wanted to put these back to use, specifically to run Armbian and do a source install of Retropie (which works suprisingly well) with only two caveats


1: The Video resolution seems to be locked to lower resolutions (1024x768 and i think 800x600)

2: The onboard HDMI Audio does not seem to work 


these issues are both apparent with the latest "automated" builds available on the Armbian website


I was just wondering which build was the last "non automated" build where HDMI Audio and Video resolutions (say, 1920x1080) are supported


Alternatively, are there any patches that can be applied to make the HDMI Audio work or to hard code a custom resolution? I seem to be finding conflicting info online, and this board does not appear to be very popular which is a bit sad, because it actually seems like a well featured board. If only the manufacturer supported it better.  

Link to comment
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.

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.

  • Create New...

Important Information

Terms of Use - Privacy Policy - Guidelines