Power & Source of Big Ideas

Nanopi new Kernel

Moderators: chensy, FATechsupport

Hi All,

I compiled the new kernel v4.x.y with the source coming from https://github.com/friendlyarm/linux-4.x.y and also from https://github.com/friendlyarm/linux.git however after copying the new kernel I always get panic. I get this result both if I copy the kernel in the SD card with e-flasher image and if I copy it in the /boot/ folder in the eMMC after OS install. Both with Debian and with Xenial. I used the script build.sh from and https://github.com/friendlyarm/debian_nanopi2.git without results.
From the message log it looks like the boot arg in the u-boot are not set properly, however I have never changed those, I only changed the uImage file and the Device Tree file.
This is for a nanopi-m1-plus by the way.
Am I missing anything? Need help. Thank you.

This is the message log coming from the boot process:

U-Boot SPL 2017.11 (Dec 08 2017 - 18:10:29)
DRAM: 1024 MiB(408MHz)
CPU Freq: 408MHz
Trying to boot from MMC1


U-Boot 2017.11 (Dec 08 2017 - 18:10:29 +0800) Allwinner Technology

CPU: Allwinner H3 (SUN8I 1680)
Model: FriendlyElec NanoPi H3
DRAM: 1 GiB
MMC: SUNXI SD/MMC: 0, SUNXI SD/MMC: 1
*** Warning - bad CRC, using default environment

In: serial
Out: vidconsole
Err: vidconsole
Net: No ethernet found.
SID: 2c00081-84004620-84004620-50358720
BOARD: nanopi-m1-plus
starting USB...
No controllers found
Hit any key to stop autoboot: 0
switch to partitions #0, OK
mmc0 is current device
Scanning mmc 0:1...
Found U-Boot script /boot.scr
reading /boot.scr
968 bytes read in 23 ms (41 KiB/s)
## Executing script at 43100000
reading zImage
5351448 bytes read in 427 ms (12 MiB/s)
reading rootfs.cpio.gz
2845838 bytes read in 236 ms (11.5 MiB/s)
reading sun8i-h3-nanopi-m1-plus.dtb
25971 bytes read in 32 ms (792 KiB/s)
## Flattened Device Tree blob at 48000000
Booting using the fdt blob at 0x48000000
Loading Ramdisk to 49b00000, end 4a000000 ... OK
Loading Device Tree to 49af6000, end 49aff572 ... OK
Cannot setup simplefb: node not found

Starting kernel ...

