刚入坑,但感觉到处是坑。
写驱动代码,说要内核源码,准备内核源码去了。
驱动编译发现不通过,说是要先编译内核源码,就先编译内核源码。
其中遇到各种编译问题,交叉编译问题,gcc版本过高问题。
完了终于编译得到 .ko 文件,拉去开发板说版本不对,无法加载,完蛋
查了半天,说可以改个头文件,改完 modinfo 后的确和开发板一样了,但还是提示加载失败
以上
最后决定从 uboot-->内核--->根文件系统 开始整个流程走一遍,心想,这下版本对了吧。
然后编译uboot遇到各种错误,很久很久才解决
然后编译内核遇到各种错误,很久很久才解决,甚至重装了 ubuntu 两次 。。。。。
最后编译根文件,又是各种错误。。。。
以上,都是根据教程来的,为啥自己就那么多错误,是官方给的东西玩我还是人品问题,这条路走不通。。。。
最后 uboot 烧录成功了,串口输出又是一堆错误,忽略!
然后拷贝镜像、设备树、根文件系统那个压缩文件解压
万事俱备,启动-------》
结果没有看到应该有的打印信息 reading zImage
反而设备树给打印出来了。。。。。
说是环境变量问题,看着也有 load mmc 0:1 0x41000000 zImage
没毛病啊。。。。
不信邪,再来几遍,再去搜
终于,既然环境变量没问题,我直接执行uboot指令可以吧
于是直接执行了 load mmc 0:1 0x41000000 zImage
好家伙,真的打印 reading zImage
然后执行 bootz 0x41000000 - 0x41800000,尝试进入Linux系统!
结果又打脸,显示根文件无法加载!
我感觉Linux就是个大坑。
最近编辑记录 linux-xc (2022-06-30 18:28:59)
离线
附上最后遇到的问题:
U-Boot SPL 2017.01-rc2 (Jun 30 2022 - 17:36:33)
DRAM: 64 MiB
Trying to boot from MMC1
U-Boot 2017.01-rc2 (Jun 30 2022 - 17:36:33 +0800) Allwinner Technology
CPU: Allwinner V3s (SUN8I 1681)
Model: Lichee Pi Zero
DRAM: 64 MiB
MMC: SUNXI SD/MMC: 0
Setting up a 800x480 lcd console (overscan 0x0)
dotclock: 33000kHz = 33000kHz: (1 * 3MHz * 66) / 6
In: serial@01c28000
Out: serial@01c28000
Err: serial@01c28000
U-Boot 2017.01-rc2 (Jun 30 2022 - 17:36:33 +0800) Allwinner Technology
CPU: Allwinner V3s (SUN8I 1681)
Model: Lichee Pi Zero
DRAM: 64 MiB
MMC: SUNXI SD/MMC: 0
Setting up a 800x480 lcd console (overscan 0x0)
dotclock: 33000kHz = 33000kHz: (1 * 3MHz * 66) / 6
In: serial@01c28000
Out: serial@01c28000
Err: serial@01c28000
Net: phy interface0
eth0: ethernet@1c30000
starting USB...
No controllers found
Hit any key to stop autoboot: 0
switch to partitions #0, OK
mmc0 is current device
Unknown command 'part' - try 'help'
Scanning mmc 0:1...
reading /sun8i-v3s-licheepi-zero.dtb
8585 bytes read in 25 ms (335 KiB/s)
starting USB...
No controllers found
USB is stopped. Please issue 'usb start' first.
starting USB...
No controllers found
BOOTP broadcast 1
BOOTP broadcast 2
BOOTP broadcast 3
BOOTP broadcast 4
BOOTP broadcast 5
BOOTP broadcast 6
BOOTP broadcast 7
BOOTP broadcast 8
BOOTP broadcast 9
BOOTP broadcast 10
BOOTP broadcast 11
BOOTP broadcast 12
BOOTP broadcast 13
BOOTP broadcast 14
BOOTP broadcast 15
BOOTP broadcast 16
BOOTP broadcast 17
Abort
missing environment variable: pxeuuid
missing environment variable: bootfile
Retrieving file: pxelinux.cfg/01-02-01-b0-b3-d6-51
_sun8i_emac_eth_init: Timeout
missing environment variable: bootfile
Retrieving file: pxelinux.cfg/00000000
*** ERROR: `ipaddr' not set
missing environment variable: bootfile
Retrieving file: pxelinux.cfg/0000000
*** ERROR: `ipaddr' not set
missing environment variable: bootfile
Retrieving file: pxelinux.cfg/000000
*** ERROR: `ipaddr' not set
missing environment variable: bootfile
Retrieving file: pxelinux.cfg/00000
*** ERROR: `ipaddr' not set
missing environment variable: bootfile
Retrieving file: pxelinux.cfg/0000
*** ERROR: `ipaddr' not set
missing environment variable: bootfile
Retrieving file: pxelinux.cfg/000
*** ERROR: `ipaddr' not set
missing environment variable: bootfile
Retrieving file: pxelinux.cfg/00
*** ERROR: `ipaddr' not set
missing environment variable: bootfile
Retrieving file: pxelinux.cfg/0
*** ERROR: `ipaddr' not set
missing environment variable: bootfile
Retrieving file: pxelinux.cfg/default-arm-sunxi
*** ERROR: `ipaddr' not set
missing environment variable: bootfile
Retrieving file: pxelinux.cfg/default-arm
*** ERROR: `ipaddr' not set
missing environment variable: bootfile
Retrieving file: pxelinux.cfg/default
*** ERROR: `ipaddr' not set
Config file not found
=> load mmc 0:1 0x41000000 zImage
reading zImage
3860984 bytes read in 199 ms (18.5 MiB/s)
=> bootz 0x41000000 - 0x41800000
## Flattened Device Tree blob at 41800000
Booting using the fdt blob at 0x41800000
Loading Device Tree to 42dfa000, end 42dff188 ... OK
Using machid 0x1029 from environment
Starting kernel ...
[ 0.000000] Booting Linux on physical CPU 0x0
[ 0.000000] Linux version 4.10.15-licheepi-zero (root@linux) (gcc version 6.3.1 20170109 (Linaro GCC 6.3-2017.02) ) #1 SMP Thu Jun 30 10:31:52 CST 2022
[ 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: Lichee Pi Zero
[ 0.000000] Memory policy: Data cache writealloc
[ 0.000000] percpu: Embedded 14 pages/cpu @c3dea000 s24716 r8192 d24436 u57344
[ 0.000000] Built 1 zonelists in Zone order, mobility grouping on. Total pages: 15883
[ 0.000000] Kernel command line:
[ 0.000000] PID hash table entries: 256 (order: -2, 1024 bytes)
[ 0.000000] Dentry cache hash table entries: 8192 (order: 3, 32768 bytes)
[ 0.000000] Inode-cache hash table entries: 4096 (order: 2, 16384 bytes)
[ 0.000000] Memory: 53648K/64036K available (6144K kernel code, 199K rwdata, 1420K rodata, 1024K init, 259K bss, 10388K reserved, 0K cma-reserved, 0K highmem)
[ 0.000000] Virtual kernel memory layout:
[ 0.000000] vector : 0xffff0000 - 0xffff1000 ( 4 kB)
[ 0.000000] fixmap : 0xffc00000 - 0xfff00000 (3072 kB)
[ 0.000000] vmalloc : 0xc4000000 - 0xff800000 ( 952 MB)
[ 0.000000] lowmem : 0xc0000000 - 0xc3e89000 ( 62 MB)
[ 0.000000] pkmap : 0xbfe00000 - 0xc0000000 ( 2 MB)
[ 0.000000] modules : 0xbf000000 - 0xbfe00000 ( 14 MB)
[ 0.000000] .text : 0xc0008000 - 0xc0700000 (7136 kB)
[ 0.000000] .init : 0xc0900000 - 0xc0a00000 (1024 kB)
[ 0.000000] .data : 0xc0a00000 - 0xc0a31e00 ( 200 kB)
[ 0.000000] .bss : 0xc0a33000 - 0xc0a73f0c ( 260 kB)
[ 0.000000] SLUB: HWalign=64, Order=0-3, MinObjects=0, CPUs=1, Nodes=1
[ 0.000000] Hierarchical RCU implementation.
[ 0.000000] Build-time adjustment of leaf fanout to 32.
[ 0.000000] RCU restricting CPUs from NR_CPUS=8 to nr_cpu_ids=1.
[ 0.000000] RCU: Adjusting geometry for rcu_fanout_leaf=32, nr_cpu_ids=1
[ 0.000000] NR_IRQS:16 nr_irqs:16 16
[ 0.000000] arm_arch_timer: Architected cp15 timer(s) running at 24.00MHz (virt).
[ 0.000000] clocksource: arch_sys_counter: mask: 0xffffffffffffff max_cycles: 0x588fe9dc0, max_idle_ns: 440795202592 ns
[ 0.000007] sched_clock: 56 bits at 24MHz, resolution 41ns, wraps every 4398046511097ns
[ 0.000018] Switching to timer-based delay loop, resolution 41ns
[ 0.000129] clocksource: timer: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 79635851949 ns
[ 0.000339] Console: colour dummy device 80x30
[ 0.000753] console [tty0] enabled
[ 0.000790] Calibrating delay loop (skipped), value calculated using timer frequency.. 48.00 BogoMIPS (lpj=240000)
[ 0.000828] pid_max: default: 32768 minimum: 301
[ 0.000975] Mount-cache hash table entries: 1024 (order: 0, 4096 bytes)
[ 0.001001] Mountpoint-cache hash table entries: 1024 (order: 0, 4096 bytes)
[ 0.001754] CPU: Testing write buffer coherency: ok
[ 0.002195] /cpus/cpu@0 missing clock-frequency property
[ 0.002239] CPU0: thread -1, cpu 0, socket 0, mpidr 80000000
[ 0.002617] Setting up static identity map for 0x40100000 - 0x40100058
[ 0.003399] smp: Bringing up secondary CPUs ...
[ 0.003439] smp: Brought up 1 node, 1 CPU
[ 0.003458] SMP: Total of 1 processors activated (48.00 BogoMIPS).
[ 0.003477] CPU: All CPU(s) started in SVC mode.
[ 0.004207] devtmpfs: initialized
[ 0.006771] VFP support v0.3: implementor 41 architecture 2 part 30 variant 7 rev 5
[ 0.007095] clocksource: jiffies: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 19112604462750000 ns
[ 0.007153] futex hash table entries: 256 (order: 2, 16384 bytes)
[ 0.007324] pinctrl core: initialized pinctrl subsystem
[ 0.008326] NET: Registered protocol family 16
[ 0.008717] DMA: preallocated 256 KiB pool for atomic coherent allocations
[ 0.009865] hw-breakpoint: found 5 (+1 reserved) breakpoint and 4 watchpoint registers.
[ 0.009998] hw-breakpoint: maximum watchpoint size is 8 bytes.
[ 0.021076] SCSI subsystem initialized
[ 0.021407] usbcore: registered new interface driver usbfs
[ 0.021495] usbcore: registered new interface driver hub
[ 0.021603] usbcore: registered new device driver usb
[ 0.021842] pps_core: LinuxPPS API ver. 1 registered
[ 0.021868] pps_core: Software ver. 5.3.6 - Copyright 2005-2007 Rodolfo Giometti <giometti@linux.it>
[ 0.021915] PTP clock support registered
[ 0.022148] Advanced Linux Sound Architecture Driver Initialized.
[ 0.023859] clocksource: Switched to clocksource arch_sys_counter
[ 0.024717] simple-framebuffer 43e89000.framebuffer: framebuffer at 0x43e89000, 0x177000 bytes, mapped to 0xc4080000
[ 0.024771] simple-framebuffer 43e89000.framebuffer: format=x8r8g8b8, mode=800x480x32, linelength=3200
[ 0.031634] Console: switching to colour frame buffer device 100x30
[ 0.041452] simple-framebuffer 43e89000.framebuffer: fb0: simplefb registered!
[ 0.055215] NET: Registered protocol family 2
[ 0.059623] TCP established hash table entries: 1024 (order: 0, 4096 bytes)
[ 0.063486] TCP bind hash table entries: 1024 (order: 1, 8192 bytes)
[ 0.067373] TCP: Hash tables configured (established 1024 bind 1024)
[ 0.071207] UDP hash table entries: 256 (order: 1, 8192 bytes)
[ 0.074985] UDP-Lite hash table entries: 256 (order: 1, 8192 bytes)
[ 0.078884] NET: Registered protocol family 1
[ 0.083126] RPC: Registered named UNIX socket transport module.
[ 0.086888] RPC: Registered udp transport module.
[ 0.090464] RPC: Registered tcp transport module.
[ 0.093951] RPC: Registered tcp NFSv4.1 backchannel transport module.
[ 0.099513] workingset: timestamp_bits=30 max_order=14 bucket_order=0
[ 0.111980] NFS: Registering the id_resolver key type
[ 0.115630] Key type id_resolver registered
[ 0.118999] Key type id_legacy registered
[ 0.126548] Block layer SCSI generic (bsg) driver version 0.4 loaded (major 249)
[ 0.130129] io scheduler noop registered
[ 0.133629] io scheduler deadline registered
[ 0.137456] io scheduler cfq registered (default)
[ 0.145341] sun8i-v3s-pinctrl 1c20800.pinctrl: initialized sunXi PIO driver
[ 0.215736] Serial: 8250/16550 driver, 8 ports, IRQ sharing disabled
[ 0.242841] 1c28000.serial: ttyS0 at MMIO 0x1c28000 (irq = 31, base_baud = 1500000) is a U6_16550A
[ 0.828193] console [ttyS0] enabled
[ 0.835956] [drm] Initialized
[ 0.844292] libphy: Fixed MDIO Bus: probed
[ 0.851995] ehci_hcd: USB 2.0 'Enhanced' Host Controller (EHCI) Driver
[ 0.861952] ehci-platform: EHCI generic platform driver
[ 0.870639] ohci_hcd: USB 1.1 'Open' Host Controller (OHCI) Driver
[ 0.880176] ohci-platform: OHCI generic platform driver
[ 0.889142] udc-core: couldn't find an available UDC - added [g_cdc] to list of pending drivers
[ 0.902203] sun6i-rtc 1c20400.rtc: rtc core: registered rtc-sun6i as rtc0
[ 0.912466] sun6i-rtc 1c20400.rtc: RTC enabled
[ 0.920309] i2c /dev entries driver
[ 0.928395] input: ns2009_ts as /devices/platform/soc/1c2ac00.i2c/i2c-0/0-0048/input/input0
[ 0.941431] sunxi-wdt 1c20ca0.watchdog: Watchdog enabled (timeout=16 sec, nowayout=0)
[ 1.013905] sunxi-mmc 1c0f000.mmc: base:0xc405d000 irq:23
[ 1.023700] usbcore: registered new interface driver usbhid
[ 1.032829] usbhid: USB HID core driver
[ 1.041954] NET: Registered protocol family 17
[ 1.050209] Key type dns_resolver registered
[ 1.058009] Registering SWP/SWPB emulation handler
[ 1.072588] usb_phy_generic.0.auto supply vcc not found, using dummy regulator
[ 1.084291] musb-hdrc musb-hdrc.1.auto: MUSB HDRC host driver
[ 1.093685] musb-hdrc musb-hdrc.1.auto: new USB bus registered, assigned bus number 1
[ 1.108601] hub 1-0:1.0: USB hub found
[ 1.116177] hub 1-0:1.0: 1 port detected
[ 1.124595] using random self ethernet address
[ 1.132603] using random host ethernet address
[ 1.141630] usb0: HOST MAC 42:40:ea:bc:b4:1e
[ 1.149450] usb0: MAC 1e:56:c4:8d:cd:ae
[ 1.156628] g_cdc gadget: CDC Composite Gadget, version: King Kamehameha Day 2008
[ 1.167412] g_cdc gadget: g_cdc ready
[ 1.174652] sun6i-rtc 1c20400.rtc: setting system clock to 1970-01-01 00:00:55 UTC (55)
[ 1.186407] vcc3v0: disabling
[ 1.192786] vcc5v0: disabling
[ 1.199086] ALSA device list:
[ 1.205283] No soundcards found.
[ 1.214197] VFS: Cannot open root device "(null)" or unknown-block(0,0): error -6
[ 1.225148] Please append a correct "root=" boot option; here are the available partitions:
[ 1.236874] Kernel panic - not syncing: VFS: Unable to mount root fs on unknown-block(0,0)
[ 1.248438] CPU: 0 PID: 1 Comm: swapper/0 Not tainted 4.10.15-licheepi-zero #1
[ 1.258996] Hardware name: Allwinner sun8i Family
[ 1.267089] [<c010e2fc>] (unwind_backtrace) from [<c010b098>] (show_stack+0x10/0x14)
[ 1.278254] [<c010b098>] (show_stack) from [<c0336824>] (dump_stack+0x84/0x98)
[ 1.288849] [<c0336824>] (dump_stack) from [<c01a6e54>] (panic+0xdc/0x248)
[ 1.299032] [<c01a6e54>] (panic) from [<c09011f0>] (mount_block_root+0x188/0x260)
[ 1.309846] [<c09011f0>] (mount_block_root) from [<c09013e8>] (mount_root+0x120/0x128)
[ 1.321155] [<c09013e8>] (mount_root) from [<c0901540>] (prepare_namespace+0x150/0x194)
[ 1.332598] [<c0901540>] (prepare_namespace) from [<c0900e40>] (kernel_init_freeable+0x1d4/0x1e4)
[ 1.345012] [<c0900e40>] (kernel_init_freeable) from [<c06495f8>] (kernel_init+0x8/0x10c)
[ 1.356791] [<c06495f8>] (kernel_init) from [<c0107638>] (ret_from_fork+0x14/0x3c)
[ 1.367938] ---[ end Kernel panic - not syncing: VFS: Unable to mount root fs on unknown-block(0,0)
[ 1.384212] musb-hdrc musb-hdrc.1.auto: VBUS_ERROR in a_wait_vrise (81, <SessEnd), retry #1, port1 00000100
[ 1.536639] musb-hdrc musb-hdrc.1.auto: VBUS_ERROR in a_wait_vrise (81, <SessEnd), retry #2, port1 00000100
[ 1.689066] musb-hdrc musb-hdrc.1.auto: VBUS_ERROR in a_wait_vrise (81, <SessEnd), retry #3, port1 00000100
[ 1.841492] musb-hdrc musb-hdrc.1.auto: VBUS_ERROR in a_wait_vrise (80, <SessEnd), retry #3, port1 00080108
离线
楼主这是高手必经之路啊,是不是没设置 bootargs 的 root 参数,linux没找到根文件系统。
查了一下,你说的应该是“ root=/dev/mmcblk0p2 ”
分区时,32M/FAT16、剩余空间/EXT4
这是uboot的环境变量:
=> printenv
arch=arm
baudrate=115200
board=sunxi
board_name=sunxi
boot_a_script=load ${devtype} ${devnum}:${distro_bootpart} ${scriptaddr} ${prefix}${script}; source ${scriptaddr}
boot_efi_binary=load ${devtype} ${devnum}:${distro_bootpart} ${kernel_addr_r} efi/boot/bootarm.efi; if fdt addr ${fdt_addr_r}; then bootefi ${kernel_addr_r} ${fdt_addr_r};else bootefi ${kernel_addr_r} ${fdtcontroladdr};fi
boot_extlinux=sysboot ${devtype} ${devnum}:${distro_bootpart} any ${scriptaddr} ${prefix}extlinux/extlinux.conf
boot_net_usb_start=usb start
boot_prefixes=/ /boot/
boot_script_dhcp=boot.scr.uimg
boot_scripts=boot.scr.uimg boot.scr
boot_targets=fel mmc0 usb0 pxe dhcp
bootcmd=run distro_bootcmd
bootcmd_dhcp=run boot_net_usb_start; if dhcp ${scriptaddr} ${boot_script_dhcp}; then source ${scriptaddr}; fi;setenv efi_fdtfile ${fdtfile}; if test -z "${fdtfile}" -a -n "${soc}"; then setenv efi_fdtfile ${soc}-${board}${boardver}.dtb; fi; setenv efi_old_vci ${bootp_vci};setenv efi_old_arch ${bootp_arch};setenv bootp_vci PXEClient:Arch:00010:UNDI:003000;setenv bootp_arch 0xa;if dhcp ${kernel_addr_r}; then tftpboot ${fdt_addr_r} dtb/${efi_fdtfile};if fdt addr ${fdt_addr_r}; then bootefi ${kernel_addr_r} ${fdt_addr_r}; else bootefi ${kernel_addr_r} ${fdtcontroladdr};fi;fi;setenv bootp_vci ${efi_old_vci};setenv bootp_arch ${efi_old_arch};setenv efi_fdtfile;setenv efi_old_arch;setenv efi_old_vci;
bootcmd_fel=if test -n ${fel_booted} && test -n ${fel_scriptaddr}; then echo '(FEL boot)'; source ${fel_scriptaddr}; fi
bootcmd_mmc0=setenv devnum 0; run mmc_boot
bootcmd_pxe=run boot_net_usb_start; dhcp; if pxe get; then pxe boot; fi
bootcmd_usb0=setenv devnum 0; run usb_boot
bootdelay=2
bootfstype=fat
bootm_boot_mode=sec
bootm_size=0x2e00000
bootz=0x41000000 - 0x41800000
console=ttyS0,115200
cpu=armv7
devnum=0
devplist=1
devtype=mmc
dfu_alt_info_ram=kernel ram 0x41000000 0x800000;fdt ram 0x41800000 0x100000;ramdisk ram 0x41B00000 0x1000000
distro_bootcmd=for target in ${boot_targets}; do run bootcmd_${target}; done
efi_dtb_prefixes=/ /dtb/ /dtb/current/
ethact=ethernet@1c30000
ethaddr=02:01:b0:b3:d6:51
fdt_addr_r=0x41800000
fdtcontroladdr=43b42228
fdtfile=sun8i-v3s-licheepi-zero.dtb
fileaddr=41800000
filesize=2189
gatewayip=192.168.1.1
ipaddr=192.168.2.140
kernel_addr_r=0x41000000
load=mmc 0:1 0x41000000 zImage
load_efi_dtb=load ${devtype} ${devnum}:${distro_bootpart} ${fdt_addr_r} ${prefix}${efi_fdtfile}
machid=1029
mmc_boot=if mmc dev ${devnum}; then setenv devtype mmc; run scan_dev_for_boot_part; fi
netmask=255.255.255.0
preboot=usb start
pxefile_addr_r=0x41A00000
ramdisk_addr_r=0x41B00000
scan_dev_for_boot=echo Scanning ${devtype} ${devnum}:${distro_bootpart}...; for prefix in ${boot_prefixes}; do run scan_dev_for_extlinux; run scan_dev_for_scripts; done;run scan_dev_for_efi;
scan_dev_for_boot_part=part list ${devtype} ${devnum} -bootable devplist; env exists devplist || setenv devplist 1; for distro_bootpart in ${devplist}; do if fstype ${devtype} ${devnum}:${distro_bootpart} bootfstype; then run scan_dev_for_boot; fi; done
scan_dev_for_efi=setenv efi_fdtfile ${fdtfile}; if test -z "${fdtfile}" -a -n "${soc}"; then setenv efi_fdtfile ${soc}-${board}${boardver}.dtb; fi; for prefix in ${efi_dtb_prefixes}; do if test -e ${devtype} ${devnum}:${distro_bootpart} ${prefix}${efi_fdtfile}; then run load_efi_dtb; fi;done;if test -e ${devtype} ${devnum}:${distro_bootpart} efi/boot/bootarm.efi; then echo Found EFI removable media binary efi/boot/bootarm.efi; run boot_efi_binary; echo EFI LOAD FAILED: continuing...; fi; setenv efi_fdtfile
scan_dev_for_extlinux=if test -e ${devtype} ${devnum}:${distro_bootpart} ${prefix}extlinux/extlinux.conf; then echo Found ${prefix}extlinux/extlinux.conf; run boot_extlinux; echo SCRIPT FAILED: continuing...; fi
scan_dev_for_scripts=for script in ${boot_scripts}; do if test -e ${devtype} ${devnum}:${distro_bootpart} ${prefix}${script}; then echo Found U-Boot script ${prefix}${script}; run boot_a_script; echo SCRIPT FAILED: continuing...; fi; done
scriptaddr=0x41900000
serial#=12c00001b0b3d651
serverip=192.168.1.152
soc=sunxi
stderr=serial@01c28000
stdin=serial@01c28000
stdout=serial@01c28000
ttyS0,115200=panic=5 rootwait root=/dev/mmcblk0p2
usb_boot=usb start; if usb dev ${devnum}; then setenv devtype usb; run scan_dev_for_boot_part; fi
Environment size: 4433/131068 bytes
此外,这是sd卡内容
=> ls mmc 0:1
8585 sun8i-v3s-licheepi-zero.dtb
3860984 zimage
2 file(s), 0 dir(s)
=> ls mmc 0:2
<DIR> 4096 .
<DIR> 4096 ..
<DIR> 16384 lost+found
5109760 rootfs.tar
<DIR> 4096 bin
<DIR> 4096 dev
<DIR> 4096 etc
<DIR> 4096 lib
<SYM> 3 lib32
<SYM> 11 linuxrc
<DIR> 4096 media
<DIR> 4096 mnt
<DIR> 4096 opt
<DIR> 4096 proc
<DIR> 4096 root
<DIR> 4096 run
<DIR> 4096 sbin
<DIR> 4096 sys
<DIR> 4096 tmp
<DIR> 4096 usr
<DIR> 4096 var
=>
最近编辑记录 linux-xc (2022-06-30 18:55:36)
离线
其实Linux还好,感觉主要是嵌入式这一块坑比较多
再加上是全志的东西,资料少之又少,坑不多才怪呢
离线
@linux-xc
看日志, 确实没有设置 root 参数
[ 1.214197] VFS: Cannot open root device "(null)" or unknown-block(0,0): error -6
[ 1.225148] Please append a correct "root=" boot option; here are the available partitions:
离线
@linux-xc
看日志, 确实没有设置 root 参数
[ 1.214197] VFS: Cannot open root device "(null)" or unknown-block(0,0): error -6
[ 1.225148] Please append a correct "root=" boot option; here are the available partitions:
这段错误我也注意到了,但是并不知道该如何更改环境变量。
我以为 ttyS0,115200=panic=5 rootwait root=/dev/mmcblk0p2 就是该部分选项
离线
其实Linux还好,感觉主要是嵌入式这一块坑比较多
再加上是全志的东西,资料少之又少,坑不多才怪呢
因为是单片机过渡来的,想玩Linux,就从最简单的荔枝派开始,以为会有个好开始。。。。
离线
@linux-xc
看日志, 确实没有设置 root 参数
[ 1.214197] VFS: Cannot open root device "(null)" or unknown-block(0,0): error -6
[ 1.225148] Please append a correct "root=" boot option; here are the available partitions:
网上搜索得知,有可能是内核不接受uboot的参数导致的:
问题来源:https://www.cnblogs.com/quanyun-linuxdriver/p/7595800.html
可能的办法:https://blog.csdn.net/weixin_29183637/article/details/116689007
离线
查看Linux内核配置:
Boot options --->
Kernel command line type (Use bootloader kernel arguments if available) --->
这说明使用的就是Uboot的参数,但是貌似无法获取
来源:https://blog.csdn.net/kangear/article/details/51985548
最近编辑记录 linux-xc (2022-06-30 20:34:23)
离线
自己瞎搞,根据网上的配置,修改了环境变量
来源: https://blog.csdn.net/xxxx123041/article/details/119938816
setenv bootargs 'console=ttyS0,115200 panic=5 rootwait root=/dev/mmcblk0p2 earlyprintk rw vt.global_cursor_default=0'
setenv bootcmd 'mmc dev 0;fatload mmc 0:1 0x41000000 zImage;fatload mmc 0:1 0x41800000 sun8i-v3s-licheepi-zero.dtb;bootz 0x41000000 - 0x41800000;'
saveenv
boot
最后打印
[ 0.969581] usb0: MAC 4a:bd:36:93:df:fc
[ 0.973456] g_cdc gadget: CDC Composite Gadget, version: King Kamehameha Day 2008
[ 0.981046] g_cdc gadget: g_cdc ready
[ 0.985080] sun6i-rtc 1c20400.rtc: setting system clock to 1970-01-01 03:04:35 UTC (11075)
[ 0.993642] vcc3v0: disabling
[ 0.996622] vcc5v0: disabling
[ 0.999586] ALSA device list:
[ 1.002547] No soundcards found.
[ 1.008083] Waiting for root device /dev/mmcblk0p2...
[ 1.054746] mmc0: host does not support reading read-only switch, assuming write-enable
[ 1.068584] mmc0: new high speed SDHC card at address aaaa
[ 1.074942] mmcblk0: mmc0:aaaa SL16G 14.8 GiB
[ 1.085024] mmcblk0: p1 p2
[ 1.097902] EXT4-fs (mmcblk0p2): couldn't mount as ext3 due to feature incompatibilities
[ 1.110153] EXT4-fs (mmcblk0p2): couldn't mount as ext2 due to feature incompatibilities
[ 1.158120] random: fast init done
[ 1.167507] EXT4-fs (mmcblk0p2): recovery complete
[ 1.173242] EXT4-fs (mmcblk0p2): mounted filesystem with ordered data mode. Opts: (null)
[ 1.181489] VFS: Mounted root (ext4 filesystem) on device 179:2.
[ 1.192331] devtmpfs: mounted
[ 1.196687] Freeing unused kernel memory: 1024K
[ 1.304943] EXT4-fs (mmcblk0p2): re-mounted. Opts: data=ordered
Starting logging: OK
Initializing random number generator... done.
Starting network: OK
[ 1.603608] usb 1-1: new high-speed USB device number 2 using musb-hdrc
Welcome to Buildroot
buildroot login: [ 1.784603] hub 1-1:1.0: USB hub found
[ 1.788990] hub 1-1:1.0: 4 ports detected
[ 2.113594] usb 1-1.4: new high-speed USB device number 3 using musb-hdrc
[ 210.163635] random: crng init done
可以看到最后打印得超级慢,也不知道是什么原因导致的
但是但是但是但是但是但是但是但是但是但是但是但是
成功了!
输入 cd /
输入 ls
看到了久违的文件列表打印
以上
最近编辑记录 linux-xc (2022-06-30 21:23:51)
离线
搞个 haveged,可加快 random 初始化
离线
3分钟以后才进入根文件系统?
离线
最近在看原子的linux教程,准备也玩玩全志的IC
离线
楼主是个大怨种!!但这是成为大神的必备的经历,参数这里可以使用boot.scr的方法传参考这个文章:https://liefyuan.blog.csdn.net/article/details/124724089
离线
做简单适配的话也就那样了。
离线
跟着教程一步步走,同样的代码,别人行自己就不行,太真实了,有时候真的搞心态
离线