荔枝派zero核心板pdf:
https://whycan.cn/files/20171005/11/lichee_zero(核心板).pdf
荔枝派zero底板pdf:
https://whycan.cn/files/20171005/11/lichee_base(底板).pdf
二代一体开发板: 荔枝派一体开发板原理图(核心板与底板整合到一块).pdf
全志V3s手册V1.0: Allwinner_V3s_Datasheet_V1.0.pdf
全志S3手册V0.2: Allwinner_S3_Datasheet_V0_2.pdf (索智S3手册)
-------------------------------------------------------------------------------------------
回顾: 【视频分享】制作荔枝派Zero开发板(全志V3s) TF/SD卡启动盘
1. 准备工作
1) 安装Ubuntu14.04LTS(长支持版本),如果用虚拟机请安装vmware14(别的虚拟机都不推荐,泪的教训), 然后安装 vmware tools(不是必须,但是方便文件共享)
2) 安装arm linux 硬件浮点数工具链, 因为V3s支持VFPv4 浮点单元: sudo apt-get install gcc-arm-linux-gnueabihf
3) 安装git源码管理软件: sudo apt-get install git
4) 其他支撑软件
2. u-boot
首先获取u-boot源码: git clone https://github.com/Lichee-Pi/u-boot.git -b v3s-current
如果你需要支持spi flash: git clone https://github.com/Lichee-Pi/u-boot.git -b v3s-spi-experimental
修改 include/configs/sun8i.h, 使u-boot可以直接从tf卡启动:
#define CONFIG_BOOTCOMMAND "setenv bootm_boot_mode sec; " \
"load mmc 0:1 0x41000000 zImage; " \
"load mmc 0:1 0x41800000 sun8i-v3s-licheepi-zero-dock.dtb; " \
"bootz 0x41000000 - 0x41800000;"#define CONFIG_BOOTARGS "console=ttyS0,115200 panic=5 rootwait root=/dev/mmcblk0p2 earlyprintk rw vt.global_cursor_default=0"
cd u-boot
ARCH=arm CROSS_COMPILE=arm-linux-gnueabihf- make LicheePi_Zero_800x480LCD_defconfig (群主网店5寸屏)ARCH=arm CROSS_COMPILE=arm-linux-gnueabihf- make LicheePi_Zero_480x272LCD_defconfig (通用4.3寸屏)
ARCH=arm CROSS_COMPILE=arm-linux-gnueabihf- make LicheePi_Zero_defconfig (默认)
ARCH=arm make menuconfig
执行编译:
ARCH=arm CROSS_COMPILE=arm-linux-gnueabihf- make多核编译,避免cpu其他内核打酱油, J后的参数是参与编译的cpu个数:
ARCH=arm CROSS_COMPILE=arm-linux-gnueabihf- make -j3
3. 设备树, Linux
获取Linux源码(zero-4.13.y分支对网卡支持比较好): git clone https://github.com/Lichee-Pi/linux.git -b zero-4.13.y
生成荔枝派Zero 默认配置文件: CROSS_COMPILE=arm-linux-gnueabihf- ARCH=arm make licheepi_zero_defconfig
设备树文件(默认不需要修改): arch/arm/boot/dts/sun8i-v3s-licheepi-zero.dts
编译内核: make ARCH=arm CROSS_COMPILE=arm-linux-gnueabihf- -j4
编译设备树: make ARCH=arm CROSS_COMPILE=arm-linux-gnueabihf- dtbs
4. 根文件系统
1). 下载最新的buildroot稳定版本
官方网站: https://buildroot.org/download.html
长支持版本:buildroot-2017.02.7.tar.gz
最新稳定版:buildroot-2017.08.1.tar.gz
2). 配置buildroot 参数, make menuconfig; make
如果不会配置, 就下载下面这个文件,然后把 buildroot-v3s-20171122.zip解压后 拷贝到 buidroot目录成 .config 文件。
3). 执行编译, 生成文件跟文件系统。
4). 如需构建Qt应用程序, 视频地址: buildroot成功后如何编译Qt应用程序
5. 烧录TF卡启动盘: 【视频分享】制作荔枝派Zero开发板(全志V3s) TF/SD卡启动盘
1) 删除TF卡所有分区
2) 将uboot写入到sd卡8k偏移处(必须8K偏移, brom龟腚的)。
sudo dd if=u-boot-sunxi-with-spl.bin of=/dev/sdX bs=1024 seek=8
3) 建立第一个分区,大小32M(可以随意填写), 格式FAT16, 把zImage, sun8i-v3s-licheepi-zero-dock.dtb拷贝到 这个分区
4) 建立第二个分区,用尽剩余空间,格式ext4, 把buildroot产生的rootfs.tar解压到该分区根目录
tar xvf output/images/rootfs.tar -C /挂载的tf卡第二个分区目录
这是我编译好的uboot, linux&dtb, rootfs: V3s_TFCard.7z
荔枝派Zero开发板网卡验证通过, 登陆账号root,无密码。
sha1sum文件校验码: 43c635802438e26c8fe96ada66255b664d52cddd
离线
U-Boot 2017.01-rc2-00071-gf03c1f5-dirty (Nov 18 2017 - 22:15:31 +0800) Allwinner Technology
CPU: Allwinner V3s (SUN8I 1681)
Model: Lichee Pi Zero
DRAM: 64 MiB
MMC: SUNXI SD/MMC: 0
SF: Detected w25q256 with page size 256 Bytes, erase size 4 KiB, total 32 MiB
SF: Warning - Only lower 16MiB accessible, Full access #define CONFIG_SPI_FLASH_BAR
*** 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
reading zImage
3898688 bytes read in 621 ms (6 MiB/s)
reading sun8i-v3s-licheepi-zero-dock.dtb
11931 bytes read in 28 ms (416 KiB/s)
## Flattened Device Tree blob at 41800000
Booting using the fdt blob at 0x41800000
Loading Device Tree to 42dfa000, end 42dffe9a ... OK
Starting kernel ...
[ 0.000000] Booting Linux on physical CPU 0x0
[ 0.000000] Linux version 4.13.0-licheepi-zero+ (hexing@ubuntu) (gcc version 4.8.4 (Ubuntu/Linaro 4.8.4-2ubuntu1~14.04.1)) #35 SMP Sat Nov 18 22:21:37 CST 2017
[ 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 s33920 r8192 d23424 u65536
[ 0.000000] Built 1 zonelists in Zone order, mobility grouping on. Total pages: 15883
[ 0.000000] Kernel command line: console=ttyS0,115200 panic=5 rootwait mtdparts=spi32766.0:1M(uboot)ro,64k(dtb)ro,6M(kernel)ro,-(rootfs) root=/dev/mmcblk0p2 earlyprintk rw
[ 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: 53580K/64036K available (6144K kernel code, 217K rwdata, 1432K rodata, 1024K init, 262K bss, 10456K 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 - 0xc0a367c0 ( 218 kB)
[ 0.000000] .bss : 0xc0a3d874 - 0xc0a7f1bc ( 263 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.000007] sched_clock: 56 bits at 24MHz, resolution 41ns, wraps every 4398046511097ns
[ 0.000018] Switching to timer-based delay loop, resolution 41ns
[ 0.000187] clocksource: timer: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 79635851949 ns
[ 0.000417] Console: colour dummy device 80x30
[ 0.000454] Calibrating delay loop (skipped), value calculated using timer frequency.. 48.00 BogoMIPS (lpj=240000)
[ 0.000470] 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.001204] CPU: Testing write buffer coherency: ok
[ 0.001578] /cpus/cpu@0 missing clock-frequency property
[ 0.001604] CPU0: thread -1, cpu 0, socket 0, mpidr 80000000
[ 0.002044] Setting up static identity map for 0x40100000 - 0x40100060
[ 0.002219] Hierarchical SRCU implementation.
[ 0.002703] smp: Bringing up secondary CPUs ...
[ 0.002720] smp: Brought up 1 node, 1 CPU
[ 0.002730] SMP: Total of 1 processors activated (48.00 BogoMIPS).
[ 0.002737] CPU: All CPU(s) started in SVC mode.
[ 0.003505] devtmpfs: initialized
[ 0.006733] VFP support v0.3: implementor 41 architecture 2 part 30 variant 7 rev 5
[ 0.007030] clocksource: jiffies: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 19112604462750000 ns
[ 0.007058] futex hash table entries: 256 (order: 2, 16384 bytes)
[ 0.007230] pinctrl core: initialized pinctrl subsystem
[ 0.008093] random: get_random_u32 called from bucket_table_alloc+0xf0/0x250 with crng_init=0
[ 0.008234] NET: Registered protocol family 16
[ 0.008703] DMA: preallocated 256 KiB pool for atomic coherent allocations
[ 0.009842] hw-breakpoint: found 5 (+1 reserved) breakpoint and 4 watchpoint registers.
[ 0.009861] hw-breakpoint: maximum watchpoint size is 8 bytes.
[ 0.023902] SCSI subsystem initialized
[ 0.024221] usbcore: registered new interface driver usbfs
[ 0.024290] usbcore: registered new interface driver hub
[ 0.024388] usbcore: registered new device driver usb
[ 0.024653] pps_core: LinuxPPS API ver. 1 registered
[ 0.024667] pps_core: Software ver. 5.3.6 - Copyright 2005-2007 Rodolfo Giometti <giometti@linux.it>
[ 0.024691] PTP clock support registered
[ 0.024931] Advanced Linux Sound Architecture Driver Initialized.
[ 0.026779] clocksource: Switched to clocksource arch_sys_counter
[ 0.037466] NET: Registered protocol family 2
[ 0.038055] TCP established hash table entries: 1024 (order: 0, 4096 bytes)
[ 0.038091] TCP bind hash table entries: 1024 (order: 1, 8192 bytes)
[ 0.038114] TCP: Hash tables configured (established 1024 bind 1024)
[ 0.038250] UDP hash table entries: 256 (order: 1, 8192 bytes)
[ 0.038299] UDP-Lite hash table entries: 256 (order: 1, 8192 bytes)
[ 0.038527] NET: Registered protocol family 1
[ 0.039133] RPC: Registered named UNIX socket transport module.
[ 0.039156] RPC: Registered udp transport module.
[ 0.039162] RPC: Registered tcp transport module.
[ 0.039167] RPC: Registered tcp NFSv4.1 backchannel transport module.
[ 0.041054] workingset: timestamp_bits=30 max_order=14 bucket_order=0
[ 0.050094] NFS: Registering the id_resolver key type
[ 0.050156] Key type id_resolver registered
[ 0.050164] Key type id_legacy registered
[ 0.051175] random: fast init done
[ 0.053944] Block layer SCSI generic (bsg) driver version 0.4 loaded (major 249)
[ 0.053969] io scheduler noop registered
[ 0.053977] io scheduler deadline registered
[ 0.054238] io scheduler cfq registered (default)
[ 0.054250] io scheduler mq-deadline registered
[ 0.054257] io scheduler kyber registered
[ 0.058737] sun8i-v3s-pinctrl 1c20800.pinctrl: initialized sunXi PIO driver
[ 0.126666] Serial: 8250/16550 driver, 8 ports, IRQ sharing disabled
[ 0.130091] console [ttyS0] disabled
[ 0.150367] 1c28000.serial: ttyS0 at MMIO 0x1c28000 (irq = 36, base_baud = 1500000) is a U6_16550A
[ 0.733086] console [ttyS0] enabled
[ 0.758199] 1c28400.serial: ttyS1 at MMIO 0x1c28400 (irq = 37, base_baud = 1500000) is a U6_16550A
[ 0.788741] 1c28800.serial: ttyS2 at MMIO 0x1c28800 (irq = 38, base_baud = 1500000) is a U6_16550A
[ 0.802399] m25p80 spi32766.0: w25q256 (32768 Kbytes)
[ 0.807603] 4 cmdlinepart partitions found on MTD device spi32766.0
[ 0.813863] Creating 4 MTD partitions on "spi32766.0":
[ 0.819040] 0x000000000000-0x000000100000 : "uboot"
[ 0.824545] 0x000000100000-0x000000110000 : "dtb"
[ 0.829815] 0x000000110000-0x000000710000 : "kernel"
[ 0.835152] 0x000000710000-0x000002000000 : "rootfs"
[ 0.840987] libphy: Fixed MDIO Bus: probed
[ 0.845629] dwmac-sun8i 1c30000.ethernet: PTP uses main clock
[ 0.851525] dwmac-sun8i 1c30000.ethernet: No regulator found
[ 0.857266] dwmac-sun8i 1c30000.ethernet: Will use internal PHY
[ 0.863418] dwmac-sun8i 1c30000.ethernet: Chain mode enabled
[ 0.869119] dwmac-sun8i 1c30000.ethernet: No HW DMA feature register supported
[ 0.876334] dwmac-sun8i 1c30000.ethernet: Normal descriptors
[ 0.882000] dwmac-sun8i 1c30000.ethernet: RX Checksum Offload Engine supported
[ 0.889225] dwmac-sun8i 1c30000.ethernet: COE Type 2
[ 0.894184] dwmac-sun8i 1c30000.ethernet: TX Checksum insertion supported
[ 0.901160] libphy: stmmac: probed
[ 0.906501] ehci_hcd: USB 2.0 'Enhanced' Host Controller (EHCI) Driver
[ 0.913168] ehci-platform: EHCI generic platform driver
[ 0.918715] ehci-platform 1c1a000.usb: EHCI Host Controller
[ 0.924329] ehci-platform 1c1a000.usb: new USB bus registered, assigned bus number 1
[ 0.932305] ehci-platform 1c1a000.usb: irq 26, io mem 0x01c1a000
[ 0.966800] ehci-platform 1c1a000.usb: USB 2.0 started, EHCI 1.00
[ 0.974049] hub 1-0:1.0: USB hub found
[ 0.977995] hub 1-0:1.0: 1 port detected
[ 0.982545] ohci_hcd: USB 1.1 'Open' Host Controller (OHCI) Driver
[ 0.988852] ohci-platform: OHCI generic platform driver
[ 0.994425] ohci-platform 1c1a400.usb: Generic Platform OHCI controller
[ 1.001157] ohci-platform 1c1a400.usb: new USB bus registered, assigned bus number 2
[ 1.009114] ohci-platform 1c1a400.usb: irq 27, io mem 0x01c1a400
[ 1.081939] hub 2-0:1.0: USB hub found
[ 1.085759] hub 2-0:1.0: 1 port detected
[ 1.093423] udc-core: couldn't find an available UDC - added [g_cdc] to list of pending drivers
[ 1.103057] input: 1c22800.lradc as /devices/platform/soc/1c22800.lradc/input/input0
[ 1.111989] sun6i-rtc 1c20400.rtc: rtc core: registered rtc-sun6i as rtc0
[ 1.118894] sun6i-rtc 1c20400.rtc: RTC enabled
[ 1.123445] i2c /dev entries driver
[ 1.128364] input: ns2009_ts as /devices/platform/soc/1c2ac00.i2c/i2c-0/0-0048/input/input1
[ 1.137888] sunxi-wdt 1c20ca0.watchdog: Watchdog enabled (timeout=16 sec, nowayout=0)
[ 1.206827] sunxi-mmc 1c0f000.mmc: base:0xc41fe000 irq:23
[ 1.253909] mmc0: host does not support reading read-only switch, assuming write-enable
[ 1.263906] mmc0: new high speed SD card at address b368
[ 1.269784] sunxi-mmc 1c10000.mmc: base:0xc4303000 irq:24
[ 1.276198] usbcore: registered new interface driver usbhid
[ 1.281865] usbhid: USB HID core driver
[ 1.286452] mmcblk0: mmc0:b368 FFFFF 1.85 GiB
[ 1.293142] sun4i-codec 1c22c00.codec: ASoC: /soc/codec-analog@01c23000 not registered
[ 1.301196] sun4i-codec 1c22c00.codec: Failed to register our card
[ 1.307701] mmcblk0: p1 p2
[ 1.315808] NET: Registered protocol family 17
[ 1.320502] Key type dns_resolver registered
[ 1.324909] Registering SWP/SWPB emulation handler
[ 1.334192] simple-framebuffer 43e89000.framebuffer: framebuffer at 0x43e89000, 0x177000 bytes, mapped to 0xc4380000
[ 1.344903] simple-framebuffer 43e89000.framebuffer: format=x8r8g8b8, mode=800x480x32, linelength=3200
[ 1.361252] Console: switching to colour frame buffer device 100x30
[ 1.373677] simple-framebuffer 43e89000.framebuffer: fb0: simplefb registered!
[ 1.382270] usb_phy_generic usb_phy_generic.0.auto: usb_phy_generic.0.auto supply vcc not found, using dummy regulator
[ 1.393669] musb-hdrc musb-hdrc.1.auto: MUSB HDRC host driver
[ 1.399513] musb-hdrc musb-hdrc.1.auto: new USB bus registered, assigned bus number 3
[ 1.408694] hub 3-0:1.0: USB hub found
[ 1.412562] hub 3-0:1.0: 1 port detected
[ 1.417910] using random self ethernet address
[ 1.422406] using random host ethernet address
[ 1.429079] usb0: HOST MAC ea:2e:b5:37:94:39
[ 1.433399] usb0: MAC ea:73:b4:e9:b1:97
[ 1.437391] g_cdc gadget: CDC Composite Gadget, version: King Kamehameha Day 2008
[ 1.444869] g_cdc gadget: g_cdc ready
[ 1.451183] sun4i-codec 1c22c00.codec: Codec <-> 1c22c00.codec mapping ok
[ 1.459688] sun6i-rtc 1c20400.rtc: setting system clock to 1970-01-01 00:00:11 UTC (11)
[ 1.468021] vcc5v0: disabling
[ 1.470997] ALSA device list:
[ 1.473961] #0: V3s Audio Codec
[ 1.479412] EXT4-fs (mmcblk0p2): couldn't mount as ext3 due to feature incompatibilities
[ 1.488737] EXT4-fs (mmcblk0p2): couldn't mount as ext2 due to feature incompatibilities
[ 1.744749] EXT4-fs (mmcblk0p2): recovery complete
[ 1.752584] EXT4-fs (mmcblk0p2): mounted filesystem with ordered data mode. Opts: (null)
[ 1.760827] VFS: Mounted root (ext4 filesystem) on device 179:2.
[ 1.769205] devtmpfs: mounted
[ 1.773355] Freeing unused kernel memory: 1024K
[ 1.924658] EXT4-fs (mmcblk0p2): re-mounted. Opts: data=ordered
Starting logging: OK
Initializing random number generator... done.
Starting network: OK
Welcome to Buildroot
buildroot login:
我的TF启动是这样的,
你看下第二个分区有没有 /dev/null, /dev/consle的设备?
离线
tar 解压缩到tf卡分区完成之后执行一次 sync再拔卡,
看下第二个分区下面的文件是否都完整, 目录结构是否正确,
看下 /sbin/init, /bin/busybox 这些文件是否都存在,
上面都试过不行的话就换张卡试一试。
离线
buildroot的默认账号是root, 密码是空,
配置的话在buildroot menuconfig里面可能可以配置,
如果不行的话, 在V3s 的Linux终端执行 passwd,
重设root密码.
如果觉得登陆对话框碍事, 看看这个 我用buildroot产生的rootfs,每次启动都要登录,有什么办法可以去掉这个登录吗?
离线
但是lcd上出现了用户登陆提示,这种情况你把 uboot,设备树, Linux都用我上面写的。
log跑屏幕上去这个是在哪里配置的,我现在还没找到,如果你找到麻烦跟帖一下。
离线
@沉鱼 楼主,你编译好的linux&dtb,是直接下载下来的主线内核没有修改过的吗?
是的,就是4.13-y 原味的。
离线