页次: 1
用过2种方法:
第一种,tinyalsa,参考:https://blog.csdn.net/qq_28877125/article/details/117395026
出现:
tinypcminfo
Info for card 0, device 0:
PCM out:
cannot open device '/dev/snd/pcmC0D0p'
Device does not exist.
PCM in:
cannot open device '/dev/snd/pcmC0D0c'
Device does not exist.
第二种方法
alsa-lib库,参考https://www.cnblogs.com/liyue3/p/14343916.html
程序出现
/usr/lib/libasound.so.2: no version information available (required)
应该设备是初始化的时候失败导致,
segment fault
# aplay -l
aplay: device_list:270: no soundcards found...
# arecord -l
arecord: device_list:270: no soundcards found...
需要怎么配置呢?
已解决,SEC_4K问题:
https://www.kancloud.cn/lichee/lpi0/470834
#define SECT_4K BIT(0) /* SPINOR_OP_BE_4K works uniformly */
如果发现信息里有SECT_4K,则会导致jffs2不能正常擦除(64KB),需要去掉该flag。
SF: Detected w25q128bv with page size 256 Bytes, erase size 4 KiB, total 16 MiB
Perhaps the file system was created with the wrong erase size?
这几个点,我试了一下4kib生成的情况,生成不了
mkfs.jffs2 -s 0x1000 -e 0x1000 -p 0x400000 -d rootfs-brmin/ -n -o jffs2.img
Erase size 0x1000 too small. Increasing to 8KiB minimum
flash是16M的
生成jffs的命令:
mkfs.jffs2 -s 0x100 -e 0x10000 -p 0xAF0000 -d rootfs-brmin/ -o jffs2.img
但无论怎样烧录,都会出现这个问题:
jffs2: jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x00097018: 0x690c instead
更全的启动日志
Hit any key to stop autoboot: 0
SF: Detected w25q128bv with page size 256 Bytes, erase size 4 KiB, total 16 MiB
device 0 offset 0x100000, size 0x10000
SF: 65536 bytes @ 0x100000 Read: OK
device 0 offset 0x110000, size 0x400000
SF: 4194304 bytes @ 0x110000 Read: OK
## Flattened Device Tree blob at 41800000
Booting using the fdt blob at 0x41800000
Loading Device Tree to 42dfa000, end 42dffecd ... OK
Starting kernel ...
[ 0.000000] Booting Linux on physical CPU 0x0
[ 0.000000] Linux version 4.13.16-licheepi-zero+ (root@6559461d4579) (gcc version 6.3.1 20170404 (Linaro GCC 6.3-2017.05)) #6 SMP Wed Jul 6 01:04:10 UTC 2
[ 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 with Dock
[ 0.000000] Memory policy: Data cache writealloc
[ 0.000000] percpu: Embedded 16 pages/cpu @c3de6000 s33868 r8192 d23476 u65536
[ 0.000000] Built 1 zonelists in Zone order, mobility grouping on. Total pages: 15883
[ 0.000000] Kernel command line: console=ttyS0,115200 earlyprintk panic=5 rootwait mtdparts=spi32766.0:1M(uboot)ro,64k(dtb)ro,4M(kernel)ro,-(rootfs) root2
[ 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: 53568K/64036K available (6144K kernel code, 225K rwdata, 1524K rodata, 1024K init, 265K bss, 10468K reserved, 0K cma-reserved, 0K hig)
[ 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 - 0xc0a386e0 ( 226 kB)
[ 0.000000] .bss : 0xc0a3fb5c - 0xc0a821ac ( 266 kB)
[ 0.000000] SLUB: HWalign=64, Order=0-3, MinObjects=0, CPUs=1, Nodes=1
[ 0.000000] Hierarchical RCU implementation.
[ 0.000000] RCU event tracing is enabled.
[ 0.000000] RCU restricting CPUs from NR_CPUS=8 to nr_cpu_ids=1.
[ 0.000000] RCU: Adjusting geometry for rcu_fanout_leaf=16, nr_cpu_ids=1
[ 0.000000] NR_IRQS: 16, nr_irqs: 16, preallocated irqs: 16
[ 0.000000] arch_timer: 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.000008] sched_clock: 56 bits at 24MHz, resolution 41ns, wraps every 4398046511097ns
[ 0.000020] Switching to timer-based delay loop, resolution 41ns
[ 0.000184] clocksource: timer: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 79635851949 ns
[ 0.000411] Console: colour dummy device 80x30
[ 0.000445] Calibrating delay loop (skipped), value calculated using timer frequency.. 48.00 BogoMIPS (lpj=240000)
[ 0.000459] pid_max: default: 32768 minimum: 301
[ 0.000588] Mount-cache hash table entries: 1024 (order: 0, 4096 bytes)
[ 0.000601] Mountpoint-cache hash table entries: 1024 (order: 0, 4096 bytes)
[ 0.001200] CPU: Testing write buffer coherency: ok
[ 0.001575] /cpus/cpu@0 missing clock-frequency property
[ 0.001597] CPU0: thread -1, cpu 0, socket 0, mpidr 80000000
[ 0.002027] Setting up static identity map for 0x40100000 - 0x40100060
[ 0.002204] Hierarchical SRCU implementation.
[ 0.002707] smp: Bringing up secondary CPUs ...
[ 0.002720] smp: Brought up 1 node, 1 CPU
[ 0.002729] SMP: Total of 1 processors activated (48.00 BogoMIPS).
[ 0.002737] CPU: All CPU(s) started in SVC mode.
[ 0.003496] devtmpfs: initialized
[ 0.006623] VFP support v0.3: implementor 41 architecture 2 part 30 variant 7 rev 5
[ 0.006909] clocksource: jiffies: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 19112604462750000 ns
[ 0.006935] futex hash table entries: 256 (order: 2, 16384 bytes)
[ 0.007096] pinctrl core: initialized pinctrl subsystem
[ 0.007968] random: get_random_u32 called from bucket_table_alloc+0xf4/0x244 with crng_init=0
[ 0.008099] NET: Registered protocol family 16
[ 0.008589] DMA: preallocated 256 KiB pool for atomic coherent allocations
[ 0.009712] hw-breakpoint: found 5 (+1 reserved) breakpoint and 4 watchpoint registers.
[ 0.009729] hw-breakpoint: maximum watchpoint size is 8 bytes.
[ 0.023012] SCSI subsystem initialized
[ 0.023316] usbcore: registered new interface driver usbfs
[ 0.023378] usbcore: registered new interface driver hub
[ 0.023486] usbcore: registered new device driver usb
[ 0.023711] Linux video capture interface: v2.00
[ 0.023753] pps_core: LinuxPPS API ver. 1 registered
[ 0.023761] pps_core: Software ver. 5.3.6 - Copyright 2005-2007 Rodolfo Giometti <giometti@linux.it>
[ 0.023782] PTP clock support registered
[ 0.024029] Advanced Linux Sound Architecture Driver Initialized.
[ 0.025904] clocksource: Switched to clocksource arch_sys_counter
[ 0.036789] NET: Registered protocol family 2
[ 0.037367] TCP established hash table entries: 1024 (order: 0, 4096 bytes)
[ 0.037397] TCP bind hash table entries: 1024 (order: 1, 8192 bytes)
[ 0.037420] TCP: Hash tables configured (established 1024 bind 1024)
[ 0.037548] UDP hash table entries: 256 (order: 1, 8192 bytes)
[ 0.037597] UDP-Lite hash table entries: 256 (order: 1, 8192 bytes)
[ 0.037799] NET: Registered protocol family 1
[ 0.038394] RPC: Registered named UNIX socket transport module.
[ 0.038412] RPC: Registered udp transport module.
[ 0.038418] RPC: Registered tcp transport module.
[ 0.038424] RPC: Registered tcp NFSv4.1 backchannel transport module.
[ 0.040538] workingset: timestamp_bits=30 max_order=14 bucket_order=0
[ 0.049473] NFS: Registering the id_resolver key type
[ 0.049526] Key type id_resolver registered
[ 0.049533] Key type id_legacy registered
[ 0.049577] jffs2: version 2.2. (NAND) © 2001-2006 Red Hat, Inc.
[ 0.051091] random: fast init done
[ 0.054025] Block layer SCSI generic (bsg) driver version 0.4 loaded (major 249)
[ 0.054046] io scheduler noop registered
[ 0.054053] io scheduler deadline registered
[ 0.054300] io scheduler cfq registered (default)
[ 0.054311] io scheduler mq-deadline registered
[ 0.054319] io scheduler kyber registered
[ 0.058727] sun8i-v3s-pinctrl 1c20800.pinctrl: initialized sunXi PIO driver
[ 0.128141] Serial: 8250/16550 driver, 8 ports, IRQ sharing disabled
[ 0.131331] console [ttyS0] disabled
[ 0.151607] 1c28000.serial: ttyS0 at MMIO 0x1c28000 (irq = 36, base_baud = 1500000) is a U6_16550A
[ 0.745561] console [ttyS0] enabled
[ 0.753551] m25p80 spi32766.0: w25q128 (16384 Kbytes)
[ 0.758716] spi32766.0: parser cmdlinepart: 4
[ 0.763070] 4 cmdlinepart partitions found on MTD device spi32766.0
[ 0.769356] Creating 4 MTD partitions on "spi32766.0":
[ 0.774500] 0x000000000000-0x000000100000 : "uboot"
[ 0.780046] 0x000000100000-0x000000110000 : "dtb"
[ 0.785150] 0x000000110000-0x000000510000 : "kernel"
[ 0.790614] 0x000000510000-0x000001000000 : "rootfs"
[ 0.796426] libphy: Fixed MDIO Bus: probed
[ 0.801016] dwmac-sun8i 1c30000.ethernet: PTP uses main clock
[ 0.806898] dwmac-sun8i 1c30000.ethernet: No regulator found
[ 0.812623] dwmac-sun8i 1c30000.ethernet: Will use internal PHY
[ 0.818812] dwmac-sun8i 1c30000.ethernet: Chain mode enabled
[ 0.824473] dwmac-sun8i 1c30000.ethernet: No HW DMA feature register supported
[ 0.831728] dwmac-sun8i 1c30000.ethernet: Normal descriptors
[ 0.837399] dwmac-sun8i 1c30000.ethernet: RX Checksum Offload Engine supported
[ 0.844613] dwmac-sun8i 1c30000.ethernet: COE Type 2
[ 0.849583] dwmac-sun8i 1c30000.ethernet: TX Checksum insertion supported
[ 0.856577] libphy: stmmac: probed
[ 0.861892] ehci_hcd: USB 2.0 'Enhanced' Host Controller (EHCI) Driver
[ 0.868552] ehci-platform: EHCI generic platform driver
[ 0.874069] ehci-platform 1c1a000.usb: EHCI Host Controller
[ 0.879761] ehci-platform 1c1a000.usb: new USB bus registered, assigned bus number 1
[ 0.887700] ehci-platform 1c1a000.usb: irq 26, io mem 0x01c1a000
[ 0.915923] ehci-platform 1c1a000.usb: USB 2.0 started, EHCI 1.00
[ 0.923192] hub 1-0:1.0: USB hub found
[ 0.927144] hub 1-0:1.0: 1 port detected
[ 0.931699] ohci_hcd: USB 1.1 'Open' Host Controller (OHCI) Driver
[ 0.937999] ohci-platform: OHCI generic platform driver
[ 0.943549] ohci-platform 1c1a400.usb: Generic Platform OHCI controller
[ 0.950289] ohci-platform 1c1a400.usb: new USB bus registered, assigned bus number 2
[ 0.958248] ohci-platform 1c1a400.usb: irq 27, io mem 0x01c1a400
[ 1.031051] hub 2-0:1.0: USB hub found
[ 1.034870] hub 2-0:1.0: 1 port detected
[ 1.043080] input: 1c22800.lradc as /devices/platform/soc/1c22800.lradc/input/input0
[ 1.052032] sun6i-rtc 1c20400.rtc: rtc core: registered rtc-sun6i as rtc0
[ 1.058940] sun6i-rtc 1c20400.rtc: RTC enabled
[ 1.063474] i2c /dev entries driver
[ 1.068347] input: ns2009_ts as /devices/platform/soc/1c2ac00.i2c/i2c-0/0-0048/input/input1
[ 1.077468] usbcore: registered new interface driver uvcvideo
[ 1.083219] USB Video Class driver (1.1.1)
[ 1.088082] sunxi-wdt 1c20ca0.watchdog: Watchdog enabled (timeout=16 sec, nowayout=0)
[ 1.155955] sunxi-mmc 1c0f000.mmc: base:0xc407b000 irq:23
[ 1.215939] sunxi-mmc 1c10000.mmc: base:0xc423b000 irq:24
[ 1.222373] usbcore: registered new interface driver usbhid
[ 1.228025] usbhid: USB HID core driver
[ 1.233472] sun4i-codec 1c22c00.codec: ASoC: /soc/codec-analog@01c23000 not registered
[ 1.241524] sun4i-codec 1c22c00.codec: Failed to register our card
[ 1.250116] NET: Registered protocol family 17
[ 1.254686] Key type dns_resolver registered
[ 1.259232] Registering SWP/SWPB emulation handler
[ 1.270626] simple-framebuffer 43e89000.framebuffer: framebuffer at 0x43e89000, 0x177000 bytes, mapped to 0xc4400000
[ 1.281296] simple-framebuffer 43e89000.framebuffer: format=x8r8g8b8, mode=800x480x32, linelength=3200
[ 1.297597] Console: switching to colour frame buffer device 100x30
[ 1.310017] simple-framebuffer 43e89000.framebuffer: fb0: simplefb registered!
[ 1.318581] usb_phy_generic usb_phy_generic.0.auto: usb_phy_generic.0.auto supply vcc not found, using dummy regulator
[ 1.329994] musb-hdrc musb-hdrc.1.auto: MUSB HDRC host driver
[ 1.335761] musb-hdrc musb-hdrc.1.auto: new USB bus registered, assigned bus number 3
[ 1.345036] hub 3-0:1.0: USB hub found
[ 1.349018] hub 3-0:1.0: 1 port detected
[ 1.356912] sun4i-codec 1c22c00.codec: Codec <-> 1c22c00.codec mapping ok
[ 1.365424] sun6i-rtc 1c20400.rtc: setting system clock to 1970-01-01 00:02:37 UTC (157)
[ 1.373859] vcc5v0: disabling
[ 1.376896] ALSA device list:
[ 1.379863] #0: V3s Audio Codec
[ 1.386026] mmc1: queuing unknown CIS tuple 0x01 (3 bytes)
[ 1.391726] jffs2: Node at 0x00000fe0 with length 0x000000cd would run over the end of the erase block
[ 1.401111] jffs2: Perhaps the file system was created with the wrong erase size?
[ 1.408660] jffs2: jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x00000fe4: 0x00cd instead
踩完坑了,可以看看
https://whycan.com/t_8436.html
多谢,发现真的是好多坑
可以考虑进入uboot命令模式,看下bootcmd和bootargs这两个参数。
print bootcmd
print bootargs
或者printenv
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}i
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
bootargs=console=ttyS0,115200 earlyprintk panic=5 rootwait mtdparts=spi32766.0:1M(uboot)ro,64k(dtb)ro,4M(kernel)ro,-(rootfs) root=31:03 rw rootfstype=jffs2
bootcmd=sf probe 0; sf read 0x41800000 0x100000 0x10000; sf read 0x41000000 0x110000 0x400000; bootz 0x41000000 - 0x41800000
bootcmd_dhcp=run boot_net_usb_start; if dhcp ${scriptaddr} ${boot_script_dhcp}; then source ${scriptaddr}; fi;setenv efi_fdtfile ${fdtfile}; if test -z "${f;
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
bootm_size=0x2e00000
console=ttyS0,115200
cpu=armv7
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/
fdt_addr_r=0x41800000
fdtcontroladdr=43b572a8
fdtfile=sun8i-v3s-licheepi-zero.dtb
kernel_addr_r=0x41000000
load_efi_dtb=load ${devtype} ${devnum}:${distro_bootpart} ${fdt_addr_r} ${prefix}${efi_fdtfile}
mmc_boot=if mmc dev ${devnum}; then setenv devtype mmc; run scan_dev_for_boot_part; fi
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_s;
scan_dev_for_boot_part=part list ${devtype} ${devnum} -bootable devplist; env exists devplist || setenv devplist 1; for distro_bootpart in ${devplist}; do ie
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 prefe
scan_dev_for_extlinux=if test -e ${devtype} ${devnum}:${distro_bootpart} ${prefix}extlinux/extlinux.conf; then echo Found ${prefix}extlinux/extlinux.conf; ri
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 e
scriptaddr=0x41900000
serial#=12c00003ac5e36ca
soc=sunxi
stderr=serial@01c28000
stdin=serial@01c28000
stdout=serial@01c28000
usb_boot=usb start; if usb dev ${devnum}; then setenv devtype usb; run scan_dev_for_boot_part; fi
Environment size: 4295/32764 bytes
参考官方文档做flash:http://zero.lichee.pro/%E7%B3%BB%E7%BB%9F%E5%BC%80%E5%8F%91/SPI_flash_build.html#
启动时卡在了Starting kernel ,没有任何下文,等多久都没有用
U-Boot SPL 2017.01-rc2-00073-gdd6e874-dirty (Jun 30 2022 - 07:09:30)
DRAM: 64 MiB
Trying to boot from sunxi SPI
U-Boot 2017.01-rc2-00073-gdd6e874-dirty (Jun 30 2022 - 07:09:30 +0000) Allwinner Technology
CPU: Allwinner V3s (SUN8I 1681)
Model: Lichee Pi Zero
DRAM: 64 MiB
MMC: SUNXI SD/MMC: 0
SF: Detected w25q128bv with page size 256 Bytes, erase size 4 KiB, total 16 MiB
*** Warning - bad CRC, using default environment
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-00073-gdd6e874-dirty (Jun 30 2022 - 07:09:30 +0000) Allwinner Technology
CPU: Allwinner V3s (SUN8I 1681)
Model: Lichee Pi Zero
DRAM: 64 MiB
MMC: SUNXI SD/MMC: 0
SF: Detected w25q128bv with page size 256 Bytes, erase size 4 KiB, total 16 MiB
*** Warning - bad CRC, using default environment
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: No ethernet found.
starting USB...
No controllers found
Hit any key to stop autoboot: 0
SF: Detected w25q128bv with page size 256 Bytes, erase size 4 KiB, total 16 MiB
device 0 offset 0x100000, size 0x10000
SF: 65536 bytes @ 0x100000 Read: OK
device 0 offset 0x110000, size 0x400000
SF: 4194304 bytes @ 0x110000 Read: OK
## Flattened Device Tree blob at 41800000
Booting using the fdt blob at 0x41800000
Loading Device Tree to 42dfa000, end 42dffec2 ... OK
Starting kernel ...
页次: 1