页次: 1
这次我每个空格都对过了,发现我的配置 这个不对,我的是ttyS1 pinctrl-1,应该都改成0 pinctrl-0
ttyS1,数据发送正常了
但是cat中断显示还是不对,不显示名称
# cat /proc/interrupts
CPU0
16: 24277 sun4i_irq 13 Edge timer@1c20c00
17: 19131 sun4i_irq 7 Edge mv64xxx_i2c
18: 649811 sun4i_irq 10 Edge sun6i-spi
19: 388 sun4i_irq 29 Edge 1c0c000.lcd-controller
20: 9839 sun4i_irq 23 Edge sunxi-mmc
24: 19517 sun4i_irq 1 Edge ttyS0
25: 82 sun4i_irq 2 Edge
64: 946 sunxi_pio_edge 35 Edge gt911
Err: 0
uart0_pins_a: uart0@0 {
pins = "PE0", "PE1";
function = "uart0";
};
uart1_pins_a: uart1@0 {
pins = "PA2", "PA3";
function = "uart1";
bias-pull-up;
};
uart2_pins_a: uart2@0 {
pins = "PE7", "PE8";
function = "uart2";
bias-pull-up;
};
&uart0 {
pinctrl-0 = <&uart0_pins_a>;
pinctrl-names = "default";
status = "okay";
};
&uart1 {
pinctrl-0 = <&uart1_pins_a>;
pinctrl-names = "default";
status = "okay";
};
&uart2 {
pinctrl-0 = <&uart2_pins_a>;
pinctrl-names = "default";
status = "okay";
};
确实挺奇怪的,你参考一下这个帖子:
终于把V3s三个串口全部榨干, 控制台只能用 ssh 了, 泪崩 (dropbear大法好,还能秘钥登录)
http://whycan.cn/t_1183.html#p5971
(出处:哇酷开发者社区【全志 V3S/F1C100s/X3】)
正常。
# echo uart-test > /dev/ttyS1
# echo uart-test > /dev/ttyS2这样之后 cat /proc/interrupts 看串口中断次数有无增加。
您好,我试了下,发现ttyS0下面两个中断有增加,但是为什么没显示名字呀,难道配置还有问题?
# echo uart-test > /dev/ttyS1
# echo uart-test > /dev/ttyS1
# echo uart-test > /dev/ttyS1
# echo uart-test > /dev/ttyS1
# echo uart-test > /dev/ttyS1
# echo uart-test > /dev/ttyS1
# echo uart-test > /dev/ttyS2
# echo uart-test > /dev/ttyS2
# echo uart-test > /dev/ttyS2
# echo uart-test > /dev/ttyS2
# echo uart-test > /dev/ttyS2
# cat /proc/interrupts
CPU0
16: 42900 sun4i_irq 13 Edge timer@1c20c00
17: 13471 sun4i_irq 7 Edge mv64xxx_i2c
18: 628722 sun4i_irq 10 Edge sun6i-spi
19: 388 sun4i_irq 29 Edge 1c0c000.lcd-controller
20: 17353 sun4i_irq 23 Edge sunxi-mmc
24: 10496 sun4i_irq 1 Edge ttyS0
25: 13 sun4i_irq 2 Edge
26: 24 sun4i_irq 3 Edge
64: 663 sunxi_pio_edge 35 Edge gt911
linux启动log有没有显示 ttyS1/2正常?
您好,我的启动logo里面显示的是这样的,好像配置正常呀,你看下对吗?
[ 0.290349] console [ttyS0] disabled
[ 0.310569] 1c25000.serial: ttyS0 at MMIO 0x1c25000 (irq = 24, base_baud = 6250000) is a 16550A
[ 0.626305] console [ttyS0] enabled
[ 0.652017] 1c25400.serial: ttyS1 at MMIO 0x1c25400 (irq = 25, base_baud = 6250000) is a 16550A
[ 0.682913] 1c25800.serial: ttyS2 at MMIO 0x1c25800 (irq = 26, base_baud = 6250000) is a 16550A
# echo uart-test > /dev/ttyS1
# echo uart-test > /dev/ttyS2
# echo uart-test > /dev/ttyS0
uart-test
# echo uart-test > /dev/ttyS3
sh: write error: I/O error
uart0_pins_a: uart0 {
pins = "PE0", "PE1";
function = "uart0";
bias-pull-up;
};
uart1_pins_a: uart1 {
pins = "PA2", "PA3";
function = "uart1";
bias-pull-up;
};
uart2_pins_a: uart2 {
pins = "PE7", "PE8";
function = "uart2";
bias-pull-up;
};
&uart0 {
pinctrl-names = "default";
pinctrl-0 = <&uart0_pins_a>;
status = "okay";
};
&uart1 {
pinctrl-names = "default";
pinctrl-1 = <&uart1_pins_a>;
status = "okay";
};
&uart2 {
pinctrl-names = "default";
pinctrl-2 = <&uart2_pins_a>;
status = "okay";
};
#include <fcntl.h>
int fd;
int uart_init()
{
fd = open("/dev/ttyS1", O_RDWR | O_NOCTTY);
struct termios oldtio = { 0 };
struct termios newtio = { 0 };
tcgetattr(fd, &oldtio);
//设置波特率为115200
newtio.c_cflag = B115200 | CS8 | CLOCAL | CREAD;
newtio.c_iflag = 0; // IGNPAR | ICRNL
newtio.c_oflag = 0;
newtio.c_lflag = 0; // ICANON
newtio.c_cc[VTIME] = 0;
newtio.c_cc[VMIN] = 1;
tcflush(fd, TCIOFLUSH);
tcsetattr(fd, TCSANOW, &newtio);
//设置为非阻塞模式,这个在读串口的时候会用到
fcntl(fd, F_SETFL, O_NONBLOCK);
return fd;
}
/* 功能:uart_send 串口数据发送函数
* 参数:无
* 返回值:int:-1 失败
* 备注:---
*/
int uart_send(void)
{
uint8_t buffer[4] = {0};
buffer[0] = 'T';
buffer[1] = 'X';
buffer[2] = '\n';
buffer[3] = '\n';
int ret = write(fd, buffer, sizeof(buffer));
return ret;
}
要不看下这个有没有参考价值:
https://whycan.cn/t_2118.html
好的谢谢,我试试看
根据官方文档,已经安装了如下软件
1 python(x64 版本>=2.7)
2 scons(版本>=3.0.0)
3 Visual Studio C++(版本>=2017)
进入win10 shell窗口输入命令 scons 编译报错 如下 、烦请各位大神看看啥情况,不胜感激
目录: E:\AWTK Projects\awtk-v1.3-SDK
Mode LastWriteTime Length Name
---- ------------- ------ ----
d----- 2020/2/10 14:18 awtk
d----- 2020/2/10 14:14 awtk-examples
d----- 2020/2/10 14:34 awtk-linux-fb
d----- 2020/2/10 14:14 user_apps
-a---- 2020/1/16 17:07 179 version.txt
PS E:\AWTK Projects\awtk-v1.3-SDK> cd awtk
PS E:\AWTK Projects\awtk-v1.3-SDK\awtk> scons
scons: Reading SConscript files ...
MACH=AMD64 ARCH=('32bit', 'WindowsPE') TARGET_ARCH=arm
TK_ROOT: E:\AWTK Projects\awtk-v1.3-SDK\awtk
scons: done reading SConscript files.
scons: Building targets ...
g++ -o 3rd\agge\agge\math.o -c -DWIN32 -D_WIN32 -DWINDOWS /EHsc -D_CONSOLE /DEBUG /Od /FS /Z7 -DWITH_64BIT_CPU -DTK_ROOT=\"E:\\AWTK Projects\\awtk-v1.3-SDK\\awtk\" -DSTBTT_STATIC -DSTB_IMAGE_STATIC -DWITH_STB_IMAGE -DWITH_SOCKET -DWITH_VGCANVAS -DWITH_UNICODE_BREAK -DWITH_DESKTOP_STYLE -DSDL2 -DHAS_STD_MALLOC -DWITH_SDL -DWITH_FS_RES -DHAS_STDIO -DHAVE_STDIO_H -DWITH_STB_FONT -DWITH_BITMAP_BGRA -DWITH_NANOVG_SOFT -DWITH_FB_BGR565=1 -DWITH_NANOVG_AGGE -D_WIN64 -DSDL_REAL_API -DSDL_HAPTIC_DISABLED -DSDL_SENSOR_DISABLED -DSDL_JOYSTICK_DISABLED -D__STDC_LIMIT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_CONSTANT_MACROS -D_HAS_EXCEPTIONS=0 -D_HAS_ITERATOR_DEBUGGING=0 -D_ITERATOR_DEBUG_LEVEL=0 -D_SCL_SECURE=0-D_SECURE_SCL=0 -D_SCL_SECURE_NO_WARNINGS -D_CRT_SECURE_NO_WARNINGS -D_CRT_SECURE_NO_DEPRECATE -I. -Isrc -I3rd -Isrc\ext_widgets -I3rd\pixman -I3rd\cairo -I3rd\bgfx\bgfx\include -I3rd\bgfx\bx\include -I3rd\bgfx\bimg\include -I3rd\agge -I3rd\agg\include -I3rd\nanovg -I3rd\nanovg\gl -I3rd\nanovg\base -I3rd\nanovg\agge -I3rd\nanovg\bgfx -I3rd\SDL\src -I3rd\SDL\include -I3rd\agge\src -I3rd\agge\include -I3rd\gpinyin\include -I3rd\libunibreak -I3rd\gtest\googletest -I3rd\gtest\googletest\include -Itools 3rd\agge\agge\math.cpp
g++: error: /EHsc: No such file or directory
g++: error: /DEBUG: No such file or directory
g++: error: /Od: No such file or directory
g++: error: /FS: No such file or directory
g++: error: /Z7: No such file or directory
g++: error: Projects\\awtk-v1.3-SDK\\awtk": No such file or directory
scons: *** [3rd\agge\agge\math.o] Error 1
scons: building terminated because of errors.
PS E:\AWTK Projects\awtk-v1.3-SDK\awtk>
请问各位大神这是啥情况呀?我电脑已经安装了gcc 和g++
命令行输入 g++ -v 可见如下 而且VS Studio2017也装的C++版本,编译LVGL都是正常的
PS E:\AWTK Projects\awtk-v1.3-SDK\awtk>
PS E:\AWTK Projects\awtk-v1.3-SDK\awtk> g++ -v
Using built-in specs.
COLLECT_GCC=C:\MinGW\bin\g++.exe
COLLECT_LTO_WRAPPER=c:/mingw/bin/../libexec/gcc/mingw32/6.3.0/lto-wrapper.exe
Target: mingw32
Configured with: ../src/gcc-6.3.0/configure --build=x86_64-pc-linux-gnu --host=mingw32 --with-gmp=/mingw --with-mpfr=/mingw --with-mpc=/mingw --with-isl=/mingw --prefix=/mingw --disable-win32-registry --target=mingw32 --with-arch=i586 --enable-languages=c,c++,objc,obj-c++,fortran,ada --with-pkgversion='MinGW.org GCC-6.3.0-1' --enable-static --enable-shared --enable-threads --with-dwarf2 --disable-sjlj-exceptions --enable-version-specific-runtime-libs --with-libiconv-prefix=/mingw --with-libintl-prefix=/mingw --enable-libstdcxx-debug --with-tune=generic --enable-libgomp --disable-libvtv --enable-nls
Thread model: win32
gcc version 6.3.0 (MinGW.org GCC-6.3.0-1)
PS E:\AWTK Projects\awtk-v1.3-SDK\awtk>
使用的是荔枝派NANO,官网主线uboot,和主线linux内核
下面是我的logo打印
U-Boot SPL 2018.01-05679-g013ca457fd-dirty (Feb 05 2020 - 13:26:07)
DRAM: 64 MiB
Trying to boot from MMC1
Card did not respond to voltage select!
mmc_init: -95, time 22
spl: mmc init failed with error: -95
Trying to boot from sunxi SPI
U-Boot 2018.01-05679-g013ca457fd-dirty (Feb 05 2020 - 13:26:07 +0800) Allwinner Technology
CPU: Allwinner F Series (SUNIV)
Model: Lichee Pi Nano
DRAM: 64 MiB
MMC: SUNXI SD/MMC: 0
SF: Detected w25q128bv with page size 256 Bytes, erase size 4 KiB, total 16 MiB
*** Warning - bad CRC, using default environment
Setting up a 480x272 lcd console (overscan 0x0)
In: serial@1c25000
Out: serial@1c25000
Err: serial@1c25000
Unknown command 'usb' - try 'help'
Hit any key to stop autoboot: 0
SF: Detected w25q128bv with page size 256 Bytes, erase size 4 KiB, total 16 MiB
device 0 offset 0x30000, size 0x4000
SF: 16384 bytes @ 0x30000 Read: OK
device 0 offset 0x40000, size 0x130000
SF: 1245184 bytes @ 0x40000 Read: OK
## Flattened Device Tree blob at 80c00000
Booting using the fdt blob at 0x80c00000
Loading Device Tree to 816fa000, end 816ff0f2 ... OK
Starting kernel ...
[ 0.000000] Booting Linux on physical CPU 0x0
[ 0.000000] Linux version 4.15.0-rc8-licheepi-nano+ (yan@yan-Z5) (gcc version 7.2.1 20171011 (Linaro GCC 7.2-2017.11)) #164 Wed Feb 5 01:42:34 CST 2020
[ 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: 16256
[ 0.000000] Kernel command line: vt.global_cursor_default=0 console=ttyS0,115200 panic=5 rootwait root=/dev/mtdblock3 rw rootfstype=jffs2
[ 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: 61212K/65536K available (2384K kernel code, 122K rwdata, 676K rodata, 276K init, 188K bss, 4324K reserved, 0K cma-reserved)
[ 0.000000] Virtual kernel memory layout:
[ 0.000000] vector : 0xffff0000 - 0xffff1000 ( 4 kB)
[ 0.000000] fixmap : 0xffc00000 - 0xfff00000 (3072 kB)
[ 0.000000] vmalloc : 0xc4800000 - 0xff800000 ( 944 MB)
[ 0.000000] lowmem : 0xc0000000 - 0xc4000000 ( 64 MB)
[ 0.000000] modules : 0xbf000000 - 0xc0000000 ( 16 MB)
[ 0.000000] .text : 0x(ptrval) - 0x(ptrval) (2386 kB)
[ 0.000000] .init : 0x(ptrval) - 0x(ptrval) ( 276 kB)
[ 0.000000] .data : 0x(ptrval) - 0x(ptrval) ( 123 kB)
[ 0.000000] .bss : 0x(ptrval) - 0x(ptrval) ( 189 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.000043] sched_clock: 32 bits at 24MHz, resolution 41ns, wraps every 89478484971ns
[ 0.000095] clocksource: timer: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 79635851949 ns
[ 0.000544] Console: colour dummy device 80x30
[ 0.000619] Calibrating delay loop... 393.21 BogoMIPS (lpj=1966080)
[ 0.050178] pid_max: default: 32768 minimum: 301
[ 0.050451] Mount-cache hash table entries: 1024 (order: 0, 4096 bytes)
[ 0.050480] Mountpoint-cache hash table entries: 1024 (order: 0, 4096 bytes)
[ 0.051343] CPU: Testing write buffer coherency: ok
[ 0.052852] Setting up static identity map for 0x80008400 - 0x8000843c
[ 0.054397] devtmpfs: initialized
[ 0.058034] clocksource: jiffies: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 19112604462750000 ns
[ 0.058078] futex hash table entries: 256 (order: -1, 3072 bytes)
[ 0.058188] pinctrl core: initialized pinctrl subsystem
[ 0.059192] DMA: preallocated 256 KiB pool for atomic coherent allocations
[ 0.070083] clocksource: Switched to clocksource timer
[ 0.088837] workingset: timestamp_bits=30 max_order=14 bucket_order=0
[ 0.097095] jffs2: version 2.2. (NAND) © 2001-2006 Red Hat, Inc.
[ 0.099127] Block layer SCSI generic (bsg) driver version 0.4 loaded (major 253)
[ 0.099167] io scheduler noop registered (default)
[ 0.105914] suniv-pinctrl 1c20800.pinctrl: initialized sunXi PIO driver
[ 0.215630] Serial: 8250/16550 driver, 8 ports, IRQ sharing disabled
[ 0.219946] console [ttyS0] disabled
[ 0.240135] 1c25000.serial: ttyS0 at MMIO 0x1c25000 (irq = 24, base_baud = 6250000) is a 16550A
[ 0.539248] console [ttyS0] enabled
[ 0.550676] m25p80 spi0.0: w25q128 (16384 Kbytes)
[ 0.555439] 4 ofpart partitions found on MTD device spi0.0
[ 0.560996] Creating 4 MTD partitions on "spi0.0":
[ 0.565796] 0x000000000000-0x000000030000 : "u-boot"
[ 0.572520] 0x000000030000-0x000000040000 : "dtb"
[ 0.578800] 0x000000040000-0x0000001b0000 : "kernel"
[ 0.585488] 0x000000170000-0x000000800000 : "rootfs"
[ 0.592503] i2c /dev entries driver
[ 0.597922] input: ns2009_ts as /devices/platform/soc/1c27000.i2c/i2c-0/0-0048/input/input0
[ 0.610556] sun4i-drm display-engine: bound 1e60000.display-backend (ops 0xc028200c)
[ 0.618975] sun4i-drm display-engine: bound 1c0c000.lcd-controller (ops 0xc02812f0)
[ 0.626728] [drm] Supports vblank timestamp caching Rev 2 (21.10.2013).
[ 0.633364] [drm] No driver support for vblank timestamp query.
[ 0.688290] Console: switching to colour frame buffer device 60x34
[ 0.713489] sun4i-drm display-engine: fb0: frame buffer device
[ 0.720270] [drm] Initialized sun4i-drm 1.0.0 20150629 for display-engine on minor 0
[ 0.821046] random: crng init done
[ 1.145981] VFS: Mounted root (jffs2 filesystem) on device 31:3.
[ 1.153325] Freeing unused kernel memory: 276K
[ 1.157768] This architecture does not have kernel memory protection.
mount: mounting tmpfs on /dev/shm failed: Invalid argument
mount: mounting tmpfs on /tmp failed: Invalid argument
mount: mounting tmpfs on /run failed: Invalid argument
hostname: applet not found
S01app start!
Starting syslogd: OK
Starting klogd: OK
Initializing random number generator... done.
[4.157768]: root login on 'ttyS0'
helloworld!
#
板子很漂亮,什么软件设计的呀?
楼主能不能分享一下内核裁剪经验,我怎么裁减zImage都有3M,你的才2.3M,厉害
厚脸皮求上传个.config最好
我的配置文件已经开源了哦,看帖不认真 哈哈,上面有个压缩包,里面镜像和配置文件都有,改了XZ压缩方式,还可以缩到1.7M
奇怪,昨天明明放上去的呀,咋不见了,我再发一次
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这篇文章提供了一些通用的方法,主要是要删掉用不上的驱动,并且把不需要的加载放在后面。
好的,:D 谢谢我参考下
SF: Detected w25q128bv with page size 256 Bytes, erase size 4 KiB, total 16 MiB
device 0 offset 0x30000, size 0x4000
SF: 16384 bytes @ 0x30000 Read: OK
device 0 offset 0x40000, size 0x1c0000
SF: 1835008 bytes @ 0x40000 Read: OK
## Flattened Device Tree blob at 80c00000
Booting using the fdt blob at 0x80c00000
Loading Device Tree to 816fa000, end 816ff0f2 ... OK
Starting kernel ...
uboot 主要是 Starting kernel ... 这个地方花的时间太多,差不多2S
这里还浪费了一点点时间,
Trying to boot from MMC1
MMC Device 0 not found
spl: could not find mmc device. error: -19还有你的 lvgl app有没有 strip ?体积多大?
mount: mounting tmpfs on /dev/shm failed: Invalid argument
mount: mounting tmpfs on /tmp failed: Invalid argument
mount: mounting tmpfs on /run failed: Invalid argument
根文件系统还缺这几个目录, 最好手动建立一下.
好的谢谢,我这就试试,我的程序775K,strip是啥?可以优化速度吗?刚搞lvgl不大懂,请指教
刚刚看了下,根文件有这几个目录的哦,不知道咋会报错
mount: mounting tmpfs on /dev/shm failed: Invalid argument
mount: mounting tmpfs on /tmp failed: Invalid argument
mount: mounting tmpfs on /run failed: Invalid argument
hostname: applet not found
S01app start!
Starting syslogd: OK
Starting klogd: OK
Starting mdev...
The framebuffer device was opened successfully.
480x272, 32bpp
The framebuffer device was mapped to memory successfully.
Frame buffer hor. res: 480, ver. res: 272
modprobe: can't change directory to '/lib/modules': No such file or directory
Initializing random number generator... done.
login[85]: root login on 'ttyS0'
helloworld!
# ls /
bin lib media proc sbin usr
dev lib32 mnt root sys var
etc linuxrc opt run tmp
#
我把SPI速度改到了128M,速度好像没有提升,使用了楼上各种方法,目前启动到 lvgl demo需要8S, uboot启动2S,内核启动完成7.4S 一共9.4S
下面是启动logo
U-Boot SPL 2018.01-05679-g013ca457fd-dirty (Jan 30 2020 - 12:55:16)
DRAM: 64 MiB
Trying to boot from MMC1
MMC Device 0 not found
spl: could not find mmc device. error: -19
Trying to boot from sunxi SPI
U-Boot 2018.01-05679-g013ca457fd-dirty (Jan 30 2020 - 12:55:16 +0800) Allwinnery
CPU: Allwinner F Series (SUNIV)
Model: Lichee Pi Nano
DRAM: 64 MiB
MMC:
SF: Detected w25q128bv with page size 256 Bytes, erase size 4 KiB, total 16 MiB
*** Warning - bad CRC, using default environment
In: serial@1c25000
Out: serial@1c25000
Err: serial@1c25000
Unknown command 'usb' - try 'help'
Hit any key to stop autoboot: 0
SF: Detected w25q128bv with page size 256 Bytes, erase size 4 KiB, total 16 MiB
device 0 offset 0x30000, size 0x4000
SF: 16384 bytes @ 0x30000 Read: OK
device 0 offset 0x40000, size 0x1c0000
SF: 1835008 bytes @ 0x40000 Read: OK
## Flattened Device Tree blob at 80c00000
Booting using the fdt blob at 0x80c00000
Loading Device Tree to 816fa000, end 816ff0f2 ... OK
Starting kernel ...
[ 0.000000] Booting Linux on physical CPU 0x0
[ 0.000000] Linux version 4.15.0-rc8-licheepi-nano+ (yan@yan-Z5) (gcc versio0
[ 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: 16256
[ 0.000000] Kernel command line: vt.global_cursor_default=0 console=ttyS0,112
[ 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: 57308K/65536K available (4096K kernel code, 170K rwdata,)
[ 0.000000] Virtual kernel memory layout:
[ 0.000000] vector : 0xffff0000 - 0xffff1000 ( 4 kB)
[ 0.000000] fixmap : 0xffc00000 - 0xfff00000 (3072 kB)
[ 0.000000] vmalloc : 0xc4800000 - 0xff800000 ( 944 MB)
[ 0.000000] lowmem : 0xc0000000 - 0xc4000000 ( 64 MB)
[ 0.000000] pkmap : 0xbfe00000 - 0xc0000000 ( 2 MB)
[ 0.000000] modules : 0xbf000000 - 0xbfe00000 ( 14 MB)
[ 0.000000] .text : 0x(ptrval) - 0x(ptrval) (5088 kB)
[ 0.000000] .init : 0x(ptrval) - 0x(ptrval) (1024 kB)
[ 0.000000] .data : 0x(ptrval) - 0x(ptrval) ( 171 kB)
[ 0.000000] .bss : 0x(ptrval) - 0x(ptrval) ( 216 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.000041] sched_clock: 32 bits at 24MHz, resolution 41ns, wraps every 8947s
[ 0.000090] clocksource: timer: mask: 0xffffffff max_cycles: 0xffffffff, maxs
[ 0.000485] Console: colour dummy device 80x30
[ 0.000553] Calibrating delay loop... 395.67 BogoMIPS (lpj=1978368)
[ 0.120222] pid_max: default: 32768 minimum: 301
[ 0.120430] Mount-cache hash table entries: 1024 (order: 0, 4096 bytes)
[ 0.120459] Mountpoint-cache hash table entries: 1024 (order: 0, 4096 bytes)
[ 0.121308] CPU: Testing write buffer coherency: ok
[ 0.122694] Setting up static identity map for 0x80100000 - 0x80100058
[ 0.124451] devtmpfs: initialized
[ 0.128223] clocksource: jiffies: mask: 0xffffffff max_cycles: 0xffffffff, ms
[ 0.128269] futex hash table entries: 256 (order: -1, 3072 bytes)
[ 0.128419] pinctrl core: initialized pinctrl subsystem
[ 0.130335] DMA: preallocated 256 KiB pool for atomic coherent allocations
[ 0.131642] cpuidle: using governor menu
[ 0.145353] SCSI subsystem initialized
[ 0.145835] Advanced Linux Sound Architecture Driver Initialized.
[ 0.146060] clocksource: Switched to clocksource timer
[ 0.167073] NetWinder Floating Point Emulator V0.97 (double precision)
[ 0.168823] workingset: timestamp_bits=30 max_order=14 bucket_order=0
[ 0.174770] jffs2: version 2.2. (NAND) © 2001-2006 Red Hat, Inc.
[ 0.185229] Block layer SCSI generic (bsg) driver version 0.4 loaded (major )
[ 0.185265] io scheduler noop registered
[ 0.185276] io scheduler deadline registered
[ 0.185797] io scheduler cfq registered (default)
[ 0.185824] io scheduler mq-deadline registered
[ 0.185835] io scheduler kyber registered
[ 0.192663] suniv-pinctrl 1c20800.pinctrl: initialized sunXi PIO driver
[ 0.326036] Serial: 8250/16550 driver, 8 ports, IRQ sharing disabled
[ 0.331324] console [ttyS0] disabled
[ 0.351583] 1c25000.serial: ttyS0 at MMIO 0x1c25000 (irq = 24, base_baud = 6A
[ 0.694356] console [ttyS0] enabled
[ 0.702548] panel-simple panel: panel supply power not found, using dummy rer
[ 0.711511] SCSI Media Changer driver v0.25
[ 0.718500] m25p80 spi0.0: w25q128 (16384 Kbytes)
[ 0.723263] 4 ofpart partitions found on MTD device spi0.0
[ 0.728833] Creating 4 MTD partitions on "spi0.0":
[ 0.733637] 0x000000000000-0x000000030000 : "u-boot"
[ 0.740726] 0x000000030000-0x000000040000 : "dtb"
[ 0.747401] 0x000000040000-0x0000002a0000 : "kernel"
[ 0.754230] 0x0000002a0000-0x000001000000 : "rootfs"
[ 0.761495] i2c /dev entries driver
[ 0.767097] input: ns2009_ts as /devices/platform/soc/1c27000.i2c/i2c-0/0-000
[ 0.836175] sunxi-mmc 1c0f000.mmc: base:0x0d7490d4 irq:20
[ 0.863654] sun4i-drm display-engine: bound 1e60000.display-backend (ops 0xc)
[ 0.872360] sun4i-drm display-engine: bound 1c0c000.lcd-controller (ops 0xc0)
[ 0.880128] [drm] Supports vblank timestamp caching Rev 2 (21.10.2013).
[ 0.886773] [drm] No driver support for vblank timestamp query.
[ 0.935414] Console: switching to colour frame buffer device 60x34
[ 0.960615] sun4i-drm display-engine: fb0: frame buffer device
[ 0.967563] [drm] Initialized sun4i-drm 1.0.0 20150629 for display-engine on0
[ 0.975881] vcc3v3: disabling
[ 0.978979] ALSA device list:
[ 0.981951] #0: Loopback 1
[ 1.086998] random: crng init done
[ 1.422609] VFS: Mounted root (jffs2 filesystem) on device 31:3.
[ 1.430718] devtmpfs: mounted
[ 1.438129] Freeing unused kernel memory: 1024K
mount: mounting tmpfs on /dev/shm failed: Invalid argument
mount: mounting tmpfs on /tmp failed: Invalid argument
mount: mounting tmpfs on /run failed: Invalid argument
hostname: applet not found
S01app start!
Starting syslogd: OK
Starting klogd: OK
Initializing random number generator... done.
login[74]: root login on 'ttyS0'
helloworld!
# The framebuffer device was opened successfully.
480x272, 32bpp
The framebuffer device was mapped to memory successfully.
Frame buffer hor. res: 480, ver. res: 272
我觉得这个ttyS0 init占用太多时间了,能不能改短一点
[ 0.192577] suniv-pinctrl 1c20800.pinctrl: initialized sunXi PIO driver
[ 0.325981] Serial: 8250/16550 driver, 8 ports, IRQ sharing disabled
[ 0.331286] console [ttyS0] disabled
[ 0.351550] 1c25000.serial: ttyS0 at MMIO 0x1c25000 (irq = 24, base_baud = 6A
[ 0.694320] console [ttyS0] enabled
是的哦,350ms有点太长了,各位大神知道如何优化麻
还是我前面那个回复,
可以把根文件系统改小一点,比如5M,
这样扫描区域就没辣么大,可以节省一点点时间。还有,lvgl应用放 /etc/init.d/S90app 里面,记得加后台运行符号。
好的谢谢,根文件系统改小我试过哦,我把根文件系统改成了5M,对比了下发现不明显哦,时间没有明显提升。lvgl应用我没加后台符号,不过我不执行lvgl开机时间也要那么长,加了lvgl demo程序加载大概需要2S时间。
这是我改的,测试发现开机时间一模一样,没啥变化
[ 0.733537] 0x000000000000-0x000000030000 : "u-boot"
[ 0.740647] 0x000000030000-0x000000040000 : "dtb"
[ 0.747326] 0x000000040000-0x0000002a0000 : "kernel"
[ 0.754149] 0x0000002a0000-0x000000800000 : "rootfs"
Starting mdev...
modprobe: can't change directory to '/lib/modules': No such file or directory
Initializing random number generator... done.
Starting network: ifup: applet not found
FAIL
[8.500100]: root login on 'ttyS0'
helloworld!
# df -h
Filesystem Size Used Available Use% Mounted on
/dev/root 5.4M 3.1M 2.3M 58% /
#
linux设备树你的 spi 速度是多少?
等等,有点不对劲,
0x0000002a0000-0x000001040000 : "rootfs"
这里貌似超过16M了?
对哦,:lol: 看了下,是设备树那里搞错了呢,改成0XD60000就好了
&spi0 {
pinctrl-names = "default";
pinctrl-0 = <&spi0_pins_a>;
status = "okay";
spi-max-frequency = <108000000>;
flash: w25q128@0 {
#address-cells = <1>;
#size-cells = <1>;
compatible = "winbond,w25q128", "jedec,spi-nor";
reg = <0>;
spi-max-frequency = <108000000>;
partitions {
compatible = "fixed-partitions";
#address-cells = <1>;
#size-cells = <1>;
partition@0 {
label = "u-boot";
reg = <0x00000 0x30000>;
read-only;
};
partition@100000 {
label = "dtb";
reg = <0x30000 0x10000>;
read-only;
};
partition@110000 {
label = "kernel";
reg = <0x40000 0x260000>;
read-only;
};
partition@510000 {
label = "rootfs";
reg = <0x2A0000 0xDA0000>;
};
};
};
};
16M spiflash 系统
uboot裁减到122K 内核2.3M rootfs 2M 移植加入tslib,使用jffs2文件系统。我目前优化办法就是各种裁减,然后内核速度改到了800Mhz,SPI速度改到了108M。
uboot等待时间改成0S,uboot启动到内核需要3S ,内核和文件系统启动需要9S ,加起来上电启动到littlegl demo 需要 12S!
12S这个时间还是太长,请问各位大神,还有什么办法可以加快开机速度,请各位不吝赐教谢谢!
下面是我的分区规划
mtd0 192KB spl+uboot 0x0000000-0x0030000 : “uboot”
mtd1 64KB dtb文件 0x0030000-0x0040000 : “dtb”
mtd2 2.375MB linux内核 0x0040000-0x02A0000 : “kernel”
mtd3 剩余 根文件系统 0x02A0000-0x1000000 : “rootfs”
下面是我系统启动打印的logo日志
U-Boot SPL 2018.01-05679-g013ca457fd-dirty (Jan 29 2020 - 15:37:30)
DRAM: 64 MiB
Trying to boot from MMC1
MMC Device 0 not found
spl: could not find mmc device. error: -19
Trying to boot from sunxi SPI
U-Boot 2018.01-05679-g013ca457fd-dirty (Jan 29 2020 - 15:37:30 +0800) Allwinnery
CPU: Allwinner F Series (SUNIV)
Model: Lichee Pi Nano
DRAM: 64 MiB
MMC:
SF: Detected w25q128bv with page size 256 Bytes, erase size 4 KiB, total 16 MiB
*** Warning - bad CRC, using default environment
In: serial@1c25000
Out: serial@1c25000
Err: serial@1c25000
Unknown command 'usb' - try 'help'
Hit any key to stop autoboot: 0
SF: Detected w25q128bv with page size 256 Bytes, erase size 4 KiB, total 16 MiB
device 0 offset 0x30000, size 0x4000
SF: 16384 bytes @ 0x30000 Read: OK
device 0 offset 0x40000, size 0x260000
SF: 2490368 bytes @ 0x40000 Read: OK
## Flattened Device Tree blob at 80c00000
Booting using the fdt blob at 0x80c00000
Loading Device Tree to 816fa000, end 816ff0f2 ... OK
Starting kernel ...
[ 0.000000] Booting Linux on physical CPU 0x0
[ 0.000000] Linux version 4.15.0-rc8-licheepi-nano+ (yan@yan-Z5) (gcc versio0
[ 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: 16256
[ 0.000000] Kernel command line: vt.global_cursor_default=0 console=ttyS0,112
[ 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: 57308K/65536K available (4096K kernel code, 170K rwdata,)
[ 0.000000] Virtual kernel memory layout:
[ 0.000000] vector : 0xffff0000 - 0xffff1000 ( 4 kB)
[ 0.000000] fixmap : 0xffc00000 - 0xfff00000 (3072 kB)
[ 0.000000] vmalloc : 0xc4800000 - 0xff800000 ( 944 MB)
[ 0.000000] lowmem : 0xc0000000 - 0xc4000000 ( 64 MB)
[ 0.000000] pkmap : 0xbfe00000 - 0xc0000000 ( 2 MB)
[ 0.000000] modules : 0xbf000000 - 0xbfe00000 ( 14 MB)
[ 0.000000] .text : 0x(ptrval) - 0x(ptrval) (5088 kB)
[ 0.000000] .init : 0x(ptrval) - 0x(ptrval) (1024 kB)
[ 0.000000] .data : 0x(ptrval) - 0x(ptrval) ( 171 kB)
[ 0.000000] .bss : 0x(ptrval) - 0x(ptrval) ( 216 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.000041] sched_clock: 32 bits at 24MHz, resolution 41ns, wraps every 8947s
[ 0.000090] clocksource: timer: mask: 0xffffffff max_cycles: 0xffffffff, maxs
[ 0.000485] Console: colour dummy device 80x30
[ 0.000553] Calibrating delay loop... 395.67 BogoMIPS (lpj=1978368)
[ 0.120222] pid_max: default: 32768 minimum: 301
[ 0.120430] Mount-cache hash table entries: 1024 (order: 0, 4096 bytes)
[ 0.120458] Mountpoint-cache hash table entries: 1024 (order: 0, 4096 bytes)
[ 0.121308] CPU: Testing write buffer coherency: ok
[ 0.122694] Setting up static identity map for 0x80100000 - 0x80100058
[ 0.124450] devtmpfs: initialized
[ 0.128221] clocksource: jiffies: mask: 0xffffffff max_cycles: 0xffffffff, ms
[ 0.128268] futex hash table entries: 256 (order: -1, 3072 bytes)
[ 0.128417] pinctrl core: initialized pinctrl subsystem
[ 0.130332] DMA: preallocated 256 KiB pool for atomic coherent allocations
[ 0.131639] cpuidle: using governor menu
[ 0.145336] SCSI subsystem initialized
[ 0.145821] Advanced Linux Sound Architecture Driver Initialized.
[ 0.146040] clocksource: Switched to clocksource timer
[ 0.167062] NetWinder Floating Point Emulator V0.97 (double precision)
[ 0.168800] workingset: timestamp_bits=30 max_order=14 bucket_order=0
[ 0.174759] jffs2: version 2.2. (NAND) © 2001-2006 Red Hat, Inc.
[ 0.185175] Block layer SCSI generic (bsg) driver version 0.4 loaded (major )
[ 0.185212] io scheduler noop registered
[ 0.185223] io scheduler deadline registered
[ 0.185746] io scheduler cfq registered (default)
[ 0.185772] io scheduler mq-deadline registered
[ 0.185783] io scheduler kyber registered
[ 0.192577] suniv-pinctrl 1c20800.pinctrl: initialized sunXi PIO driver
[ 0.325981] Serial: 8250/16550 driver, 8 ports, IRQ sharing disabled
[ 0.331286] console [ttyS0] disabled
[ 0.351550] 1c25000.serial: ttyS0 at MMIO 0x1c25000 (irq = 24, base_baud = 6A
[ 0.694320] console [ttyS0] enabled
[ 0.702503] panel-simple panel: panel supply power not found, using dummy rer
[ 0.711471] SCSI Media Changer driver v0.25
[ 0.718451] m25p80 spi0.0: w25q128 (16384 Kbytes)
[ 0.723210] 4 ofpart partitions found on MTD device spi0.0
[ 0.728785] Creating 4 MTD partitions on "spi0.0":
[ 0.733586] 0x000000000000-0x000000030000 : "u-boot"
[ 0.740702] 0x000000030000-0x000000040000 : "dtb"
[ 0.747377] 0x000000040000-0x0000002a0000 : "kernel"
[ 0.754202] 0x0000002a0000-0x000001040000 : "rootfs"
[ 0.759287] mtd: partition "rootfs" extends beyond the end of device "spi0.00
[ 0.771218] i2c /dev entries driver
[ 0.776825] input: ns2009_ts as /devices/platform/soc/1c27000.i2c/i2c-0/0-000
[ 0.846154] sunxi-mmc 1c0f000.mmc: base:0x0d7490d4 irq:20
[ 0.873560] sun4i-drm display-engine: bound 1e60000.display-backend (ops 0xc)
[ 0.882275] sun4i-drm display-engine: bound 1c0c000.lcd-controller (ops 0xc0)
[ 0.890041] [drm] Supports vblank timestamp caching Rev 2 (21.10.2013).
[ 0.896677] [drm] No driver support for vblank timestamp query.
[ 0.945303] Console: switching to colour frame buffer device 60x34
[ 0.970499] sun4i-drm display-engine: fb0: frame buffer device
[ 0.977443] [drm] Initialized sun4i-drm 1.0.0 20150629 for display-engine on0
[ 0.985746] vcc3v3: disabling
[ 0.988841] ALSA device list:
[ 0.991814] #0: Loopback 1
[ 1.096244] random: crng init done
[ 1.412503] VFS: Mounted root (jffs2 filesystem) on device 31:3.
[ 1.420587] devtmpfs: mounted
[ 1.428004] Freeing unused kernel memory: 1024K
mount: mounting tmpfs on /dev/shm failed: Invalid argument
mount: mounting tmpfs on /tmp failed: Invalid argument
mount: mounting tmpfs on /run failed: Invalid argument
hostname: applet not found
Starting syslogd: OK
Starting klogd: OK
Starting mdev...
modprobe: can't change directory to '/lib/modules': No such file or directory
Initializing random number generator... done.
Starting network: ifup: applet not found
FAIL
[8.500100]: root login on 'ttyS0'
helloworld!
#
下面是我的测试镜像f1c100s-img.tar.gz里面包含测试镜像,编译好的uboot,内核,文件系统,还有config配置文件,16M flash可以直接烧录flashimg.bin,支持F1C100S和F1C200S,上电以后显示linux 开机LOGO,然后自动加载 demo程序
-rw-r--r-- 1 yan yan 93K 1月 29 23:35 buildroot-2019.5.1.config
-rw-r--r-- 1 yan yan 8.0M 1月 29 23:28 flashimg.bin
-rw-r--r-- 1 yan yan 5.3M 1月 29 23:27 jffs2.img
-rw-r--r-- 1 yan yan 66K 1月 29 23:34 linux.config
-rw-r--r-- 1 yan yan 234 1月 29 23:29 mtd.hklm.txt
-rw-r--r-- 1 yan yan 2.0M 1月 29 23:27 rootfs.tar
-rw-r--r-- 1 yan yan 8.3K 1月 29 23:27 suniv-f1c100s-licheepi-nano.dtb
-rw-r--r-- 1 yan yan 122K 1月 29 23:28 u-boot.bin
-rw-r--r-- 1 yan yan 24K 1月 29 23:34 uboot.config
-rw-r--r-- 1 yan yan 156K 1月 29 23:27 u-boot-sunxi-with-spl.bin
-rwxr-xr-x 1 yan yan 85 1月 29 23:29 write-all-spiimg.sh
-rwxr-xr-x 1 yan yan 2.3M 1月 29 23:27 zImage
最后附上我的测试视频,和我自己设计的开发板美照,手工焊接QFN着实难焊 。
结贴啦,问题终于解决了,就是电阻触摸屏,必须用tslib处理过的数据。晚点把附件传上来。
cmake报错问题 -- 解决办法如下: 加入编译好的tslib动态链接库 libts.so
修改CMakelist.txt
从tslib读取触摸数据--测试视频如下
https://whycan.cn/files/members/2460/VID_20191128_124201.mp4
你的应用程序读取触摸屏数据是不是使用 tslib ?
#
#
我程序读取触摸使用的是荔枝派官方给出的代码,具体如下
#
目前怀疑触摸数据读的是原始数据,没有经过tslib校准。
#
现在正在根据这个大神的帖子 笔记-编译LittlevGL GUI demo支持tslib 来加入tslib支持,目前卡在找不到tslib.h头文件这里,编译报错!
#
正在想办法把tslib动态链接库引入到cmake里面编译!还在奋斗中
#
感谢晕哥的热心解答!
不过我不是这个问题、
我的 tslib 配置运行是好的,运行 ts_calibrate校准以后 ts_test触摸和划线都是没问题的,触摸很精准。
我的问题是ts_test 测试触摸精准,但是运行荔枝派nano官方littlevgl_demo_with_wallpaper程序触摸不准,我试了自己编译出来的Littlegl程序运行也是一样,只有一小块触摸区域有反应,并且位置不准确!目前手里测试的是ns2009驱动的电阻屏,驱动是从zero那里扣过来的。
我的TS LIB 环境变量配置如下,在系统任何位置输入ts_ 然后tab都可以找到命令运行!
#
#
#
页次: 1