您尚未登录。

楼主 #1 2018-11-09 12:26:20

checkout
会员
注册时间: 2018-11-09
已发帖子: 173
积分: 168

licheepi_zero开发板 buildroot配置 一键编译

开贴记录配置最新buildroot-2018.08.使用buildroot自带工具链一键编译生成uboot,kernel,dtb和rootfs.
最新稳定版buildroot下载:buildroot-2018.08.02稳定版
我配置好的config文件:配置好的.config

最近编辑记录 checkout (2018-11-09 12:27:16)

离线

楼主 #3 2018-11-09 13:47:35

checkout
会员
注册时间: 2018-11-09
已发帖子: 173
积分: 168

Re: licheepi_zero开发板 buildroot配置 一键编译

本人的开发环境是vmware workstation 15 pro+ubuntu 16.04_x64
参照沉鱼的帖子荔枝派Zero V3s开发板入坑记录 (TF/SD卡启动)(主线Linux,主线u-boot)
做如下配置:
1.target options配置
target_options.jpg
2.kernel配置
    使用licheepi官方git代码库linux-4.13.y分支
    使用licheepi_zero_deconfig配置(可在内核文件夹arch/arm/configs/下找到)
    使用sun8i-v3s-licheepi-zero.dts,生成dtb(可在内核文件夹arch/arm/boot/dts/下找到)
kernel.jpg
3.uboot配置
    使用Kconfig构建(新版本都是使用Kconfig)
    使用licheepi官方git代码库ubootuboot v3s-spi-experimental分支
    使用licheepi官方uboot里面的LicheePi_Zero_defconfig
bootloader.jpg
4.Toolchain配置
    使用buildroot工具链
    kernel header配置成same as kernel being built
    custom kernel headers series配置成相应的4.13.x版本(可在内核文件夹根目录Makefile文件中查看相应内核版本)
   其他项默认即可,如默认编译uClibc, 开启MMU等
toolchain.jpg
5.其余项配置,可按需配置
Build options,默认配置
System configuration
    -/dev managerment,选择dynamic using devtmpfs+mdev
Target packages,各种第三方软件包,默认配置
Filesystem images,默认是tar
Host utilities,默认配置
Legacy config  options,默认配置

保存配置,执行make,由于buildroot版本较新,可能对系统软件个别依赖包版本较高,可在编译前sudo apt-get update,再sudo apt-get upgrade

离线

楼主 #4 2018-11-09 14:19:04

checkout
会员
注册时间: 2018-11-09
已发帖子: 173
积分: 168

Re: licheepi_zero开发板 buildroot配置 一键编译

配置完,一键编译后的uboot还是不能直接从sd卡启动的,需要手动配置CONFIG_BOOTCOMMAND和CONFIG_BOOTARGS参数
1.cd 你的buildroot所在根目录/output/build/uboot-v3s-spi-experimental/
2.删除.stamp_built,.stamp_images_installed,.stamp_installed
3.修改 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"

4.在回到builroot根目录,再次make
5.在output/images目录可以得到uboot.bin,xxx.dtb,zimage和rootfs.tar
6. 烧录TF卡启动盘: 
参考搬运:荔枝派Zero V3s开发板入坑记录 (TF/SD卡启动)(主线Linux,主线u-boot)

    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.dtb拷贝到 这个分区
    4) 建立第二个分区,用尽剩余空间,格式ext4, 把buildroot产生的rootfs.tar解压到该分区根目录
        tar xvf output/images/rootfs.tar -C /挂载的tf卡第二个分区目录

   附 log如下:

U-Boot SPL 2017.01-rc2 (Nov 08 2018 - 20:06:11)
DRAM: 64 MiB
Trying to boot from MMC1

U-Boot 2017.01-rc2 (Nov 08 2018 - 20:06:11 +0800) Allwinner Technology

