页次: 1
https://whycan.cn/files/members/1935/QQ图片20191105195154.jpg
参数没问题的,启动log都显示出来了
我现在只在怀疑framebuffer的大小了
暂时还不知道在哪改,明天弄些图片刷刷再测试下
默认颜色R和B反了,我修改了: sys_config.fex中 lcd_rb_swap = 0(默认为 1);可以使RED和BLUE颜色交换
效果是:
有没有人用过usb0虚拟以太网,来代替网线,进行window和licheepi开发板共享文件????
# ifconfig -a
eth0 Link encap:Ethernet HWaddr 02:02:3E:D8:63:5E
BROADCAST MULTICAST MTU:1500 Metric:1
RX packets:0 errors:0 dropped:0 overruns:0 frame:0
TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:0 (0.0 B) TX bytes:0 (0.0 B)
Interrupt:38
lo Link encap:Local Loopback
inet addr:127.0.0.1 Mask:255.0.0.0
UP LOOPBACK RUNNING MTU:65536 Metric:1
RX packets:0 errors:0 dropped:0 overruns:0 frame:0
TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:0 (0.0 B) TX bytes:0 (0.0 B)
usb0 Link encap:Ethernet HWaddr 6A:6E:A8:9B:35:9B
BROADCAST MULTICAST MTU:1500 Metric:1
RX packets:0 errors:0 dropped:0 overruns:0 frame:0
TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:0 (0.0 B) TX bytes:0 (0.0 B)
wlan0 Link encap:Ethernet HWaddr 8C:18:D9:47:05:97
inet addr:192.168.1.11 Bcast:192.168.1.255 Mask:255.255.255.0
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:191 errors:0 dropped:192 overruns:0 frame:0
TX packets:6 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:19601 (19.1 KiB) TX bytes:1164 (1.1 KiB)
请问开启eth0后出现下面信息正常吗?
# ifconfig eth0 192.168.1.100
[ 3647.260168] Generic PHY stmmac-0:01: attached PHY driver [Generic PHY] (mii_bus:phy_addr=stmmac-0:01, irq=-1)
[ 3647.272133] dwmac-sun8i 1c30000.ethernet eth0: No MAC Management Counters available
[ 3647.279920] dwmac-sun8i 1c30000.ethernet eth0: PTP not supported by HW
# [ 3649.366434] dwmac-sun8i 1c30000.ethernet eth0: Link is Up - 100Mbps/Full - flow control rx/tx
【buildroot一键编译】是个好东西!
基于本文,实现一个荔枝派zero音乐MP3播放器(madplay)!
编译环境: VMware Workstation 15 Player + ubuntu-16.04.6-desktop-amd64
原料:buildroot-2018.08.02稳定版
1.获得buildroot源码:
wget https://buildroot.org/downloads/buildroot-2018.08.2.tar.gz
解压:
tar xvzf buildroot-2018.08.2.tar.gz
2.配置linux内核:
cd buildroot-2018.08.2
make menuconfig
Kernel --->
[*] Linux Kernel | |
| | *** Linux kernel in thumb mode may be broken with binutils >= 2.29 *** | |
| | Kernel version (Custom Git repository) ---> | |
| | (https://github.com/Lichee-Pi/linux.git) URL of custom repository | |
| | (zero-4.13.y) Custom repository version | |
| | () Custom kernel patches | |
| | Kernel configuration (Use the architecture default configuration) ---> | |
(注:使用自定义config,即使用根目录.config, 因为要在内核添加减少东西)
Kernel configuration (Use the architecture default configuration)
所以上面这个配置与楼主稍有不同
3. 配置Uboot:
(与楼主一样配置)
4. 配置toolchain:
C library (glibc)
(其余与楼主一样配置)
5. 配置 System configuration:
System configuration --->
Root FS skeleton (default target skeleton) ---> | |
| | (buildroot) System hostname | |
| | (Welcome to Buildroot) System banner | |
| | Passwords encoding (md5) ---> | |
| | Init system (BusyBox) ---> | |
| | /dev management (Dynamic using devtmpfs + mdev) ---> | |
| | (system/device_table.txt) Path to the permission tables | |
| | [ ] support extended attributes in device tables | |
| | [ ] Use symlinks to /usr for /bin, /sbin and /lib | |
| | [*] Enable root login with password | |
| | () Root password | |
| | /bin/sh (busybox' default shell) ---> | |
| | [*] Run a getty (login prompt) after boot ---> | |
6. 配置 Target packages:
--- Audio and video applications
[*] alsa-utils ---> | |
| | [*] madplay | |
6. 编译buildroot:
output/images/目录会下生成:rootfs.tar sun8i-v3s-licheepi-zero.dtb zImage
配置和编译内核时,要注意的是:
(此时在 buildroot-2018.08.2/output/build/linux-zero-4.13.y/ 目录下)
【坑】:千万不要在这个内核源码根目录中直接使用:make menuconfig !!! 因为这样会改变.config 里面东西,导致生成的zImage无法启动。
【解决方法】:
我目前做法是,使用buildroot的工具链的同时,也配置一个外部交叉编译工具链gcc-linaro-6.3.1-2017.02-x86_64_arm-linux-gnueabihf,然后 使用 make ARCH=arm menuconfig:
修改了设备树文件dts后,编译buildroot,发现无法生成dtb文件,要注意的是:
删除 kernel源码目录下 .stamp* 文件(时间短,行不行看实际情况),或者直接make clean(时间长,但相对可靠)。
7. 烧录SD卡,启动,登录串口终端OK后,
直接用: madplay *.mp3 发现耳机无声音,
需要首先设置: amixer -c 0 sset 'Headphone',0 50% unmute
然后madplay *.mp3 就可以播放音乐了!
播放串口控制台效果如下,音乐?脑补
# mount /dev/sda1 /mnt
[ 6125.335919] FAT-fs (sda1): Volume was not properly unmounted. Some data may be corrupt. Please run fsck.
# cd /mnt/
# amixer -c 0 sset 'Headphone',0 50% unmute
Simple mixer control 'Headphone',0
Capabilities: pvolume pvolume-joined pswitch
Playback channels: Front Left - Front Right
Limits: Playback 0 - 63
Mono:
Front Left: Playback 32 [51%] [-31.00dB] [on]
Front Right: Playback 32 [51%] [-31.00dB] [on]
# madplay *.mp3
MPEG Audio Decoder 0.15.2 (beta) - Copyright (C) 2000-2004 Robert Leslie et al.
>> ??,??? - ??????.mp3
Title: 贩贩贩
Artist: 贩/贩
Album: 贩 贩贩
Track: 2
Comment: 163 key(Don't
modify):L64FU3W4YxX3ZFTmbZ+8/RcZFBSDF9Ipjmo8Xpgi3ObZ4OvvUWVFWQsm6HXGw6VhW5mtRmGvRfv0h0eLFjkv6ebgfYb7usutJX3mH1QAwm2pzqkns/hDFSJjERsY0+Ax4AXwPfrqvJbsyajUvhAkJLpZ0a08iI2Ugqwz7QwPh1LW+dMLcYJdnBu7MWv2cOnrruhL91oRpejzoIIB8pEwLbcbd5f6ptYSo6GbuEOV96END56Ut+xRCsb2LssL/Worxe4Jfb3dBnZJF1jod/6k9DGHT4wXDAp8sqiV33/JLWE3bT61oK8+Lj+31xdv22mP3ouhs7TiMvJf8oOL0vAjIbiNyJ4BwRATJUe4XMISA9BDJFJbc5Mm7zJZq5vBnFs5ww9K3mSeMCV/a2W7utVrEm6gZgAeBQTPZBMRsIjEwhqrZje6R8PPJuR8/6cHfbdFai/Gw/0y6DY3Hg8QhIoWwvFcvPO5rbdND3tjEJw523lgR2uT9JqLgLIWZ/ISiryZX6lnv4T8xJcOVAl/vfjM/RyreeNz1R7DHoE6w6YENbWaBrXCSZiQ/T/zS27TmKTAx1LTOEPZPrW8tAXCYG07UemFEQAcokR0OgiObb7cc0I=
为什么我没有 /dev/mtdblock4 文件生成?
U-Boot 2017.01-rc2-gdd6e874-dirty (May 07 2020 - 16:51:38 +0800) 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
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 42dffc30 ... OK
Starting kernel ...
[ 0.000000] Booting Linux on physical CPU 0x0
[ 0.000000] Linux version 4.13.16-licheepi-zero+ (root@wyj-virtual-machine) (gcc version 6.3.1 20170109 (Linaro GCC 6.3-2017.02)) #7 SMP Thu May 7 17:24:25 CST 2020
[ 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 16 pages/cpu @c3f5f000 s33868 r8192 d23476 u65536
[ 0.000000] Built 1 zonelists in Zone order, mobility grouping on. Total pages: 16256
[ 0.000000] Kernel command line: console=ttyS0,115200 earlyprintk panic=5 rootwait mtdparts=spi32766.0:1M(uboot)ro,64k(dtb)ro,4M(kernel)ro,8M(rootfs) -(data) root=31:03 rw rootfstype=squashfs
[ 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: 55092K/65536K available (6144K kernel code, 218K rwdata, 1476K rodata, 1024K init, 264K bss, 10444K 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 : 0xc4800000 - 0xff800000 ( 944 MB)
[ 0.000000] lowmem : 0xc0000000 - 0xc4000000 ( 64 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 - 0xc0a36b00 ( 219 kB)
[ 0.000000] .bss : 0xc0a3dc28 - 0xc0a7fdec ( 265 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.000175] clocksource: timer: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 79635851949 ns
[ 0.000402] Console: colour dummy device 80x30
[ 0.000436] Calibrating delay loop (skipped), value calculated using timer frequency.. 48.00 BogoMIPS (lpj=240000)
[ 0.000450] pid_max: default: 32768 minimum: 301
[ 0.000578] Mount-cache hash table entries: 1024 (order: 0, 4096 bytes)
[ 0.000591] Mountpoint-cache hash table entries: 1024 (order: 0, 4096 bytes)
[ 0.001183] CPU: Testing write buffer coherency: ok
[ 0.001552] /cpus/cpu@0 missing clock-frequency property
[ 0.001576] CPU0: thread -1, cpu 0, socket 0, mpidr 80000000
[ 0.002006] Setting up static identity map for 0x40100000 - 0x40100060
[ 0.002182] Hierarchical SRCU implementation.
[ 0.002690] smp: Bringing up secondary CPUs ...
[ 0.002705] smp: Brought up 1 node, 1 CPU
[ 0.002714] SMP: Total of 1 processors activated (48.00 BogoMIPS).
[ 0.002721] CPU: All CPU(s) started in SVC mode.
[ 0.003466] devtmpfs: initialized
[ 0.006443] VFP support v0.3: implementor 41 architecture 2 part 30 variant 7 rev 5
[ 0.006718] clocksource: jiffies: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 19112604462750000 ns
[ 0.006747] futex hash table entries: 256 (order: 2, 16384 bytes)
[ 0.006912] pinctrl core: initialized pinctrl subsystem
[ 0.007789] random: get_random_u32 called from bucket_table_alloc+0xf4/0x244 with crng_init=0
[ 0.007920] NET: Registered protocol family 16
[ 0.008386] DMA: preallocated 256 KiB pool for atomic coherent allocations
[ 0.009516] hw-breakpoint: found 5 (+1 reserved) breakpoint and 4 watchpoint registers.
[ 0.009530] hw-breakpoint: maximum watchpoint size is 8 bytes.
[ 0.022329] SCSI subsystem initialized
[ 0.022637] usbcore: registered new interface driver usbfs
[ 0.022707] usbcore: registered new interface driver hub
[ 0.022802] usbcore: registered new device driver usb
[ 0.023032] pps_core: LinuxPPS API ver. 1 registered
[ 0.023043] pps_core: Software ver. 5.3.6 - Copyright 2005-2007 Rodolfo Giometti <giometti@linux.it>
[ 0.023065] PTP clock support registered
[ 0.023298] Advanced Linux Sound Architecture Driver Initialized.
[ 0.025094] clocksource: Switched to clocksource arch_sys_counter
[ 0.035478] NET: Registered protocol family 2
[ 0.036063] TCP established hash table entries: 1024 (order: 0, 4096 bytes)
[ 0.036098] TCP bind hash table entries: 1024 (order: 1, 8192 bytes)
[ 0.036120] TCP: Hash tables configured (established 1024 bind 1024)
[ 0.036239] UDP hash table entries: 256 (order: 1, 8192 bytes)
[ 0.036287] UDP-Lite hash table entries: 256 (order: 1, 8192 bytes)
[ 0.036501] NET: Registered protocol family 1
[ 0.037074] RPC: Registered named UNIX socket transport module.
[ 0.037094] RPC: Registered udp transport module.
[ 0.037100] RPC: Registered tcp transport module.
[ 0.037106] RPC: Registered tcp NFSv4.1 backchannel transport module.
[ 0.039164] workingset: timestamp_bits=30 max_order=14 bucket_order=0
[ 0.047143] squashfs: version 4.0 (2009/01/31) Phillip Lougher
[ 0.048275] NFS: Registering the id_resolver key type
[ 0.048321] Key type id_resolver registered
[ 0.048329] Key type id_legacy registered
[ 0.048378] jffs2: version 2.2. (NAND) (SUMMARY) 漏 2001-2006 Red Hat, Inc.
[ 0.050088] random: fast init done
[ 0.052964] Block layer SCSI generic (bsg) driver version 0.4 loaded (major 249)
[ 0.052984] io scheduler noop registered
[ 0.052991] io scheduler deadline registered
[ 0.053254] io scheduler cfq registered (default)
[ 0.053265] io scheduler mq-deadline registered
[ 0.053272] io scheduler kyber registered
[ 0.057513] sun8i-v3s-pinctrl 1c20800.pinctrl: initialized sunXi PIO driver
[ 0.127659] Serial: 8250/16550 driver, 8 ports, IRQ sharing disabled
[ 0.130932] console [ttyS0] disabled
[ 0.151204] 1c28000.serial: ttyS0 at MMIO 0x1c28000 (irq = 33, base_baud = 1500000) is a U6_16550A
[ 0.748126] console [ttyS0] enabled
[ 0.755890] m25p80 spi32766.0: w25q128 (16384 Kbytes)
[ 0.760976] spi32766.0: parser cmdlinepart: 4
[ 0.765404] 4 cmdlinepart partitions found on MTD device spi32766.0
[ 0.771664] Creating 4 MTD partitions on "spi32766.0":
[ 0.776827] 0x000000000000-0x000000100000 : "uboot"
[ 0.783064] 0x000000100000-0x000000110000 : "dtb"
[ 0.789095] 0x000000110000-0x000000510000 : "kernel"
[ 0.795329] 0x000000510000-0x000000d10000 : "rootfs"
[ 0.801974] libphy: Fixed MDIO Bus: probed
[ 0.806573] ehci_hcd: USB 2.0 'Enhanced' Host Controller (EHCI) Driver
[ 0.813102] ehci-platform: EHCI generic platform driver
[ 0.818662] ehci-platform 1c1a000.usb: EHCI Host Controller
[ 0.824282] ehci-platform 1c1a000.usb: new USB bus registered, assigned bus number 1
[ 0.832242] ehci-platform 1c1a000.usb: irq 25, io mem 0x01c1a000
[ 0.865129] ehci-platform 1c1a000.usb: USB 2.0 started, EHCI 1.00
[ 0.872413] hub 1-0:1.0: USB hub found
[ 0.876354] hub 1-0:1.0: 1 port detected
[ 0.880793] ohci_hcd: USB 1.1 'Open' Host Controller (OHCI) Driver
[ 0.887087] ohci-platform: OHCI generic platform driver
[ 0.892619] ohci-platform 1c1a400.usb: Generic Platform OHCI controller
[ 0.899361] ohci-platform 1c1a400.usb: new USB bus registered, assigned bus number 2
[ 0.907289] ohci-platform 1c1a400.usb: irq 26, io mem 0x01c1a400
[ 0.980099] hub 2-0:1.0: USB hub found
[ 0.983918] hub 2-0:1.0: 1 port detected
[ 0.991458] udc-core: couldn't find an available UDC - added [g_cdc] to list of pending drivers
[ 1.001174] sun6i-rtc 1c20400.rtc: rtc core: registered rtc-sun6i as rtc0
[ 1.008071] sun6i-rtc 1c20400.rtc: RTC enabled
[ 1.012608] i2c /dev entries driver
[ 1.017496] input: ns2009_ts as /devices/platform/soc/1c2ac00.i2c/i2c-0/0-0048/input/input0
[ 1.026990] sunxi-wdt 1c20ca0.watchdog: Watchdog enabled (timeout=16 sec, nowayout=0)
[ 1.095333] sunxi-mmc 1c0f000.mmc: base:0xc48c2000 irq:23
[ 1.102247] usbcore: registered new interface driver usbhid
[ 1.107918] usbhid: USB HID core driver
[ 1.113547] NET: Registered protocol family 17
[ 1.118221] Key type dns_resolver registered
[ 1.122661] Registering SWP/SWPB emulation handler
[ 1.136562] usb_phy_generic usb_phy_generic.0.auto: usb_phy_generic.0.auto supply vcc not found, using dummy regulator
[ 1.147950] musb-hdrc musb-hdrc.1.auto: MUSB HDRC host driver
[ 1.153717] musb-hdrc musb-hdrc.1.auto: new USB bus registered, assigned bus number 3
[ 1.162925] hub 3-0:1.0: USB hub found
[ 1.166911] hub 3-0:1.0: 1 port detected
[ 1.172061] using random self ethernet address
[ 1.176638] using random host ethernet address
[ 1.182139] usb0: HOST MAC 2a:2c:0b:f7:61:88
[ 1.186600] usb0: MAC aa:a1:b7:35:c9:e7
[ 1.190507] g_cdc gadget: CDC Composite Gadget, version: King Kamehameha Day 2008
[ 1.198033] g_cdc gadget: g_cdc ready
[ 1.201999] sun6i-rtc 1c20400.rtc: setting system clock to 1970-01-01 05:30:15 UTC (19815)
[ 1.210549] vcc3v0: disabling
[ 1.213526] vcc5v0: disabling
[ 1.216541] ALSA device list:
[ 1.219508] No soundcards found.
[ 1.228598] VFS: Mounted root (squashfs filesystem) readonly on device 31:3.
[ 1.238461] devtmpfs: mounted
[ 1.242617] Freeing unused kernel memory: 1024K
[ 1.311131] random: crng init done
Starting syslogd: OK
Starting klogd: OK
Running sysctl: OK
Saving random seed: SKIP (read-only file system detected)
Starting network: OK
Welcome to Buildroot
buildroot login:
请问启动log中含有警告:“*** Warning - bad CRC, using default environment” 是说明哪里有问题?
我截取自己串口终端的log:
U-Boot SPL 2017.01-rc2-gdd6e874-dirty (Apr 29 2020 - 21:28:33)
DRAM: 64 MiB
Trying to boot from sunxi SPI
U-Boot 2017.01-rc2-gdd6e874-dirty (Apr 29 2020 - 21:28:33 +0800) 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
In: serial@01c28000
Out: serial@01c28000
Err: serial@01c28000
U-Boot 2017.01-rc2-gdd6e874-dirty (Apr 29 2020 - 21:28:33 +0800) 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
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 42dffc30 ... OK
Starting kernel ...
页次: 1