页次: 1
期待开卖!
不过要是DSI能引出4Lane就更好了啊
沙发,先赞一个
https://github.com/Lotlab/nrf52-keyboard/tree/master/usb
这是我看到这个帖子之后自己移植的,由于是一个产品的一部分,所以可能看上去会有点复杂
V133是什么新的芯片吗?还是F1C100s的加强版?
https://github.com/jiangming1399/buildroot_configs 220k左右,不过我是关掉了环境变量存储
George Hilliard(就是那个做 F1c100s 电子名片的)在博客上发表了 Mastering Embedded Linux 一系列的文章。我看着写的很不错,就把它翻译了过来,也作为一个英语翻译的练习吧。翻译的不好还请见谅。
- 精通嵌入式 Linux 第一章:概述
- 精通嵌入式 Linux 第二章:硬件
- 精通嵌入式 Linux 第三章:Buildroot
- 精通嵌入式 Linux 第四章:添加功能
新的第五章还没翻译,等我有空再继续翻吧。
所有的编译必须使用ROOT权限吗?如果没有使用ROOT会不会出现意想不到的问题?
所有的编译必须不使用ROOT权限,如果用ROOT权限会出现意想不到的问题
中间改了些配置,clear 之后再编译就OK了。
需要加
BR2_PACKAGE_HOST_GENIMAGE=y
BR2_PACKAGE_HOST_MTD=y
多谢提醒
楼主,请教下,这个改了设备树怎么编译?改了设备树后编译完发现dtb没有更新
用 make linux-rebuild 把linux内核标记为需要重新编译,然后再make
既然用了buildroot,为啥不直接打开这个功能编译呢……
(我个人是喜欢用dropbear来ssh连接到电脑的,只需要设置usb gadget网卡就可以了)
请教下楼主,编译后出现这个错误怎么解决?
>>> Executing post-image script support/scripts/genimage.sh
support/scripts/genimage.sh: 行 44: genimage: 未找到命令
Makefile:823: recipe for target 'target-post-image' failed
自己装一下genimage就可以了,具体的有点忘了,搜索一下软件包看看
debootstrap --arch=armhf buster chroot https://mirrors.ustc.edu.cn/debian/
这一行就够了,不用什么stage2之类的东西。
ref: https://www.lotlab.org/2020/04/09/run-debian-on-rtd1195-based-nas-device/
root密码必须在设定rootfs的时候弄,不然空密码很可能进不去;现在已经有Debian10Buster了,为啥不用最新的呢
PA0-3: TP/DA
PE0-1: UART0
PE2-5: GPIO
PE6: PWM0
PE7-PE10: SPI1
PE11-12: TWI
个人喜欢这样的方案,这样可以实现SPI Flash + SPI Wifi + SD卡 + 电容/电阻触摸 + RTC + 音频输出,可以做一个简易的MP3
PS> 啥?你问我CSI?这玩意要摄像头干啥
基于Buildroot 2020.02,可以一键编译UBoot、Linux和Rootfs并生成Flash镜像。
地址: https://github.com/jiangming1399/buildroot_configs
用法:在Buildroot目录下执行
make BR2_EXTERNAL=$PATH_TO_CONFIGS menuconfig #将 $PATH_TO_CONFIGS 替换为实际的配置目录
make lotlab_fam_zkswe_defconfig # 载入某个指定硬件的defconfig
make -j
基本上都是最简的配置,没有添加什么额外的东西。主要特点有:
- 4.5s开机
- 支持OverlayFS
- 支持开机Logo
defconfig主要有这些区别:
- lotlab_fam_zkswe_defconfig :适用于ZKSWE串口屏的配置,8MFlash,480*272
- jxhmi_5_inch_defconfig:适用于本论坛开源串口屏的配置,16M Flash,800*480,交换红蓝
- jxhmi_4_3_inch_defconfig:适用于本论坛开源串口屏的配置,16M Flash,480*272,交换红蓝
要改可以自己改,至于怎么做这个我之后有空的话可能会开个贴子,或者直接查阅Buildroot的手册就行
以下由 @哇酷小二 2020-04-30 更新:
---------------------------------------------
不方便用git的朋友请此处下载: jiangming1399_buildroot_configs.tgz
看你怎么定义“良心”了。LCEDA可是在一开始导入了大量的KiCAD的库去使用,现在其开源氛围也越来越淡了。将一个开源软件转变为闭源软件,我认为这不能算是“良心”。
linux 的 device tree中加上
chosen {
simplefb_lcd: framebuffer-lcd0 {
compatible = "allwinner,simple-framebuffer",
"simple-framebuffer";
allwinner,pipeline = "de_be0-lcd0";
clocks = <&ccu CLK_BUS_LCD>, <&ccu CLK_BUS_DE_BE>,
<&ccu CLK_TCON>, <&ccu CLK_DE_BE>,
<&ccu CLK_DRAM_DE_BE>;
status = "okay";
};
};
然后把CONFIG_VIDEO_DT_SIMPLEFB打开后,发现正确预留了内存
# cat /proc/iomem
...
80000000-81e88fff : System RAM
80008000-805fffff : Kernel code
80700000-8075b493 : Kernel data
其实我个人是觉得,没有意义的回帖还不如不回……主要是我会定期看我被回复的贴子,要是水占大部分的话那就纯粹是浪费时间了
以前版面上一天新的帖子数量不会很多,但是最近忽然变多了。好像最近有很多人在水贴的样子,是站长做了什么新的积分限制吗?
在哪里设置呢? u-boot 吗?
uboot设备树
之前SPI频率没设置好,导致用默认的1MHZ读取,所以才那么慢……这次改了之后,启动到shell只要4.72秒了
[0.000000 0.000000]
[0.000081 0.000081] U-Boot SPL 2019.04 (Apr 17 2020 - 20:28:57 +0800)
[0.004955 0.004874] DRAM: 32 MiB
[0.015868 0.010913] SPL: Unsupported Boot Device!
[0.018527 0.002659] Trying to boot from sunxi SPI
[0.360361 0.341834]
[0.360445 0.000083]
[0.360477 0.000033] U-Boot 2019.04 (Apr 17 2020 - 20:28:57 +0800) Allwinner Technology
[0.365895 0.005418]
[0.365914 0.000019] CPU: Allwinner F Series (SUNIV)
[0.368937 0.003022] Model: Lotlab ACT Monitor
[0.372805 0.003869] DRAM: 32 MiB
[0.894012 0.521207] Setting up a 480x272 lcd console (overscan 0x0)
[0.981311 0.087299] In: serial
[0.981699 0.000388] Out: vga
[0.981949 0.000250] Err: vga
[0.985814 0.003865] Hit any key to stop autoboot: 0
[0.994699 0.008885] SF: Detected w25q64cv with page size 256 Bytes, erase size 4 KiB, total 8 MiB
[1.004777 0.010079] device 0 offset 0x3c000, size 0x4000
[1.014091 0.009314] SF: 16384 bytes @ 0x3c000 Read: OK
[1.018516 0.004424] device 0 offset 0x40000, size 0x240000
[1.591478 0.572962] SF: 2359296 bytes @ 0x40000 Read: OK
[1.595648 0.004170] ## Flattened Device Tree blob at 80c00000
[1.599776 0.004128] Booting using the fdt blob at 0x80c00000
[1.604728 0.004951] Loading Device Tree to 80eab000, end 80eb02de ... OK
[1.618777 0.014050]
[1.618844 0.000067] Starting kernel ...
[1.619115 0.000271]
[2.350141 0.731026] [ 0.000000] Booting Linux on physical CPU 0x0
[2.353339 0.003198] [ 0.000000] Linux version 5.2.4 (jim@jim-pc) (gcc version 8.3.0 (Buildroot 2020.02)) #1 Fri Apr 17 16:03:10 CST 2020
[2.364343 0.011004] [ 0.000000] CPU: ARM926EJ-S [41069265] revision 5 (ARMv5TEJ), cr=0005317f
[2.370341 0.005997] [ 0.000000] CPU: VIVT data cache, VIVT instruction cache
[2.375832 0.005491] [ 0.000000] OF: fdt: Machine model: Lichee Pi Nano
[2.381069 0.005237] [ 0.000000] Memory policy: Data cache writeback
[2.386379 0.005310] [ 0.000000] Built 1 zonelists, mobility grouping on. Total pages: 8128
[2.392483 0.006103] [ 0.000000] Kernel command line: panic=5 rootwait root=/dev/mtdblock3 rw rootfstype=squashfs init=/sbin/mnt_overlay
[2.403266 0.010783] [ 0.000000] Dentry cache hash table entries: 4096 (order: 2, 16384 bytes)
[2.409246 0.005980] [ 0.000000] Inode-cache hash table entries: 2048 (order: 1, 8192 bytes)
[2.414662 0.005415] [ 0.000000] Memory: 25868K/32768K available (4096K kernel code, 159K rwdata, 532K rodata, 1024K init, 205K bss, 6900K reserved, 0K cma-reserved)
[2.428816 0.014154] [ 0.000000] NR_IRQS: 16, nr_irqs: 16, preallocated irqs: 16
[2.434347 0.005532] [ 0.000000] random: get_random_bytes called from 0xc0600a84 with crng_init=0
[2.442313 0.007966] [ 0.000046] sched_clock: 32 bits at 24MHz, resolution 41ns, wraps every 89478484971ns
[2.448554 0.006240] [ 0.000103] clocksource: timer: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 79635851949 ns
[2.459003 0.010449] [ 0.000530] Console: colour dummy device 80x30
[2.462107 0.003104] [ 0.000961] printk: console [tty0] enabled
[2.467560 0.005453] [ 0.001063] Calibrating delay loop... 358.80 BogoMIPS (lpj=1794048)
[2.473369 0.005809] [ 0.050274] pid_max: default: 32768 minimum: 301
[2.478546 0.005177] [ 0.050431] Mount-cache hash table entries: 1024 (order: 0, 4096 bytes)
[2.484616 0.006070] [ 0.050488] Mountpoint-cache hash table entries: 1024 (order: 0, 4096 bytes)
[2.492521 0.007905] [ 0.051836] CPU: Testing write buffer coherency: ok
[2.495973 0.003452] [ 0.054011] Setting up static identity map for 0x80100000 - 0x8010003c
[2.503781 0.007807] [ 0.056039] devtmpfs: initialized
[2.506730 0.002949] [ 0.070914] clocksource: jiffies: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 19112604462750000 ns
[2.515540 0.008811] [ 0.071055] futex hash table entries: 256 (order: -1, 3072 bytes)
[2.523230 0.007690] [ 0.071200] pinctrl core: initialized pinctrl subsystem
[2.528665 0.005435] [ 0.073526] NET: Registered protocol family 16
[2.532079 0.003413] [ 0.074841] DMA: preallocated 256 KiB pool for atomic coherent allocations
[2.539894 0.007816] [ 0.079693] cpuidle: using governor menu
[2.543061 0.003167] [ 0.125078] clocksource: Switched to clocksource timer
[2.548722 0.005660] [ 0.178353] NET: Registered protocol family 2
[2.551851 0.003129] [ 0.181941] tcp_listen_portaddr_hash hash table entries: 512 (order: 0, 4096 bytes)
[2.559968 0.008117] [ 0.182092] TCP established hash table entries: 1024 (order: 0, 4096 bytes)
[2.567875 0.007907] [ 0.182175] TCP bind hash table entries: 1024 (order: 0, 4096 bytes)
[2.573756 0.005881] [ 0.182240] TCP: Hash tables configured (established 1024 bind 1024)
[2.579702 0.005946] [ 0.182553] UDP hash table entries: 256 (order: 0, 4096 bytes)
[2.585088 0.005385] [ 0.182655] UDP-Lite hash table entries: 256 (order: 0, 4096 bytes)
[2.592948 0.007861] [ 0.184044] NET: Registered protocol family 1
[2.596119 0.003170] [ 0.188572] workingset: timestamp_bits=30 max_order=13 bucket_order=0
[2.601933 0.005814] [ 0.190016] squashfs: version 4.0 (2009/01/31) Phillip Lougher
[2.609621 0.007689] [ 0.190123] jffs2: version 2.2. (NAND) 2001-2006 Red Hat, Inc.
[2.615380 0.005759] [ 0.196256] sun4i-usb-phy 1c13400.phy: Couldn't request ID GPIO
[2.621007 0.005626] [ 0.247807] suniv-f1c100s-pinctrl 1c20800.pinctrl: initialized sunXi PIO driver
[2.627030 0.006023] [ 0.248568] suniv-f1c100s-pinctrl 1c20800.pinctrl: 1c20800.pinctrl supply vcc-pe not found, using dummy regulator
[2.638022 0.010992] [ 0.251323] pwm-backlight backlight: backlight supply power not found, using dummy regulator
[2.646965 0.008943] [ 0.335831] Serial: 8250/16550 driver, 8 ports, IRQ sharing disabled
[2.652162 0.005197] [ 0.372278] 1c25000.serial: ttyS0 at MMIO 0x1c25000 (irq = 23, base_baud = 6250000) is a 16550A
[2.662772 0.010610] [ 0.685537] printk: console [ttyS0] enabled
[2.673443 0.010671] [ 0.696059] suniv-f1c100s-pinctrl 1c20800.pinctrl: 1c20800.pinctrl supply vcc-pd not found, using dummy regulator
[2.693179 0.019736] [ 0.715625] suniv-f1c100s-pinctrl 1c20800.pinctrl: 1c20800.pinctrl supply vcc-pc not found, using dummy regulator
[2.713386 0.020207] [ 0.735987] m25p80 spi0.0: found s25fl064k, expected w25q64
[2.719090 0.005704] [ 0.741680] m25p80 spi0.0: s25fl064k (8192 Kbytes)
[2.722610 0.003520] [ 0.746664] 5 fixed-partitions partitions found on MTD device spi0.0
[2.730417 0.007807] [ 0.753058] Creating 5 MTD partitions on "spi0.0":
[2.734192 0.003775] [ 0.757955] 0x000000000000-0x00000003c000 : "u-boot"
[2.749183 0.014991] [ 0.771745] 0x00000003c000-0x000000040000 : "dtb"
[2.763125 0.013942] [ 0.785552] 0x000000040000-0x000000280000 : "kernel"
[2.777174 0.014049] [ 0.799569] 0x000000280000-0x000000780000 : "rootfs"
[2.793167 0.015993] [ 0.815553] 0x000000780000-0x000000800000 : "overlay"
[2.810735 0.017568] [ 0.833326] udc-core: couldn't find an available UDC - added [g_ether] to list of pending drivers
[2.823409 0.012674] [ 0.845894] sunxi-wdt 1c20ca0.watchdog: Watchdog enabled (timeout=16 sec, nowayout=0)
[2.834450 0.011041] [ 0.857047] Initializing XFRM netlink socket
[2.837862 0.003412] [ 0.861570] NET: Registered protocol family 17
[2.845357 0.007494] [ 0.868002] NET: Registered protocol family 15
[2.860150 0.014793] [ 0.882686] suniv-f1c100s-pinctrl 1c20800.pinctrl: 1c20800.pinctrl supply vcc-pd not found, using dummy regulator
[2.875217 0.015067] [ 0.897785] sun4i-backend 1e60000.display-backend: Couldn't find matching frontend, frontend features disabled
[2.884561 0.009344] [ 0.908447] sun4i-drm display-engine: bound 1e60000.display-backend (ops 0xc05308a0)
[2.896362 0.011801] [ 0.919005] sun4i-drm display-engine: bound 1c0c000.lcd-controller (ops 0xc052f508)
[2.902674 0.006312] [ 0.926870] [drm] Supports vblank timestamp caching Rev 2 (21.10.2013).
[2.910596 0.007922] [ 0.933515] [drm] No driver support for vblank timestamp query.
[2.919911 0.009315] [ 0.942445] [drm] Initialized sun4i-drm 1.0.0 20150629 for display-engine on minor 0
[2.935894 0.015983] [ 0.958518] sun4i-drm display-engine: fb0: sun4i-drmdrmfb frame buffer device
[2.943292 0.007398] [ 0.967079] usb_phy_generic usb_phy_generic.0.auto: usb_phy_generic.0.auto supply vcc not found, using dummy regulator
[2.960226 0.016934] [ 0.982810] using random self ethernet address
[2.963835 0.003608] [ 0.987453] using random host ethernet address
[2.976130 0.012295] [ 0.998613] usb0: HOST MAC 5e:b0:50:1e:38:d0
[2.979740 0.003609] [ 1.003061] usb0: MAC 36:03:f5:46:dc:54
[2.983214 0.003474] [ 1.007124] using random self ethernet address
[2.988200 0.004986] [ 1.011616] using random host ethernet address
[2.993549 0.005349] [ 1.016334] g_ether gadget: Ethernet Gadget, version: Memorial Day 2008
[2.999682 0.006133] [ 1.022994] g_ether gadget: g_ether ready
[3.007613 0.007931] [ 1.030254] vcc3v3: disabling
[3.018141 0.010529] [ 1.040721] random: fast init done
[3.023640 0.005499] [ 1.046263] VFS: Mounted root (squashfs filesystem) readonly on device 31:3.
[3.041610 0.017971] [ 1.064226] devtmpfs: mounted
[3.048696 0.007086] [ 1.071328] Freeing unused kernel memory: 1024K
[3.052474 0.003778] [ 1.076110] Run /sbin/mnt_overlay as init process
[3.189843 0.137369] [ 1.212072] random: crng init done
[3.577372 0.387528] [ 1.599975] g_ether gadget: high-speed config #1: CDC Ethernet (ECM)
[3.709996 0.132624] [ 1.732544] overlayfs: upper fs does not support tmpfile.
[3.713619 0.003624] [ 1.738142] overlayfs: upper fs does not support xattr, falling back to index=off and metacopy=off.
[3.954268 0.240649] Starting syslogd: OK
[3.989470 0.035202] Starting klogd: OK
[4.032711 0.043241] Running sysctl: OK
[4.217460 0.184750] Initializing random number generator: OK
[4.229857 0.012396] Saving random seed: OK
[4.278125 0.048269] Starting network: OK
[4.469963 0.191837] Starting udhcpd: OK
[4.510248 0.040286] Starting dropbear sshd: OK
[4.724422 0.214173]
[4.724488 0.000067] Welcome to Buildroot
[4.724971 0.000482] buildroot login:
TOTP,Time-based One-time Password algorithm,一种根据时间和预制密钥计算一次性密码的算法
以后会直接提交到uboot的代码库,但不会在这里发patch
棒!
U-Boot是一个GPL授权的软件,再发行Binary是需要开源的
你说的这几个都支持吧……
至少我手上的ConnectBot是支持的
能支持电阻触摸屏吗?没有用触摸芯片的直接连线的 ,能按我的线路适配吗?
触摸我没调过,不是很清楚要怎么弄;其他的连线我等下看看重新适配一下
Edit: 删掉了两个EN,新的固件发百度云了,地址在上面。触摸没有硬件没法调,只是暂时增加了设备树和驱动,不过应该没法跑。
QTdemo镜像占坑
(坑网这个附件有问题 链接: https://pan.baidu.com/s/13ZTG_R-9arwCKWC4h3P7kA 提取码: i13g)
root密码是 lotlab
屏幕是480*272的,适配的是zkswe的板子,PE5是BL_EN,PE11是SCREEN_EN,PE6是PWM亮度调整
可惜不自带USB座,要是自带USB座就可以方便烧写了
拼完,编辑掉
卡在start kernel 这里会是什么问题导致的?
原因有很多,比如内核地址不对,比如内核不在串口输出
buildroot-2017.08 配置后,生成的rootfs.tar 太大了90多M, SPI Flash 才16M,
需要裁剪掉哪些内容??
@晕哥
建议从0开始配置自己的rootfs,这样不至于要啥不要啥都不知道
make ARCH=arm CROSS_COMPILE=arm-linux-gnueabi-
1. 本地计算机运行 ssh-gen-id,生成私钥(如果生成过了则跳过)
2. 本地计算机运行 ssh-copy-id user@address,将公钥复制到服务器上
3. 现在你就可以直接使用ssh免密码登录了
4. 修改/etc/ssh/sshd_config
5. 输入sudo systemctl reload sshd,重新加载配置
6. 不要关闭此窗口,新开一个窗口做登录测试,防止改炸了之后没法登录还没法改回来
你是怎么让Uboot和kernel统一时间打印的?
用grabserial
4.5s进Kernel,7秒到命令行是我的极限了……
[0.000000 0.000000]
[0.000567 0.000567] U-Boot SPL 2019.04 (Mar 15 2020 - 20:25:30 +0800)
[0.004723 0.004156] DRAM: 32 MiB
[0.016690 0.011967] SPL: Unsupported Boot Device!
[0.002319 0.002319] Trying to boot from sunxi SPI
[0.345268 0.342949]
[0.345360 0.000092]
[0.345387 0.000027] U-Boot 2019.04 (Mar 15 2020 - 20:25:30 +0800) Allwinner Technology
[0.351057 0.005670]
[0.351088 0.000031] CPU: Allwinner F Series (SUNIV)
[0.354100 0.003011] Model: Lotlab ACT Monitor
[0.357005 0.002906] DRAM: 32 MiB
[0.879050 0.522044] Setting up a 480x272 lcd console (overscan 0x0)
[0.967089 0.088039] In: serial
[0.968047 0.000958] Out: vga
[0.969033 0.000986] Err: vga
[0.971987 0.002954] Hit any key to stop autoboot: 0
[0.980985 0.008999] SF: Detected w25q64cv with page size 256 Bytes, erase size 4 KiB, total 8 MiB
[0.991056 0.010071] device 0 offset 0x3c000, size 0x4000
[1.015056 0.024000] SF: 16384 bytes @ 0x3c000 Read: OK
[1.019068 0.004012] device 0 offset 0x40000, size 0x240000
[3.719108 2.700040] SF: 2359296 bytes @ 0x40000 Read: OK
[3.724043 0.004935] ## Flattened Device Tree blob at 80c00000
[3.728991 0.004948] Booting using the fdt blob at 0x80c00000
[3.735000 0.006009] Loading Device Tree to 80eab000, end 80eb01a2 ... OK
[3.746073 0.011072]
[3.746195 0.000122] Starting kernel ...
[3.748125 0.001930]
[4.503158 0.755033] [ 0.000000] Booting Linux on physical CPU 0x0
[4.508012 0.004854] [ 0.000000] Linux version 5.2.4 (jim@jim-pc) (gcc version 8.3.0 (Buildroot 2020.02)) #5 Sun Mar 15 20:14:37 CST 2020
[4.518121 0.010109] [ 0.000000] CPU: ARM926EJ-S [41069265] revision 5 (ARMv5TEJ), cr=0005317f
[4.525092 0.006971] [ 0.000000] CPU: VIVT data cache, VIVT instruction cache
[4.530318 0.005226] [ 0.000000] OF: fdt: Machine model: Lichee Pi Nano
[4.535147 0.004828] [ 0.000000] Memory policy: Data cache writeback
[4.540014 0.004868] [ 0.000000] Built 1 zonelists, mobility grouping on. Total pages: 8128
[4.546372 0.006358] [ 0.000000] Kernel command line: panic=5 rootwait root=/dev/mtdblock3 rw rootfstype=squashfs init=/sbin/mnt_overlay
[4.557096 0.010724] [ 0.000000] Dentry cache hash table entries: 4096 (order: 2, 16384 bytes)
[4.563426 0.006330] [ 0.000000] Inode-cache hash table entries: 2048 (order: 1, 8192 bytes)
[4.570290 0.006864] [ 0.000000] Memory: 25868K/32768K available (4096K kernel code, 159K rwdata, 532K rodata, 1024K init, 205K bss, 6900K reserved, 0K cma-reserved)
[4.583270 0.012980] [ 0.000000] NR_IRQS: 16, nr_irqs: 16, preallocated irqs: 16
[4.589105 0.005835] [ 0.000000] random: get_random_bytes called from 0xc0600a84 with crng_init=0
[4.596064 0.006959] [ 0.000046] sched_clock: 32 bits at 24MHz, resolution 41ns, wraps every 89478484971ns
[4.604088 0.008024] [ 0.000101] clocksource: timer: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 79635851949 ns
[4.613078 0.008990] [ 0.000568] Console: colour dummy device 80x30
[4.617318 0.004241] [ 0.001027] printk: console [tty0] enabled
[4.621344 0.004025] [ 0.001138] Calibrating delay loop... 334.23 BogoMIPS (lpj=1671168)
[4.628018 0.006675] [ 0.050263] pid_max: default: 32768 minimum: 301
[4.632339 0.004321] [ 0.050425] Mount-cache hash table entries: 1024 (order: 0, 4096 bytes)
[4.639180 0.006841] [ 0.050484] Mountpoint-cache hash table entries: 1024 (order: 0, 4096 bytes)
[4.646232 0.007052] [ 0.051856] CPU: Testing write buffer coherency: ok
[4.651090 0.004858] [ 0.054029] Setting up static identity map for 0x80100000 - 0x8010003c
[4.657220 0.006130] [ 0.056102] devtmpfs: initialized
[4.661073 0.003853] [ 0.070968] clocksource: jiffies: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 19112604462750000 ns
[4.670980 0.009907] [ 0.071114] futex hash table entries: 256 (order: -1, 3072 bytes)
[4.677037 0.006058] [ 0.071270] pinctrl core: initialized pinctrl subsystem
[4.682108 0.005070] [ 0.074046] NET: Registered protocol family 16
[4.686270 0.004162] [ 0.075338] DMA: preallocated 256 KiB pool for atomic coherent allocations
[4.693215 0.006946] [ 0.080370] cpuidle: using governor menu
[4.697250 0.004035] [ 0.126249] clocksource: Switched to clocksource timer
[4.702239 0.004989] [ 0.180323] NET: Registered protocol family 2
[4.707061 0.004822] [ 0.183919] tcp_listen_portaddr_hash hash table entries: 512 (order: 0, 4096 bytes)
[4.714263 0.007203] [ 0.184071] TCP established hash table entries: 1024 (order: 0, 4096 bytes)
[4.721272 0.007009] [ 0.184151] TCP bind hash table entries: 1024 (order: 0, 4096 bytes)
[4.728051 0.006779] [ 0.184219] TCP: Hash tables configured (established 1024 bind 1024)
[4.734209 0.006158] [ 0.184535] UDP hash table entries: 256 (order: 0, 4096 bytes)
[4.740157 0.005948] [ 0.184639] UDP-Lite hash table entries: 256 (order: 0, 4096 bytes)
[4.746239 0.006082] [ 0.186047] NET: Registered protocol family 1
[4.751062 0.004823] [ 0.190645] workingset: timestamp_bits=30 max_order=13 bucket_order=0
[4.757162 0.006100] [ 0.192058] squashfs: version 4.0 (2009/01/31) Phillip Lougher
[4.763079 0.005917] [ 0.192167] jffs2: version 2.2. (NAND) © 2001-2006 Red Hat, Inc.
[4.769082 0.006003] [ 0.198473] sun4i-usb-phy 1c13400.phy: Couldn't request ID GPIO
[4.775056 0.005974] [ 0.250694] suniv-f1c100s-pinctrl 1c20800.pinctrl: initialized sunXi PIO driver
[4.782225 0.007169] [ 0.252818] suniv-f1c100s-pinctrl 1c20800.pinctrl: 1c20800.pinctrl supply vcc-pe not found, using dummy regulator
[4.793005 0.010780] [ 0.257108] pwm-backlight backlight: backlight supply power not found, using dummy regulator
[4.801214 0.008209] [ 0.344204] Serial: 8250/16550 driver, 8 ports, IRQ sharing disabled
[4.807384 0.006171] [ 0.382288] 1c25000.serial: ttyS0 at MMIO 0x1c25000 (irq = 23, base_baud = 6250000) is a 16550A
[4.816277 0.008893] [ 0.695683] printk: console [ttyS0] enabled
[4.828065 0.011788] [ 0.707818] suniv-f1c100s-pinctrl 1c20800.pinctrl: 1c20800.pinctrl supply vcc-pd not found, using dummy regulator
[4.850157 0.022091] [ 0.729106] suniv-f1c100s-pinctrl 1c20800.pinctrl: 1c20800.pinctrl supply vcc-pc not found, using dummy regulator
[4.872073 0.021917] [ 0.750949] m25p80 spi0.0: found s25fl064k, expected w25q64
[4.877286 0.005213] [ 0.756747] m25p80 spi0.0: s25fl064k (8192 Kbytes)
[4.882336 0.005050] [ 0.761652] 5 fixed-partitions partitions found on MTD device spi0.0
[4.889007 0.006670] [ 0.768112] Creating 5 MTD partitions on "spi0.0":
[4.893381 0.004374] [ 0.772955] 0x000000000000-0x00000003c000 : "u-boot"
[4.907049 0.013668] [ 0.786887] 0x00000003c000-0x000000040000 : "dtb"
[4.921066 0.014017] [ 0.800637] 0x000000040000-0x000000280000 : "kernel"
[4.934068 0.013002] [ 0.813192] 0x000000280000-0x000000780000 : "rootfs"
[4.948041 0.013973] [ 0.827617] 0x000000780000-0x000000800000 : "overlay"
[4.968011 0.019970] [ 0.847169] udc-core: couldn't find an available UDC - added [g_ether] to list of pending drivers
[4.980047 0.012037] [ 0.859628] sunxi-wdt 1c20ca0.watchdog: Watchdog enabled (timeout=16 sec, nowayout=0)
[4.990011 0.009964] [ 0.869284] Initializing XFRM netlink socket
[4.994210 0.004199] [ 0.873754] NET: Registered protocol family 17
[5.001047 0.006837] [ 0.880207] NET: Registered protocol family 15
[5.016096 0.015049] [ 0.894942] suniv-f1c100s-pinctrl 1c20800.pinctrl: 1c20800.pinctrl supply vcc-pd not found, using dummy regulator
[5.031058 0.014961] [ 0.910067] sun4i-backend 1e60000.display-backend: Couldn't find matching frontend, frontend features disabled
[5.040995 0.009937] [ 0.920745] sun4i-drm display-engine: bound 1e60000.display-backend (ops 0xc05308a0)
[5.052203 0.011209] [ 0.931292] sun4i-drm display-engine: bound 1c0c000.lcd-controller (ops 0xc052f508)
[5.060031 0.007827] [ 0.939156] [drm] Supports vblank timestamp caching Rev 2 (21.10.2013).
[5.066326 0.006295] [ 0.945803] [drm] No driver support for vblank timestamp query.
[5.075135 0.008809] [ 0.954805] [drm] Initialized sun4i-drm 1.0.0 20150629 for display-engine on minor 0
[5.092130 0.016994] [ 0.970946] sun4i-drm display-engine: fb0: sun4i-drmdrmfb frame buffer device
[5.100040 0.007910] [ 0.979521] usb_phy_generic usb_phy_generic.0.auto: usb_phy_generic.0.auto supply vcc not found, using dummy regulator
[5.116049 0.016008] [ 0.995243] using random self ethernet address
[5.120280 0.004231] [ 0.999893] using random host ethernet address
[5.132252 0.011971] [ 1.011061] usb0: HOST MAC 6e:38:35:96:dc:b3
[5.136162 0.003910] [ 1.015513] usb0: MAC 3a:97:0e:a2:12:d4
[5.140116 0.003954] [ 1.019570] using random self ethernet address
[5.145041 0.004925] [ 1.024066] using random host ethernet address
[5.149205 0.004164] [ 1.028785] g_ether gadget: Ethernet Gadget, version: Memorial Day 2008
[5.156180 0.006975] [ 1.035453] g_ether gadget: g_ether ready
[5.163033 0.006853] [ 1.042700] vcc3v3: disabling
[5.176095 0.013062] [ 1.054986] random: fast init done
[5.181042 0.004947] [ 1.060490] VFS: Mounted root (squashfs filesystem) readonly on device 31:3.
[5.194026 0.012984] [ 1.073359] devtmpfs: mounted
[5.201013 0.006987] [ 1.080565] Freeing unused kernel memory: 1024K
[5.206109 0.005095] [ 1.085259] Run /sbin/mnt_overlay as init process
[5.381470 0.175361] [ 1.260258] random: crng init done
[5.779200 0.397730] [ 1.658367] g_ether gadget: high-speed config #1: CDC Ethernet (ECM)
[5.883472 0.104272] [ 1.762622] overlayfs: upper fs does not support tmpfile.
[5.888996 0.005524] [ 1.768214] overlayfs: upper fs does not support xattr, falling back to index=off and metacopy=off.
[6.116461 0.227465] Starting syslogd: OK
[6.150147 0.033685] Starting klogd: OK
[6.186171 0.036024] Running sysctl: OK
[6.339748 0.153577] Saving random seed: OK
[6.400528 0.060780] Starting network: OK
[6.590488 0.189960] Starting udhcpd: OK
[6.631476 0.040988] Starting dropbear sshd: OK
[6.852184 0.220708]
[6.852304 0.000120] Welcome to Buildroot
[6.854232 0.001928] buildroot login:
注意啥啊,这服务器在国外
~/.ssh/目录下
居然用到了汇编优化!
我想移植一个v1版本的协议到ch552,感觉对速度的要求就不是那么高了,应该就用不上这些高端的优化手段了
我的方法和楼主的差不多,不过区别就是我用的是compiler.h这个头文件,用于兼容各个编译器不同的写法。把sdcc的compiler.h这个文件复制一份,然后针对不同的编译器的写法写不一样的代码,最后在没有匹配的(即lint)里面禁用。
读了一下楼主的代码,有几个疑问想请教一下楼主:
1. SW_DP.c中,原版代码是有PIN_SWDIO_OUT_ENABLE这一个切换SWDIO的功能的宏的,我看在楼主的代码里面并没有使用,而是直接将这个IO设置为1。请问IO在PP模式下可以直接这样读取到SWDIO的值吗?
2. DAP.c的DAP_SWJ_Clock函数中,原版代码是有设置快速和慢速的区分,而楼主代码里面则是强制设置为快速,并取消掉所有的IO延时。请问这样在实际使用中是否有发现问题?
#66CCFF
如果只是实现很简单的UI的话,其实我建议自己写一个简单的框架,直接写Framebuffer
大佬牛逼!
https://elinux.org/images/9/97/Boot_one_second_altenberg.pdf
https://elinux.org/images/6/64/Chris-simmonds-boot-time-elce-2017_0.pdf
这篇文章提供了一些通用的方法,主要是要删掉用不上的驱动,并且把不需要的加载放在后面。
http://www.mee.gov.cn/ywgz/fgbz/bz/bzwb/other/qt/201706/t20170608_415697.shtml
这玩意也不是很难找啊……不过之前的生态环境部科技司的网站似乎给关掉了,那里可以下载到所有的标准文件
更新:
http://www.mee.gov.cn/ywgz/fgbz/bz/
这里应该是替代以前的科技司的搜索页面的
用buildroot编译一下有工具链了啊……
wch的这个库封装的太底层了,要对蓝牙有比较深刻的理解才能玩起来,不像nordic的SDK那样。如果有类似 nRF SDK 的SDK就好了
其实还好,用droidsans fallback字体加squashfs,塞到16M的flash中还能剩下大概4M放东西
这屏幕是lvds还是啥信号的吧……f1c100s不是只支持rgb吗
感觉现在已经很少有人裸写win32 api gui了,都是用一些界面库来实现了
rootfs里面记得要把rtl8723的固件丢进去
debian8,梦回2015
不是很能明白楼上某些人的逻辑,GPL本身就是一个协议,你用了人家的东西,人家要求你开源,这是一个对等的关系;你不想开源可以不用,没人逼你用。但你用了又不开源,这就连商业上最基础的契约精神都丢掉了。今天你可以违反一个GPL,只是暂时没人管你;明天要是没人管是不是就要骗人家的货款了?这点东西都不懂吗?说什么自己工业还要发展这类的借口,完全只是为了逃避义务罢了。这点义务只不过是将自己的某些驱动贡献出来,就好像要了国内某些厂商的命一样。殊不知这个软件是多少人辛勤工作换来的。饮水不忘挖井人,你仅仅只是为这口井添上了一块石头而已,并不能成为你独占这口井的理由。
全志这事已经干了很多年了,无论如何还是要站出来推动全志开源比较好。总是没有人推动,国内的开源环境就还是原地踏步。国内的小米就是一个正面例子,经过国内外的玩家的不懈努力,新发布的手机的内核会在3个月内开源。国产软件被钉在开源耻辱柱上的例子已经很多了,还是希望不要有更多的厂商被钉在上面。
这个是视频素材吧
打个diff发上来吧……整个发出来太大了
用esp8089的驱动啊,就是esp8266+驱动内置固件这种方案的,esp32还是贵了点
是rikka!
之前卡在了preinit的脚本的编写上,感谢分享
这个驱动稍全,至少USB和LCD都正常,操心比较少: https://github.com/Lichee-Pi/linux/commits/nano-4.14-exp
Linux 5.2尝鲜: https://whycan.cn/t_2896.html
转载地址: http://greedyhao.cc/2019/07/26/工作-Linux-2019-07-26-drm设备不工作/
日期: 2019-07-26
作者: greedyhao
代码: https://github.com/greedyhao/linux/tree/nano-5.2-flash
代码: https://github.com/greedyhao/linux/tree/nano-5.2-tf
greedyhao的树已经被merge到licheepi里面了
个人没法备案论坛的……所以还是统一用外面的好了。
1. 不建议在Windows下开发,坑很多
2. uboot是bootloader;xboot是一个系统,与其对应的概念是linux、freertos、rt-thread等
3. 主线内核版本新, 有人维护;BSP驱动多,版本旧没人维护。
4. 这个建议自己对比,每个框架都有自己的优点和缺点,脱离应用场景来谈是没法谈的
5. 接口问题建议看数据手册;USB Wifi没有用过没法回答你
6. 肯定没法达到的。intel最近有写一篇文章怎么将linux的启动时间缩短到3秒内,你可以去看看。
居然没有在github上面放,感觉有点……不太可信?
我知道的几个论坛系统可以推荐一下:
https://github.com/flarum/flarum
https://nodebb.org/
flarum是用PHP写的,Nodebb是用nodejs写的。widora和坑智的论坛都是用的nodebb
well,我还真找到了SPI的Wifi模块,就是ESP8089,驱动在此: https://github.com/george-hopkins/esp8089-spi
看看有没有人能驱动起来
这个选项可以在busybox的menuconfig里面开吧,手动改配置感觉有点不方便
关于framebuffer的问题,其实可以不用改内核编译参数的
echo 0 > /sys/class/graphics/fbcon/cursor_blink
echo 0 > /sys/class/vtconsole/vtcon1/bind
这样就可以关掉了
5.2的内核已经合并了这个更改了,后续应该是不用手动更改了
jiangming1399 说:f1c100系列的就是没有俩SDIO。要有俩的话就能SD和Wifi共存了
有一个 1bit sdio
有1bit sdio能用的WIFI模块吗……我看SDIO的1bit模式至少都要两根线啊……
f1c100系列的就是没有俩SDIO。要有俩的话就能SD和Wifi共存了
你这透明通道怎么还带棋盘网格的(
再发一次这个: https://whycan.cn/t_2179.html 希望对你有所帮助
既然都是基于gnu工具链,试试Clion也可以啊。JetBrains家的IDE,素质都不错的。原生支持CMake构建,整合的GDB调试器,随意连Jlink,用着很舒服。
Clion要钱啊(
盒子上还写着ARM呢哈哈
jiangming1399 说:Han 说:CONFIG_MTD_BLOCK 应该在哪勾选呀?
我把CONFIG_BOOTARGS 里的root=31:03改为了root=/linuxrc,可是会卡在这个地方:[ 1.407647] Waiting for root device /linuxrc...1. root用建议我帖子里的那个,记得勾上 Caching block device access to MTD devices
2. 检查你的分区结构与分区格式你帖子里那个root=/dev/mtdblock3,这个具体地址是怎么确定的呀,还是说我直接用这个就行呢
看我帖子最开头,我写明了分区结构,mtdblock3就是rootfs。如果你的结构不一致的话得自己改,dtb的也是。
还能这么玩 说:1. CONFIG_MTD_BLOCK 这个有没有勾选?
2. bootargs 加 root=/linuxrc
3. jffs2 文件系统有问题:[ 3.840645] jffs2: Cowardly refusing to erase blocks on filesystem with no valid JFFS2 nodes
[ 3.849120] jffs2: empty_blocks 0, bad_blocks 0, c->nr_blocks 175
[ 3.855382] VFS: Cannot open root device "31:03" or unknown-block(31,3): error -5CONFIG_MTD_BLOCK 应该在哪勾选呀?
我把CONFIG_BOOTARGS 里的root=31:03改为了root=/linuxrc,可是会卡在这个地方:[ 1.407647] Waiting for root device /linuxrc...
1. root用建议我帖子里的那个,记得勾上 Caching block device access to MTD devices
2. 检查你的分区结构与分区格式
卡文件下载是一方面,另一方面是buildroot是单线程编译的,第一次编译都这么慢,后面就好了
建议参考这个文档看看配置文件里面的设置项目
1. 勾上root用户。
2. 可能与ash的配置有关。不推荐把home目录设置到/,建议放到/root或/home/$(USER)目录下。
3. 本质上屏幕和串口不是同一个输出设备,没有很方便的方法做到两个同时输出:只能将串口和屏幕二选一作为默认输出设备。
弱弱的问一句 fakeroot的作用是什么呢?
用fakeroot执行的命令,会被认为是以root用户ID执行的。在这里是为了让文件的所有者变为root,而不是打包时候的用户,防止在新的系统中出现文件权限问题。
看样子节点是有了,但是文件系统不支持。你启用了SquashFS或者你用的文件系统的支持吗?
按楼主的配置来,启动后,使用root登陆不进去,难道不是这个用户名。。。
默认是空密码 你进不去吗?
你们用16Mflash可以成功reboot吗
不行……
敲碗催更~ 有wifi蓝牙什么的就好,最好是能够内置FLASH+外接SD卡,这样可以不用占用珍贵的SD位置放系统。
最近没啥东西想玩,就等着这个呢
为何不用letencrypt的证书呢?全自动签发,支持泛域名,服务器上装个脚本就能自动续期了
站长你不要把原debugdump.com的证书给换掉啊,现在直接上就提示证书错误了。
如果你在用nginx的话,可以新增一个网站配置,里面做301重定向,并且配置上原有的挖坑网证书。
基本做不到吧,光内核就差不多4M了,rootfs也需要空间。除非对内核进行很大的裁剪才行。我看linux4.x之后,openwrt官方就很难弄出支持4Mflash的固件了。
我猜大概是因为这是6bit的屏幕?6bit需要抖动才能达到8bit的效果,所以特定的bit就被省略了?
看上去和DAPLink差不多的样子?
内核要改分辨率的话,需要在设备树里面把屏幕的型号换一下
关于邮费的问题,楼主寄往国外是走转运公司的,是先发往国内的转运公司再发往国外的,淘宝的邮费是走到转运公司的邮费,理应包邮才对。
请问编译Buildroot的工具链怎么配置呢?
我用的是buildroot自带工具链,配置方法见“基础设置”那一节。如果要设置外部工具链,可以在同一个菜单中设置
jiangming1399 说:刘少来了 说:开启了gadget后,启动log基本没变化,但是改了inittab后,启动log如下,还是卡住了 - -。感觉是root权限的问题,有没有什么方法,让开机启动时就是root
mount: only root can use "--types" option (effective UID is 1000)
mount: only root can use "--options" option (effective UID is 1000)
mkdir: can't create directory '/dev/pts': Permission denied
mkdir: can't create directory '/dev/shm': Permission denied
mount: only root can use "--all" option (effective UID is 1000)
hostname: sethostname: Operation not permitted
Starting logging: OK
Initializing random number generator... done.按理说默认就是root用户才对啊,你构建jffs2的时候有没有用fakeroot?
没有,我用的官网提供的buildroot和 .config文件,然后自己做了修改,修改后里面也没有用到 fakeroot
我感觉可能是文件权限的问题。你用的是我的打包脚本吗?如果不是的话,在制作jffs2的时候要用root权限,或者用fakeroot,不然里面的文件权限可能会有问题。
jiangming1399 说:刘少来了 说:楼主,我按照你的改了一部分,启动log如下,一直打印 can't open /dev/ttyS0: Permission denied,有什么方法能解决吗
USB那里没有启用gadget。要么把gadget打开,要么修改inittab把里面的/dev/ttyS0的getty给删了
开启了gadget后,启动log基本没变化,但是改了inittab后,启动log如下,还是卡住了 - -。感觉是root权限的问题,有没有什么方法,让开机启动时就是root
mount: only root can use "--types" option (effective UID is 1000)
mount: only root can use "--options" option (effective UID is 1000)
mkdir: can't create directory '/dev/pts': Permission denied
mkdir: can't create directory '/dev/shm': Permission denied
mount: only root can use "--all" option (effective UID is 1000)
hostname: sethostname: Operation not permitted
Starting logging: OK
Initializing random number generator... done.
按理说默认就是root用户才对啊,你构建jffs2的时候有没有用fakeroot?
楼主,我按照你的改了一部分,启动log如下,一直打印 can't open /dev/ttyS0: Permission denied,有什么方法能解决吗
USB那里没有启用gadget。要么把gadget打开,要么修改inittab把里面的/dev/ttyS0的getty给删了
https://www.lotlab.org/2019/02/22/荔枝派nano的spi-flash系统编译创建全过程/
看屏幕背光亮度调整那一节 可能能帮到你
Waiting for root device /dev/mtdblock3...
https://whycan.cn/t_2179.html
看SPI-Flash支持的那一节
博客里面的文章更新了背光的调整设置,这里没法编辑原帖很难受
楼主是用buildroot2017.8 吗
用的是最新的2018.11.1
原文发表在我博客上:荔枝派nano的SPI-Flash系统编译创建全过程
本文的目标是创建一个运行在SPI-Flash上的精简系统,附带填一些前人没有提及的坑。在开始之前,请先通读官方教程的即食部分(U-Boot)、Linux编译和SPI-Flash系统的创建部分的教程,并搭建好编译工具链。以下我假设你已经按照上面的教程下载好了U-Boot和Linux内核,并且到Buildroot的官网下载好了Buildroot(但没按教程创建config文件)。
以下是我这里的分区结构。你可以自由的分配后面两个分区的大小。
ID SIZE USAGE ADDR
0 448kb U-boot 0x0000 0000 - 0x0007 0000
1 64kb dtb 0x0007 0000 - 0x0008 0000
2 4mb kernel 0x0008 0000 - 0x0048 0000
3 7.5mb rootfs 0x0048 0000 - 0x00c0 0000
4 4mb overlay 0x00c0 0000 - 0x0100 0000
按照上面的U-Boot的编译教程来编译基本上是没有什么太大问题。我这里就说一下上面教程里面没有说的配置:
勾上
Enable boot arguments
,然后在下面填上:
panic=5 rootwait root=/dev/mtdblock3 rw rootfstype=squashfs
其中,root=/dev/mtdblock3指定了第3分区为rootfs所在分区,rootfstype=squashfs指定了这个分区的格式是squashfs。
勾上
Enable a default value for bootcmd
,然后在下面填上:
sf probe 0 60000000; sf read 0x80c00000 0x70000 0x10000; sf read 0x80008000 0x80000 0x400000; bootz 0x80008000 - 0x80c00000
0x70000和0x80000分别是分区1和2的起始地址。
默认配置下,U-Boot的体积是接近1M的,但实际上U-Boot本体才270k左右。多余的空间实际上是被环境配置所占据了。
进入Environment菜单,找到Environment Offset。这个Offset就是配置的偏移地址,只要它比U-Boot本体大就可以了。这里我设置成0x68000,并将Environment Size设置成0x8000,这样编译出来的U-Boot大小就正好是0x70000,也就是448kb。
勾上Console下的 Enable console multiplexing 和 Select console devices from environment,就可以在屏幕上看到启动日志了。
Linux的坑就稍微有些多了。在做接下来的东西之前,你最好先载入官方的配置文件。
进入 Device Drivers -> SPI support,将 Allwinner A10 SoCs SPI controller取消勾选,然后勾上下面的Allwinner A31 SPI Controller。这是为了修正配置文件中SPI驱动不正确的问题。
勾上并进入 Device Drivers -> Memory Technology Device (MTD) support,选上下面两项:
Command line partitioning table parsing #为了解析内核参数传过来的分区信息,如果用设备树应该可以不选
Caching block device access to MTD devices #为了生成/dev/mtdblock*设备,不选会报错
取消勾选 General setup -> initramfs support (存疑)。
再进入Filesystem Drivers,选上JFFS2和SquashFS的支持。
然后打开drivers/mtd/spi-nor/spi-nor.c,检查自己的flash型号的参数是否含有SECT_4K,如果有则改为0。例如对于w25q128,需要将
{ "w25q128", INFO(0xef4018, 0, 64 * 1024, 256, SECT_4K) },
改为
{ "w25q128", INFO(0xef4018, 0, 64 * 1024, 256, 0) }
。
最后修改设备树文件中的分区信息,可以参考前面官方教程里面的dts修改章节。
flash@0 {
#address-cells = <1>;
#size-cells = <1>;
compatible = "macronix,mx25l12805d", "jedec,spi-nor";
reg = <0>;
spi-max-frequency = <50000000>;
partitions {
compatible = "fixed-partitions";
#address-cells = <1>;
#size-cells = <1>;
partition@0 {
label = "u-boot";
reg = <0x000000 0x70000>;
read-only;
};
partition@70000 {
label = "dtb";
reg = <0x70000 0x10000>;
read-only;
};
partition@80000 {
label = "kernel";
reg = <0x80000 0x400000>;
read-only;
};
partition@480000 {
label = "rootfs";
reg = <0x480000 0x780000>;
};
partition@c00000 {
label = "overlayfs";
reg = <0xc00000 0x400000>;
};
};
};
为了方便调试,需要启用USB Gadget。
转到 Device Driver -> USB support -> USB Gadget support,勾上 Usb gadget functions configurable through configfs,和上面的Serial gadget console support,以及下面的CDC ACM、CDC ECM、RNDIS、FunctionFS,再取消USB Gadget precomposed configurations的勾选。(具体原因和操作方法可以看我前面的文章)
对文件drivers/clk/sunxi-ng/ccu-suniv.c应用下面这个补丁,修正USB驱动问题
--- ../linux/drivers/clk/sunxi-ng/ccu-suniv.c 2019-01-15 22:48:18.824587965 +0800
+++ drivers/clk/sunxi-ng/ccu-suniv.c 2019-01-23 09:05:17.959348454 +0800
@@ -238,7 +238,7 @@
/* The BSP header file has a CIR_CFG, but no mod clock uses this definition */
static SUNXI_CCU_GATE(usb_phy0_clk, "usb-phy0", "osc24M",
- 0x0cc, BIT(8), 0);
+ 0x0cc, BIT(1), 0);
static SUNXI_CCU_GATE(dram_ve_clk, "dram-ve", "pll-ddr",
0x100, BIT(0), 0);
我这里用的是rtl8723bs,所以在drivers->staging里面启用相关的驱动就可以了。
下载Buildroot后解压,不要使用官方的配置文件,应当自己从零开始编译。
Target options
-- Target Architecture (ARM (little endian))
-- Target Variant arm926t
Toolchain
-- C library (musl) # 使用musl减小最终体积
System configuration
-- Use syslinks to /usr .... # 启用/bin, /sbin, /lib的链接
-- Enable root login # 启用root登录
-- Run a getty after boot # 启用登录密码输入窗口
-- remount root filesystem # 重新挂载根文件系统到可读写
-- Install Timezone info # 安装时区信息。我的程序需要所以就打开了这个玩意
-- timezone list (asia)
-- default local time (Asia/Shanghai)
Target Packages
-- mount/umount # 如果要用overlayfs,那就要用这个挂载
这里我给出包名然后自己搜素就好了
ifupdown scripts
iw # 用做无线网络管理的,可不要
wpa_supplicant # 无线网络管理需要这个玩意
linux-firmware -> rtl87xx # 无线网卡的固件
lrzsz # rz/sz命令,用于传输文件
gawk # 用于解析iw命令的输出
dialog # 用于wifish管理的图形界面的生成
有一些软件包在busybox内是自带的,可以到使用busybox的menuconfig进行配置。需要先运行一次make生成busybox的构建文件夹,然后再使用 make busybox-menuconfig 配置。每次clean后都需要重新配置一次,因为在clean的时候这个配置会被清除。
可能需要的软件包:
ntpd # 网络自动校正时间
udhcpc # dhcp客户端
下面所说的所有操作都包含在这个打包脚本里面了:licheepi-nano-image-master
这里有个脚本可以一键生成镜像。
OUT_FILENAME="flashimg.bin"
UBOOT_FILE=../u-boot-new/u-boot-sunxi-with-spl.bin
KERNEL_DIR=../linux
KERNEL_MODULES_DIR=$KERNEL_DIR/out/*
DTB_FILE=$KERNEL_DIR/arch/arm/boot/dts/suniv-f1c100s-licheepi-nano.dtb
KERNEL_FILE=$KERNEL_DIR/arch/arm/boot/zImage
ROOTFS_FILE=../buildroot-2018.11.1/output/images/rootfs.tar
SPEC_FILE=./custom/*
SCRIPTES=./scripts/*.sh
dd if=/dev/zero of=$OUT_FILENAME bs=1M count=16
dd if=$UBOOT_FILE of=$OUT_FILENAME bs=1K conv=notrunc
dd if=$DTB_FILE of=$OUT_FILENAME bs=1K seek=448 conv=notrunc
dd if=$KERNEL_FILE of=$OUT_FILENAME bs=1K seek=512 conv=notrunc
mkdir rootfs
tar xf $ROOTFS_FILE -C ./rootfs
cp -r $KERNEL_MODULES_DIR rootfs/usr/
cp -r $SPEC_FILE rootfs/
# add some custom modify
for f in $SCRIPTES; do
ROOTFS_PATH=./rootfs bash "$f" -H
done
fakeroot mksquashfs rootfs/ rootfs.img -no-exports -no-xattrs -all-root
fakeroot mkfs.jffs2 -s 0x100 -e 0x10000 --pad=0x400000 -o jffs2.img -d overlay/
dd if=rootfs.img of=$OUT_FILENAME bs=1K seek=4608 conv=notrunc
dd if=jffs2.img of=$OUT_FILENAME bs=1M seek=12 conv=notrunc
rm -rf rootfs rootfs.img jffs2.img
需要增加一个开机启动脚本,指向前面文章的USB gadget的配置脚本。
需要修改/etc/inittab,增加ttyGS0的getty。
sed -i 's/\# Put a getty on the serial port/\# Put a getty on the serial port\nttyGS0::respawn:\/sbin\/getty -L ttyGS0 0 vt100 # GENERIC_SERIAL/g' $ROOTFS_PATH/etc/inittab
修改/etc/network/interface,增加wlan0
auto wlan0
iface wlan0 inet dhcp
pre-up wpa_supplicant -i wlan0 -c /overlay/etc/wpa_supplicant.conf -B
wait-delay 15
hostname $(hostname)
post-down killall -q wpa_supplicant
为了使wpa_supplicant.conf可写,故我将其放在了overlay分区上。
修改/etc/fstab,增加一行
/dev/mtdblock4 /overlay jffs2 defaults 0 0
这就将第四分区挂载到了/overlay上。需要注意这个文件夹需要预先创建
在overlay分区创建etc/wpa_supplicant.conf,内容如下:
ctrl_interface=/var/run/wpa_supplicant
ctrl_interface_group=wheel
update_config=1
eapol_version=1
ap_scan=1
fast_reauth=1
增加的update_config=1是为了让wpa_cli能够修改这个文件,保存wifi的配置。
创建/etc/wpa_supplicant/wpa_cli-action.sh,内容见:
https://git.yoctoproject.org/cgit/cgit.cgi/meta-intel-edison/plain/meta-intel-edison-distro/recipes-connectivity/wpa_supplicant/wpa-supplicant/wpa_cli-actions.sh
增加一个启动脚本,命令行为:
/usr/sbin/wpa_cli -a /etc/wpa_supplicant/wpa_cli-action.sh -B
。
上面的两个脚本的作用是让wpa_cli在Wifi连接上后调用wpa_cli-action.sh,从而自动调用udhcpc获取ip地址。
按照安装脚本将wifish的文件复制到它们应该在的地方。启动后就可以调用wifish来配置WiFi了。
先预定一个,想做个便携播放器23333
真贵啊
我寻思着这些资料网上应该挺多的来着
jiangming1399 说:花了一点时间对Icenowy的patch和chong的patch进行了比较,结果发现chong的patch包基本上就是在Icenowy的基础上更改了下面的这个文件:
--- ../linux/drivers/clk/sunxi-ng/ccu-suniv.c 2019-01-15 22:48:18.824587965 +0800
+++ drivers/clk/sunxi-ng/ccu-suniv.c 2019-01-23 09:05:17.959348454 +0800
@@ -238,7 +238,7 @@
/* The BSP header file has a CIR_CFG, but no mod clock uses this definition */static SUNXI_CCU_GATE(usb_phy0_clk, "usb-phy0", "osc24M",
- 0x0cc, BIT(8), 0);
+ 0x0cc, BIT(1), 0);static SUNXI_CCU_GATE(dram_ve_clk, "dram-ve", "pll-ddr",
0x100, BIT(0), 0);理论上将上面这个patch应用到Icenowy的4.14内核中,USB应该也就能跑了。
@jiangming1399 我的4.14内核只修改此处,USB没办法正常运行,请问你用的哪个内核?
内核:https://github.com/Lichee-Pi/linux/tree/nano-4.14-exp
内核日志:Starting kernel ... [ 0.000000] Booting Linux on physical CPU 0x0 [ 0.000000] Linux version 4.14.0-licheepi-nano (peter@peter-ThinkPad-T440p) (gcc version 6.4.0 (Buildroot 2018.11.1)) #25 Thu Feb 14 14:42:36 CST 2019 [ 0.000000] CPU: ARM926EJ-S [41069265] revision 5 (ARMv5TEJ), cr=0005317f [ 0.000000] CPU: VIVT data cache, VIVT instruction cache [ 0.000000] OF: fdt: Machine model: Lichee Pi Nano [ 0.000000] Memory policy: Data cache writeback [ 0.000000] random: fast init done [ 0.000000] Built 1 zonelists, mobility grouping on. Total pages: 8128 [ 0.000000] Kernel command line: console=tty0 console=ttyS0,115200 panic=5 rootwait root=/dev/mmcblk0p2 rw [ 0.000000] PID hash table entries: 128 (order: -3, 512 bytes) [ 0.000000] Dentry cache hash table entries: 4096 (order: 2, 16384 bytes) [ 0.000000] Inode-cache hash table entries: 2048 (order: 1, 8192 bytes) [ 0.000000] Memory: 23736K/32768K available (5120K kernel code, 187K rwdata, 1148K rodata, 1024K init, 229K bss, 9032K 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 : 0xc2800000 - 0xff800000 ( 976 MB) [ 0.000000] lowmem : 0xc0000000 - 0xc2000000 ( 32 MB) [ 0.000000] pkmap : 0xbfe00000 - 0xc0000000 ( 2 MB) [ 0.000000] modules : 0xbf000000 - 0xbfe00000 ( 14 MB) [ 0.000000] .text : 0xc0008000 - 0xc0600000 (6112 kB) [ 0.000000] .init : 0xc0800000 - 0xc0900000 (1024 kB) [ 0.000000] .data : 0xc0900000 - 0xc092ef40 ( 188 kB) [ 0.000000] .bss : 0xc0933830 - 0xc096d00c ( 230 kB) [ 0.000000] SLUB: HWalign=32, Order=0-3, MinObjects=0, CPUs=1, Nodes=1 [ 0.000000] NR_IRQS: 16, nr_irqs: 16, preallocated irqs: 16 [ 0.000048] sched_clock: 32 bits at 24MHz, resolution 41ns, wraps every 89478484971ns [ 0.000115] clocksource: timer: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 79635851949 ns [ 0.000628] Console: colour dummy device 80x30 [ 0.001539] console [tty0] enabled [ 0.001644] Calibrating delay loop... 203.16 BogoMIPS (lpj=1015808) [ 0.070285] pid_max: default: 32768 minimum: 301 [ 0.070650] Mount-cache hash table entries: 1024 (order: 0, 4096 bytes) [ 0.070744] Mountpoint-cache hash table entries: 1024 (order: 0, 4096 bytes) [ 0.072205] CPU: Testing write buffer coherency: ok [ 0.073908] Setting up static identity map for 0x80100000 - 0x80100058 [ 0.076430] devtmpfs: initialized [ 0.082809] clocksource: jiffies: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 19112604462750000 ns [ 0.082969] futex hash table entries: 256 (order: -1, 3072 bytes) [ 0.083279] pinctrl core: initialized pinctrl subsystem [ 0.085309] NET: Registered protocol family 16 [ 0.086631] DMA: preallocated 256 KiB pool for atomic coherent allocations [ 0.088521] cpuidle: using governor menu [ 0.108569] SCSI subsystem initialized [ 0.108976] usbcore: registered new interface driver usbfs [ 0.109224] usbcore: registered new interface driver hub [ 0.109470] usbcore: registered new device driver usb [ 0.109969] pps_core: LinuxPPS API ver. 1 registered [ 0.110054] pps_core: Software ver. 5.3.6 - Copyright 2005-2007 Rodolfo Giometti <giometti@linux.it> [ 0.110293] PTP clock support registered [ 0.112052] clocksource: Switched to clocksource timer [ 0.138288] NET: Registered protocol family 2 [ 0.139776] TCP established hash table entries: 1024 (order: 0, 4096 bytes) [ 0.139930] TCP bind hash table entries: 1024 (order: 0, 4096 bytes) [ 0.140021] TCP: Hash tables configured (established 1024 bind 1024) [ 0.140335] UDP hash table entries: 256 (order: 0, 4096 bytes) [ 0.140446] UDP-Lite hash table entries: 256 (order: 0, 4096 bytes) [ 0.140970] NET: Registered protocol family 1 [ 0.141489] NetWinder Floating Point Emulator V0.97 (double precision) [ 0.143450] Initialise system trusted keyrings [ 0.144298] workingset: timestamp_bits=30 max_order=13 bucket_order=0 [ 0.172281] Key type asymmetric registered [ 0.172394] Asymmetric key parser 'x509' registered [ 0.172638] Block layer SCSI generic (bsg) driver version 0.4 loaded (major 251) [ 0.172736] io scheduler noop registered [ 0.172784] io scheduler deadline registered [ 0.173593] io scheduler cfq registered (default) [ 0.173690] io scheduler mq-deadline registered [ 0.173743] io scheduler kyber registered [ 0.174895] sun4i-usb-phy 1c13400.phy: Couldn't request ID GPIO [ 0.185088] suniv-pinctrl 1c20800.pinctrl: initialized sunXi PIO driver [ 0.353071] Serial: 8250/16550 driver, 8 ports, IRQ sharing disabled [ 0.359799] console [ttyS0] disabled [ 0.380122] 1c25000.serial: ttyS0 at MMIO 0x1c25000 (irq = 24, base_baud = 6250000) is a 16550A [ 0.815430] console [ttyS0] enabled [ 0.825943] panel-simple panel: panel supply power not found, using dummy regulator [ 0.835166] SCSI Media Changer driver v0.25 [ 0.842257] mousedev: PS/2 mouse device common for all mice [ 0.849609] input: 1c24800.rtp as /devices/platform/soc/1c24800.rtp/input/input0 [ 0.858396] i2c /dev entries driver [ 0.922179] sunxi-mmc 1c0f000.mmc: base:0xc2857000 irq:19 [ 0.930592] NET: Registered protocol family 17 [ 0.935344] Key type dns_resolver registered [ 0.941835] Loading compiled-in X.509 certificates [ 0.957017] [drm] Supports vblank timestamp caching Rev 2 (21.10.2013). [ 0.963848] [drm] No driver support for vblank timestamp query. [ 0.970811] sun4i-drm display-engine: bound 1e60000.display-backend (ops 0xc0635088) [ 0.979760] sun4i-drm display-engine: bound 1c0c000.lcd-controller (ops 0xc063443c) [ 1.122547] Console: switching to colour frame buffer device 100x30 [ 1.130367] mmc0: host does not support reading read-only switch, assuming write-enable [ 1.132568] mmc0: new high speed SD card at address 2143 [ 1.133765] mmcblk0: mmc0:2143 APPSD 120 MiB [ 1.171682] mmcblk0: p1 p2 [ 1.172550] mmcblk0: p2 size 1048576 extends beyond EOD, truncated [ 1.256746] sun4i-drm display-engine: fb0: frame buffer device [ 1.275094] [drm] Initialized sun4i-drm 1.0.0 20150629 for display-engine on minor 0 [ 1.295646] usb_phy_generic usb_phy_generic.0.auto: usb_phy_generic.0.auto supply vcc not found, using dummy regulator [ 1.330101] ------------[ cut here ]------------ [ 1.346479] WARNING: CPU: 0 PID: 3 at drivers/usb/musb/sunxi.c:411 sunxi_musb_ep_offset+0x3c/0x54 [ 1.367375] sunxi_musb_ep_offset called with non 0 offset [ 1.384570] Modules linked in: [ 1.399371] CPU: 0 PID: 3 Comm: kworker/0:0 Not tainted 4.14.0-licheepi-nano #25 [ 1.418797] Hardware name: Allwinner suniv Family [ 1.435493] Workqueue: events deferred_probe_work_func [ 1.452838] [<c010e6d8>] (unwind_backtrace) from [<c010b88c>] (show_stack+0x10/0x14) [ 1.473318] [<c010b88c>] (show_stack) from [<c0116708>] (__warn+0xd4/0xfc) [ 1.492822] [<c0116708>] (__warn) from [<c0116768>] (warn_slowpath_fmt+0x38/0x48) [ 1.513050] [<c0116768>] (warn_slowpath_fmt) from [<c0418418>] (sunxi_musb_ep_offset+0x3c/0x54) [ 1.534686] [<c0418418>] (sunxi_musb_ep_offset) from [<c040c060>] (ep_config_from_hw+0xe0/0x158) [ 1.556405] [<c040c060>] (ep_config_from_hw) from [<c040d8c4>] (musb_probe+0x528/0xc0c) [ 1.577327] [<c040d8c4>] (musb_probe) from [<c03a6c64>] (platform_drv_probe+0x50/0xb0) [ 1.598033] [<c03a6c64>] (platform_drv_probe) from [<c03a5394>] (driver_probe_device+0x22c/0x2f0) [ 1.619738] [<c03a5394>] (driver_probe_device) from [<c03a39c8>] (bus_for_each_drv+0x64/0x94) [ 1.641224] [<c03a39c8>] (bus_for_each_drv) from [<c03a5084>] (__device_attach+0xac/0x114) [ 1.662464] [<c03a5084>] (__device_attach) from [<c03a467c>] (bus_probe_device+0x84/0x8c) [ 1.683726] [<c03a467c>] (bus_probe_device) from [<c03a2b88>] (device_add+0x3c8/0x578) [ 1.704952] [<c03a2b88>] (device_add) from [<c03a69d8>] (platform_device_add+0x100/0x218) [ 1.726576] [<c03a69d8>] (platform_device_add) from [<c03a73c8>] (platform_device_register_full+0xf0/0x114) [ 1.762783] [<c03a73c8>] (platform_device_register_full) from [<c0418090>] (sunxi_musb_probe+0x26c/0x414) [ 1.798970] [<c0418090>] (sunxi_musb_probe) from [<c03a6c64>] (platform_drv_probe+0x50/0xb0) [ 1.821539] [<c03a6c64>] (platform_drv_probe) from [<c03a5394>] (driver_probe_device+0x22c/0x2f0) [ 1.844552] [<c03a5394>] (driver_probe_device) from [<c03a39c8>] (bus_for_each_drv+0x64/0x94) [ 1.867118] [<c03a39c8>] (bus_for_each_drv) from [<c03a5084>] (__device_attach+0xac/0x114) [ 1.889558] [<c03a5084>] (__device_attach) from [<c03a467c>] (bus_probe_device+0x84/0x8c) [ 1.911845] [<c03a467c>] (bus_probe_device) from [<c03a4ac8>] (deferred_probe_work_func+0x4c/0x140) [ 1.948664] [<c03a4ac8>] (deferred_probe_work_func) from [<c0129de8>] (process_one_work+0x1f4/0x404) [ 1.986179] [<c0129de8>] (process_one_work) from [<c012a27c>] (worker_thread+0x284/0x59c) [ 2.009350] [<c012a27c>] (worker_thread) from [<c012f434>] (kthread+0xf8/0x138) [ 2.031533] [<c012f434>] (kthread) from [<c0107f48>] (ret_from_fork+0x14/0x2c) [ 2.053322] ---[ end trace 0009ee3b665ce1e0 ]--- [ 2.072380] musb-sunxi 1c13000.usb: Error unknown readb offset 128 [ 2.093172] musb-hdrc musb-hdrc.1.auto: musb_init_controller failed with status -22 [ 2.115552] musb-hdrc: probe of musb-hdrc.1.auto failed with error -22 [ 2.140270] EXT4-fs (mmcblk0p2): couldn't mount as ext3 due to feature incompatibilities [ 2.387597] EXT4-fs (mmcblk0p2): recovery complete [ 2.448078] EXT4-fs (mmcblk0p2): mounted filesystem with ordered data mode. Opts: (null) [ 2.470667] VFS: Mounted root (ext4 filesystem) on device 179:2. [ 2.492549] devtmpfs: mounted [ 2.516475] Freeing unused kernel memory: 1024K [ 2.720487] EXT4-fs (mmcblk0p2): re-mounted. Opts: data=ordered
我用的就是这个4.14版本的内核,就只改了那里,自己测试时是可以用的,你要不试试重新下载下来用默认配置文件编译?
jiangming1399 说:不支持Hub是什么鬼
应该是固件兼容性,或者上位机烧录软件没做好
之前自己用CH552/4DIY过一些东西,兼容性也不是很好。感觉可能是自己线路画得有问题
不支持Hub是什么鬼
做过相关的程序。实际上就是一个带USB的51,USB部分的代码有例程,GIthub上也有一些库。写这个需要对USB协议有一定的理解才可以,不然就只能改改例程啥的(
看了一下我和楼主编译的方法是一样的,但是我在连接到wifi一定时间后,会出现下面的Err:
err: to_host_seq reg 0x**, seq 0x00
楼主要不连着放久一点试试看看会不会出现这种问题?
jiangming1399 说:花了一点时间对Icenowy的patch和chong的patch进行了比较,结果发现chong的patch包基本上就是在Icenowy的基础上更改了下面的这个文件:
--- ../linux/drivers/clk/sunxi-ng/ccu-suniv.c 2019-01-15 22:48:18.824587965 +0800
+++ drivers/clk/sunxi-ng/ccu-suniv.c 2019-01-23 09:05:17.959348454 +0800
@@ -238,7 +238,7 @@
/* The BSP header file has a CIR_CFG, but no mod clock uses this definition */static SUNXI_CCU_GATE(usb_phy0_clk, "usb-phy0", "osc24M",
- 0x0cc, BIT(8), 0);
+ 0x0cc, BIT(1), 0);static SUNXI_CCU_GATE(dram_ve_clk, "dram-ve", "pll-ddr",
0x100, BIT(0), 0);理论上将上面这个patch应用到Icenowy的4.14内核中,USB应该也就能跑了。
有nano的朋友可以试一试这位的想法, 这种 bug 还真难找
自己尝试了一下,真的可以跑了。
花了一点时间对Icenowy的patch和chong的patch进行了比较,结果发现chong的patch包基本上就是在Icenowy的基础上更改了下面的这个文件:
--- ../linux/drivers/clk/sunxi-ng/ccu-suniv.c 2019-01-15 22:48:18.824587965 +0800
+++ drivers/clk/sunxi-ng/ccu-suniv.c 2019-01-23 09:05:17.959348454 +0800
@@ -238,7 +238,7 @@
/* The BSP header file has a CIR_CFG, but no mod clock uses this definition */
static SUNXI_CCU_GATE(usb_phy0_clk, "usb-phy0", "osc24M",
- 0x0cc, BIT(8), 0);
+ 0x0cc, BIT(1), 0);
static SUNXI_CCU_GATE(dram_ve_clk, "dram-ve", "pll-ddr",
0x100, BIT(0), 0);
理论上将上面这个patch应用到Icenowy的4.14内核中,USB应该也就能跑了。
主线=Mainline,意味着是项目维护者维护的代码。
BSP=板级开发包,意味着是厂家给的代码。
主线xx约等于:直接从Linux/u-boot官网上下载的代码
通常来说,BSP修改了过多的代码,不能合并到主线上面去,于是当主线更新的时候,BSP的代码无法跟着主线一起更新。但由于主线的代码基本上都是社区贡献的,所以部分功能可能不生效。
lcfmax 说:有一个支持4.3寸屏的板子,功能比这个全面点
求链接
就在同一家店里面
页次: 1