CPU:   Allwinner V3s (SUN8I 1681)
Model: Lichee Pi Zero
DRAM:  64 MiB
MMC:   SUNXI SD/MMC: 0
SF: unrecognized JEDEC id bytes: 00, 00, 00
*** Warning - spi_flash_probe() failed, using default environment

In:    serial@01c28000
Out:   serial@01c28000
Err:   serial@01c28000


U-Boot 2017.01-rc2 (Nov 08 2018 - 20:06:11 +0800) Allwinner Technology

CPU:   Allwinner V3s (SUN8I 1681)
Model: Lichee Pi Zero
DRAM:  64 MiB
MMC:   SUNXI SD/MMC: 0
SF: unrecognized JEDEC id bytes: 00, 00, 00
*** Warning - spi_flash_probe() failed, 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 
reading zImage
3937936 bytes read in 206 ms (18.2 MiB/s)
reading sun8i-v3s-licheepi-zero.dtb
11187 bytes read in 26 ms (419.9 KiB/s)
## Flattened Device Tree blob at 41800000
   Booting using the fdt blob at 0x41800000
   Loading Device Tree to 42dfa000, end 42dffbb2 ... OK

Starting kernel ...

[    0.000000] Booting Linux on physical CPU 0x0
[    0.000000] Linux version 4.13.16-licheepi-zero (root@ubuntu) (gcc version 7.3.0 (Buildroot 2018.08.2)) #3 SMP Fri Nov 9 00:17:39 CST 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: 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 panic=5 rootwait root=/dev/mmcblk0p2 earlyprintk rw  vt.global_cursor_default=0
[    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: 55096K/65536K available (6144K kernel code, 217K rwdata, 1436K rodata, 1024K init, 261K bss, 10440K 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 - 0xc0a366c0   ( 218 kB)
[    0.000000]        .bss : 0xc0a3d7f0 - 0xc0a7efec   ( 262 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.000006] sched_clock: 56 bits at 24MHz, resolution 41ns, wraps every 4398046511097ns
[    0.000019] Switching to timer-based delay loop, resolution 41ns
[    0.000174] clocksource: timer: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 79635851949 ns
[    0.000404] Console: colour dummy device 80x30
[    0.000438] Calibrating delay loop (skipped), value calculated using timer frequency.. 48.00 BogoMIPS (lpj=240000)
[    0.000453] pid_max: default: 32768 minimum: 301
[    0.000580] Mount-cache hash table entries: 1024 (order: 0, 4096 bytes)
[    0.000597] Mountpoint-cache hash table entries: 1024 (order: 0, 4096 bytes)
[    0.001194] CPU: Testing write buffer coherency: ok
[    0.001567] /cpus/cpu@0 missing clock-frequency property
[    0.001591] CPU0: thread -1, cpu 0, socket 0, mpidr 80000000
[    0.002044] Setting up static identity map for 0x40100000 - 0x40100060
[    0.002229] Hierarchical SRCU implementation.
[    0.002729] smp: Bringing up secondary CPUs ...
[    0.002743] smp: Brought up 1 node, 1 CPU
[    0.002751] SMP: Total of 1 processors activated (48.00 BogoMIPS).
[    0.002758] CPU: All CPU(s) started in SVC mode.
[    0.003509] devtmpfs: initialized
[    0.006461] VFP support v0.3: implementor 41 architecture 2 part 30 variant 7 rev 5
[    0.006735] clocksource: jiffies: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 19112604462750000 ns
[    0.006765] futex hash table entries: 256 (order: 2, 16384 bytes)
[    0.006925] pinctrl core: initialized pinctrl subsystem
[    0.007808] random: get_random_u32 called from bucket_table_alloc+0x110/0x238 with crng_init=0
[    0.007943] NET: Registered protocol family 16
[    0.008390] DMA: preallocated 256 KiB pool for atomic coherent allocations
[    0.009493] hw-breakpoint: found 5 (+1 reserved) breakpoint and 4 watchpoint registers.
[    0.009511] hw-breakpoint: maximum watchpoint size is 8 bytes.
[    0.022063] SCSI subsystem initialized
[    0.022350] usbcore: registered new interface driver usbfs
[    0.022417] usbcore: registered new interface driver hub
[    0.022503] usbcore: registered new device driver usb
[    0.022766] pps_core: LinuxPPS API ver. 1 registered
[    0.022777] pps_core: Software ver. 5.3.6 - Copyright 2005-2007 Rodolfo Giometti <giometti@linux.it>
[    0.022808] PTP clock support registered
[    0.023035] Advanced Linux Sound Architecture Driver Initialized.
[    0.024843] clocksource: Switched to clocksource arch_sys_counter
[    0.035851] NET: Registered protocol family 2
[    0.036445] TCP established hash table entries: 1024 (order: 0, 4096 bytes)
[    0.036478] TCP bind hash table entries: 1024 (order: 1, 8192 bytes)
[    0.036501] TCP: Hash tables configured (established 1024 bind 1024)
[    0.036624] UDP hash table entries: 256 (order: 1, 8192 bytes)
[    0.036672] UDP-Lite hash table entries: 256 (order: 1, 8192 bytes)
[    0.036863] NET: Registered protocol family 1
[    0.037458] RPC: Registered named UNIX socket transport module.
[    0.037476] RPC: Registered udp transport module.
[    0.037481] RPC: Registered tcp transport module.
[    0.037487] RPC: Registered tcp NFSv4.1 backchannel transport module.
[    0.039536] workingset: timestamp_bits=30 max_order=14 bucket_order=0
[    0.048572] NFS: Registering the id_resolver key type
[    0.048619] Key type id_resolver registered
[    0.048626] Key type id_legacy registered
[    0.049668] random: fast init done
[    0.052668] Block layer SCSI generic (bsg) driver version 0.4 loaded (major 249)
[    0.052690] io scheduler noop registered
[    0.052697] io scheduler deadline registered
[    0.052942] io scheduler cfq registered (default)
[    0.052956] io scheduler mq-deadline registered
[    0.052962] io scheduler kyber registered
[    0.057383] sun8i-v3s-pinctrl 1c20800.pinctrl: initialized sunXi PIO driver
[    0.130187] Serial: 8250/16550 driver, 8 ports, IRQ sharing disabled
[    0.133726] console [ttyS0] disabled
[    0.153995] 1c28000.serial: ttyS0 at MMIO 0x1c28000 (irq = 33, base_baud = 1500000) is a U6_16550A
[    0.730815] console [ttyS0] enabled
[    0.737534] libphy: Fixed MDIO Bus: probed
[    0.741981] ehci_hcd: USB 2.0 'Enhanced' Host Controller (EHCI) Driver
[    0.748597] ehci-platform: EHCI generic platform driver
[    0.754087] ehci-platform 1c1a000.usb: EHCI Host Controller
[    0.759759] ehci-platform 1c1a000.usb: new USB bus registered, assigned bus number 1
[    0.767682] ehci-platform 1c1a000.usb: irq 25, io mem 0x01c1a000
[    0.794889] ehci-platform 1c1a000.usb: USB 2.0 started, EHCI 1.00
[    0.802044] hub 1-0:1.0: USB hub found
[    0.806020] hub 1-0:1.0: 1 port detected
[    0.810484] ohci_hcd: USB 1.1 'Open' Host Controller (OHCI) Driver
[    0.816779] ohci-platform: OHCI generic platform driver
[    0.822323] ohci-platform 1c1a400.usb: Generic Platform OHCI controller
[    0.829049] ohci-platform 1c1a400.usb: new USB bus registered, assigned bus number 2
[    0.837003] ohci-platform 1c1a400.usb: irq 26, io mem 0x01c1a400
[    0.909912] hub 2-0:1.0: USB hub found
[    0.913739] hub 2-0:1.0: 1 port detected
[    0.921298] udc-core: couldn't find an available UDC - added [g_cdc] to list of pending drivers
[    0.931051] sun6i-rtc 1c20400.rtc: rtc core: registered rtc-sun6i as rtc0
[    0.937938] sun6i-rtc 1c20400.rtc: RTC enabled
[    0.942468] i2c /dev entries driver
[    0.947364] input: ns2009_ts as /devices/platform/soc/1c2ac00.i2c/i2c-0/0-0048/input/input0
[    0.956908] sunxi-wdt 1c20ca0.watchdog: Watchdog enabled (timeout=16 sec, nowayout=0)
[    1.025085] sunxi-mmc 1c0f000.mmc: base:0xc4869000 irq:23
[    1.032135] usbcore: registered new interface driver usbhid
[    1.037809] usbhid: USB HID core driver
[    1.043484] NET: Registered protocol family 17
[    1.048163] Key type dns_resolver registered
[    1.052570] Registering SWP/SWPB emulation handler
[    1.064226] usb_phy_generic usb_phy_generic.0.auto: usb_phy_generic.0.auto supply vcc not found, using dummy regulator
[    1.075671] musb-hdrc musb-hdrc.1.auto: MUSB HDRC host driver
[    1.081437] musb-hdrc musb-hdrc.1.auto: new USB bus registered, assigned bus number 3
[    1.092806] hub 3-0:1.0: USB hub found
[    1.096782] hub 3-0:1.0: 1 port detected
[    1.101852] using random self ethernet address
[    1.106411] using random host ethernet address
[    1.111878] usb0: HOST MAC 82:36:5c:de:e9:65
[    1.116306] usb0: MAC 7e:61:88:48:1c:f4
[    1.120188] g_cdc gadget: CDC Composite Gadget, version: King Kamehameha Day 2008
[    1.127706] g_cdc gadget: g_cdc ready
[    1.131701] sun6i-rtc 1c20400.rtc: setting system clock to 1970-01-01 00:00:32 UTC (32)
[    1.139972] vcc3v0: disabling
[    1.142948] vcc5v0: disabling
[    1.145969] ALSA device list:
[    1.148935]   No soundcards found.
[    1.154304] Waiting for root device /dev/mmcblk0p2...
[    1.191988] mmc0: host does not support reading read-only switch, assuming write-enable
[    1.201993] mmc0: new high speed SDHC card at address 0001
[    1.208315] mmcblk0: mmc0:0001 SD8GB 7.28 GiB 
[    1.214376]  mmcblk0: p1 p2
[    1.246409] EXT4-fs (mmcblk0p2): couldn't mount as ext3 due to feature incompatibilities
[    1.255643] EXT4-fs (mmcblk0p2): couldn't mount as ext2 due to feature incompatibilities
[    1.283859] musb-hdrc musb-hdrc.1.auto: VBUS_ERROR in b_idle (80, <SessEnd), retry #0, port1 00000100
[    1.356292] EXT4-fs (mmcblk0p2): recovery complete
[    1.363139] EXT4-fs (mmcblk0p2): mounted filesystem with ordered data mode. Opts: (null)
[    1.371387] VFS: Mounted root (ext4 filesystem) on device 179:2.
[    1.380654] devtmpfs: mounted
[    1.384805] Freeing unused kernel memory: 1024K
[    1.472655] EXT4-fs (mmcblk0p2): re-mounted. Opts: data=ordered
Starting logging: OK
Starting mdev...
Initializing random number generator... done.
Starting network: OK

Welcome to Buildroot
buildroot login: root
# 

第一次发帖,先写这么多了:D

离线

页脚

工信部备案:粤ICP备20025096号 Powered by FluxBB

感谢为中文互联网持续输出优质内容的各位老铁们。 QQ: 516333132, 微信(wechat): whycan_cn (哇酷网/挖坑网/填坑网) service@whycan.cn