页次: 1
你的应用程序使用了 cygwin提供的POSIX API吗?如果用了,就把 cygwin*.dll 和 exe 复制到同一个文件夹.
如果不需要posix api,可以使用-mno-cygwin标志编译它,它不依赖于cygwin,但它将是一个本地Windows应用程序。通常,只需要一个真正的shell(Bash)来配置和构建应用程序,但实际上并不需要Cygwin的POSIX功能。
另一种选择是安装MSYS+MinGW,这是Cygwin的一个轻量级fork, 默认情况下生成本机Windows应用程序, 我记得Qt安装包里面自带了。
搜索: qt-opensource-windows-x86-5.13.2.exe (很大)
或者使用Cygwin本身的MinGW编译器。它们应该可以通过普通的Cygwin软件包管理器获得。然后使用MinGW编译器将项目配置为交叉编译。
ubuntu20.04 自带的 qemu 还是没有 riscv 得自己编译.
wget https://download.qemu.org/qemu-6.0.0.tar.xz
tar xvJf qemu-6.0.0.tar.xz
cd qemu-6.0.0
./configure
make
把find找出的文件打包:
find . -name "*.pdf" -print | tar -czf pdfs.tar.gz --files-from -
或者
find . -name "*.xyz" | xargs tar cvf xyz.tar;
https://stackoverflow.com/questions/11540964/find-with-xargs-and-tar
围观蓝莓派(Blueberry-PI)之后, 一定要试一试 主线 Linux DVP CSI 摄像头
http://whycan.com/t_2039.html#p16744
还有一些网友反应摄像头有条纹,
猜测可能是摄像头电源没有处理好。
怼个mjpeg-streamer 上去试一试:
分享荔枝派zero V3s gc0312 / gc0308 mjpg-streamer IP摄像头固件
http://whycan.com/t_5397.html
Ubuntu@VMWare mjpeg-streamer FRP 搭建远程 USB摄像头(webcam)
http://whycan.com/t_2708.html
wujique 说:mango 说:漂亮,推荐使用 http://g.widora.io 下载git包,填入: https://github.com/wujique/F1C200S_HDK.git
你这仓库中的 ibom.html 真牛逼,好评!
我第一次见,觉得python真是无所不能。
对了,我用CP2104新手问个问题,就是spiflash 16Mz这么小,它是怎么跑linux系统的?一个uboot+内核+根文件就超过16M了,怎么烧录到flash启动
uboot 一般 100k ~ 500k
kernel 一般 1M ~ 6M
rootfs 一般 500k 起
所以, 有2M flash 就能跑Linux了, 记得很久以前1.44M 软盘就能在x86电脑跑路由器固件.
荔枝派Zero V3s开发板入坑记录 (TF/SD卡启动)(主线Linux,主线u-boot)
http://whycan.com/t_561.html
(出处:哇酷开发者社区)
*** Warning - bad CRC, using default environment
这个没问题, 是uboot加载环境变量出错, 他就用了默认参数.
帧率挺高的, 请问是用硬件解码器吗?
这是小智X3开发板上面跑的TF固件, 可以通过USB把eMMC模拟成U盘: smallwit_x3_usb_burn_emmc.img
diff --git a/arch/arm64/boot/dts/allwinner/sun50i-a64-amarula-relic.dts b/arch/arm64/boot/dts/allwinner/sun50i-a64-amarula-relic.dts
index f180c841ac3c..703055f2a4fb 100644
--- a/arch/arm64/boot/dts/allwinner/sun50i-a64-amarula-relic.dts
+++ b/arch/arm64/boot/dts/allwinner/sun50i-a64-amarula-relic.dts
@@ -9,6 +9,7 @@
#include "sun50i-a64.dtsi"
#include <dt-bindings/gpio/gpio.h>
+#include <dt-bindings/pwm/pwm.h>
/ {
model = "Amarula A64-Relic";
@@ -18,6 +19,14 @@
serial0 = &uart0;
};
+ backlight: backlight {
+ compatible = "pwm-backlight";
+ pwms = <&pwm 0 50000 PWM_POLARITY_INVERTED>;
+ brightness-levels = <1 2 4 8 16 32 64 128 512>;
+ default-brightness-level = <2>;
+ enable-gpios = <&pio 3 23 GPIO_ACTIVE_HIGH>; /* LCD-BL-EN: PD23 */
+ };
+
chosen {
stdout-path = "serial0:115200n8";
};
@@ -83,6 +92,30 @@
};
};
+&de {
+ status = "okay";
+};
+
+&dphy {
+ status = "okay";
+};
+
+&dsi {
+ vcc-dsi-supply = <®_dldo1>;
+ #address-cells = <1>;
+ #size-cells = <0>;
+ status = "okay";
+
+ panel@0 {
+ compatible = "techstar,ts8550b", "sitronix,st7701";
+ reg = <0>;
+ VCC-supply = <®_dldo2>;
+ IOVCC-supply = <®_dldo2>;
+ reset-gpios = <&pio 3 24 GPIO_ACTIVE_HIGH>; /* LCD-RST: PD24 */
+ backlight = <&backlight>;
+ };
+};
+
&ehci0 {
status = "okay";
};
@@ -160,6 +193,12 @@
status = "okay";
};
+&pwm {
+ pinctrl-names = "default";
+ pinctrl-0 = <&pwm_pin>;
+ status = "okay";
+};
+
&r_rsb {
status = "okay";
明月照我沟渠 说:日志有没有出现 tsc2007 设备? 是不是 /dev/input/event1 ?
是的,启动日志没有tsc2007,在/dev/下也没有input
检查 "board/allwinner/suniv-f1c100s/linux.defconfig"
有没有勾选
CONFIG_TOUCHSCREEN_TSC2007
这个文件是否存在:
output/target/lib/modules/5.4.66/kernel/drivers/input/touchscreen/tsc2007.ko
再执行 ./rebuild-kernel.sh & make
U-Boot 2020.07 (Oct 10 2020 - 08:45:42 +0800) Allwinner Technology
CPU: Allwinner F Series (SUNIV)
Model: Allwinner F1C100s Generic Device
DRAM: 64 MiB
MMC: mmc@1c0f000: 0, mmc@1c10000: 1
Setting up a 800x480 lcd console (overscan 0x0)
In: serial
Out: vga
Err: vga
Allwinner mUSB OTG (Peripheral)
Hit any key to stop autoboot: 0
Booting from FEL...
List of MTD devices:
* spi-nand0
- device: spi-nand@1
- parent: spi@1c05000
- driver: spi_nand
- type: NAND flash
- block size: 0x20000 bytes
- min I/O: 0x800 bytes
- OOB size: 64 bytes
- OOB available: 31 bytes
- 0x000000000000-0x000008000000 : "spi-nand0"
DFU waiting on SPI-NAND...
musb-hdrc: peripheral reset irq lost!
##############################################################################################################################################################################################################################################################################################################################################################################################################################################################################################Skipping bad block at 0x03bc0000
#################################################################################################################################################################################################################################################################################################Skipping bad block at 0x06000000
##############################################################################################################################################################################################################################################################Skipping bad block at 0x07fe0000
Limit reached 0x8000000 while erasing at offset 0x7fe0000
Skipping bad block at 0x03bc0000
Skipping bad block at 0x06000000
Skipping bad block at 0x07fe0000
请教烧写spi nand的时候跳开三块block, 程序不会出错吗?
这是虚拟机跑Linux?
对的, 就是Ubuntu 18.04
请教tabview的标题文字能修改中文吗
你用中文有什么问题吗?
按正常流程在 https://www.ys7.com/ 平台注册账号, 添加摄像头.
1. 打开 https://open.ys7.com/console/device.html 找出摄像头的序列号
2. 打开 https://open.ys7.com/console/application.html 获取Appkey, Appscrect
3. 拼凑URL地址,填写密钥到某平台
url地址: ezopen://open.ys7.com/E023XXXXX3/1.hd.live
其中 E023XXXXX3 是 步骤1获取的设备序列号
4. 观看视频
widora的5寸液晶触摸屏型号也是 stc 5099
好像是开启 CONFIG_SPL_OS_BOOT 开关就行了?
全志的看来没戏了,
arch/arm/mach-sunxi/spl_spi_sunxi.c
// SPDX-License-Identifier: GPL-2.0+
/*
* Copyright (C) 2016 Siarhei Siamashka <siarhei.siamashka@gmail.com>
*/
#include <common.h>
#include <image.h>
#include <log.h>
#include <spl.h>
#include <asm/gpio.h>
#include <asm/io.h>
#include <linux/bitops.h>
#include <linux/delay.h>
#include <linux/libfdt.h>
#include <asm/arch/spl.h>
#ifdef CONFIG_SPL_OS_BOOT
#error CONFIG_SPL_OS_BOOT is not supported yet
#endif
编译出错:
COPY u-boot.bin
SYM u-boot.sym
CC spl/arch/arm/mach-sunxi/spl_spi_sunxi.o
arch/arm/mach-sunxi/spl_spi_sunxi.c:18:2: error: #error CONFIG_SPL_OS_BOOT is not supported yet
#error CONFIG_SPL_OS_BOOT is not supported yet
^~~~~
scripts/Makefile.build:265: recipe for target 'spl/arch/arm/mach-sunxi/spl_spi_sunxi.o' failed
make[2]: *** [spl/arch/arm/mach-sunxi/spl_spi_sunxi.o] Error 1
scripts/Makefile.spl:428: recipe for target 'spl/arch/arm/mach-sunxi' failed
make[1]: *** [spl/arch/arm/mach-sunxi] Error 2
Makefile:1926: recipe for target 'spl/u-boot-spl' failed
make: *** [spl/u-boot-spl] Error 2
#
#
找到了: https://github.com/u-boot/u-boot/blob/master/fs/fs.c
#ifdef CONFIG_LMB
/* Check if a file may be read to the given address */
static int fs_read_lmb_check(const char *filename, ulong addr, loff_t offset,
loff_t len, struct fstype_info *info)
{
struct lmb lmb;
int ret;
loff_t size;
loff_t read_len;
/* get the actual size of the file */
ret = info->size(filename, &size);
if (ret)
return ret;
if (offset >= size) {
/* offset >= EOF, no bytes will be written */
return 0;
}
read_len = size - offset;
/* limit to 'len' if it is smaller */
if (len && len < read_len)
read_len = len;
lmb_init_and_reserve(&lmb, gd->bd, (void *)gd->fdt_blob);
lmb_dump_all(&lmb);
if (lmb_alloc_addr(&lmb, addr, read_len) == addr)
return 0;
printf("** Reading file would overwrite reserved memory **\n");
return -ENOSPC;
}
U-Boot SPL 2020.07-dirty (Aug 20 2020 - 00:42:14 -0700)
DRAM: 128 MiB
Failed to set core voltage! Can't set CPU frequency
Trying to boot from MMC1
U-Boot 2020.07-dirty (Aug 20 2020 - 00:42:14 -0700) Allwinner Technology
CPU: Allwinner A33 (SUN8I 1667)
Model: Sinlinx SinA33
DRAM: 128 MiB
MMC: mmc@1c0f000: 0, mmc@1c11000: 1
Loading Environment from FAT... Card did not respond to voltage select!
Setting up a 800x480 lcd console (overscan 0x0)
In: serial
Out: vga
Err: vga
Allwinner mUSB OTG (Peripheral)
Net:
Warning: usb_ether using MAC address from ROM
eth0: usb_ether
starting USB...
Bus usb@1c1a000: USB EHCI 1.00
Bus usb@1c1a400: USB OHCI 1.0
scanning bus usb@1c1a000 for devices... 1 USB Device(s) found
scanning bus usb@1c1a400 for devices... 1 USB Device(s) found
scanning usb for storage devices... 0 Storage Device(s) found
Hit any key to stop autoboot: 0
switch to partitions #0, OK
mmc0 is current device
Scanning mmc 0:1...
Found U-Boot script /boot.scr
355 bytes read in 3 ms (115.2 KiB/s)
## Executing script at 41900000
** Reading file would overwrite reserved memory **
There is no valid bmp file at the given address
** Reading file would overwrite reserved memory **
** Reading file would overwrite reserved memory **
SCRIPT FAILED: continuing...
Card did not respond to voltage select!
Device 0: unknown device
using musb-hdrc, OUT ep1out IN ep1in STATUS ep2in
MAC de:ad:be:ef:00:01
HOST MAC de:ad:be:ef:00:00
RNDIS ready
The remote end did not respond in time.missing environment variable: pxeuuid
missing environment variable: bootfile
Retrieving file: pxelinux.cfg/01-de-ad-be-ef-00-01
using musb-hdrc, OUT ep1out IN ep1in STATUS ep2in
MAC de:ad:be:ef:00:01
HOST MAC de:ad:be:ef:00:00
RNDIS ready
The remote end did not respond in time.missing environment variable: bootfile
Retrieving file: pxelinux.cfg/00000000
using musb-hdrc, OUT ep1out IN ep1in STATUS ep2in
MAC de:ad:be:ef:00:01
HOST MAC de:ad:be:ef:00:00
RNDIS ready
The remote end did not respond in time.missing environment variable: bootfile
Retrieving file: pxelinux.cfg/0000000
using musb-hdrc, OUT ep1out IN ep1in STATUS ep2in
MAC de:ad:be:ef:00:01
HOST MAC de:ad:be:ef:00:00
RNDIS ready
The remote end did not respond in time.missing environment variable: bootfile
Retrieving file: pxelinux.cfg/000000
using musb-hdrc, OUT ep1out IN ep1in STATUS ep2in
MAC de:ad:be:ef:00:01
HOST MAC de:ad:be:ef:00:00
RNDIS ready
The remote end did not respond in time.missing environment variable: bootfile
Retrieving file: pxelinux.cfg/00000
using musb-hdrc, OUT ep1out IN ep1in STATUS ep2in
MAC de:ad:be:ef:00:01
HOST MAC de:ad:be:ef:00:00
RNDIS ready
The remote end did not respond in time.missing environment variable: bootfile
Retrieving file: pxelinux.cfg/0000
using musb-hdrc, OUT ep1out IN ep1in STATUS ep2in
MAC de:ad:be:ef:00:01
HOST MAC de:ad:be:ef:00:00
RNDIS ready
The remote end did not respond in time.missing environment variable: bootfile
Retrieving file: pxelinux.cfg/000
using musb-hdrc, OUT ep1out IN ep1in STATUS ep2in
MAC de:ad:be:ef:00:01
HOST MAC de:ad:be:ef:00:00
RNDIS ready
The remote end did not respond in time.missing environment variable: bootfile
Retrieving file: pxelinux.cfg/00
using musb-hdrc, OUT ep1out IN ep1in STATUS ep2in
MAC de:ad:be:ef:00:01
HOST MAC de:ad:be:ef:00:00
RNDIS ready
The remote end did not respond in time.missing environment variable: bootfile
Retrieving file: pxelinux.cfg/0
using musb-hdrc, OUT ep1out IN ep1in STATUS ep2in
MAC de:ad:be:ef:00:01
HOST MAC de:ad:be:ef:00:00
RNDIS ready
The remote end did not respond in time.missing environment variable: bootfile
Retrieving file: pxelinux.cfg/default-arm-sunxi-sunxi
using musb-hdrc, OUT ep1out IN ep1in STATUS ep2in
MAC de:ad:be:ef:00:01
HOST MAC de:ad:be:ef:00:00
RNDIS ready
The remote end did not respond in time.missing environment variable: bootfile
Retrieving file: pxelinux.cfg/default-arm-sunxi
using musb-hdrc, OUT ep1out IN ep1in STATUS ep2in
MAC de:ad:be:ef:00:01
HOST MAC de:ad:be:ef:00:00
RNDIS ready
The remote end did not respond in time.missing environment variable: bootfile
Retrieving file: pxelinux.cfg/default-arm
using musb-hdrc, OUT ep1out IN ep1in STATUS ep2in
MAC de:ad:be:ef:00:01
HOST MAC de:ad:be:ef:00:00
RNDIS ready
The remote end did not respond in time.missing environment variable: bootfile
Retrieving file: pxelinux.cfg/default
using musb-hdrc, OUT ep1out IN ep1in STATUS ep2in
MAC de:ad:be:ef:00:01
HOST MAC de:ad:be:ef:00:00
RNDIS ready
The remote end did not respond in time.Config file not found
using musb-hdrc, OUT ep1out IN ep1in STATUS ep2in
MAC de:ad:be:ef:00:01
HOST MAC de:ad:be:ef:00:00
RNDIS ready
The remote end did not respond in time.using musb-hdrc, OUT ep1out IN ep1in STATUS ep2in
MAC de:ad:be:ef:00:01
HOST MAC de:ad:be:ef:00:00
RNDIS ready
The remote end did not respond in time.=>
&spi1 {
pinctrl-names = "default";
pinctrl-0 = <&spi1_pins_a>;
pinctrl-1 = <&spi1_pins_a>;
status = "okay";
spi-max-frequency = <25000000>;
dm9051@0 {
compatible = "davicom,dm9051";
reg = <0>;
spi-max-frequency = <25000000>;/*<109000000>;*/
dm9051_rst = <&pio 4 3 GPIO_ACTIVE_HIGH>; /* PE3 */
status = "okay";
};
};
厚脸求 "davicom,dm9051" 这个的驱动.
这个是小智X3的log:
[ 0.000000] Booting Linux on physical CPU 0x0
[ 0.000000] Linux version 4.20.0-dirty (whycan@ubuntu) (gcc version 7.5.0 (Ubuntu/Linaro 7.5.0-3ubuntu1~18.04)) #52 SMP Sun Jul 5 01:57:44 PDT 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: Sinlinx SinA33
[ 0.000000] Memory policy: Data cache writealloc
[ 0.000000] cma: Reserved 16 MiB at 0x45c00000
[ 0.000000] psci: probing for conduit method from DT.
[ 0.000000] psci: Using PSCI v0.1 Function IDs from DT
[ 0.000000] random: get_random_bytes called from start_kernel+0xa0/0x3f4 with crng_init=0
[ 0.000000] percpu: Embedded 16 pages/cpu @(ptrval) s34444 r8192 d22900 u65536
[ 0.000000] Built 1 zonelists, mobility grouping on. Total pages: 32385
[ 0.000000] Kernel command line: console=ttyS0,115200 earlyprintk root=/dev/mmcblk0p2 rootwait panic=10
[ 0.000000] Dentry cache hash table entries: 16384 (order: 4, 65536 bytes)
[ 0.000000] Inode-cache hash table entries: 8192 (order: 3, 32768 bytes)
[ 0.000000] Memory: 102684K/130560K available (6144K kernel code, 456K rwdata, 1652K rodata, 1024K init, 250K bss, 11492K reserved, 16384K 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 : 0xc8000000 - 0xff800000 ( 888 MB)
[ 0.000000] lowmem : 0xc0000000 - 0xc7f80000 ( 127 MB)
[ 0.000000] pkmap : 0xbfe00000 - 0xc0000000 ( 2 MB)
[ 0.000000] modules : 0xbf000000 - 0xbfe00000 ( 14 MB)
[ 0.000000] .text : 0x(ptrval) - 0x(ptrval) (7136 kB)
[ 0.000000] .init : 0x(ptrval) - 0x(ptrval) (1024 kB)
[ 0.000000] .data : 0x(ptrval) - 0x(ptrval) ( 457 kB)
[ 0.000000] .bss : 0x(ptrval) - 0x(ptrval) ( 251 kB)
[ 0.000000] SLUB: HWalign=64, Order=0-3, MinObjects=0, CPUs=4, Nodes=1
[ 0.000000] rcu: Hierarchical RCU implementation.
[ 0.000000] rcu: RCU restricting CPUs from NR_CPUS=8 to nr_cpu_ids=4.
[ 0.000000] rcu: RCU calculated value of scheduler-enlistment delay is 10 jiffies.
[ 0.000000] rcu: Adjusting geometry for rcu_fanout_leaf=16, nr_cpu_ids=4
[ 0.000000] NR_IRQS: 16, nr_irqs: 16, preallocated irqs: 16
[ 0.000000] GIC: Using split EOI/Deactivate mode
[ 0.000000] arch_timer: cp15 timer(s) running at 24.00MHz (phys).
[ 0.000000] clocksource: arch_sys_counter: mask: 0xffffffffffffff max_cycles: 0x588fe9dc0, max_idle_ns: 440795202592 ns
[ 0.000013] sched_clock: 56 bits at 24MHz, resolution 41ns, wraps every 4398046511097ns
[ 0.000038] Switching to timer-based delay loop, resolution 41ns
[ 0.001042] Console: colour dummy device 80x30
[ 0.001123] Calibrating delay loop (skipped), value calculated using timer frequency.. 48.00 BogoMIPS (lpj=240000)
[ 0.001150] pid_max: default: 32768 minimum: 301
[ 0.001471] Mount-cache hash table entries: 1024 (order: 0, 4096 bytes)
[ 0.001499] Mountpoint-cache hash table entries: 1024 (order: 0, 4096 bytes)
[ 0.002608] CPU: Testing write buffer coherency: ok
[ 0.003205] /cpus/cpu@0 missing clock-frequency property
[ 0.003248] /cpus/cpu@1 missing clock-frequency property
[ 0.003282] /cpus/cpu@2 missing clock-frequency property
[ 0.003317] /cpus/cpu@3 missing clock-frequency property
[ 0.003341] CPU0: thread -1, cpu 0, socket 0, mpidr 80000000
[ 0.004305] Setting up static identity map for 0x40100000 - 0x40100060
[ 0.004558] rcu: Hierarchical SRCU implementation.
[ 0.005831] smp: Bringing up secondary CPUs ...
[ 0.007136] CPU1: thread -1, cpu 1, socket 0, mpidr 80000001
[ 0.008615] CPU2: thread -1, cpu 2, socket 0, mpidr 80000002
[ 0.010021] CPU3: thread -1, cpu 3, socket 0, mpidr 80000003
[ 0.010196] smp: Brought up 1 node, 4 CPUs
[ 0.010241] SMP: Total of 4 processors activated (192.00 BogoMIPS).
[ 0.010254] CPU: All CPU(s) started in HYP mode.
[ 0.010266] CPU: Virtualization extensions available.
[ 0.011826] devtmpfs: initialized
[ 0.023734] VFP support v0.3: implementor 41 architecture 2 part 30 variant 7 rev 5
[ 0.024103] clocksource: jiffies: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 19112604462750000 ns
[ 0.024144] futex hash table entries: 1024 (order: 4, 65536 bytes)
[ 0.025681] pinctrl core: initialized pinctrl subsystem
[ 0.027251] NET: Registered protocol family 16
[ 0.029933] DMA: preallocated 256 KiB pool for atomic coherent allocations
[ 0.032064] hw-breakpoint: found 5 (+1 reserved) breakpoint and 4 watchpoint registers.
[ 0.032085] hw-breakpoint: maximum watchpoint size is 8 bytes.
[ 0.062739] SCSI subsystem initialized
[ 0.063638] usbcore: registered new interface driver usbfs
[ 0.063740] usbcore: registered new interface driver hub
[ 0.063861] usbcore: registered new device driver usb
[ 0.064294] pps_core: LinuxPPS API ver. 1 registered
[ 0.064311] pps_core: Software ver. 5.3.6 - Copyright 2005-2007 Rodolfo Giometti <giometti@linux.it>
[ 0.064353] PTP clock support registered
[ 0.064788] Advanced Linux Sound Architecture Driver Initialized.
[ 0.066605] clocksource: Switched to clocksource arch_sys_counter
[ 0.067691] simple-framebuffer 47f80000.framebuffer: framebuffer at 0x47f80000, 0x7f800 bytes, mapped to 0x(ptrval)
[ 0.067723] simple-framebuffer 47f80000.framebuffer: format=x8r8g8b8, mode=480x272x32, linelength=1920
[ 0.073827] Console: switching to colour frame buffer device 60x34
[ 0.079056] simple-framebuffer 47f80000.framebuffer: fb0: simplefb registered!
[ 0.094461] NET: Registered protocol family 2
[ 0.095495] tcp_listen_portaddr_hash hash table entries: 512 (order: 0, 6144 bytes)
[ 0.095555] TCP established hash table entries: 1024 (order: 0, 4096 bytes)
[ 0.095605] TCP bind hash table entries: 1024 (order: 1, 8192 bytes)
[ 0.095657] TCP: Hash tables configured (established 1024 bind 1024)
[ 0.095838] UDP hash table entries: 256 (order: 1, 8192 bytes)
[ 0.095900] UDP-Lite hash table entries: 256 (order: 1, 8192 bytes)
[ 0.096240] NET: Registered protocol family 1
[ 0.097242] RPC: Registered named UNIX socket transport module.
[ 0.097265] RPC: Registered udp transport module.
[ 0.097278] RPC: Registered tcp transport module.
[ 0.097291] RPC: Registered tcp NFSv4.1 backchannel transport module.
[ 0.100352] Initialise system trusted keyrings
[ 0.100677] workingset: timestamp_bits=30 max_order=15 bucket_order=0
[ 0.115439] NFS: Registering the id_resolver key type
[ 0.115501] Key type id_resolver registered
[ 0.115517] Key type id_legacy registered
[ 0.115591] jffs2: version 2.2. (NAND) © 2001-2006 Red Hat, Inc.
[ 0.121708] Key type asymmetric registered
[ 0.121737] Asymmetric key parser 'x509' registered
[ 0.121855] Block layer SCSI generic (bsg) driver version 0.4 loaded (major 248)
[ 0.121878] io scheduler noop registered
[ 0.121895] io scheduler deadline registered
[ 0.122227] io scheduler cfq registered (default)
[ 0.122248] io scheduler mq-deadline registered
[ 0.122264] io scheduler kyber registered
[ 0.123856] sun4i-usb-phy 1c19400.phy: Couldn't request ID GPIO
[ 0.126030] sun8i-a23-r-pinctrl 1f02c00.pinctrl: Reset controller missing
[ 0.131952] sun8i-a33-pinctrl 1c20800.pinctrl: initialized sunXi PIO driver
[ 0.134696] pwm-backlight backlight: backlight supply power not found, using dummy regulator
[ 0.134871] pwm-backlight backlight: Linked as a consumer to regulator.0
[ 0.238485] Serial: 8250/16550 driver, 8 ports, IRQ sharing disabled
[ 0.242948] printk: console [ttyS0] disabled
[ 0.263235] 1c28000.serial: ttyS0 at MMIO 0x1c28000 (irq = 37, base_baud = 1500000) is a U6_16550A
[ 0.971097] printk: console [ttyS0] enabled
[ 0.989242] m25p80 spi0.0: unrecognized JEDEC id bytes: 00, 00, 00
[ 0.995469] m25p80: probe of spi0.0 failed with error -2
[ 1.002131] libphy: Fixed MDIO Bus: probed
[ 1.006241] CAN device driver interface
[ 1.011847] ehci_hcd: USB 2.0 'Enhanced' Host Controller (EHCI) Driver
[ 1.018412] ehci-platform: EHCI generic platform driver
[ 1.024203] ohci_hcd: USB 1.1 'Open' Host Controller (OHCI) Driver
[ 1.030443] ohci-platform: OHCI generic platform driver
[ 1.036271] usbcore: registered new interface driver usb-storage
[ 1.044471] i2c /dev entries driver
[ 1.051571] sunxi-wdt 1c20ca0.watchdog: Watchdog enabled (timeout=16 sec, nowayout=0)
[ 1.061679] sunxi-mmc 1c0f000.mmc: Linked as a consumer to regulator.2
[ 1.106628] sunxi-mmc 1c0f000.mmc: initialized, max. request size: 16384 KB
[ 1.114238] sunxi-mmc 1c10000.mmc: Linked as a consumer to regulator.2
[ 1.121673] sunxi-mmc 1c10000.mmc: allocated mmc-pwrseq
[ 1.166642] sunxi-mmc 1c10000.mmc: initialized, max. request size: 16384 KB
[ 1.174218] sunxi-mmc 1c11000.mmc: Linked as a consumer to regulator.2
[ 1.216639] sunxi-mmc 1c11000.mmc: initialized, max. request size: 16384 KB
[ 1.225881] usbcore: registered new interface driver usbhid
[ 1.231507] usbhid: USB HID core driver
[ 1.339615] mmc1: queuing unknown CIS tuple 0x80 (2 bytes)
[ 1.352479] mmc1: queuing unknown CIS tuple 0x80 (3 bytes)
[ 1.364400] mmc1: queuing unknown CIS tuple 0x80 (3 bytes)
[ 1.376338] mmc0: host does not support reading read-only switch, assuming write-enable
[ 1.386377] mmc1: queuing unknown CIS tuple 0x80 (7 bytes)
[ 1.391774] fb_st7789v spi0.1: fbtft_request_one_gpio: 'reset-gpios' = GPIO68
[ 1.397902] mmc0: new high speed SD card at address 0001
[ 1.403331] fb_st7789v spi0.1: fbtft_request_one_gpio: 'dc-gpios' = GPIO71
[ 1.410805] mmcblk0: mmc0:0001 00000 1.83 GiB
[ 1.425366] mmc1: queuing unknown CIS tuple 0x81 (9 bytes)
[ 1.448442] mmcblk0: p1 p2
[ 1.449580] fb_st7789v spi0.1: fbtft_request_one_gpio: 'led-gpios' = GPIO224
[ 1.485283] random: fast init done
[ 1.508175] mmc2: new DDR MMC card at address 0001
[ 1.619108] mmcblk2: mmc2:0001 8GTF4R 7.28 GiB
[ 1.625130] mmcblk2boot0: mmc2:0001 8GTF4R partition 1 4.00 MiB
[ 1.632660] mmcblk2boot1: mmc2:0001 8GTF4R partition 2 4.00 MiB
[ 1.642756] mmcblk2: p1 p2
[ 1.689155] graphics fb1: fb_st7789v frame buffer, 320x240, 150 KiB video memory, 4 KiB buffer memory, fps=33, spi0.1 at 50 MHz
[ 1.714097] mmc1: new high speed SDIO card at address 0001
[ 1.714806] NET: Registered protocol family 17
[ 1.724126] can: controller area network core (rev 20170425 abi 9)
[ 1.730469] NET: Registered protocol family 29
[ 1.734924] can: raw protocol (rev 20170425)
[ 1.739225] can: broadcast manager protocol (rev 20170425 t)
[ 1.744900] can: netlink gateway (rev 20170425) max_hops=1
[ 1.750858] Key type dns_resolver registered
[ 1.755372] Registering SWP/SWPB emulation handler
[ 1.761149] Loading compiled-in X.509 certificates
[ 1.777651] sun4i-usb-phy 1c19400.phy: Couldn't request ID GPIO
[ 1.787651] sun8i-a23-r-pinctrl 1f02c00.pinctrl: initialized sunXi PIO driver
[ 1.803539] asoc-simple-card sound: sun8i <-> 1c22c00.dai mapping ok
[ 1.812297] sun4i-usb-phy 1c19400.phy: Couldn't request ID GPIO
[ 1.823712] sun4i-usb-phy 1c19400.phy: Couldn't request ID GPIO
[ 1.835344] input: keys as /devices/platform/keys/input/input0
[ 1.841851] hctosys: unable to open rtc device (rtc0)
[ 1.847499] vcc3v0: disabling
[ 1.850483] vcc5v0: disabling
[ 1.853461] ALSA device list:
[ 1.856433] #0: sun8i-a33-audio
[ 1.860711] sun4i-usb-phy 1c19400.phy: Couldn't request ID GPIO
[ 1.881959] EXT4-fs (mmcblk0p2): mounted filesystem with ordered data mode. Opts: (null)
[ 1.890187] VFS: Mounted root (ext4 filesystem) readonly on device 179:2.
[ 1.899574] devtmpfs: mounted
[ 1.905274] Freeing unused kernel memory: 1024K
[ 1.926989] Run /sbin/init as init process
[ 2.108451] EXT4-fs (mmcblk0p2): re-mounted. Opts: (null)
Starting syslogd: OK
Starting klogd: OK
Running sysctl: OK
Saving random seed: [ 2.332094] random: dd: uninitialized urandom read (512 bytes read)
OK
modprobe: module r8723bs not found in modules.dep
modprobe: module esp8089.ko not found in modules.dep
[ 2.440010] cfg80211: Loading compiled-in X.509 certificates for regulatory database
[ 2.538102] cfg80211: Loaded X.509 cert 'sforshee: 00b28ddf47aef9cea7'
[ 2.546844] platform regulatory.0: Direct firmware load for regulatory.db failed with error -2
[ 2.555518] cfg80211: failed to load regulatory.db
[ 2.610853] sun4i-usb-phy 1c19400.phy: Couldn't request ID GPIO
[ 2.647955] brcmfmac: brcmf_fw_alloc_request: using brcm/brcmfmac43430-sdio for chip BCM43430/1
[ 2.656998] usbcore: registered new interface driver brcmfmac
[ 2.663661] sun4i-usb-phy 1c19400.phy: Couldn't request ID GPIO
[ 2.918163] brcmfmac: brcmf_fw_alloc_request: using brcm/brcmfmac43430-sdio for chip BCM43430/1
[ 2.938281] brcmfmac: brcmf_c_preinit_dcmds: Firmware: BCM43430/1 wl0: Oct 22 2019 01:57:42 version 7.45.98.94 (r723000 CY) FWID 01-73a5ed62
[ 5.802343] random: dnsmasq: uninitialized urandom read (128 bytes read)
[ 5.809366] random: dnsmasq: uninitialized urandom read (48 bytes read)
Starting network: OK
random: Only 6/20 bytes of strong random data available
random: Not enough entropy pool available for secure operations
WPA: Not enough entropy in random pool for secure operations - update keys later when the first station connects
wlan0: interface state UNINITIALIZED->ENABLED
wlan0: AP-ENABLED
[ 7.203929] EXT4-fs (mmcblk2p2): mounted filesystem with ordered data mode. Opts: (null)
[ 7.318350] tsc2007 0-0048: missing ti,x-plate-ohms devicetree property.
[ 7.325148] tsc2007: probe of 0-0048 failed with error -22
modprobe: module g_ffs not found in modules.dep
mount: mounting adb on /dev/usb-ffs/adb failed: No such device
install_listener('tcp:5037','*smartsocket*')
插U盘和电脑都没反应。
好像并没有 boot_process.c 源码?
这是 V3s OTG相关的log:
[ 0.000000] Booting Linux on physical CPU 0x0
[ 0.000000] Linux version 4.13.16-licheepi-zero+ (gcc version 7.5.0 (Ubuntu/Linaro 7.5.0-3ubuntu1~18.04)) #60 SMP Wed Jun 10 16:17:56 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 with Dock
[ 0.000000] Memory policy: Data cache writealloc
[ 0.000000] On node 0 totalpages: 16009
[ 0.000000] free_area_init_node: node 0, pgdat c0938cc0, node_mem_map c3e03000
[ 0.000000] Normal zone: 126 pages used for memmap
[ 0.000000] Normal zone: 0 pages reserved
[ 0.000000] Normal zone: 16009 pages, LIFO batch:3
[ 0.000000] percpu: Embedded 16 pages/cpu @c3de5000 s33868 r8192 d23476 u65536
[ 0.000000] pcpu-alloc: s33868 r8192 d23476 u65536 alloc=16*4096
[ 0.000000] pcpu-alloc: [0] 0
[ 0.000000] Built 1 zonelists in Zone order, mobility grouping on. Total pages: 15883
[ 0.000000] Kernel command line: console=ttyS0,115200 earlyprintk panic=5 rootwait mtdparts=spi32766.0:320k(uboot),320k(logob),320k(logoa),64k(dtb),5M(kernel),-(rootfs) root=31:5 rw rootfstype=jffs2 init=/linuxrc fbcon=map:1 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: 54604K/64036K available (5120K kernel code, 230K rwdata, 1440K rodata, 1024K init, 250K bss, 9432K 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 - 0xc0600000 (6112 kB)
[ 0.000000] .init : 0xc0800000 - 0xc0900000 (1024 kB)
[ 0.000000] .data : 0xc0900000 - 0xc0939820 ( 231 kB)
[ 0.000000] .bss : 0xc094031c - 0xc097edd4 ( 251 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.000011] sched_clock: 56 bits at 24MHz, resolution 41ns, wraps every 4398046511097ns
[ 0.000028] Switching to timer-based delay loop, resolution 41ns
[ 0.000274] clocksource: timer: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 79635851949 ns
[ 0.000652] Console: colour dummy device 80x30
[ 0.000715] Calibrating delay loop (skipped), value calculated using timer frequency.. 48.00 BogoMIPS (lpj=240000)
[ 0.000739] pid_max: default: 32768 minimum: 301
[ 0.000941] Mount-cache hash table entries: 1024 (order: 0, 4096 bytes)
[ 0.000962] Mountpoint-cache hash table entries: 1024 (order: 0, 4096 bytes)
[ 0.001964] CPU: Testing write buffer coherency: ok
[ 0.002626] /cpus/cpu@0 missing clock-frequency property
[ 0.002659] CPU0: thread -1, cpu 0, socket 0, mpidr 80000000
[ 0.003404] Setting up static identity map for 0x40100000 - 0x40100060
[ 0.003708] Hierarchical SRCU implementation.
[ 0.004471] smp: Bringing up secondary CPUs ...
[ 0.004493] smp: Brought up 1 node, 1 CPU
[ 0.004507] SMP: Total of 1 processors activated (48.00 BogoMIPS).
[ 0.004516] CPU: All CPU(s) started in SVC mode.
[ 0.005710] devtmpfs: initialized
[ 0.010764] VFP support v0.3: implementor 41 architecture 2 part 30 variant 7 rev 5
[ 0.011234] clocksource: jiffies: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 19112604462750000 ns
[ 0.011277] futex hash table entries: 256 (order: 2, 16384 bytes)
[ 0.011568] pinctrl core: initialized pinctrl subsystem
[ 0.013040] random: get_random_u32 called from bucket_table_alloc+0x110/0x238 with crng_init=0
[ 0.013265] NET: Registered protocol family 16
[ 0.014084] DMA: preallocated 256 KiB pool for atomic coherent allocations
[ 0.015782] hw-breakpoint: found 5 (+1 reserved) breakpoint and 4 watchpoint registers.
[ 0.015811] hw-breakpoint: maximum watchpoint size is 8 bytes.
[ 0.034533] SCSI subsystem initialized
[ 0.034994] usbcore: registered new interface driver usbfs
[ 0.035149] usbcore: registered new interface driver hub
[ 0.035310] usbcore: registered new device driver usb
[ 0.035677] pps_core: LinuxPPS API ver. 1 registered
[ 0.035691] pps_core: Software ver. 5.3.6 - Copyright 2005-2007 Rodolfo Giometti <giometti@linux.it>
[ 0.035726] PTP clock support registered
[ 0.036052] Advanced Linux Sound Architecture Driver Initialized.
[ 0.037984] clocksource: Switched to clocksource arch_sys_counter
[ 0.053740] NET: Registered protocol family 2
[ 0.054667] TCP established hash table entries: 1024 (order: 0, 4096 bytes)
[ 0.054719] TCP bind hash table entries: 1024 (order: 1, 8192 bytes)
[ 0.054749] TCP: Hash tables configured (established 1024 bind 1024)
[ 0.055010] UDP hash table entries: 256 (order: 1, 8192 bytes)
[ 0.055095] UDP-Lite hash table entries: 256 (order: 1, 8192 bytes)
[ 0.055463] NET: Registered protocol family 1
[ 0.059510] workingset: timestamp_bits=30 max_order=14 bucket_order=0
[ 0.070625] jffs2: version 2.2. (NAND) © 2001-2006 Red Hat, Inc.
[ 0.073079] random: fast init done
[ 0.077162] Block layer SCSI generic (bsg) driver version 0.4 loaded (major 249)
[ 0.077196] io scheduler noop registered
[ 0.077207] io scheduler deadline registered
[ 0.077590] io scheduler cfq registered (default)
[ 0.077607] io scheduler mq-deadline registered
[ 0.077615] io scheduler kyber registered
[ 0.084117] sun8i-v3s-pinctrl 1c20800.pinctrl: initialized sunXi PIO driver
[ 0.085558] pwm-backlight backlight: backlight supply power not found, using dummy regulator
[ 0.256176] Serial: 8250/16550 driver, 8 ports, IRQ sharing disabled
[ 0.261478] console [ttyS0] disabled
[ 0.281908] 1c28000.serial: ttyS0 at MMIO 0x1c28000 (irq = 36, base_baud = 1500000) is a U6_16550A
[ 0.851605] console [ttyS0] enabled
[ 0.877516] 1c28400.serial: ttyS1 at MMIO 0x1c28400 (irq = 37, base_baud = 1500000) is a U6_16550A
[ 0.911127] 1c28800.serial: ttyS2 at MMIO 0x1c28800 (irq = 38, base_baud = 1500000) is a U6_16550A
[ 0.927239] m25p80 spi32766.0: mx25l25635e (32768 Kbytes)
[ 0.932902] spi32766.0: parser cmdlinepart: 6
[ 0.937266] 6 cmdlinepart partitions found on MTD device spi32766.0
[ 0.943576] Creating 6 MTD partitions on "spi32766.0":
[ 0.948754] 0x000000000000-0x000000050000 : "uboot"
[ 0.955858] 0x000000050000-0x0000000a0000 : "logob"
[ 0.962912] 0x0000000a0000-0x0000000f0000 : "logoa"
[ 0.969777] 0x0000000f0000-0x000000100000 : "dtb"
[ 0.976355] 0x000000100000-0x000000600000 : "kernel"
[ 0.983212] 0x000000600000-0x000002000000 : "rootfs"
[ 0.990633] libphy: Fixed MDIO Bus: probed
[ 0.995599] dwmac-sun8i 1c30000.ethernet: PTP uses main clock
[ 1.001619] dwmac-sun8i 1c30000.ethernet: No regulator found
[ 1.007372] dwmac-sun8i 1c30000.ethernet: Will use internal PHY
[ 1.013701] dwmac-sun8i 1c30000.ethernet: Chain mode enabled
[ 1.019437] dwmac-sun8i 1c30000[ 162.597945] mmc0: card never left busy state
.ethernet: No HW DMA feature register supported
[ 1.026657] [ 162.604400] mmc0: error -110 whilst initialising SD card
dwmac-sun8i 1c30000.ethernet: Normal descriptors
[ 1.032335] dwmac-sun8i 1c30000.ethernet: RX Checksum Offload Engine supported
[ 1.039571] dwmac-sun8i 1c30000.ethernet: COE Type 2
[ 1.044533] dwmac-sun8i 1c30000.ethernet: TX Checksum insertion supported
[ 1.051617] libphy: stmmac: probed
[ 1.057870] PPP generic driver version 2.4.2
[ 1.062913] PPP BSD Compression module registered
[ 1.067636] PPP Deflate Compression module registered
[ 1.072834] PPP MPPE Compression module registered
[ 1.077634] NET: Registered protocol family 24
[ 1.082324] usbcore: registered new interface driver asix
[ 1.087861] usbcore: registered new interface driver ax88179_178a
[ 1.094091] usbcore: registered new interface driver cdc_ether
[ 1.100037] usbcore: registered new interface driver net1080
[ 1.105741] usbcore: registered new interface driver rndis_host
[ 1.111753] usbcore: registered new interface driver cdc_subset
[ 1.117716] usbcore: registered new interface driver zaurus
[ 1.123411] usbcore: registered new interface driver cdc_ncm
[ 1.129141] ehci_hcd: USB 2.0 'Enhanced' Host Controller (EHCI) Driver
[ 1.135665] ehci-platform: EHCI generic platform driver
[ 1.141467] ehci-platform 1c1a000.usb: EHCI Host Controller
[ 1.147120] ehci-platform 1c1a000.usb: new USB bus registered, assigned bus number 1
[ 1.155250] ehci-platform 1c1a000.usb: irq 26, io mem 0x01c1a000
[ 1.187975] ehci-platform 1c1a000.usb: USB 2.0 started, EHCI 1.00
[ 1.195838] hub 1-0:1.0: USB hub found
[ 1.199904] hub 1-0:1.0: 1 port detected
[ 1.204684] ohci_hcd: USB 1.1 'Open' Host Controller (OHCI) Driver
[ 1.211090] ohci-platform: OHCI generic platform driver
[ 1.216863] ohci-platform 1c1a400.usb: Generic Platform OHCI controller
[ 1.223694] ohci-platform 1c1a400.usb: new USB bus registered, assigned bus number 2
[ 1.231815] ohci-platform 1c1a400.usb: irq 27, io mem 0x01c1a400
[ 1.303636] hub 2-0:1.0: USB hub found
[ 1.307535] hub 2-0:1.0: 1 port detected
[ 1.315356] usbcore: registered new interface driver usb-storage
[ 1.321828] usbcore: registered new interface driver usbserial
[ 1.327730] usbcore: registered new interface driver ch341
[ 1.333387] usbserial: USB Serial support registered for ch341-uart
[ 1.339771] usbcore: registered new interface driver cp210x
[ 1.345390] usbserial: USB Serial support registered for cp210x
[ 1.351428] usbcore: registered new interface driver ftdi_sio
[ 1.357221] usbserial: USB Serial support registered for FTDI USB Serial Device
[ 1.364738] usbcore: registered new interface driver option
[ 1.370432] usbserial: USB Serial support registered for GSM modem (1-port)
[ 1.377670] usbcore: registered new interface driver pl2303
[ 1.383444] usbserial: USB Serial support registered for pl2303
[ 1.390794] mousedev: PS/2 mouse device common for all mice
[ 1.397601] input: 1c22800.lradc as /devices/platform/soc/1c22800.lradc/input/input0
[ 1.407700] sun6i-rtc 1c20400.rtc: rtc core: registered rtc-sun6i as rtc0
[ 1.414695] sun6i-rtc 1c20400.rtc: RTC enabled
[ 1.419411] i2c /dev entries driver
[ 1.426308] sunxi-wdt 1c20ca0.watchdog: Watchdog enabled (timeout=16 sec, nowayout=0)
[ 1.488043] sunxi-mmc 1c0f000.mmc: base:0xc423d000 irq:23
[ 1.548000] sunxi-mmc 1c10000.mmc: base:0xc4253000 irq:24
[ 1.554997] usbcore: registered new interface driver usbhid
[ 1.560732] usbhid: USB HID core driver
[ 1.567642] sun4i-codec 1c22c00.codec: ASoC: /soc/codec-analog@01c23000 not registered
[ 1.575838] sun4i-codec 1c22c00.codec: Failed to register our card
[ 1.584328] NET: Registered protocol family 17
[ 1.589121] Key type dns_resolver registered
[ 1.593628] Registering SWP/SWPB emulation handler
[ 1.608915] simple-framebuffer 43e89000.framebuffer: framebuffer at 0x43e89000, 0x177000 bytes, mapped to 0xc4400000
[ 1.619639] simple-framebuffer 43e89000.framebuffer: format=x8r8g8b8, mode=800x480x32, linelength=3200
[ 1.629850] simple-framebuffer 43e89000.framebuffer: fb0: simplefb registered!
[ 1.639322] usb_phy_generic usb_phy_generic.0.auto: usb_phy_generic.0.auto supply vcc not found, using dummy regulator
[ 1.651163] musb-hdrc musb-hdrc.1.auto: MUSB HDRC host driver
[ 1.656953] musb-hdrc musb-hdrc.1.auto: new USB bus registered, assigned bus number 3
[ 1.666923] hub 3-0:1.0: USB hub found
[ 1.671026] hub 3-0:1.0: 1 port detected
[ 1.681826] sun4i-codec 1c22c00.codec: Codec <-> 1c22c00.codec mapping ok
[ 1.691814] sun6i-rtc 1c20400.rtc: setting system clock to 1970-01-01 00:00:06 UTC (6)
[ 1.700330] vcc5v0: disabling
[ 1.703318] ALSA device list:
[ 1.706286] #0: V3s Audio Codec
[ 1.717763] mmc1: queuing unknown CIS tuple 0x01 (3 bytes)
[ 1.742342] mmc1: queuing unknown CIS tuple 0x1a (5 bytes)
[ 1.756394] mmc1: queuing unknown CIS tuple 0x1b (8 bytes)
[ 1.766910] mmc1: queuing unknown CIS tuple 0x80 (1 bytes)
[ 1.777588] mmc1: queuing unknown CIS tuple 0x81 (1 bytes)
[ 1.788892] mmc1: queuing unknown CIS tuple 0x82 (1 bytes)
[ 1.800175] mmc1: new high speed SDIO card at address 0001
[ 1.809652] random: crng init done
[ 4.915358] VFS: Mounted root (jffs2 filesystem) on device 31:5.
[ 4.923547] devtmpfs: mounted
[ 4.929523] Freeing unused kernel memory: 1024K
[ 5.982220] r8723bs: module is from the staging directory, the quality is unknown, you have been warned.
[ 6.005174] RTL8723BS: module init start
[ 6.009501] RTL8723BS: rtl8723bs v4.3.5.5_12290.20140916_BTCOEX20140507-4E40
[ 6.016559] RTL8723BS: rtl8723bs BT-Coex version = BTCOEX20140507-4E40
[ 6.023290] RTL8723BS: module init ret =0
[ 40.647995] usb 1-1: new high-speed USB device number 2 using ehci-platform
[ 40.841453] usb-storage 1-1:1.0: USB Mass Storage device detected
[ 40.862015] scsi host0: usb-storage 1-1:1.0
[ 41.929582] scsi 0:0:0:0: Direct-Access Mass Storage Device 1.00 PQ: 0 ANSI: 0 CCS
[ 42.110510] sd 0:0:0:0: [sda] 3870720 512-byte logical blocks: (1.98 GB/1.85 GiB)
[ 42.119578] sd 0:0:0:0: [sda] Write Protect is off
[ 42.124398] sd 0:0:0:0: [sda] Mode Sense: 03 00 00 00
[ 42.125628] sd 0:0:0:0: [sda] No Caching mode page found
[ 42.131113] sd 0:0:0:0: [sda] Assuming drive cache: write through
[ 42.154462] sda: sda1
[ 42.163965] sd 0:0:0:0: [sda] Attached SCSI removable disk
[ 42.386419] FAT-fs (sda1): Volume was not properly unmounted. Some data may be corrupt. Please run fsck.
插U盘和电脑都正常。
=> mmc dev 0
switch to partitions #0, OK
mmc0 is current device
=>
=> mmc dev 1
switch to partitions #0, OK
mmc1(part 0) is current device
=>
=> mmc info
Device: mmc@1c11000
Manufacturer ID: 15
OEM: 100
Name: 8GTF4
Bus Speed: 52000000
Mode: MMC High Speed (52MHz)
Rd Block Len: 512
MMC version 5.1
High Capacity: Yes
Capacity: 7.3 GiB
Bus Width: 4-bit
Erase Group Size: 512 KiB
HC WP Group Size: 8 MiB
User Capacity: 7.3 GiB WRREL
Boot Capacity: 4 MiB ENH
RPMB Capacity: 512 KiB ENH
Boot area 0 is not write protected
Boot area 1 is not write protected
=>
X3 u-boot 切换 TF/eMMC正常
这是把eMMC (mmc1)通过 ums 1 mmc 1 命令挂载成U盘
u-boot 2020.v07 开启:
CONFIG_USB_FUNCTION_MASS_STORAGE=y
即可.
Widora TINY200 R2 体验版开源开发包,修复了大部分F1C100s/F1C200s的遗留问题
http://whycan.cn/t_5061.html#p51862
(出处:哇酷开发者社区【全志 V3S/F1C100s/X3】)
求助:A33主线uboot跑起来了,但是无法从 eMMC 启动
http://whycan.cn/t_3633.html#p32970
(出处:哇酷开发者社区【全志 V3S/F1C100s/X3】)
lv_font_conv --no-compress --format lvgl --font "D:\8899\digital-7\digital-7 (mono).ttf" -o lv_font_segment_24.c --bpp 4 --size 24 --symbols "0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ: " -r 0x20-0x7F
lv_font_conv --no-compress --format lvgl --font "D:\8899\digital-7\digital-7 (mono).ttf" -o lv_font_segment_32.c --bpp 4 --size 32 --symbols "0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ: " -r 0x20-0x7F
lv_font_conv --no-compress --format lvgl --font "D:\8899\digital-7\digital-7 (mono).ttf" -o lv_font_segment_48.c --bpp 4 --size 48 --symbols "0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ: " -r 0x20-0x7F
lv_font_conv --no-compress --format lvgl --font "D:\8899\digital-7\digital-7 (mono).ttf" -o lv_font_segment_64.c --bpp 4 --size 64 --symbols "0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ: " -r 0x20-0x7F
lv_font_conv --no-compress --format lvgl --font "D:\8899\digital-7\digital-7 (mono).ttf" -o lv_font_segment_128.c --bpp 4 --size 128 --symbols "0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ: " -r 0x20-0x7F
CONFIG_USB_GADGET=y
# CONFIG_USB_GADGET_DEBUG is not set
# CONFIG_USB_GADGET_DEBUG_FILES is not set
# CONFIG_USB_GADGET_DEBUG_FS is not set
CONFIG_USB_GADGET_VBUS_DRAW=500
CONFIG_USB_GADGET_STORAGE_NUM_BUFFERS=2
CONFIG_U_SERIAL_CONSOLE=y
这个地方有问题, 需要用 modprobe 加载 ko文件的方式驱动.
本站有很多帖子可以参考:
只需要修改 lv_conf.h 就可以了:
#define LV_THEME_DEFAULT_INCLUDE <stdint.h> /*Include a header for the init. function*/
#define LV_THEME_DEFAULT_INIT lv_theme_mono_init
#define LV_THEME_DEFAULT_COLOR_PRIMARY LV_COLOR_WHITE
#define LV_THEME_DEFAULT_COLOR_SECONDARY LV_COLOR_BLACK
#define LV_THEME_DEFAULT_FLAG 0
#define LV_THEME_DEFAULT_FONT_SMALL &lv_font_msyh_12//&lv_font_montserrat_12
#define LV_THEME_DEFAULT_FONT_NORMAL &lv_font_msyh_16//&lv_font_montserrat_16
#define LV_THEME_DEFAULT_FONT_SUBTITLE &lv_font_msyh_24//&lv_font_montserrat_20
#define LV_THEME_DEFAULT_FONT_TITLE &lv_font_msyh_32//&lv_font_montserrat_24
代码: https://github.com/lvgl/lvgl/blob/master/src/lv_core/lv_obj.c
/*Test if the IDE has UTF-8 encoding*/
char * txt = "Á";
uint8_t * txt_u8 = (uint8_t *) txt;
if(txt_u8[0] != 0xc3 || txt_u8[1] != 0x81 || txt_u8[2] != 0x00) {
LV_LOG_WARN("The strings has no UTF-8 encoding. Some characters won't be displayed.")
}
代码: https://github.com/lvgl/lvgl/blob/master/src/lv_widgets/lv_msgbox.c
/**
* Set animation duration
* @param mbox pointer to a message box object
* @param anim_time animation length in milliseconds (0: no animation)
*/
void lv_msgbox_set_anim_time(lv_obj_t * mbox, uint16_t anim_time)
{
LV_ASSERT_OBJ(mbox, LV_OBJX_NAME);#if LV_USE_ANIMATION
lv_msgbox_ext_t * ext = lv_obj_get_ext_attr(mbox);
anim_time = 0;
ext->anim_time = anim_time;
#else
(void)mbox;
(void)anim_time;
#endif
}
void task2(lv_task_t* task)
{
char strdate[16];
char strtime[16];
time_t t = time(NULL);
struct tm tm = *localtime(&t);
snprintf(strdate, sizeof(strdate) - 1, "%04d-%02d-%02d", tm.tm_year + 1900, tm.tm_mon + 1, tm.tm_mday);
snprintf(strtime, sizeof(strtime) - 1, "%02d:%02d:%02d", tm.tm_hour, tm.tm_min, tm.tm_sec);
lv_label_set_text(labelDate, strdate);
lv_label_set_text(labelTime, strtime);
}
void lv_test2()
{
labelDate = lv_label_create(lv_scr_act(), NULL);
lv_obj_set_pos(labelDate, 10, 160);
lv_obj_set_size(labelDate, 650, 128);
lv_obj_set_style_local_text_font(labelDate, LV_LABEL_PART_MAIN, LV_STATE_DEFAULT, &font_segment_64);
lv_obj_set_style_local_text_color(labelDate, LV_LABEL_PART_MAIN, LV_STATE_DEFAULT, LV_COLOR_BLUE);
lv_label_set_text(labelDate, "");
labelTime = lv_label_create(lv_scr_act(), NULL);
lv_obj_set_pos(labelTime, 10, 220);
lv_obj_set_size(labelTime, 650, 128);
lv_obj_set_style_local_text_font(labelTime, LV_LABEL_PART_MAIN, LV_STATE_DEFAULT, &font_segment_128);
lv_obj_set_style_local_text_color(labelTime, LV_LABEL_PART_MAIN, LV_STATE_DEFAULT, LV_COLOR_BLUE);
lv_label_set_text(labelTime, "");
lv_task_create(task2, 900, LV_TASK_PRIO_LOWEST, NULL);
//lv_task_ready(task2);
}
代码:
void lv_test2()
{
lv_task_create(task2, 1000, LV_TASK_PRIO_LOWEST, NULL);
lv_obj_t* button2 = lv_btn_create(lv_scr_act(), NULL);
lv_obj_set_pos(button2, 10, 10);
lv_obj_set_size(button2, 550, 64);
lv_obj_t* label2 = lv_label_create(button2, NULL);
lv_obj_set_style_local_text_font(label2, LV_LABEL_PART_MAIN, LV_STATE_DEFAULT, &font_segment_64);
lv_obj_set_style_local_text_color(label2, LV_LABEL_PART_MAIN, LV_STATE_DEFAULT, LV_COLOR_GREEN);
lv_label_set_text(label2, "2020-07-05 10:17:33");
lv_obj_t* button3 = lv_btn_create(lv_scr_act(), NULL);
lv_obj_set_pos(button3, 10, 80);
lv_obj_set_size(button3, 500, 64);
lv_obj_t* label3 = lv_label_create(button3, NULL);
lv_obj_set_style_local_text_font(label3, LV_LABEL_PART_MAIN, LV_STATE_DEFAULT, &font_segment_64);
lv_obj_set_style_local_text_color(label3, LV_LABEL_PART_MAIN, LV_STATE_DEFAULT, LV_COLOR_RED);
lv_label_set_text(label3, "ABCDEFGHIJK");
lv_obj_t* label4 = lv_label_create(lv_scr_act(), NULL);
lv_obj_set_pos(label4, 10, 250);
lv_obj_set_size(label4, 650, 128);
lv_obj_set_style_local_text_font(label4, LV_LABEL_PART_MAIN, LV_STATE_DEFAULT, &font_segment_128);
lv_obj_set_style_local_text_color(label4, LV_LABEL_PART_MAIN, LV_STATE_DEFAULT, LV_COLOR_BLUE);
lv_label_set_text(label4, "2020-07-05");
}
字体生成:
lv_font_conv --no-compress --format lvgl --font "D:\8899\7 Segment.ttf" -o font_segment_64.c --bpp 4 --size 64 --symbols "0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ " -r 0x20-0x7F
lv_font_conv --no-compress --format lvgl --font "D:\8899\7 Segment.ttf" -o font_segment_128.c --bpp 4 --size 128 --symbols "0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ: " -r 0x20-0x7F
又找到一个段码字体: https://fontmeme.com/fonts/seven-segment-font/
ttf段码字体本站下载: seven-segment.zip
littlevgl 字体生成:
lv_font_conv --no-compress --format lvgl --font "D:\8899\7 Segment.ttf" -o font_segment_64.c --bpp 4 --size 64 --symbols "0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ " -r 0x20-0x7F
lv_obj_t* label2 = lv_label_create(button2, NULL);
lv_obj_set_style_local_text_font(label2, LV_LABEL_PART_MAIN, LV_STATE_DEFAULT, &font_segment_64);
lv_label_set_text(label2, "0123456789");
lv_obj_t* button3 = lv_btn_create(lv_scr_act(), NULL);
lv_obj_set_pos(button3, 150, 250);
lv_obj_set_size(button3, 500, 64);
lv_obj_t* label3 = lv_label_create(button3, NULL);
lv_obj_set_style_local_text_font(label3, LV_LABEL_PART_MAIN, LV_STATE_DEFAULT, &font_segment_64);
lv_label_set_text(label3, "ABCDEFGHIJK");
不能直接输入汉字吗?
VS2017/2019 彻底解决UTF-8汉字显示问题, 设置一下工程属性即可: https://whycan.cn/t_5013.html#p50955
离线方式
1. windows 下载 npm: https://nodejs.org/en/
2. 安装 npm 程序
3. 命令行运行: npm i lv_font_conv -g 安装离线字体工具
4. 命令行运行生成字体文件:
lv_font_conv --no-compress --format lvgl --font "D:\work\\Microsoft-Yahei-UI-Light_1.ttf" -o myFont.c --bpp 4 --size 16 --symbols "我是红色主题绿色科技有限公司保存关闭0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ " -r 0x20-0x7F
添加定义:
static void button_event_cb(lv_obj_t * slider, lv_event_t e);
static lv_obj_t *button2, *button3;
添加两个按钮:
button2 = lv_btn_create(h, NULL);
lv_obj_set_event_cb(button2, button_event_cb);
lv_obj_t* label2 = lv_label_create(button2, NULL);
lv_label_set_text(label2, "红色主题");
button3 = lv_btn_create(h, NULL);
lv_obj_set_event_cb(button3, button_event_cb);
lv_obj_t* label3 = lv_label_create(button3, NULL);
lv_label_set_text(label3, "绿色主题");
添加按钮事件:
static void button_event_cb(lv_obj_t * button, lv_event_t e)
{
if (e == LV_EVENT_RELEASED)
{
if (button2 == button)
{
lv_theme_t * theme = LV_THEME_DEFAULT_INIT(LV_COLOR_RED,
LV_THEME_DEFAULT_COLOR_SECONDARY,
LV_THEME_DEFAULT_FLAG,
LV_THEME_DEFAULT_FONT_SMALL,
&myFont,
LV_THEME_DEFAULT_FONT_SUBTITLE,
LV_THEME_DEFAULT_FONT_TITLE);
lv_theme_set_act(theme);
}
else if (button3 == button)
{
lv_theme_t * theme = LV_THEME_DEFAULT_INIT(LV_COLOR_GREEN,
LV_THEME_DEFAULT_COLOR_SECONDARY,
LV_THEME_DEFAULT_FLAG,
LV_THEME_DEFAULT_FONT_SMALL,
&myFont,
LV_THEME_DEFAULT_FONT_SUBTITLE,
LV_THEME_DEFAULT_FONT_TITLE);
lv_theme_set_act(theme);
}
}
}
diff --git a/Makefile b/Makefile
index bb8e264..6bf149c 100644
--- a/Makefile
+++ b/Makefile
@@ -5,7 +5,7 @@ CC ?= gcc
LVGL_DIR_NAME ?= lvgl
LVGL_DIR ?= ${shell pwd}
CFLAGS ?= -O3 -g0 -I$(LVGL_DIR)/ -Wall -Wshadow -Wundef -Wmaybe-uninitialized -Wmissing-prototypes -Wno-discarded-qualifiers -Wall -Wextra -Wno-unused-function -Wundef -Wno-error=strict-prototypes -Wpointer-arith -fno-strict-aliasing -Wno-error=cpp -Wuninitialized -Wmaybe-uninitialized -Wno-unused-parameter -Wno-missing-field-initializers -Wtype-limits -Wsizeof-pointer-memaccess -Wno-format-nonliteral -Wno-cast-qual -Wunreachable-code -Wno-switch-default -Wno-switch-enum -Wreturn-type -Wmultichar -Wformat-security -Wno-ignored-qualifiers -Wno-error=pedantic -Wno-sign-compare -Wno-error=missing-prototypes -Wdouble-promotion -Wclobbered -Wdeprecated -Wempty-body -Wtype-limits -Wshift-negative-value -Wstack-usage=1024 -Wno-unused-value -Wno-unused-parameter -Wno-missing-field-initializers -Wuninitialized -Wmaybe-uninitialized -Wall -Wextra -Wno-unused-parameter -Wno-missing-field-initializers -Wtype-limits -Wsizeof-pointer-memaccess -Wno-format-nonliteral -Wpointer-arith -Wno-cast-qual -Wmissing-prototypes -Wunreachable-code -Wno-switch-default -Wswitch-enum -Wreturn-type -Wmultichar -Wno-discarded-qualifiers -Wformat-security -Wno-ignored-qualifiers -Wno-sign-compare
-LDFLAGS ?= -lSDL2 -lm
+LDFLAGS ?= -lSDL2 -lm -linput
BIN = demo
diff --git a/lv_conf.h b/lv_conf.h
index b31a820..e03cf82 100644
--- a/lv_conf.h
+++ b/lv_conf.h
@@ -20,8 +20,8 @@
*====================*/
/* Maximal horizontal and vertical resolution to support by the library.*/
-#define LV_HOR_RES_MAX (480)
-#define LV_VER_RES_MAX (320)
+#define LV_HOR_RES_MAX (800)
+#define LV_VER_RES_MAX (480)
/* Color depth:
* - 1: 1 byte per pixel
@@ -190,7 +190,7 @@ typedef void * lv_fs_drv_user_data_t;
#define LV_USE_USER_DATA 0
/*1: Show CPU usage and FPS count in the right bottom corner*/
-#define LV_USE_PERF_MONITOR 1
+#define LV_USE_PERF_MONITOR 0
/*========================
* Image decoder and cache
diff --git a/lv_drivers b/lv_drivers
--- a/lv_drivers
+++ b/lv_drivers
@@ -1 +1 @@
-Subproject commit 4e26c37e7ba7518c4f48cabf31c53aeeace35b7d
+Subproject commit 4e26c37e7ba7518c4f48cabf31c53aeeace35b7d-dirty
diff --git a/lv_drv_conf.h b/lv_drv_conf.h
index 975c7b4..3e69dd3 100644
--- a/lv_drv_conf.h
+++ b/lv_drv_conf.h
@@ -310,22 +310,22 @@
* Touchscreen as libinput interface (for Linux based systems)
*------------------------------------------------*/
#ifndef USE_LIBINPUT
-# define USE_LIBINPUT 0
+# define USE_LIBINPUT 1
#endif
#if USE_LIBINPUT
-# define LIBINPUT_NAME "/dev/input/event0" /*You can use the "evtest" Linux tool to get the list of devices and test them*/
+# define LIBINPUT_NAME "/dev/input/event2" /*You can use the "evtest" Linux tool to get the list of devices and test them*/
#endif /*USE_LIBINPUT*/
/*-------------------------------------------------
* Mouse or touchpad as evdev interface (for Linux based systems)
*------------------------------------------------*/
#ifndef USE_EVDEV
-# define USE_EVDEV 0
+# define USE_EVDEV 1
#endif
#if USE_EVDEV
-# define EVDEV_NAME "/dev/input/event0" /*You can use the "evtest" Linux tool to get the list of devices and test them*/
+# define EVDEV_NAME "/dev/input/event2" /*You can use the "evtest" Linux tool to get the list of devices and test them*/
# define EVDEV_SWAP_AXES 0 /*Swap the x and y axes of the touchscreen*/
# define EVDEV_SCALE 0 /* Scale input, e.g. if touchscreen resolution does not match display resolution */
diff --git a/main.c b/main.c
index d286cc7..ea505b4 100644
--- a/main.c
+++ b/main.c
@@ -1,5 +1,6 @@
#include "lvgl/lvgl.h"
#include "lv_drivers/display/fbdev.h"
+#include "lv_drivers/indev/evdev.h"
#include "lv_examples/lv_examples.h"
#include <unistd.h>
#include <pthread.h>
@@ -30,6 +31,24 @@ int main(void)
disp_drv.flush_cb = fbdev_flush;
lv_disp_drv_register(&disp_drv);
+
+
+
+ /* Add the mouse (or touchpad) as input device
+ * Use the 'mouse' driver which reads the PC's mouse*/
+ evdev_init();
+ evdev_set_file("/dev/input/event2");
+ /* Set up touchpad input device interface */
+ lv_indev_drv_t indev_drv;
+ lv_indev_drv_init(&indev_drv);
+ indev_drv.type = LV_INDEV_TYPE_POINTER;
+ indev_drv.read_cb = evdev_read;
+ lv_indev_t *indev = lv_indev_drv_register(&indev_drv);
+
+ lv_obj_t *cursor_img = lv_img_create(lv_scr_act(), NULL);
+ lv_img_set_src(cursor_img, LV_SYMBOL_OK);
+ lv_indev_set_cursor(indev, cursor_img);
+
/*Create a Demo*/
lv_demo_widgets();
按上面的patch, VMWARE + Ubuntu + LittleVGL + FrameBuffer支持鼠标了
https://forum.lvgl.io/t/how-to-set-a-cursor-to-show-where-i-touch-the-screen/1524/2
lv_indev_drv_t indev_drv;
lv_indev_drv_init(&indev_drv);
indev_drv.type = LV_INDEV_TYPE_POINTER;
indev_drv.read_cb = mouse_read;
lv_indev_t *indev = lv_indev_drv_register(&indev_drv);
lv_obj_t *cursor_img = lv_img_create(lv_scr_act(), NULL);
lv_img_set_src(cursor_img, LV_SYMBOL_OK);
lv_indev_set_cursor(indev, cursor_img);
项目地址: https://github.com/lvgl/lv_port_linux_frame_buffer
递归克隆到本地:
git clone https://github.com/lvgl/lv_port_linux_frame_buffer.git
cd lv_port_linux_frame_buffer
git submodule update --init --recursive
上面速度太慢了, 本站下载: lv_port_linux_frame_buffer.tgz (消耗晕哥70M空间 ~~~)
md5校验码: 4f1d02832086dc1011c98e64c2abe08c
原子哥视频教程: https://www.bilibili.com/video/BV1ug4y1q7ha
这个视频教程基于LVGL6, 与最新的LVGL7接口又有很大变化, 但是仍然有很重要的参考价值.
终极解决方案, 这样可以用无签名的UTF-8文件了:
/utf-8 /source-charset:utf-8 /execution-charset:utf-8
lvgl 的按钮不能直接设置他的按钮标题, 只能把Button作为父容器, 创建一个Label:
#include "../../lv_examples.h"
static void btn_event_cb(lv_obj_t * btn, lv_event_t event)
{
if(event == LV_EVENT_CLICKED) {
static uint8_t cnt = 0;
cnt++;
/*Get the first child of the button which is the label and change its text*/
lv_obj_t * label = lv_obj_get_child(btn, NULL);
lv_label_set_text_fmt(label, "Button: %d", cnt);
}
}
/**
* Create a button with a label and react on Click event.
*/
void lv_ex_get_started_1(void)
{
lv_obj_t * btn = lv_btn_create(lv_scr_act(), NULL); /*Add a button the current screen*/
lv_obj_set_pos(btn, 10, 10); /*Set its position*/
lv_obj_set_size(btn, 120, 50); /*Set its size*/
lv_obj_set_event_cb(btn, btn_event_cb); /*Assign a callback to the button*/
lv_obj_t * label = lv_label_create(btn, NULL); /*Add a label to the button*/
lv_label_set_text(label, "Button"); /*Set the labels text*/
}
代码: https://github.com/lvgl/lv_examples/blob/master/src/lv_ex_get_started/lv_ex_get_started_1.c
VC2017终于识别utf-8字符串了:
lv_label_set_text(label2, "一七");
但是文件一定要保存成 带签名的UTF-8文件,
如果保存成不带签名的UTF-8文件, 遇到汉字会出现编译错误.
然后还得加上编译指令:
#if defined(_MSC_VER) && (_MSC_VER >= 1900)
# pragma execution_character_set("utf-8")
#endif
参考: https://blog.csdn.net/wrzfeijianshen/article/details/84948234
现象和这个一样: https://github.com/lvgl/lvgl/issues/1662
这个是我的代码:
lv_obj_set_style_local_text_font(label1, LV_LABEL_PART_MAIN, LV_STATE_DEFAULT, &lv_font_simsun_16_cjk); lv_label_set_text(label1, "ABC\xE4\xB8\x80\xE4\xB8\x83ZZZ"); //"一七"
我用LVGL7 测试正常噢: https://whycan.cn/t_5014.html#p50915
void lv_test2()
{
lv_obj_t* label2 = lv_label_create(lv_scr_act(), NULL);
lv_obj_set_style_local_text_font(label2, LV_LABEL_PART_MAIN, LV_STATE_DEFAULT, &lv_font_simsun_16_cjk);
lv_obj_set_pos(label2, 100, 100);
lv_label_set_text(label2, "\xE4\xB8\x80\xE4\xB8\x83\xE4\xB8\x80\xE4\xB8\x83\xE4\xB8\x80\xE4\xB8\x83\xE4\xB8\x80\xE4\xB8\x83");
}
用自带的 lv_font_simsun_16_cjk 汉字字库显示正常.
项目地址: https://github.com/lvgl/lv_sim_visual_studio_sdl
递归克隆到本地:
git clone https://github.com/lvgl/lv_sim_visual_studio_sdl.git
cd lv_sim_visual_studio_sdl
git submodule update --init --recursive
上面速度太慢了, 本站下载: lv_sim_visual_studio_sdl.tgz (消耗晕哥70M空间 ~~~)
md5校验码: 5fb6ead5d76a1068f593386587cc2499
原子哥视频教程: https://www.bilibili.com/video/BV1ug4y1q7ha
这个视频教程基于LVGL6, 与最新的LVGL7接口又有很大变化, 但是仍然有很重要的参考价值.
1. 驱动或者设备禁用内置RTC 都可以.
2. rtc-pcf8563 1-0051: low voltage detected, date/time is not reliable.
电压不够或者没有放rtc电池。
https://blog.csdn.net/qq_39346729/article/details/80509599
2.
先执行: date -s 2020.07.21-22:59:00
再执行 hwclock -w --rtc /dev/rtc1就可以了.
页次: 1