[ 0.000000] Booting Linux on physical CPU 0x0
[ 0.000000] Linux version 4.14.0 (gianluca@ENG09) (gcc version 4.9.3 (ctng-1.21.0-229g-FA)) #1 SMP Sat Feb 3 15:22:21 HKT 2018
[ 0.000000] CPU: ARMv7 Processor [410fc075] revision 5 (ARMv7), cr=10c5387d
[ 0.000000] CPU: div instructions available: patching division code
[ 0.000000] CPU: PIPT / VIPT nonaliasing data cache, VIPT aliasing instruction cache
[ 0.000000] OF: fdt: Machine model: FriendlyElec NanoPi-M1-Plus
[ 0.000000] Memory policy: Data cache writealloc
[ 0.000000] Ignoring RAM at 0x70000000-0x80000000
[ 0.000000] Consider using a HIGHMEM enabled kernel.
[ 0.000000] cma: Reserved 16 MiB at 0x6f000000
[ 0.000000] psci: probing for conduit method from DT.
[ 0.000000] psci: Using PSCI v0.1 Function IDs from DT
[ 0.000000] random: fast init done
[ 0.000000] percpu: Embedded 16 pages/cpu @ee8dc000 s36224 r8192 d21120 u65536
[ 0.000000] Built 1 zonelists, mobility grouping on. Total pages: 194880
[ 0.000000] Kernel command line: console=ttyS0,115200 earlyprintk root=/dev/mmcblk0p2 rootfstype=ext4 rw rootwait fsck.repair=yes panic=10 fbcon=map:0
[ 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] Memory: 744768K/786432K available (8192K kernel code, 430K rwdata, 1740K rodata, 1024K init, 289K bss, 25280K reserved, 16384K cma-reserved)
[ 0.000000] Virtual kernel memory layout:
[ 0.000000] vector : 0xffff0000 - 0xffff1000 ( 4 kB)
[ 0.000000] fixmap : 0xffc00000 - 0xfff00000 (3072 kB)
[ 0.000000] vmalloc : 0xf0800000 - 0xff800000 ( 240 MB)
[ 0.000000] lowmem : 0xc0000000 - 0xf0000000 ( 768 MB)
[ 0.000000] modules : 0xbf000000 - 0xc0000000 ( 16 MB)
[ 0.000000] .text : 0xc0008000 - 0xc0900000 (9184 kB)
[ 0.000000] .init : 0xc0b00000 - 0xc0c00000 (1024 kB)
[ 0.000000] .data : 0xc0c00000 - 0xc0c6b918 ( 431 kB)
[ 0.000000] .bss : 0xc0c74098 - 0xc0cbc7ec ( 290 kB)
[ 0.000000] SLUB: HWalign=64, Order=0-3, MinObjects=0, CPUs=4, Nodes=1
[ 0.000000] Hierarchical RCU implementation.
[ 0.000000] RCU restricting CPUs from NR_CPUS=8 to nr_cpu_ids=4.
[ 0.000000] RCU: Adjusting geometry for rcu_fanout_leaf=16, nr_cpu_ids=4
[ 0.000000] NR_IRQS: 16, nr_irqs: 16, preallocated irqs: 16
[ 0.000000] GIC: Using split EOI/Deactivate mode
[ 0.000000] clocksource: timer: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 79635851949 ns
[ 0.000000] arch_timer: cp15 timer(s) running at 24.00MHz (phys).
[ 0.000000] clocksource: arch_sys_counter: mask: 0xffffffffffffff max_cycles: 0x588fe9dc0, max_idle_ns: 440795202592 ns
[ 0.000014] sched_clock: 56 bits at 24MHz, resolution 41ns, wraps every 4398046511097ns
[ 0.000040] Switching to timer-based delay loop, resolution 41ns
[ 0.000402] Console: colour dummy device 80x30
[ 0.000463] Calibrating delay loop (skipped), value calculated using timer frequency.. 48.00 BogoMIPS (lpj=96000)
[ 0.000494] pid_max: default: 32768 minimum: 301
[ 0.000824] Mount-cache hash table entries: 2048 (order: 1, 8192 bytes)
[ 0.000859] Mountpoint-cache hash table entries: 2048 (order: 1, 8192 bytes)
[ 0.002189] CPU: Testing write buffer coherency: ok
[ 0.002910] CPU0: update cpu_capacity 1024
[ 0.002935] CPU0: thread -1, cpu 0, socket 0, mpidr 80000000
[ 0.003622] Setting up static identity map for 0x40100000 - 0x40100060
[ 0.003950] Hierarchical SRCU implementation.
[ 0.005069] smp: Bringing up secondary CPUs ...
[ 0.016288] CPU1: update cpu_capacity 1024
[ 0.016301] CPU1: thread -1, cpu 1, socket 0, mpidr 80000001
[ 0.027776] CPU2: update cpu_capacity 1024
[ 0.027789] CPU2: thread -1, cpu 2, socket 0, mpidr 80000002
[ 0.039138] CPU3: update cpu_capacity 1024
[ 0.039151] CPU3: thread -1, cpu 3, socket 0, mpidr 80000003
[ 0.039327] smp: Brought up 1 node, 4 CPUs
[ 0.039389] SMP: Total of 4 processors activated (192.00 BogoMIPS).
[ 0.039402] CPU: All CPU(s) started in HYP mode.
[ 0.039414] CPU: Virtualization extensions available.
[ 0.040974] devtmpfs: initialized
[ 0.054404] VFP support v0.3: implementor 41 architecture 2 part 30 variant 7 rev 5
[ 0.054932] clocksource: jiffies: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 7645041785100000 ns
[ 0.054973] futex hash table entries: 1024 (order: 4, 65536 bytes)
[ 0.056654] xor: measuring software checksum speed
[ 0.094953] arm4regs : 556.000 MB/sec
[ 0.135100] 8regs : 312.000 MB/sec
[ 0.175249] 32regs : 345.000 MB/sec
[ 0.215390] neon : 520.000 MB/sec
[ 0.215407] xor: using function: arm4regs (556.000 MB/sec)
[ 0.215439] pinctrl core: initialized pinctrl subsystem
[ 0.217162] NET: Registered protocol family 16
[ 0.219939] DMA: preallocated 256 KiB pool for atomic coherent allocations
[ 0.221644] cpuidle: using governor ladder
[ 0.221705] cpuidle: using governor menu
[ 0.222341] hw-breakpoint: found 5 (+1 reserved) breakpoint and 4 watchpoint registers.
[ 0.222364] hw-breakpoint: maximum watchpoint size is 8 bytes.
[ 0.260097] reg-fixed-voltage gmac-3v3: could not find pctldev for node /soc/pinctrl@01c20800/gmac_power_pin@0, deferring probe
[ 0.260422] gpio-regulator gpio-regulator: could not find pctldev for node /soc/pinctrl@01f02c00/regulator_pins@0, deferring probe
[ 0.261238] SCSI subsystem initialized
[ 0.262070] usbcore: registered new interface driver usbfs
[ 0.262177] usbcore: registered new interface driver hub
[ 0.262362] usbcore: registered new device driver usb
[ 0.262754] pps_core: LinuxPPS API ver. 1 registered
[ 0.262772] pps_core: Software ver. 5.3.6 - Copyright 2005-2007 Rodolfo Giometti <giometti@linux.it>
[ 0.262817] PTP clock support registered
[ 0.263187] Advanced Linux Sound Architecture Driver Initialized.
[ 0.266227] clocksource: Switched to clocksource arch_sys_counter
[ 0.266622] VFS: Disk quotas dquot_6.6.0
[ 0.266762] VFS: Dquot-cache hash table entries: 1024 (order 0, 4096 bytes)
[ 0.267064] FS-Cache: Loaded
[ 0.283937] NET: Registered protocol family 2
[ 0.285219] TCP established hash table entries: 8192 (order: 3, 32768 bytes)
[ 0.285438] TCP bind hash table entries: 8192 (order: 4, 65536 bytes)
[ 0.285719] TCP: Hash tables configured (established 8192 bind 8192)
[ 0.285923] UDP hash table entries: 512 (order: 2, 16384 bytes)
[ 0.286031] UDP-Lite hash table entries: 512 (order: 2, 16384 bytes)
[ 0.286695] NET: Registered protocol family 1
[ 0.287541] RPC: Registered named UNIX socket transport module.
[ 0.287562] RPC: Registered udp transport module.
[ 0.287575] RPC: Registered tcp transport module.
[ 0.287588] RPC: Registered tcp NFSv4.1 backchannel transport module.
[ 0.287990] Unpacking initramfs...
[ 0.646632] Initramfs unpacking failed: junk in compressed archive
[ 0.658290] Freeing initrd memory: 5120K
[ 0.661832] workingset: timestamp_bits=14 max_order=18 bucket_order=4
[ 0.672371] zbud: loaded
[ 0.675666] FS-Cache: Netfs 'nfs' registered for caching
[ 0.676777] NFS: Registering the id_resolver key type
[ 0.676839] Key type id_resolver registered
[ 0.676854] Key type id_legacy registered
[ 0.676888] nfs4filelayout_init: NFSv4 File Layout Driver Registering...
[ 0.676920] Installing knfsd (copyright (C) 1996 okir@monad.swb.de).
[ 0.678710] fuse init (API version 7.26)
[ 0.690241] async_tx: api initialized (async)
[ 0.690400] Block layer SCSI generic (bsg) driver version 0.4 loaded (major 248)
[ 0.690688] io scheduler noop registered (default)
[ 0.690709] io scheduler deadline registered
[ 0.691226] io scheduler cfq registered
[ 0.691247] io scheduler mq-deadline registered
[ 0.691519] io scheduler bfq registered
[ 0.700005] sun8i-h3-pinctrl 1c20800.pinctrl: initialized sunXi PIO driver
[ 0.703285] sun8i-h3-r-pinctrl 1f02c00.pinctrl: initialized sunXi PIO driver
[ 0.707610] Serial: 8250/16550 driver, 8 ports, IRQ sharing disabled
[ 0.711699] console [ttyS0] disabled
[ 0.732018] 1c28000.serial: ttyS0 at MMIO 0x1c28000 (irq = 46, base_baud = 1500000) is a U6_16550A
[ 1.477037] console [ttyS0] enabled
[ 1.505098] 1c28400.serial: ttyS1 at MMIO 0x1c28400 (irq = 47, base_baud = 1500000) is a U6_16550A
[ 1.538487] 1c28800.serial: ttyS2 at MMIO 0x1c28800 (irq = 48, base_baud = 1500000) is a U6_16550A
[ 1.568783] 1c28c00.serial: ttyS3 at MMIO 0x1c28c00 (irq = 49, base_baud = 1500000) is a U6_16550A
[ 1.594877] loop: module loaded
[ 1.629596] libphy: Fixed MDIO Bus: probed
[ 1.633805] tun: Universal TUN/TAP device driver, 1.6
[ 1.639264] CAN device driver interface
[ 1.644624] dwmac-sun8i 1c30000.ethernet: PTP uses main clock
[ 1.651349] ehci_hcd: USB 2.0 'Enhanced' Host Controller (EHCI) Driver
[ 1.657917] ehci-platform: EHCI generic platform driver
[ 1.663539] ehci-platform 1c1a000.usb: EHCI Host Controller
[ 1.669202] ehci-platform 1c1a000.usb: new USB bus registered, assigned bus number 1
[ 1.677860] ehci-platform 1c1a000.usb: irq 30, io mem 0x01c1a000
[ 1.698283] ehci-platform 1c1a000.usb: USB 2.0 started, EHCI 1.00
[ 1.704782] usb usb1: New USB device found, idVendor=1d6b, idProduct=0002
[ 1.711623] usb usb1: New USB device strings: Mfr=3, Product=2, SerialNumber=1
[ 1.718884] usb usb1: Product: EHCI Host Controller
[ 1.723798] usb usb1: Manufacturer: Linux 4.14.0 ehci_hcd
[ 1.729230] usb usb1: SerialNumber: 1c1a000.usb
[ 1.734947] hub 1-0:1.0: USB hub found
[ 1.738814] hub 1-0:1.0: 1 port detected
[ 1.744179] ohci_hcd: USB 1.1 'Open' Host Controller (OHCI) Driver
[ 1.750431] ohci-platform: OHCI generic platform driver
[ 1.756066] ohci-platform 1c1a400.usb: Generic Platform OHCI controller
[ 1.762776] ohci-platform 1c1a400.usb: new USB bus registered, assigned bus number 2
[ 1.770861] ohci-platform 1c1a400.usb: irq 31, io mem 0x01c1a400
[ 1.838570] usb usb2: New USB device found, idVendor=1d6b, idProduct=0001
[ 1.845411] usb usb2: New USB device strings: Mfr=3, Product=2, SerialNumber=1
[ 1.852690] usb usb2: Product: Generic Platform OHCI controller
[ 1.858649] usb usb2: Manufacturer: Linux 4.14.0 ohci_hcd
[ 1.864083] usb usb2: SerialNumber: 1c1a400.usb
[ 1.872539] hub 2-0:1.0: USB hub found
[ 1.876402] hub 2-0:1.0: 1 port detected
[ 1.881876] usbcore: registered new interface driver cdc_acm
[ 1.887581] cdc_acm: USB Abstract Control Model driver for USB modems and ISDN adapters
[ 1.895722] usbcore: registered new interface driver usblp
[ 1.901312] usbcore: registered new interface driver cdc_wdm
[ 1.907180] usbcore: registered new interface driver usb-storage
[ 1.913382] usbcore: registered new interface driver usbserial
[ 1.919320] usbcore: registered new interface driver usbserial_generic
[ 1.925943] usbserial: USB Serial support registered for generic
[ 1.932914] mousedev: PS/2 mouse device common for all mice
[ 1.939516] sun6i-rtc 1f00000.rtc: rtc core: registered rtc-sun6i as rtc0
[ 1.946368] sun6i-rtc 1f00000.rtc: RTC enabled
[ 1.951004] i2c /dev entries driver
[ 1.955646] device-mapper: ioctl: 4.37.0-ioctl (2017-09-20) initialised: dm-devel@redhat.com
[ 1.966430] ledtrig-cpu: registered to indicate activity on CPUs
[ 1.972616] hidraw: raw HID events driver (C) Jiri Kosina
[ 1.978333] usbcore: registered new interface driver usbhid
[ 1.983960] usbhid: USB HID core driver
[ 2.005318] wireguard: WireGuard 0.0.20171111 loaded. See http://www.wireguard.com for information.
[ 2.013818] wireguard: Copyright (C) 2015-2017 Jason A. Donenfeld <Jason@zx2c4.com>. All Rights Reserved.
[ 2.023742] Initializing XFRM netlink socket
[ 2.028998] NET: Registered protocol family 10
[ 2.073474] Segment Routing with IPv6
[ 2.077452] NET: Registered protocol family 17
[ 2.081983] NET: Registered protocol family 15
[ 2.086464] can: controller area network core (rev 20170425 abi 9)
[ 2.092834] NET: Registered protocol family 29
[ 2.097316] can: raw protocol (rev 20170425)
[ 2.101613] can: broadcast manager protocol (rev 20170425 t)
[ 2.107310] can: netlink gateway (rev 20170425) max_hops=1
[ 2.114248] rfkill_gpio rfkill_bt: sunxi-bt device registered.
[ 2.120351] Key type dns_resolver registered
[ 2.125126] Registering SWP/SWPB emulation handler
[ 2.131141] registered taskstats version 1
[ 2.153881] Key type encrypted registered
[ 2.170802] dwmac-sun8i 1c30000.ethernet: PTP uses main clock
[ 2.176891] dwmac-sun8i 1c30000.ethernet: Will use external PHY
[ 2.290511] dwmac-sun8i 1c30000.ethernet: Chain mode enabled
[ 2.296225] dwmac-sun8i 1c30000.ethernet: No HW DMA feature register supported
[ 2.303480] dwmac-sun8i 1c30000.ethernet: Normal descriptors
[ 2.309175] dwmac-sun8i 1c30000.ethernet: RX Checksum Offload Engine supported
[ 2.316430] dwmac-sun8i 1c30000.ethernet: COE Type 2
[ 2.321428] dwmac-sun8i 1c30000.ethernet: TX Checksum insertion supported
[ 2.328482] libphy: stmmac: probed
[ 2.347177] input: r_gpio_keys as /devices/platform/r_gpio_keys/input/input0
[ 2.357486] sun6i-rtc 1f00000.rtc: setting system clock to 1970-01-01 07:54:59 UTC (28499)
[ 2.366518] vcc3v0: disabling
[ 2.369500] vcc3v3: disabling
[ 2.372525] vcc5v0: disabling
[ 2.375553] usb0-vbus: disabling
[ 2.378815] ALSA device list:
[ 2.381788] #0: Dummy 1
[ 2.384433] #1: Loopback 1
[ 2.390322] Freeing unused kernel memory: 1024K
Loading, please wait...
starting version 225
Begin: Loading essential drivers ... done.
Begin: Running /scripts/init-premount ... done.
Begin: Mounting root file system ... Begin: Running /scripts/local-top ... done.
Begin: Running /scripts/local-premount ... done.
Gave up waiting for root device. Common problems:
- Boot args (cat /proc/cmdline)
- Check rootdelay= (did the system wait long enough?)
- Check root= (did the system wait for the right device?)
- Missing modules (cat /proc/modules; ls /dev)
ALERT! /dev/mmcblk0p2 does not exist. Dropping to a shell!
Rebooting automatically due to panic= boot argument
[ 43.157992] reboot: Restarting system
[ 44.161962] Reboot failed -- System halted
I answer to myself here for people who may encounter the same issue and find this post on google.
After launching make sunxi_defconfig I invoked xconfig to customize my kernel. However after launching make zImage the terminal started to ask me many questions about the modules to include in the kernel. I have gone back to the sunxi_defconfig file in arch/arm/configs/sunxi_defconfigs to review all settings and I noticed some settings marked as default in the make process were wrong. So I took care to answer every question according to the defconfig file (if specified there) and new kernel works fine.
In the case before the booting fails due to missing MMC driver support.
Gianluca wrote:
I answer to myself here for people who may encounter the same issue and find this post on google.
After launching make sunxi_defconfig I invoked xconfig to customize my kernel. However after launching make zImage the terminal started to ask me many questions about the modules to include in the kernel. I have gone back to the sunxi_defconfig file in arch/arm/configs/sunxi_defconfigs to review all settings and I noticed some settings marked as default in the make process were wrong. So I took care to answer every question according to the defconfig file (if specified there) and new kernel works fine.
In the case before the booting fails due to missing MMC driver support.


MMC is just another form of SD card. It is failing for other reasons - wrong root= parameter, your SD card is probably /dev/mmcblk1p2 or /dev/mmcblk2p2 ...

Try rather this way: https://docs.armbian.com/Developer-Guid ... eparation/

Its simpler with better board support.
It is working now, no problems with bootloader and relative parameters for booting.
I have started from a working bootloader, kernel and root filesystem and I changed the kernel only. At the beginning it was not working showing the issue I illustrated in my first post. After that I recompiled the kernel making sure every module was included as required. The issue was due to the missing MMC module included in the Kernel. The newest kernel works fine, at least until now.

Therefore we can mark this problem as solved.

Who is online

In total there are 30 users online :: 0 registered, 0 hidden and 30 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 30 guests