你好大佬这个是用什么做的
是LVGL做的
英习凌的CYW43012 43438这些。有大佬开源的whd驱动
https://github.com/Infineon/wifi-host-driver/
xfdr0805 说:整了个时钟 有白色 黑色 彩色 三种模式 还有6种动画特效
https://whycan.com/files/members/4881/IMG_4025.mp4这个动画怎么实现的?lvgl 的动画吗?
就是lvgl动画
有新版本了:
这个版本 最小化后 可以正常显示出来了,再也不用killall 了 。
测试各个功能都正常,已满足日常使用了
https://software.openkylin.top/openkylin/yangtze/pool/all/wechat-beta_1.0.0.238_amd64.deb
等了好久,终于发布了 。
之前试过wine不太好用,不稳定,问题比较多。
后来就是用Virtualbox 安装了精简Windows10,显然也不是好办法,但是挻稳定,就是麻烦了点,占用资源多。
现在原生的出来了,安装后与Windows版相差无几,体验不错,几乎完美。
测试系统:
下载地址:
https://github.com/lovechoudoufu/wechat_for_linux
正在做4.3寸的开发板,以最低的价格给各位。
https://whycan.com/files/members/13307/微信图片_20231114214515.png
原理图 pcb能放上来吗
感谢ti工程师的帮助!已经搞定了 放上eq计算的代码 分享给大家EQ_Calculation.zip
还有TI的这个DSP TLV320AIC3xxx 这个文档写白非常清楚,但不适用于tas5805.
一般 AIC31 系列为 16 位系数,而 AIC32 系列为 24 位系数,具体可以查看对应的数据手册。在
Resolution 位置设定对应的系数位数并回车,下面的窗口就显示出对应的滤波器情况,传输函数和对
应的参数的数值。这些数值即可用于写入 CODEC 内部对应的系数寄存器。数值的排列和窗口上面所
列的传输函数是对应的,比如对于两阶滤波器,有 N0, N1, N2 和 D1, D2 分别对应列出的 5 组数值。
而对于一阶的滤波器,N2 和 D2 为 0,所以只有三个系数,对应 N0, N1 和 D1。这些数值的定义和
CODEC 的数据手册中的定义是相对应的。
文档最后还给出了用程序计算 EQ 的参数的代码
最后举例说明在程序中怎样实时计算 EQ 的参数。通常 EQ 需要根据给定的频率带宽和增益来实时调整
的,其他类型的滤波器一般没有这种需求。在文档 SLAA447 中,作者给出了公式的推导方法和
Matlab 的工具生成的参数的转换方法,没有介绍怎样用代码将这些东西实现并联系起来,这里不在重
复 SLAA447 中讲的变换过程,直接给出经过测试验证正确的代码和简单注释供参考,从代码和注释来
看,转换的过程更加清晰和直观。
#include <stdio.h>
#include <math.h>
int main(int argc, char **argv){
double res = 8388607; /* 这是一个常量: (2^(B-1)–1); 24位系数: 8388607, 16位: 32767 */
double dBVal = 3; /* 增益 */
double SRVal = 48000; /* 采样率 */
double F0Val = 300; /* 频点 */
double BWVal = 100; /* 带宽 */
double A, omega, sn, cs, alpha; /* 中间量,S域到Z域双线性变换使用 */
double a0, a1, a2, b0, b1, b2; /* 系数,计算用中间量 */
double absMax = 0; /* 将b0, b1, b2转为小数时使用 */
int N0, N1, N2, D1, D2; /* 保存计算的系数结果 */
A = pow(10, (dBVal)/40);
omega = 2 * M_PI * (F0Val)/(SRVal);
sn = sin(omega);
cs = cos(omega);
alpha = A*sn/(2*F0Val/BWVal); /* 对于Peak EQ, Q = Q/A */
b0 = 1 + (alpha*A); /* 这里开始根据S域到Z域的映射计算Z域的系数 */
b1 = -1 * cs; /* 这里在转换的时候本应当乘以-2, 但是CODEC内部已经乘以2,所以这里只能乘以1 */
b2 = 1 - (alpha*A);
a0 = 1 + (alpha/A);
a1 = -1 * cs; /* 同上,这里本应乘以-2 */
a2 = 1 - (alpha/A);
b0 /= a0; /* 这里开始将a0变换为1 */
if(fabs(b0) > absMax) absMax = fabs(b0); /* 获取b0, b1, b2的最大绝对值 */
b1 /= a0;
if(fabs(b1) > absMax) absMax = fabs(b1);
b2 /= a0;
if(fabs(b2) > absMax) absMax = fabs(b2);
a1 /= (-1*a0); /* a1, a2乘以-1是因为CODEC滤波器的设计,参见第一章的逻辑方框图 */
a2 /= (-1*a0);
6
TLV320AIC3xxx 滤波器的设置与实时调节ZHCA721
if(absMax > 1.0) { /* 确保b0, b1, b2为纯小数 */
b0 /= absMax;
b1 /= absMax;
b2 /= absMax;
}
/* 转换为整数并打印结果。在显示的时候,因为最高位是符号位,所以如果超出位宽24/16位则需要去掉纯符号位,比如FF81AA09实际数
值取0x81AA09就是用于写到CODEC的系数数值 */
N0 = floor(b0*res);
N1 = floor(b1*res);
N2 = floor(b2*res);
D1 = floor(a1*res);
D2 = floor(a2*res);
printf("N0: %04X, N1: %04X, N2:%04X\r\nD1: %04X, D2: %04X\r\n", N0, N1, N2, D1, D2);
return 0;
}
TLV320AIC3xxx滤波器的设置与实时调节
TLV320AIC3xxx滤波器的设置与实时调节.pdf
对应的软件:
TIBQ.exe
1.第一种是USB Gadget Audio Class 1.0 Legacy
这种方式需要有实体的声卡,就是加载驱动时指定那个放音设备/dev/snd/pcmC1D0p,不指定的话,放音设备是/dev/snd/pcmC0D0p 录音设备是/dev/snd/pcmC0D0c,驱动加载完,不需要其它操作,就可以直接使用了。
但是问题来了,但是这种方式会独占那个声卡,其它程序是无法再访问那个设备了,我需要程序和USB混音,修改asound.conf也没用
2.第一种是USB Gadget Audio Class 1.0
这种方式在驱动加载后,系统会多出一张声卡,包含一个放音,一个录音设备,前边那种是不会出现任何设备的
modprobe g_audio.ko c_srate=48000 c_ssize=2 c_chmask=3 #48k 16bit 2ch
[ 71.822514] g_audio gadget: Hardware params: access 3, format 2, channels 2, rate 48000
[ 71.830844] g_audio gadget: Linux USB Audio Gadget, version: Feb 2, 2012
[ 71.837646] g_audio gadget: g_audio ready
[ 72.123305] g_audio gadget: high-speed config #1: Linux USB Audio Gadget
名字也叫 AC INTERFACE ,如果需要改名字,是在uac1.c里边修改,电脑播放音乐
执行 arecord -D hw:2,0 -f dat -vv | aplay -D hw:1,0 -f dat 可以听到电脑播放的音乐,这种方式好像挻符合要求的
但是问题又来了,这种方式需要电脑或者手机一直播放着音乐才行,否则过一会I/O错误,录音进程直接退出,电脑端正常播放不受影响,但是板子肯定没音了,录音进程已经退出了,重新执行命令才可以。问题是我怎么知道用户什么播放呢?录音进程录不到东西就直接能出了,不能一直在后台运行
3.USB Gadget Audio Class 2.0
既然上边那种方式也不行,那再试试2.0,驱动加载完成后,同样会多出2个声卡,设备管理器里会出现一个叫 Source/Sink的设备,尴尬的是设备启动不了,但是在Linux或者手机上是正常的,系统是win10 build1909 已经自动2.0驱动了,其它操作跟上边是一样的,也是需要一直录音才能使用,不放音时 录音进程直接IO错误面退出
最后,请大神支点招,如何解决电脑在没播放音乐时,录音进程退出问题?不放音乐时 一直传输0不就行了吗,这样录音也可以一直进行下去了
bl808_linux来了
https://github.com/bouffalolab/bl808_linux
可以参考下边示波器,主控用的F1C100S ADC是AD9288.pdf
https://github.com/pecostm32/FNIRSI-1013D-1014D-Hack
Schematic_Scope 1014D_2022-05-10.pdf
原子DS100使用的控是国产兆易GD32F450VET6 ADC芯片北是京时代民芯科技有限公司 MXT2088双八位100M ADC,兼容AD9288.
http://www.mxtronics.com/n107/n124/n181/n184/c692/attr/2630.pdf
LINK rtthread.elf
build\packages\CherryUSB-latest\core\usbh_core.o: In function `usbh_initialize':
usbh_core.c:(.text.usbh_initialize+0x8c): undefined reference to `_usbh_class_info_end'
usbh_core.c:(.text.usbh_initialize+0x90): undefined reference to `_usbh_class_info_start'
collect2.exe: error: ld returned 1 exit status
scons: *** [rtthread.elf] Error 1
scons: building terminated because of errors.
大佬,usbd_cdc 我测试没问题,但是usbh编译不过去,是什么原因呢?
插上U盘或者鼠标 没有任何反应,是内核哪里没配置好吗?
# lsusb 只有这个
Bus 001 Device 001: ID 1d6b:0002
下边是启动记录,看起来驱动加载也正常
Starting kernel ...
[ 0.000000] Booting Linux on physical CPU 0x0
[ 0.000000] Linux version 5.4.180 (xfdr@Latitude-E6530) (gcc version 10.3.0 (Buildroot -gef012cf7)) #2 Fri Jun 10 23:00:09 CST 2022
[ 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: weather station
[ 0.000000] Memory policy: Data cache writeback
[ 0.000000] cma: Reserved 16 MiB at 0x83000000
[ 0.000000] Built 1 zonelists, mobility grouping on. Total pages: 16256
[ 0.000000] Kernel command line: console=ttyS0,115200 earlyprintk rootwait init=/preinit root=/dev/mtdblock2 rootfstype=squashfs overlayfsdev=/dev/mtdblock3 net.ifnames=0 vt.global_cursor_default=0
[ 0.000000] Dentry cache hash table entries: 8192 (order: 3, 32768 bytes, linear)
[ 0.000000] Inode-cache hash table entries: 4096 (order: 2, 16384 bytes, linear)
[ 0.000000] mem auto-init: stack:off, heap alloc:off, heap free:off
[ 0.000000] Memory: 37548K/65536K available (7168K kernel code, 385K rwdata, 1708K rodata, 1024K init, 246K bss, 11604K reserved, 16384K cma-reserved)
[ 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.000000] random: get_random_bytes called from start_kernel+0x254/0x454 with crng_init=0
[ 0.000048] sched_clock: 32 bits at 24MHz, resolution 41ns, wraps every 89478484971ns
[ 0.000138] clocksource: timer: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 79635851949 ns
[ 0.000881] Console: colour dummy device 80x30
[ 0.000987] Calibrating delay loop... 203.16 BogoMIPS (lpj=1015808)
[ 0.070257] pid_max: default: 32768 minimum: 301
[ 0.070723] Mount-cache hash table entries: 1024 (order: 0, 4096 bytes, linear)
[ 0.070772] Mountpoint-cache hash table entries: 1024 (order: 0, 4096 bytes, linear)
[ 0.072672] CPU: Testing write buffer coherency: ok
[ 0.074685] Setting up static identity map for 0x80100000 - 0x80100058
[ 0.075983] devtmpfs: initialized
[ 0.087516] clocksource: jiffies: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 19112604462750000 ns
[ 0.087579] futex hash table entries: 256 (order: -1, 3072 bytes, linear)
[ 0.091596] pinctrl core: initialized pinctrl subsystem
[ 0.094209] NET: Registered protocol family 16
[ 0.097801] DMA: preallocated 256 KiB pool for atomic coherent allocations
[ 0.099973] cpuidle: using governor menu
[ 0.164830] SCSI subsystem initialized
[ 0.165238] usbcore: registered new interface driver usbfs
[ 0.165404] usbcore: registered new interface driver hub
[ 0.165557] usbcore: registered new device driver usb
[ 0.166130] pps_core: LinuxPPS API ver. 1 registered
[ 0.166154] pps_core: Software ver. 5.3.6 - Copyright 2005-2007 Rodolfo Giometti <giometti@linux.it>
[ 0.166225] PTP clock support registered
[ 0.166719] Advanced Linux Sound Architecture Driver Initialized.
[ 0.168966] clocksource: Switched to clocksource timer
[ 0.198714] thermal_sys: Registered thermal governor 'step_wise'
[ 0.199541] NET: Registered protocol family 2
[ 0.199893] IP idents hash table entries: 2048 (order: 2, 16384 bytes, linear)
[ 0.201183] tcp_listen_portaddr_hash hash table entries: 512 (order: 0, 4096 bytes, linear)
[ 0.201262] TCP established hash table entries: 1024 (order: 0, 4096 bytes, linear)
[ 0.201320] TCP bind hash table entries: 1024 (order: 0, 4096 bytes, linear)
[ 0.201373] TCP: Hash tables configured (established 1024 bind 1024)
[ 0.201676] UDP hash table entries: 256 (order: 0, 4096 bytes, linear)
[ 0.201743] UDP-Lite hash table entries: 256 (order: 0, 4096 bytes, linear)
[ 0.202213] NET: Registered protocol family 1
[ 0.204657] NetWinder Floating Point Emulator V0.97 (double precision)
[ 0.206496] Initialise system trusted keyrings
[ 0.207073] workingset: timestamp_bits=30 max_order=14 bucket_order=0
[ 0.228753] squashfs: version 4.0 (2009/01/31) Phillip Lougher
[ 0.229516] jffs2: version 2.2. (NAND) (SUMMARY) © 2001-2006 Red Hat, Inc.
[ 0.335459] Key type asymmetric registered
[ 0.335496] Asymmetric key parser 'x509' registered
[ 0.335671] Block layer SCSI generic (bsg) driver version 0.4 loaded (major 250)
[ 0.335700] io scheduler mq-deadline registered
[ 0.335718] io scheduler kyber registered
[ 0.351049] suniv-f1c100s-pinctrl 1c20800.pinctrl: initialized sunXi PIO driver
[ 0.351966] suniv-f1c100s-pinctrl 1c20800.pinctrl: 1c20800.pinctrl supply vcc-pe not found, using dummy regulator
[ 0.353839] pwm-backlight backlight: backlight supply power not found, using dummy regulator
[ 0.451633] Serial: 8250/16550 driver, 8 ports, IRQ sharing disabled
[ 0.458418] printk: console [ttyS0] disabled
[ 0.478737] 1c25000.serial: ttyS0 at MMIO 0x1c25000 (irq = 29, base_baud = 6250000) is a 16550A
[ 0.912782] printk: console [ttyS0] enabled
[ 0.918124] suniv-f1c100s-pinctrl 1c20800.pinctrl: 1c20800.pinctrl supply vcc-pa not found, using dummy regulator
[ 0.950162] 1c25400.serial: ttyS1 at MMIO 0x1c25400 (irq = 30, base_baud = 6250000) is a 16550A
[ 0.964408] suniv-f1c100s-pinctrl 1c20800.pinctrl: 1c20800.pinctrl supply vcc-pd not found, using dummy regulator
[ 0.987080] SCSI Media Changer driver v0.25
[ 0.992931] suniv-f1c100s-pinctrl 1c20800.pinctrl: 1c20800.pinctrl supply vcc-pc not found, using dummy regulator
[ 1.005737] spi-nor spi0.0: found w25q256, expected w25q128
[ 1.012093] spi-nor spi0.0: w25q256 (32768 Kbytes)
[ 1.017868] 4 fixed-partitions partitions found on MTD device spi0.0
[ 1.024333] Creating 4 MTD partitions on "spi0.0":
[ 1.029234] 0x000000000000-0x000000070000 : "u-boot"
[ 1.037594] 0x000000070000-0x000000600000 : "kernel"
[ 1.045983] 0x000000600000-0x000000d00000 : "rom"
[ 1.054134] 0x000000d00000-0x000001000000 : "overlay"
[ 1.063145] ehci_hcd: USB 2.0 'Enhanced' Host Controller (EHCI) Driver
[ 1.069789] ehci-platform: EHCI generic platform driver
[ 1.075428] ohci_hcd: USB 1.1 'Open' Host Controller (OHCI) Driver
[ 1.081733] ohci-platform: OHCI generic platform driver
[ 1.087490] usbcore: registered new interface driver usb-storage
[ 1.094544] usb_phy_generic usb_phy_generic.0.auto: usb_phy_generic.0.auto supply vcc not found, using dummy regulator
[ 1.106468] musb-hdrc musb-hdrc.1.auto: MUSB HDRC host driver
[ 1.112431] musb-hdrc musb-hdrc.1.auto: new USB bus registered, assigned bus number 1
[ 1.122403] hub 1-0:1.0: USB hub found
[ 1.126292] hub 1-0:1.0: 1 port detected
[ 1.134216] input: 1c23400.lradc as /devices/platform/soc/1c23400.lradc/input/input0
[ 1.143184] i2c /dev entries driver
[ 1.147353] suniv-f1c100s-pinctrl 1c20800.pinctrl: 1c20800.pinctrl supply vcc-pd not found, using dummy regulator
[ 1.160609] IR NEC protocol handler initialized
[ 1.166067] Registered IR keymap rc-nec-remote
[ 1.170955] rc rc0: sunxi-ir as /devices/platform/soc/1c22c00.cir/rc/rc0
[ 1.178039] input: sunxi-ir as /devices/platform/soc/1c22c00.cir/rc/rc0/input1
[ 1.186293] sunxi-ir 1c22c00.cir: initialized sunXi IR driver
[ 1.193769] sunxi-wdt 1c20ca0.watchdog: Watchdog enabled (timeout=16 sec, nowayout=0)
[ 1.203761] suniv-f1c100s-pinctrl 1c20800.pinctrl: 1c20800.pinctrl supply vcc-pf not found, using dummy regulator
[ 1.241804] sunxi-mmc 1c0f000.mmc: initialized, max. request size: 16384 KB
[ 1.251213] usbcore: registered new interface driver usbhid
[ 1.256786] usbhid: USB HID core driver
[ 1.264970] debugfs: Directory '1c23c00.codec' with parent 'F1C100s Audio Codec' already present!
[ 1.278832] sun4i-codec 1c23c00.codec: Codec <-> 1c23c00.codec mapping ok
[ 1.294623] NET: Registered protocol family 17
[ 1.299302] Key type dns_resolver registered
[ 1.304526] Loading compiled-in X.509 certificates
[ 1.322620] sun4i-drm soc:display-engine: bound 1e00000.display-frontend (ops 0xc083b420)
[ 1.331735] sun4i-drm soc:display-engine: bound 1e60000.display-backend (ops 0xc083ac60)
[ 1.341316] sun4i-drm soc:display-engine: bound 1c0c000.lcd-controller (ops 0xc0839800)
[ 1.349435] [drm] Supports vblank timestamp caching Rev 2 (21.10.2013).
[ 1.356037] [drm] No driver support for vblank timestamp query.
[ 1.363370] [drm] Initialized sun4i-drm 1.0.0 20150629 for soc:display-engine on minor 0
[ 1.393236] mmc0: new high speed SDIO card at address 0001
[ 1.395148] random: fast init done
[ 1.401132] bFWReady == _FALSE call reset 8051...
[ 1.437695] Console: switching to colour frame buffer device 100x30
[ 1.498409] sun4i-drm soc:display-engine: fb0: sun4i-drmdrmfb frame buffer device
[ 1.506927] cfg80211: Loading compiled-in X.509 certificates for regulatory database
[ 1.524030] cfg80211: Loaded X.509 cert 'sforshee: 00b28ddf47aef9cea7'
[ 1.530885] ALSA device list:
[ 1.533876] #0: F1C100s Audio Codec
[ 1.538079] platform regulatory.0: Direct firmware load for regulatory.db failed with error -2
[ 1.546826] cfg80211: failed to load regulatory.db
[ 1.557291] VFS: Mounted root (squashfs filesystem) readonly on device 31:2.
[ 1.571020] devtmpfs: mounted
[ 1.580116] Freeing unused kernel memory: 1024K
[ 1.584782] Run /preinit as init process
[ 1.792382] crng init done
[ 2.302922] overlayfs: upper fs does not support tmpfile.
[ 2.308349] overlayfs: upper fs does not support xattr, falling back to index=off and metacopy=off.
Starting syslogd: OK
Starting klogd: OK
Running sysctl: OK
Populating /dev using udev:
[ 3.069623] udevd[95]: starting version 3.2.11
[ 3.327012] udevd[96]: starting eudev-3.2.11
done
Initializing random number generator: OK
Saving random seed: OK
Starting haveged: haveged: command socket is listening at fd 3
OK
Starting network: OK
Welcome to sipeed Lichee Nano
lichee-nano login: root
# lsusb
Bus 001 Device 001: ID 1d6b:0002
#
# echo peripheral > /sys/devices/platform/soc/1c13000.usb/musb-hdrc.1.auto/mode
# cat /sys/devices/platform/soc/1c13000.usb/musb-hdrc.1.auto/mode
b_idle
# echo host > /sys/devices/platform/soc/1c13000.usb/musb-hdrc.1.auto/mode
# cat /sys/devices/platform/soc/1c13000.usb/musb-hdrc.1.auto/mode
b_idle
这才是正确的颜色 那个代码默认是rgb555的 你这颜色应该是rgb555怼到rgb565的显示器上
https://whycan.com/t_8108.html#p77745
这是启动记录 ,发现有三个地方时间比较长
1.加载内核 5M用了6.4S
[2.210483 0.007721] device 0 offset 0x100000, size 0x500000
[8.621888 6.411405] SF: 5242880 bytes @ 0x100000 Read: OK
2.挂载20M jffs2 rootfs 4.6S
[2.598025 0.274050] [ 1.621659] random: crng init done
[5.579701 2.981676] [ 4.603341] VFS: Mounted root (jffs2 filesystem) on device 31:2.
3.初始化随机数种子 10S
[15.749774 10.148108] Initializing random number generator: OK
[0.000001 0.000001]
[0.312321 0.312320] U-Boot SPL 2020.07 (May 04 2022 - 22:11:07 +0800)
[0.317020 0.004699] DRAM: 64 MiB
[0.327749 0.010729] Trying to boot from sunxi SPI
[0.886271 0.558523]
[0.886478 0.000207]
[0.886560 0.000082] U-Boot 2020.07 (May 04 2022 - 22:11:07 +0800) Allwinner Technology
[0.892310 0.005750]
[0.892433 0.000123] CPU: Allwinner F Series (SUNIV)
[0.895404 0.002971] Model: Allwinner F1C100s Generic Device
[0.898828 0.003425] DRAM: 64 MiB
[1.428792 0.529963] Setting up a 800x480 lcd console (overscan 0x0)
[1.523858 0.095066] In: serial
[1.524756 0.000899] Out: serial
[1.525471 0.000715] Err: serial
[1.530406 0.004935] Hit any key to stop autoboot: 0
[1.539890 0.009483] SF: Detected w25q256 with page size 256 Bytes, erase size 4 KiB, total 32 MiB
[1.545825 0.005936] device 0 offset 0x80000, size 0x80000
[2.188511 0.642685] SF: 524288 bytes @ 0x80000 Read: OK
[2.198806 0.010295] gpio: pin 134 (gpio 134) value is 1
[2.201701 0.002896] Booting from SPI-NOR...
[2.202761 0.001060] SF: Detected w25q256 with page size 256 Bytes, erase size 4 KiB, total 32 MiB
[2.210483 0.007721] device 0 offset 0x100000, size 0x500000
[8.621888 6.411405] SF: 5242880 bytes @ 0x100000 Read: OK
[8.624978 0.003090] ## Loading kernel from FIT Image at 81000000 ...
[8.628689 0.003711] Using 'conf@0' configuration
[8.631557 0.002868] Trying 'kernel@0' kernel subimage
[8.635610 0.004053] Description: Linux kernel
[8.638474 0.002863] Type: Kernel Image
[8.641198 0.002725] Compression: uncompressed
[8.644037 0.002839] Data Start: 0x810000cc
[8.646755 0.002717] Data Size: 4924432 Bytes = 4.7 MiB
[8.649986 0.003231] Architecture: ARM
[8.652351 0.002365] OS: Linux
[8.654952 0.002601] Load Address: 0x80000000
[8.656097 0.001145] Entry Point: 0x80000000
[8.658899 0.002802] Hash algo: crc32
[8.661201 0.002303] Hash value: 0a339eef
[8.663858 0.002657] Verifying Hash Integrity ... crc32+ OK
[8.805165 0.141307] ## Loading fdt from FIT Image at 81000000 ...
[8.808371 0.003206] Using 'conf@0' configuration
[8.811141 0.002771] Trying 'fdt@0' fdt subimage
[8.813929 0.002787] Description: Flattened Device Tree blob
[8.818855 0.004926] Type: Flat Device Tree
[8.821654 0.002799] Compression: uncompressed
[8.824597 0.002943] Data Start: 0x814b25c0
[8.827349 0.002753] Data Size: 17251 Bytes = 16.8 KiB
[8.830249 0.002899] Architecture: ARM
[8.832778 0.002529] Hash algo: crc32
[8.835350 0.002572] Hash value: b145fd30
[8.838138 0.002789] Verifying Hash Integrity ... crc32+ OK
[8.841718 0.003580] Booting using the fdt blob at 0x814b25c0
[8.844907 0.003189] Loading Kernel Image
[8.893860 0.048953] Loading Device Tree to 817f8000, end 817ff362 ... OK
[8.915193 0.021333]
[8.915327 0.000134] Starting kernel ...
[0.000514 0.000514]
[1.388993 1.388479] [ 0.000000] Booting Linux on physical CPU 0x0
[1.392876 0.003884] [ 0.000000] Linux version 5.4.99 (xfdr@Latitude-E6530) (gcc version 8.4.0 (Buildroot -g21de572-dirty)) #30 Tue May 3 21:22:16 CST 2022
[1.403568 0.010692] [ 0.000000] CPU: ARM926EJ-S [41069265] revision 5 (ARMv5TEJ), cr=0005317f
[1.411366 0.007798] [ 0.000000] CPU: VIVT data cache, VIVT instruction cache
[1.416928 0.005562] [ 0.000000] OF: fdt: Machine model: Widora MangoPi R3
[1.422384 0.005456] [ 0.000000] Memory policy: Data cache writeback
[1.425818 0.003434] [ 0.000000] cma: Reserved 16 MiB at 0x82c00000
[1.431070 0.005252] [ 0.000000] Built 1 zonelists, mobility grouping on. Total pages: 15883
[1.436641 0.005570] [ 0.000000] Kernel command line: console=ttyS0,115200 fbcon=map:1 rootwait init=/linuxrc root=/dev/mtdblock2 rootfstype=jffs2 rw net.ifnames=0 vt.global_cursor_default=0
[1.453128 0.016488] [ 0.000000] Dentry cache hash table entries: 8192 (order: 3, 32768 bytes, linear)
[1.458900 0.005771] [ 0.000000] Inode-cache hash table entries: 4096 (order: 2, 16384 bytes, linear)
[1.467318 0.008418] [ 0.000000] mem auto-init: stack:off, heap alloc:off, heap free:off
[1.472735 0.005417] [ 0.000000] Memory: 35004K/64036K available (7168K kernel code, 372K rwdata, 1936K rodata, 1024K init, 277K bss, 12648K reserved, 16384K cma-reserved)
[1.486672 0.013937] [ 0.000000] SLUB: HWalign=32, Order=0-3, MinObjects=0, CPUs=1, Nodes=1
[1.492238 0.005567] [ 0.000000] NR_IRQS: 16, nr_irqs: 16, preallocated irqs: 16
[1.497997 0.005759] [ 0.000000] random: get_random_bytes called from start_kernel+0x254/0x444 with crng_init=0
[1.506332 0.008335] [ 0.000038] sched_clock: 32 bits at 24MHz, resolution 41ns, wraps every 89478484971ns
[1.514480 0.008147] [ 0.000118] clocksource: timer: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 79635851949 ns
[1.522801 0.008321] [ 0.000793] Console: colour dummy device 80x30
[1.528352 0.005551] [ 0.000874] Calibrating delay loop... 203.16 BogoMIPS (lpj=1015808)
[1.534091 0.005739] [ 0.070222] pid_max: default: 32768 minimum: 301
[1.539133 0.005042] [ 0.070683] Mount-cache hash table entries: 1024 (order: 0, 4096 bytes, linear)
[1.547285 0.008152] [ 0.070719] Mountpoint-cache hash table entries: 1024 (order: 0, 4096 bytes, linear)
[1.553689 0.006403] [ 0.072289] CPU: Testing write buffer coherency: ok
[1.559007 0.005319] [ 0.073878] Setting up static identity map for 0x80100000 - 0x80100058
[1.564719 0.005712] [ 0.074876] devtmpfs: initialized
[1.569613 0.004894] [ 0.086352] clocksource: jiffies: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 19112604462750000 ns
[1.578178 0.008565] [ 0.086408] futex hash table entries: 256 (order: -1, 3072 bytes, linear)
[1.586387 0.008210] [ 0.089798] pinctrl core: initialized pinctrl subsystem
[1.591658 0.005270] [ 0.092059] NET: Registered protocol family 16
[1.594707 0.003049] [ 0.095466] DMA: preallocated 256 KiB pool for atomic coherent allocations
[1.602808 0.008101] [ 0.097348] cpuidle: using governor menu
[1.605809 0.003001] [ 0.176504] SCSI subsystem initialized
[1.608827 0.003018] [ 0.176816] usbcore: registered new interface driver usbfs
[1.614522 0.005695] [ 0.176949] usbcore: registered new interface driver hub
[1.620079 0.005557] [ 0.177078] usbcore: registered new device driver usb
[1.625526 0.005447] [ 0.177619] pps_core: LinuxPPS API ver. 1 registered
[1.630836 0.005309] [ 0.177641] pps_core: Software ver. 5.3.6 - Copyright 2005-2007 Rodolfo Giometti <giometti@linux.it>
[1.639228 0.008393] [ 0.177698] PTP clock support registered
[1.642351 0.003123] [ 0.178192] Advanced Linux Sound Architecture Driver Initialized.
[1.650277 0.007926] [ 0.180998] clocksource: Switched to clocksource timer
[1.655509 0.005232] [ 0.182436] simple-framebuffer 83e89000.framebuffer: framebuffer at 0x83e89000, 0x177000 bytes, mapped to 0x(ptrval)
[1.664707 0.009198] [ 0.182487] simple-framebuffer 83e89000.framebuffer: format=x8r8g8b8, mode=800x480x32, linelength=3200
[1.675123 0.010416] [ 0.183110] simple-framebuffer 83e89000.framebuffer: fb0: simplefb registered!
[1.681002 0.005879] [ 0.207677] thermal_sys: Registered thermal governor 'step_wise'
[1.686728 0.005726] [ 0.208325] NET: Registered protocol family 2
[1.691934 0.005205] [ 0.209616] tcp_listen_portaddr_hash hash table entries: 512 (order: 0, 4096 bytes, linear)
[1.700221 0.008287] [ 0.209685] TCP established hash table entries: 1024 (order: 0, 4096 bytes, linear)
[1.708488 0.008268] [ 0.209740] TCP bind hash table entries: 1024 (order: 0, 4096 bytes, linear)
[1.714292 0.005804] [ 0.209787] TCP: Hash tables configured (established 1024 bind 1024)
[1.722168 0.007876] [ 0.210022] UDP hash table entries: 256 (order: 0, 4096 bytes, linear)
[1.727987 0.005819] [ 0.210078] UDP-Lite hash table entries: 256 (order: 0, 4096 bytes, linear)
[1.733802 0.005815] [ 0.210527] NET: Registered protocol family 1
[1.739192 0.005390] [ 0.211892] RPC: Registered named UNIX socket transport module.
[1.744727 0.005536] [ 0.211924] RPC: Registered udp transport module.
[1.750152 0.005424] [ 0.211938] RPC: Registered tcp transport module.
[1.753302 0.003150] [ 0.211952] RPC: Registered tcp NFSv4.1 backchannel transport module.
[1.761297 0.007995] [ 0.214392] NetWinder Floating Point Emulator V0.97 (double precision)
[1.767172 0.005874] [ 0.215886] Initialise system trusted keyrings
[1.772370 0.005199] [ 0.216359] workingset: timestamp_bits=30 max_order=14 bucket_order=0
[1.778056 0.005685] [ 0.238946] NFS: Registering the id_resolver key type
[1.783466 0.005410] [ 0.239084] Key type id_resolver registered
[1.786531 0.003065] [ 0.239103] Key type id_legacy registered
[1.791923 0.005392] [ 0.239149] nfs4filelayout_init: NFSv4 File Layout Driver Registering...
[1.797665 0.005742] [ 0.239240] jffs2: version 2.2. (NAND) 2001-2006 Red Hat, Inc.
[1.803279 0.005614] [ 0.350977] Key type asymmetric registered
[1.808545 0.005265] [ 0.351080] Asymmetric key parser 'x509' registered
[1.813941 0.005396] [ 0.351234] Block layer SCSI generic (bsg) driver version 0.4 loaded (major 249)
[1.820036 0.006096] [ 0.351257] io scheduler mq-deadline registered
[1.825336 0.005300] [ 0.351273] io scheduler kyber registered
[1.828267 0.002931] [ 0.364293] suniv-f1c100s-pinctrl 1c20800.pinctrl: initialized sunXi PIO driver
[1.836361 0.008094] [ 0.365059] suniv-f1c100s-pinctrl 1c20800.pinctrl: 1c20800.pinctrl supply vcc-pe not found, using dummy regulator
[1.847266 0.010905] [ 0.386287] Serial: 8250/16550 driver, 8 ports, IRQ sharing disabled
[1.853152 0.005886] [ 0.392268] printk: console [ttyS0] disabled
[1.856466 0.003314] [ 0.412533] 1c25000.serial: ttyS0 at MMIO 0x1c25000 (irq = 29, base_baud = 6250000) is a 16550A
[1.866625 0.010159] [ 0.890454] printk: console [ttyS0] enabled
[1.870977 0.004352] [ 0.895596] suniv-f1c100s-pinctrl 1c20800.pinctrl: 1c20800.pinctrl supply vcc-pa not found, using dummy regulator
[1.903398 0.032421] [ 0.927149] 1c25400.serial: ttyS1 at MMIO 0x1c25400 (irq = 30, base_baud = 6250000) is a 16550A
[1.916019 0.012621] [ 0.939727] suniv-f1c100s-pinctrl 1c20800.pinctrl: 1c20800.pinctrl supply vcc-pd not found, using dummy regulator
[1.936824 0.020806] [ 0.960579] SCSI Media Changer driver v0.25
[1.941579 0.004755] [ 0.966315] suniv-f1c100s-pinctrl 1c20800.pinctrl: 1c20800.pinctrl supply vcc-pc not found, using dummy regulator
[1.955532 0.013953] [ 0.979236] spi-nor spi0.0: w25q256 (32768 Kbytes)
[1.959153 0.003621] [ 0.984167] 3 fixed-partitions partitions found on MTD device spi0.0
[1.966709 0.007557] [ 0.990511] Creating 3 MTD partitions on "spi0.0":
[1.970320 0.003610] [ 0.995369] 0x000000000000-0x000000080000 : "u-boot"
[1.980064 0.009745] [ 1.003853] 0x000000100000-0x000000600000 : "kernel"
[1.988481 0.008416] [ 1.012251] 0x000000600000-0x000002000000 : "rom"
[1.997382 0.008902] [ 1.021143] ehci_hcd: USB 2.0 'Enhanced' Host Controller (EHCI) Driver
[2.003111 0.005729] [ 1.027669] ehci-platform: EHCI generic platform driver
[2.009201 0.006090] [ 1.033274] ohci_hcd: USB 1.1 'Open' Host Controller (OHCI) Driver
[2.014997 0.005795] [ 1.039486] ohci-platform: OHCI generic platform driver
[2.020879 0.005883] [ 1.045228] usbcore: registered new interface driver usb-storage
[2.027705 0.006825] [ 1.052501] input: 1c23400.lradc as /devices/platform/soc/1c23400.lradc/input/input0
[2.036876 0.009172] [ 1.061221] i2c /dev entries driver
[2.040595 0.003719] [ 1.065334] suniv-f1c100s-pinctrl 1c20800.pinctrl: 1c20800.pinctrl supply vcc-pd not found, using dummy regulator
[2.056044 0.015449] [ 1.079827] rtc-pcf8563 0-0051: low voltage detected, date/time is not reliable.
[2.062724 0.006680] [ 1.087822] rtc-pcf8563 0-0051: registered as rtc0
[2.069653 0.006929] [ 1.094060] IR NEC protocol handler initialized
[2.074758 0.005105] [ 1.098595] IR RC5(x/sz) protocol handler initialized
[2.079069 0.004312] [ 1.104497] Registered IR keymap rc-empty
[2.084461 0.005392] [ 1.108774] rc rc0: sunxi-ir as /devices/platform/soc/1c22c00.cir/rc/rc0
[2.090987 0.006526] [ 1.116026] input: sunxi-ir as /devices/platform/soc/1c22c00.cir/rc/rc0/input1
[2.099995 0.009008] [ 1.124121] sunxi-ir 1c22c00.cir: initialized sunXi IR driver
[2.107070 0.007075] [ 1.131467] sunxi-wdt 1c20ca0.watchdog: Watchdog enabled (timeout=16 sec, nowayout=0)
[2.117511 0.010441] [ 1.141261] suniv-f1c100s-pinctrl 1c20800.pinctrl: 1c20800.pinctrl supply vcc-pf not found, using dummy regulator
[2.155205 0.037694] [ 1.178889] sunxi-mmc 1c0f000.mmc: initialized, max. request size: 16384 KB
[2.162188 0.006983] [ 1.186879] ledtrig-cpu: registered to indicate activity on CPUs
[2.173243 0.011056] [ 1.197024] debugfs: Directory '1c23c00.codec' with parent 'F1C100s Audio Codec' already present!
[2.187350 0.014106] [ 1.211127] sun4i-codec 1c23c00.codec: Codec <-> 1c23c00.codec mapping ok
[2.202675 0.015326] [ 1.226418] NET: Registered protocol family 17
[2.206585 0.003910] [ 1.231413] Key type dns_resolver registered
[2.213016 0.006430] [ 1.237012] Loading compiled-in X.509 certificates
[2.229556 0.016540] [ 1.253233] sunxi-mmc 1c0f000.mmc: card claims to support voltages below defined range
[2.243477 0.013921] [ 1.267216] rtc-pcf8563 0-0051: low voltage detected, date/time is not reliable.
[2.249735 0.006258] [ 1.274728] rtc-pcf8563 0-0051: hctosys: unable to read the hardware clock
[2.258493 0.008758] [ 1.282299] cfg80211: Loading compiled-in X.509 certificates for regulatory database
[2.275926 0.017433] [ 1.299647] cfg80211: Loaded X.509 cert 'sforshee: 00b28ddf47aef9cea7'
[2.282217 0.006290] [ 1.306735] platform regulatory.0: Direct firmware load for regulatory.db failed with error -2
[2.290985 0.008769] [ 1.315464] cfg80211: failed to load regulatory.db
[2.296542 0.005557] [ 1.320628] ALSA device list:
[2.299548 0.003005] [ 1.323720] #0: F1C100s Audio Codec
[2.304204 0.004657] [ 1.329091] random: fast init done
[2.323975 0.019771] [ 1.347659] mmc0: new high speed SDIO card at address 0001
[2.598025 0.274050] [ 1.621659] random: crng init done
[5.579701 2.981676] [ 4.603341] VFS: Mounted root (jffs2 filesystem) on device 31:2.
[5.588810 0.009109] [ 4.612540] devtmpfs: mounted
[5.597997 0.009187] [ 4.621797] Freeing unused kernel memory: 1024K
[5.601666 0.003669] [ 4.626412] Run /linuxrc as init process
[15.749774 10.148108] Initializing random number generator: OK
[15.773156 0.023382] Saving random seed: OK
[15.864465 0.091309] Starting network: OK
[16.226601 0.362136]
[16.226745 0.000144] Welcome to WS
[16.229263 0.002518] mes login:
发现在uboot在从spi-nor启动时是用1MHZ加载数据的,读取5M kernel 要5秒多 速度太慢了
使用sf probe 0 50000000 不生效,速度没变化
然后看了下代码,将
#define SPI_DEFAULT_SPEED_HZ 50000000
#define CONFIG_SF_DEFAULT_SPEED 50000000
这2个宏都修改了,打印出来速度是设置成50MHZ了,貌似没生效,依然是1MHZ速度加载
uboot新的DM_MODEL太复杂还看不懂,然后不使用DM_DRIVER,又出现
Invalid chip select 0:0 (err=-19)
Failed to initialize SPI flash at 0:0
参考了这一篇文章
https://blog.csdn.net/zhaoxinfan/article/details/79417696
看起来不错额,就是不知道GUI Guider支持8不,一直用这个来画7的界面。
新版本支持V8 也支持V7,也可以试试另外官方的https://squareline.io/
编译InfoNes 跑了一下 https://github.com/nejidev/arm-NES-linux 声音听着难受
颜色问题 一开始以为是RGB5565 转换后还是颜色不对, 原来InfoNes默认输出的是RGB555 格式的
static DWORD rgb555_2_argb888(WORD color)
{
DWORD c;
unsigned char red;
unsigned char green;
unsigned char blue;
red = ((unsigned char)(color >> 10)) << 3;
green = ((unsigned char)(color >> 5)) << 3;
blue = ((unsigned char)color) << 3;
c = (red | c) << 16 | (green | c) << 8 | (blue | c);
return c;
}
今天测试了一下,我用的5.4内核,不过匹配的是compatible = "allwinner,sun6i-a31-ir";
[ 1.156710] IR NEC protocol handler initialized
[ 1.161258] IR RC5(x/sz) protocol handler initialized
[ 1.167467] Registered IR keymap rc-empty
[ 1.172009] rc rc0: sunxi-ir as /devices/platform/soc/1c22c00.cir/rc/rc0
[ 1.179245] input: sunxi-ir as /devices/platform/soc/1c22c00.cir/rc/rc0/input1
[ 1.187776] sunxi-ir 1c22c00.cir: initialized sunXi IR driver
# ./evtest
No device specified, trying to scan all of /dev/input/event*
Available devices:
/dev/input/event0: 1c23400.lradc
/dev/input/event1: sunxi-ir
Select the device event number [0-1]: 1
Input driver version is 1.0.1
Input device ID: bus 0x19 vendor 0x1 product 0x1 version 0x100
Input device name: "sunxi-ir"
Supported events:
Event type 0 (EV_SYN)
Event type 1 (EV_KEY)
Event code 152 (KEY_SCREENLOCK)
Event type 2 (EV_REL)
Event code 0 (REL_X)
Event code 1 (REL_Y)
Event type 4 (EV_MSC)
Event code 4 (MSC_SCAN)
Key repeat handling:
Repeat type 20 (EV_REP)
Repeat code 0 (REP_DELAY)
Value 500
Repeat code 1 (REP_PERIOD)
Value 125
Properties:
Property type 5 (INPUT_PROP_POINTING_STICK)
Testing ... (interrupt to exit)
Event: time 113.474487, type 4 (EV_MSC), code 4 (MSC_SCAN), value 9f43
Event: time 113.474487, -------------- SYN_REPORT ------------
Event: time 113.528867, type 4 (EV_MSC), code 4 (MSC_SCAN), value 9f43
Event: time 113.528867, -------------- SYN_REPORT ------------
Event: time 123.140115, type 4 (EV_MSC), code 4 (MSC_SCAN), value 9f0a
Event: time 123.140115, -------------- SYN_REPORT ------------
Event: time 123.194514, type 4 (EV_MSC), code 4 (MSC_SCAN), value 9f0a
Event: time 123.194514, -------------- SYN_REPORT ------------
Event: time 125.754998, type 4 (EV_MSC), code 4 (MSC_SCAN), value 9f06
Event: time 125.754998, -------------- SYN_REPORT ------------
Event: time 145.473697, type 4 (EV_MSC), code 4 (MSC_SCAN), value bf0d
Event: time 145.473697, -------------- SYN_REPORT ------------
Event: time 145.527068, type 4 (EV_MSC), code 4 (MSC_SCAN), value bf0d
Event: time 145.527068, -------------- SYN_REPORT ------------
Event: time 134.284454, type 4 (EV_MSC), code 4 (MSC_SCAN), value bf43
Event: time 134.284454, -------------- SYN_REPORT ------------
这个问题是图片格式问题,修改为RGB888就行了,原来的是ARGB888,RGB565格式也会提示Error: compression type 3 not supported
=> bmp info 0x80000000
Image size : 251 x 94
Bits per pixel: 32
Compression : 3
=> bmp display 0x80000000
Error: compression type 3 not supported
=> bmp info 0x80000000
Image size : 251 x 94
Bits per pixel: 16
Compression : 3
=> bmp display 0x80000000
Error: compression type 3 not supported
=> bmp info 0x80000000
Image size : 251 x 94
Bits per pixel: 24
Compression : 0
=> bmp display 0x80000000 350 200
跟阿里兄请教了下 原来是lv_config里的一个宏没开启导致 之前还真没注意过 开启后正常显示 至于不一样大 是因为freetype是16像素 取模工具是16号 单位不一样
解决方案参考连接
http://dz.lfly.xyz/forum.php?mod=viewthread&tid=34&extra=page%3D1
在电脑上使用vs2019,移植到F1C100S上后,画面相当卡,惨不忍睹啊。
硬件:F1C100S + 25q256 + LCD 800X480 RGB565
软件:Linux 5.4 framebuffer 32bpp + LVGL8 + freetype
目前LVGL 位深是32 硬件连线是RGB565 暂时当成RGB888来用, 修改了设备树,format=r5g6b5,还是一样,不知道如何将framebuffer 修改为16bpp?单缓冲,双缓冲,全屏缓冲都试过了,目前感觉是LVGL绘图跟不上,图片,字体资源都放在外边,因为用fb-test-rect或者编译widgets_demo 帧率还可以。
请教坛里的大佬们,如何将framebuffer 修改为16bpp或者提高刷屏速度?
直接拿原版键盘开刀,在26键基础上修改最省事,只需要简单修改一下布局就可以了,使用时可直接替换原来的keyboard即可,效果如下图
过程参考了一个输入法,忘记哪找的了,把原版也一并放上
在原版基础上做了一点修改,统计了一下,有7451个汉字可以输入
修复必须全拼才能打出字的问题,现在只需要输一个字母即可出现候选字
将原来的候选按钮分离出来,方便设置候选词字库,键盘符号不受影响
原版如果设置其它字库,键盘一些符号会不显示,需要将字库与fontawesome合并才能显示符号
程序肯定有不足的地方,最后附上代码,大家一起改进
lv_pinyin-原版.zip
keyboard_20220414-1904.7z
keyboard.7z
模拟器x64.7z
使用的mangPi R3 SDK 编译的,不能正常显示splash.bmp
提示
Reading 524288 byte(s) (256 page(s)) at offset 0x00080000
Error: compression type 3 not supported
-Boot 2020.07 (Mar 13 2022 - 21:11:31 +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: serial
Err: serial
Allwinner mUSB OTG (Peripheral)
Hit any key to stop autoboot: 0
Card did not respond to voltage select!
Card did not respond to voltage select!
unrecognized JEDEC id bytes: ff, c8, 51
Failed to initialize SPI flash at 0:0 (error -2)
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: 128 bytes
- OOB available: 4 bytes
- 0x000000000000-0x000008000000 : "spi-nand0"
=========================
Boot Device: spi
Boot Slot 0: empty
Boot Slot 1: spi-nand
=========================
Reading 524288 byte(s) (256 page(s)) at offset 0x00080000
Error: compression type 3 not supported
gpio: pin 134 (gpio 134) value is 1
DFU waiting on SPI-NAND...
musb-hdrc: peripheral reset irq lost!
Booting from SPI-NAND...
Reading 5242880 byte(s) (2560 page(s)) at offset 0x00100000
## Loading kernel from FIT Image at 81000000 ...
Using 'conf@0' configuration
Trying 'kernel@0' kernel subimage
Description: Linux kernel
Type: Kernel Image
Compression: uncompressed
Data Start: 0x810000cc
Data Size: 4309816 Bytes = 4.1 MiB
Architecture: ARM
OS: Linux
Load Address: 0x80000000
Entry Point: 0x80000000
Hash algo: crc32
Hash value: 9f754ba3
Verifying Hash Integrity ... crc32+ OK
## Loading fdt from FIT Image at 81000000 ...
Using 'conf@0' configuration
Trying 'fdt@0' fdt subimage
Description: Flattened Device Tree blob
Type: Flat Device Tree
Compression: uncompressed
Data Start: 0x8141c4e8
Data Size: 15757 Bytes = 15.4 KiB
Architecture: ARM
Hash algo: crc32
Hash value: 6c9c69a9
Verifying Hash Integrity ... crc32+ OK
Booting using the fdt blob at 0x8141c4e8
Loading Kernel Image
Loading Device Tree to 817f9000, end 817ffd8c ... OK
Starting kernel ...
[ 0.000000] Booting Linux on physical CPU 0x0
Usage:
bmp info <imageAddr> - display image info
bmp display <imageAddr> [x y] - display image at x,y
=> bmp info 0x80000
There is no valid bmp file at the given address
=>
如何确认nand.img分区里是否有splash.bmp ?挂载后啥也看不到,不像SD卡镜像都能查看各个分区内容
genimage-nand.cfg文件:
flash nand-128M {
pebsize = 128K
numpebs = 1024
minimum-io-unit-size = 2048
}
image sysimage-nand.img {
flash {}
flashtype = "nand-128M"
partition u-boot {
image = "u-boot-sunxi-with-nand-spl.bin"
size = 512K
}
partition splash {
offset = 0x80000
image = "splash.bmp"
size = 512K
}
partition kernel {
offset = 0x100000
image = "kernel.itb"
size = 5M
}
partition rom {
offset = 0x600000
image = "rootfs.squashfs"
}
}
能做成目前这样,看得出已经花了不少精力了。但我认为更快的实现方式可以是借用InteractiveHtmlBom,修改它的文件解析这一步骤其它少做修改可能会少点工作量。
现在前端有WASM,要比以前只有javascript的时代灵活不少。
其实没花多少精力 一上午就完成了 因为有大神已经完成了gerber解析并渲染了 我只是读取座位号及数量然后从坐标文件里获得每个元件的坐标并生成gerber绘图语句就完了 只有这么一丢丢的工作量 比起gerber解析渲染 可以忽略
关于那个插件 我觉得插件是读取的源文件的方式生成的 因为无需导出gerber bom 坐标文件就可以生成 并且lceda也可以用这个插件生成 那个也是源文件 在没pcb源文件的情况下用不了 这是个人猜测 没深究 所以就用C#写了一个 如果有kicad或者lceda源文件 用那个插件更好
一直一来,在开发完新样品做样机的时候,手工贴片非常痛苦,板子简单还好,如果板子复杂且样机数量又多(一般10台以内),那真是贴的眼疼胳膊酸啊,在贴片过程中最耗费时间的就是在密密麻麻的丝印图上找元件座位号了,所以如果有什么工具能一下子找到并能图形化标注出来位置,那将大大加快贴片的速度,也不用闻那么长时间的锡膏散发出来的有毒气体了。
之前在用Kicad设计板子的时候,有一款插件不得不提一下,就是InteractiveHtmlBom,这款插件可以生成一个交互式BOM的文件,可以在浏览器里打开,图形化展示出来各个元件位置,手工贴片非常方便
这正是我想要的效果,但是这个插件只适合用在Kicad或者LCEDA里,其它软件使用不了,而且还得是源代码才能生成交互式BOM,只能自己开发了,于是就有了这个软件
由于没有源文件,要实现这种效果,需要有BOM表,Gerber,及坐标文件,这些是工厂批量生产的最基本的东西,都会提供的。
原理:根据BOM表获取同一种元件的座位号,再从坐标里件里获取每一个元件的坐标,然后生成每一个元件的gerber绘图语句,最后就是渲染gerber丝印图并在上边标识出来
Gerber文件要是自己写,还是比较复杂的,网上已有很多开源的Gerber文件解析的库,就不重复造轮子了,这里使用了miltonneal54大神开源的GerberVS库,我测试了一下,已经相当完善了,测试了一些产品的gerber 基本没问题。
Gerber解析库
https://github.com/miltonneal54/GerberVS
Gerber规范
gerber_rs274xrevd_e.pdf
BOM是excel格式的,这里使用开源的NPOI进行BOM表的读取,还是比较简单的
workBook = new XSSFWorkbook(tbx_bom.Text);
ISheet sheet = workBook.GetSheetAt(0);//"PCB 部分"
//计算总行数
int lastNum = sheet.LastRowNum;
Console.WriteLine("总行数:" + lastNum);
//从第1行开始
//Console.WriteLine(sheet.GetRow(3).GetCell(1).StringCellValue);
dataGridView1.Rows.Clear();
for (int i = 2; i < lastNum; i++)
{
if (sheet.GetRow(i) != null)
{
//Console.WriteLine(i + " ---> " + sheet.GetRow(i).Count());
dataGridView1.Rows.Add();
for (int j = 0; j < 10; j++)
{
if (sheet.GetRow(i).GetCell(j) != null)
{
if (sheet.GetRow(i).Cells.Count > 10)
{
//dataGridView1.Rows[i].Cells[j].Value = sheet.GetRow(i).GetCell(j).StringCellValue;
switch (sheet.GetRow(i).GetCell(j).CellType)
{
case CellType.Numeric:
//Console.WriteLine(j + " ---> " + sheet.GetRow(i).GetCell(j).NumericCellValue);
dataGridView1.Rows[i - 2].Cells[j].Value = sheet.GetRow(i).GetCell(j).NumericCellValue;
break;
case CellType.String:
//Console.WriteLine(j + " ---> " + sheet.GetRow(i).GetCell(j).StringCellValue);
dataGridView1.Rows[i - 2].Cells[j].Value = sheet.GetRow(i).GetCell(j).StringCellValue;
break;
}
}
else
{
Console.WriteLine(i + " ---> cells < 10");
}
}
}
}
}
//dataGridView1.AutoResizeColumns();
dataGridView1.AutoResizeRows();
坐标文件就是普通的文本文件,按照坐标格式进行读取就可以了
StreamReader sr = File.OpenText(tbx_rep.Text);
pst = new List<Placement>();
while ((temp = sr.ReadLine()) != null)
{
if (temp.Contains("Total Number of SMD Components on Top"))
{
string s = temp.Remove(0, temp.IndexOf(':') + 1);
line = int.Parse(s);
sr.ReadLine();//空一行
sr.ReadLine();//空一行
for (int i = 0; i < line; i++)
{
temp = sr.ReadLine();
//坐标文件格式 座位号 X Y 长度都为10 角度为7
string str = temp.Substring(0, 10).Trim();
string x = temp.Substring(10, 10).Trim();
string y = temp.Substring(20, 10).Trim();
string r = temp.Substring(30, 7).Trim();
if (i == 0)
{
label_first_smd.Text = string.Format("{0}--->X:{1} Y:{2}", str, x, y);
}
Placement p = new Placement();
p.Symbol = str;
p.X_pos = x;
p.Y_pos = y;
p.Rotation = r;
pst.Add(p);
}
}
}
根据坐标生成对应的gerber绘图语句,比如画一个圆点,能标识出即可
//获取座位号
Console.WriteLine(dataGridView1.Rows[e.RowIndex].Cells[7].Value);
string location = (string)dataGridView1.Rows[e.RowIndex].Cells[7].Value;
string[] loc;
StringBuilder sb = new StringBuilder();
sb.Append("G04 Sonavox auto mark smd commpent helper *\r\n");
sb.Append("G04 Draw by:101367 *\n");
sb.Append("%MOIN*%\n");//单位选择
sb.Append("%FSLAX55Y55*%\n");//坐标系选择
//sb.Append("%ADD12R,0.050X0.050X*%\n");//画圆点
sb.Append(string.Format("%ADD11C,{0}*%\n", numericUpDown_size.Value.ToString()));//画圆点
sb.Append("\nG54D11*\n");//选择自定义光圈
if (location != "")
{
loc = location.Split(',');
bool find = false;
foreach (string s in loc)
{
find = false;
foreach (Placement p in pst)
{
if (s == p.Symbol)
{
find = true;
Int32 xpos = Int32.Parse(p.X_pos) + (Int32)numericUpDown_x.Value;
Int32 ypos = Int32.Parse(p.Y_pos) + (Int32)numericUpDown_y.Value;
xpos = xpos * 100;
ypos = ypos * 100;
sb.Append(string.Format("X{0}Y{1}D03*\n", xpos, ypos));//标识位置
Console.WriteLine(string.Format("Top SMD:{0}--->X:{1} Y:{2} R:{3}", s, p.X_pos, p.Y_pos, p.Rotation));
//break;
continue;//跳过剩下的代码,继续执行循环
}
}
if (find == false)
{
foreach (Placement p in psb)
{
if (s == p.Symbol)
{
find = true;
Int32 xpos = Int32.Parse(p.X_pos) + (Int32)numericUpDown_x.Value;
Int32 ypos = Int32.Parse(p.Y_pos) + (Int32)numericUpDown_y.Value;
xpos = xpos * 100;
ypos = ypos * 100;
sb.Append(string.Format("X{0,0.00}Y{1,0.00}D03*\n", xpos, ypos));//标识位置
Console.WriteLine(string.Format("Bottom SMD:{0}--->X:{1} Y:{2} R:{3}", s, p.X_pos, p.Y_pos, p.Rotation));
continue;//跳过剩下的代码,继续执行循环
}
}
}
if (find == false)
{
MessageBox.Show(s + "的坐标未找到,请确认!!!\r\n可能是座位号不正确或者在MI部分");
return;
}
}
sb.Append("M02*\n");
richTextBox1.Text = sb.ToString();
//保存到文件,通知gerberV加载,reload即可刷新视图
StreamWriter sw = new StreamWriter(@"Auto-Generate-Gerber.gbx");
sw.Write(sb.ToString());
sw.Flush();
sw.Close();
reload_event(0);
}
图形标记目前只支持加点,可以很容易添加方框,箭头等符号
软件以坐标文件中第一个位置为参照来计算偏移量的,需要填入实际坐标才可以计算出偏移量,如果坐标没有偏移,则无需计算,贴完的可以标记为绿色背景,取消即为默认背景
目前代码只适合解析我们cadstar导出的文件,这个EDA国内用的不多,这里给出源码,简单修改下就可以解析其它格式的BOM及坐标文件了,有需要的朋友可以参考
点击下载源码
GerberVS.7z
抽空也画了一块,还未验证,就先不开源出来了 双层单面元件 好焊接 F133_Board.pdf
确定要使用的GPIO,这里需要使用带外部中断的引脚,否则驱动注册失败 request:-22
这是我的设备树配置
ir_gpio {
compatible = "gpio-ir-receiver";
gpios = <&pio 1 5 GPIO_ACTIVE_LOW>; /* PB5 */
/*active_low = <1>;*/
linux,rc-map-name = "rc-tevii-nec";
status = "okay";
};
内核里修改
Device Drivers > Remote Controller support >
[*] LIRC user interface
[*] Remote controller decoders --->
[*] Remote Controller devices --->
<*> GPIO IR remote control
驱动成功加载会有如下输出
[ 1.223257] IR NEC protocol handler initialized
[ 1.227806] IR RC5(x/sz) protocol handler initialized
[ 1.232985] IR RC6 protocol handler initialized
[ 1.237517] IR JVC protocol handler initialized
[ 1.242080] IR Sony protocol handler initialized
[ 1.246693] IR SANYO protocol handler initialized
[ 1.251406] IR Sharp protocol handler initialized
[ 1.256104] IR RCMM protocol handler initialized
[ 1.261050] Registered IR keymap rc-tevii-nec
[ 1.265477] rc rc0: gpio_ir_recv as /devices/platform/ir_gpio/rc/rc0
[ 1.272194] rc rc0: lirc_dev: driver gpio_ir_recv registered at minor = 0, raw IR receiver, no transmitter
[ 1.282144] input: gpio_ir_recv as /devices/platform/ir_gpio/rc/rc0/input3
此时查看/dev/input目录下,会有如下显示:
# evtest
No device specified, trying to scan all of /dev/input/event*
Available devices:
/dev/input/event0: 1c22800.lradc
/dev/input/event1: rotary@0
/dev/input/event2: ns2009_ts
/dev/input/event3: gpio_ir_recv
此时如果用evtest测试按键是没有任何反应的,需要修改对应的驱动,此问题先留在这里
不影响后续操作
后来查资料,发现可以用lirc里的工具去测试硬件是否OK,测试之前要先修改默认配置文件,不修改的话,同样没反应
# vi /etc/lirc/lirc_options.conf
driver = default
device = /dev/lric0
修改这2行就可以,里边driver默认是uinput,device默认是auto
再次测试就有反应了
# mode2 -m -d /dev/lirc0
Using driver default on device /dev/lirc0
Trying device: /dev/lirc0
Using device: /dev/lirc0
Warning: Running as root.
9043 4402 626 497 656 499
624 499 656 499 624 499
656 499 624 499 624 531
624 1630 619 1624 655 1624
624 1624 624 1634 646 1624
624 1624 655 1624 593 1656
624 501 654 1624 593 534
652 1624 624 499 625 1624
656 504 619 499 655 1625
624 499 656 1625 593 531
624 1633 648 498 624 1624
624 40035
9060 2184 624 143451-pulse 483450-space
从这结果上可以明显的看出这些数值代表脉冲宽度,单位是us
使用irrecod -f -d /dev/lirc0 –disable-namespace来录制配置文件
录制完成后放到 /etc/lric/liricd.conf.d/下边
!注意,这里录制的结果不准确,需要借助上边的命令来获取每一个按键的值,这里只是借用一下配置文件的格式,里边的数字是右对齐
示例:
# Please take the time to finish this file as described in
# https://sourceforge.net/p/lirc-remotes/wiki/Checklist/
# and make it available to others by sending it to
# <lirc@bartelmus.de>
#
# This config file was automatically generated
# using lirc-0.10.1(default) on Thu Jan 1 01:37:06 1970
# Command line used: -f -d /dev/lirc0 --disable-namespace
# Kernel version (uname -r): 5.10.19
#
# Remote name (as of config file): elac
# Brand of remote device, the thing you hold in your hand:
# Remote device model nr:
# Remote device info url:
# Does remote device has a bundled capture device e. g., a
# usb dongle? :
# For bundled USB devices: usb vendor id, product id
# and device string (use dmesg or lsusb):
# Type of device controlled
# (TV, VCR, Audio, DVD, Satellite, Cable, HTPC, ...) :
# Device(s) controlled by this remote:
begin remote
name elac
flags RAW_CODES|CONST_LENGTH
eps 30
aeps 100
gap 108533
begin raw_codes
name Power
9043 4403 623 531 593 531
624 531 593 531 624 531
593 531 624 531 593 536
594 1680 592 1656 593 1656
625 1655 593 1666 582 1656
624 1656 593 1655 625 530
593 534 621 530 593 1656
624 1624 624 531 593 530
624 531 595 1655 623 1655
593 1656 593 530 624 531
593 1664 616 1656 593 1656
593
name BT
9041 4407 622 531 593 531
593 562 593 531 593 531
625 533 596 525 624 530
593 1656 624 1656 593 1655
593 1664 616 1655 593 1656
593 1656 624 1658 591 530
624 1656 593 531 624 531
593 531 593 531 624 1661
587 530 624 1656 593 531
593 1687 593 1656 601 1648
624 1656 593 531 593 1656
624
name Vol+
9013 4437 592 530 593 562
593 531 624 531 593 531
594 565 589 530 593 531
624 1656 593 1656 624 1665
590 1651 591 1656 624 1655
593 1656 593 1667 613 531
593 1656 624 1656 593 531
593 562 595 528 593 1656
624 531 593 1656 624 531
593 530 593 1659 621 1655
593 1656 593 562 593 1656
593
name Vol-
9044 4436 592 531 624 531
593 533 622 530 593 531
593 531 624 531 593 530
624 1656 593 1661 595 1679
593 1655 593 1656 624 1656
593 1667 582 1659 620 530
593 1656 624 1656 600 524
624 1656 593 531 593 531
624 531 593 1656 624 531
598 530 620 1654 593 531
624 1625 624 1656 593 1666
614
name Pre
9048 4403 592 562 593 530
593 562 593 530 593 531
624 531 593 531 624 531
593 1661 593 1680 592 1656
593 1656 624 1656 603 1650
588 1656 623 1656 593 1656
624 1662 587 1655 593 531
624 531 593 531 624 1656
593 531 631 524 593 530
593 562 593 1656 593 1656
624 1663 586 530 624 1624
624
name Next
9022 4425 593 530 624 531
593 531 624 531 597 527
623 531 593 531 593 562
593 1656 593 1656 624 1663
585 1655 624 1656 593 1656
593 1656 633 1646 593 1656
593 562 593 1656 593 530
624 1658 591 531 593 562
593 531 624 531 593 1656
624 499 624 1659 591 530
624 1656 593 1656 593 1687
601
name Play
9027 4431 592 531 624 531
593 531 624 531 593 531
593 562 593 531 624 531
598 1652 592 1655 624 1656
593 1656 624 1633 616 1656
593 1656 624 1624 624 1656
595 529 624 1656 593 531
593 1687 593 531 593 1665
620 526 592 530 624 1656
593 531 594 1655 624 531
593 1665 615 531 593 1656
624
name Ana1
9044 4408 621 530 593 530
624 531 593 531 593 562
593 531 593 562 593 531
593 1655 624 1656 593 1655
597 1654 621 1655 593 1655
624 1624 624 1665 584 530
625 530 593 1656 593 562
593 531 624 499 624 531
599 525 624 1655 593 1656
593 562 593 1656 593 1659
621 1655 593 1656 593 1656
624
name Ana2
9040 4402 656 500 624 499
656 499 624 499 624 531
624 499 624 531 624 499
624 1632 655 1628 589 1650
593 1655 624 1655 593 1670
610 1656 593 1656 593 531
624 1656 596 1655 590 562
593 531 624 500 624 531
593 531 624 1656 599 529
620 530 593 1656 624 1625
624 1656 593 1662 619 1656
593
name Opt1
9016 4435 624 530 593 531
624 533 591 531 624 531
593 531 593 562 593 531
593 1656 624 1685 564 1655
624 1624 624 1656 593 1656
637 1643 593 1656 593 531
624 531 593 1656 624 531
596 1653 624 531 593 531
593 562 593 1656 593 1656
630 526 591 1656 624 531
593 1656 593 1656 624 1664
585
name Opt2
9043 4403 655 499 624 499
656 499 627 497 656 499
624 499 625 530 624 502
628 1618 655 1654 601 1619
623 1624 656 1624 624 1624
656 1636 613 1625 624 499
656 499 624 499 656 499
624 1626 622 531 624 499
624 531 624 1624 624 1624
624 1662 618 1624 624 499
656 1624 624 1624 624 1665
615
name Coax
9015 4439 591 531 624 531
593 530 624 531 593 531
593 562 593 531 593 531
624 1656 593 1656 624 1656
611 1642 589 1655 624 1656
593 1656 593 1668 613 1655
593 1656 593 1656 624 531
593 1658 622 531 593 530
593 562 593 531 624 531
656 468 593 1656 630 525
592 1655 593 1687 593 1656
593
name USB
9050 4433 593 531 594 561
593 531 593 531 624 531
593 531 624 530 593 531
624 1656 603 1645 593 1656
624 1656 593 1655 624 1659
590 1655 593 1656 624 531
593 531 624 531 593 537
618 530 593 531 624 1656
593 531 624 1624 624 1662
587 1655 624 1655 593 1656
593 1656 632 523 593 1656
624
end raw_codes
end remote
接下来使用irw来验证刚才录制的是否正确
# irw
lircd-0.10.1[432]: Notice: accepted new client on /var/run/lirc/lircd
lircd-0.10.1[432]: Info: [lirc] protocol is enabled
0000000000000001 00 Power elac
0000000000000002 00 BT elac
0000000000000003 00 Vol+ elac
0000000000000004 00 Vol- elac
0000000000000008 00 Ana1 elac
000000000000000a 00 Opt1 elac
000000000000000b 00 Opt2 elac
然后在/etc/lirc/目录下创建lircrc配置文件或~/.lircrc
格式如下
begin
prog = irexec
button = Power
repeat = 0
config = echo "power"
end
begin
prog = irexec
button = Vol+
repeat = 1
config = amixer -M -c 0 sset 'Headphone',0 1%+ > /dev/null
end
begin
prog = irexec
button = Vol-
repeat = 1
config = amixer -M -c 0 sset 'Headphone',0 1%- > /dev/null
end
保存
最后就是使用irexec来进行各种操作了,无需编程,到这里可以自由发挥了,想要集成到代码里也很简单,看下图
# irexec
lircd-0.10.1[448]: Notice: accepted new client on /var/run/lirc/lircd
lircd-0.10.1[448]: Info: [lirc] protocol is enabled
power
Simple mixer control 'Headphone',0
Capabilities: pvolume pvolume-joined pswitch
Playback channels: Front Left - Front Right
Limits: Playback 0 - 63
Mono:
Front Left: Playback 47 [54%] [-16.00dB] [on]
Front Right: Playback 47 [54%] [-16.00dB] [on]
Simple mixer control 'Headphone',0
Capabilities: pvolume pvolume-joined pswitch
Playback channels: Front Left - Front Right
Limits: Playback 0 - 63
Mono:
Front Left: Playback 45 [50%] [-18.00dB] [on]
Front Right: Playback 45 [50%] [-18.00dB] [on]
power
LIRC处理流程
+--------+ +-------------+ +--------+
| | | Linux input | | Appli- |
--->---| kernel |---->----| layer |---------->----------| cation |
| | | | /dev/input/eventX | |
+--------+ +-------------+ +--------+
+--------+ +-------------+
| | | Linux input |
--->---| kernel |---->----| layer |
| | | |
+--------+ +-------------+
|
v
|
| +--------+
+-------------+ | Appli- |
| lirc |---------->----------| cation |-+
| | lirc socket | | |
+-------------+ +--------+ |-+
| | |
+--------+ |
| |
+--------+
+--------+ +-------------+ +--------+
| | | | | Appli- |
--->---| kernel |---->----| lirc |---------->----------| cation |-+
| | | | lirc socket | | |
+--------+ +-------------+ +--------+ |-+
| | |
+--------+ |
| |
+--------+
通过socket使用lirc,不需要引入任何文件,可以方便的集成到代码里,就是上述第三种方式
struct sigaction act;
char buf[128];
struct sockaddr_un addr;
typedef struct
{
char addr[32];
char code[8];
char type[16];
char name[16];
} IRW_DATA;
IRW_DATA irw_data;
act.sa_handler = sigusr1;
sigfillset(&act.sa_mask);
act.sa_flags = SA_RESTART; /* don't fiddle with EINTR */
sigaction(SIGUSR1, &act, NULL);
addr.sun_family = AF_UNIX;
strcpy(addr.sun_path, "/var/run/lirc/lircd");
fd_lircd = socket(AF_UNIX, SOCK_STREAM | SOCK_NONBLOCK, 0);
if (fd_lircd == -1)
{
printf("Create socket failed\n");
}
if (connect(fd_lircd, (struct sockaddr *)&addr, sizeof(addr)) == -1)
{
printf("Cannot connect to socket %s\n", addr.sun_path);
}
while (1)
{
// lircd
if (read(fd_lircd, buf, 128) > 0)
{
LOG_D("%s\n", buf);
char *p = strtok(buf, " ");
int i = 0;
while (p)
{
// LOG_D("%s\n", p);
if (i == 0)
strcpy(irw_data.addr, p);
else if (i == 1)
strcpy(irw_data.code, p);
else if (i == 2)
strcpy(irw_data.type, p);
else if (i == 3)
strcpy(irw_data.name, p);
p = strtok(NULL, " ");
i++;
}
LOG_D("%s\n", irw_data.type);
switch ((uint8_t)strtol(irw_data.addr, NULL, 10))
{
case Vol_up:
rotary_encoder_handler(&u8g2, -1);
break;
case Vol_down:
rotary_encoder_handler(&u8g2, 1);
break;
case Play:
rotary_encoder_button_handler(&u8g2);
break;
case Bt:
printf("BT button\n");
break;
}
}
}
测试的硬件
1.从此处下载sox官网http://sox.sourceforge.net 解压后新建一个autoconfig.sh脚本
这里使用了绝对路径,使用相对路径在最后链接时找不到文件,所以直接使用了绝对路径,里边的一些插件如果不需要可以去掉,我也一起打包传上来,另外这手动编译依赖可真烦那,只能缺哪个下载哪个再编译哪个最后才能给链接出来,跟buildroot里3S钟把sox勾选上完事编译完事相比,手动编译估计得3小时 ^*_*^,简直弱爆了,附件在最后,是修改好的源文件,稍做修改即可编译。
#!/bin/sh
./configure
CC=”arm-linux-gnueabihf-gcc”
LDFLAGS=”-L/home/xfdr/v3s_licheepi_zero/sox-14.4.2-sonavox/alsa/ -L/home/xfdr/v3s_licheepi_zero/sox-14.4.2-sonavox/flac-1.3.3/src/libFLAC/.libs -L/home/xfdr/v3s_licheepi_zero/sox-14.4.2-sonavox/lame-3.100/libmp3lame/.libs/ -L/home/xfdr/v3s_licheepi_zero/sox-14.4.2-sonavox/twolame-0.4.0/libtwolame/.libs/ -L/home/xfdr/v3s_licheepi_zero/sox-14.4.2-sonavox/libmad-0.15.1b/.libs/ -L/home/xfdr/v3s_licheepi_zero/sox-14.4.2-sonavox/libid3tag-0.15.1b/.libs/ -L/home/xfdr/v3s_licheepi_zero/sox-14.4.2-sonavox/zlib-1.2.11”
CFLAGS=”-I/home/xfdr/v3s_licheepi_zero/buildroot-2021.02/output/host/arm-buildroot-linux-gnueabihf/sysroot/usr/include/ -I/home/xfdr/v3s_licheepi_zero/sox-14.4.2-sonavox/lame-3.100/include/ -I/home/xfdr/v3s_licheepi_zero/sox-14.4.2-sonavox/flac-1.3.3/src/libFLAC/ -I/home/xfdr/v3s_licheepi_zero/sox-14.4.2-sonavox/twolame-0.4.0/libtwolame/ -I/home/xfdr/v3s_licheepi_zero/sox-14.4.2-sonavox/libmad-0.15.1b/ -I/home/xfdr/v3s_licheepi_zero/sox-14.4.2-sonavox/libid3tag-0.15.1b/“
–prefix /opt/sox.14.4.2
–host=arm-linux-gnueabihf
–target=arm-linux
–with-alsa
–with-flac
–with-mp3
–with-id3tag
–with-lame
–with-wavpack
#–with-twolame \
2.编译完成后执行make install 即可,安装目录就是上边指定的,拷贝到开发板或者NFS目录下
3.先来播放音乐试一下
# ./sox.14.4.2/bin/play -t mp3 ./群星-雨花石.mp3
./sox.14.4.2/bin/play WARN alsa: can’t encode 0-bit Unknown or not applicable
./群星-雨花石.mp3:
File Size: 13.7M Bit Rate: 321k
Encoding: MPEG audio Info: 163 key(Don’t modify):cEgtqHxwpdRKcBCRPBlPkg2DgcBlNoDaE7DLI/2UHqynoBve87Svw+quIkOr72Ov7q2menCG1hUs953Iws8wjHxQUjhQGB3sa2Sa9AVOc0ek4+GcHOxN9VcDh3GNItlfDRG7Pi/y+oz0U3xrKMvDiHZErPJlv6SHCl/k5qddt6BXsgTw3fn/9fNu/LLy/lawUWghlFz+aUkza7omDosFsjHYbZYrBjDqcCegSdhUOA43QD89da8FaXkqPqcMQVYqEBm7uirR2NrhGOOGt29H8sgWqCZ1icsjX7XcnX0035IQQ5Fj3dVW49U4iJMDLJtbM9DDheK/KwCziC1y9ISodum8kf9PC7+b+JLNr/mhg5DifEjdqngnEHAzqRUNufhtjc530m+aglaPBRphTfryHMYPKTWq311dQFnn9Ru1rnrpjBwyc9avaOrd10VsncqCPRHdRET/f7ygAMyztzSPzQ==
Channels: 2 @ 16-bit Track: 4
Samplerate: 44100Hz Album: 女人如歌 柔情魅声
Replaygain: off Artist: 群星
Duration: 00:05:40.79 Title: 雨花石
In:1.23% 00:00:04.18 [00:05:36.61] Out:184k [ =|== ] Clip:0
Aborted.
# ./sox.14.4.2/bin/play -t flac ./wodeloulan.flac
./sox.14.4.2/bin/play WARN alsa: can’t encode 0-bit Unknown or not applicable
./wodeloulan.flac:
File Size: 39.0M Bit Rate: 952k
Encoding: FLAC
Channels: 2 @ 16-bit
Samplerate: 44100Hz Album: 倔强
Replaygain: off Artist: 云朵
Duration: 00:05:27.59 Title: 我的楼兰
In:0.48% 00:00:01.58 [00:05:26.01] Out:69.6k [ ===|==- ] Clip:0
Aborted.
4.本地音乐播放没问题,也可以播放网络音频,实际就是通过wget获取的
# ./play -t flac http://192.168.6.123:8080/wodeloulan.flac
./play WARN alsa: can’t encode 0-bit Unknown or not applicable
http://192.168.6.123:8080/wodeloulan.flac:
File Size: 0 Bit Rate: 0
Encoding: FLAC
Channels: 2 @ 16-bit
Samplerate: 44100Hz Album: 倔强
Replaygain: off Artist: 云朵
Duration: 00:05:27.59 Title: 我的楼兰
In:0.57% 00:00:01.86 [00:05:25.73] Out:81.9k [ ==|==- ] Clip:0
Aborted.
5.下边开始使用sox产生一些测试信号试试,产生1Khz 44.1KHz 0dB 的sin pink white
play -V -r 48000 -b 16 -c 2 -n synth sin 1000 vol 0db #产生正弦波
play -V -r 48000 -b 16 -c 2 -n synth pink 1000 vol 0db #产生粉红噪音
play -V -r 48000 -b 16 -c 2 -n synth white 1000 vol 0db #产生白噪音
# ./play -V -r 48000 -b 16 -c 2 -n synth pink 1000 vol 0db
./play WARN alsa: can’t encode 0-bit Unknown or not applicable
./play: SoX v14.4.2
Input File : ‘’ (null)
Channels : 2
Sample Rate : 48000
Precision : 16-bit
Endian Type : little
Reverse Nibbles: no
Reverse Bits : no
./play INFO formats: can't set sample rate 48000; using 44100
Output File : ‘default’ (alsa)
Channels : 2
Sample Rate : 44100
Precision : 16-bit
Sample Encoding: 16-bit Signed Integer PCM
Endian Type : little
Reverse Nibbles: no
Reverse Bits : no
./play INFO vol: has no effect in this configuration
./play INFO sox: effects chain: input 48000Hz 2 channels
./play INFO sox: effects chain: synth 48000Hz 2 channels
./play INFO sox: effects chain: rate 44100Hz 2 channels
./play INFO sox: effects chain: dither 44100Hz 2 channels
./play INFO sox: effects chain: output 44100Hz 2 channels
In:0.00% 00:00:04.78 [00:00:00.00] Out:203k [ | ] Hd:3.4 Clip:0
Aborted.
6.从 20Hz 到 20kHz 的频率扫描,持续时间为 30 秒 音量0 重复10次
play -V -r 44100 -b -c 2 -n synth 30 sin 20+20000 vol 0db repeat 10
7.20-10kHz 和 1kHz-20kHz 双频扫描
play -V -r 44100 -n synth 30 sin 20+10000 sin 1000+20000 remix 1,2 channels 2
8.sox功能还有很多,不过这几个功能目前已经满足我的需要了,其它高级玩法就留给大家了
这里有一个悟空语音助手
一个简单、灵活、优雅的中文语音对话机器人/智能音箱项目
蓝牙连接成功后,自动生成了一个event3 通过这个为什么不能控制手机呢?还是说我的手机变成了一个输入设备,按手机音量加减 也没事件输出啊?
# evtest /dev/input/event3
Input driver version is 1.0.1
Input device ID: bus 0x5 vendor 0x4c product 0x710c version 0xe70
Input device name: "iPhone (AVRCP)"
Supported events:
Event type 0 (EV_SYN)
Event type 1 (EV_KEY)
Event code 2 (KEY_1)
Event code 3 (KEY_2)
Event code 4 (KEY_3)
Event code 5 (KEY_4)
Event code 6 (KEY_5)
Event code 7 (KEY_6)
Event code 8 (KEY_7)
Event code 9 (KEY_8)
Event code 10 (KEY_9)
Event code 11 (KEY_0)
Event code 28 (KEY_ENTER)
Event code 52 (KEY_DOT)
Event code 59 (KEY_F1)
Event code 60 (KEY_F2)
Event code 61 (KEY_F3)
Event code 62 (KEY_F4)
Event code 63 (KEY_F5)
Event code 64 (KEY_F6)
Event code 65 (KEY_F7)
Event code 66 (KEY_F8)
Event code 67 (KEY_F9)
Event code 103 (KEY_UP)
Event code 105 (KEY_LEFT)
Event code 106 (KEY_RIGHT)
Event code 108 (KEY_DOWN)
Event code 113 (KEY_MUTE)
Event code 114 (KEY_VOLUMEDOWN)
Event code 115 (KEY_VOLUMEUP)
Event code 138 (KEY_HELP)
Event code 139 (KEY_MENU)
Event code 163 (KEY_NEXTSONG)
Event code 165 (KEY_PREVIOUSSONG)
Event code 166 (KEY_STOPCD)
Event code 167 (KEY_RECORD)
Event code 168 (KEY_REWIND)
Event code 171 (KEY_CONFIG)
Event code 174 (KEY_EXIT)
Event code 200 (KEY_PLAYCD)
Event code 201 (KEY_PAUSECD)
Event code 208 (KEY_FASTFORWARD)
Event code 353 (KEY_SELECT)
Event code 356 (KEY_POWER2)
Event code 358 (KEY_INFO)
Event code 362 (KEY_PROGRAM)
Event code 364 (KEY_FAVORITES)
Event code 395 (KEY_LIST)
Event code 398 (KEY_RED)
Event code 399 (KEY_GREEN)
Event code 400 (KEY_YELLOW)
Event code 401 (KEY_BLUE)
Event code 402 (KEY_CHANNELUP)
Event code 403 (KEY_CHANNELDOWN)
Event code 405 (KEY_LAST)
Event type 2 (EV_REL)
Key repeat handling:
Repeat type 20 (EV_REP)
Repeat code 0 (REP_DELAY)
Value 300
Repeat code 1 (REP_PERIOD)
Value 33
Properties:
Testing ... (interrupt to exit)
## 全志V3S上通过蓝牙播放音乐
`我使用的是RTL8723DS模块,引脚与BS是兼容的,内核使用的是5.10, Bluez使用的是5.55 终端是UART0,蓝牙串口使用的是UART2,板子是参照licheepi 自己画的`
[参考链接](https://gitee.com/yocop/drv_bt_rtl8723ds)
[BT参考链接](https://github.com/Poco-Ye/rtl8723DS-BT-uart-driver)
[WIFI参考链接](https://github.com/lwfinger/rtl8723ds)
1. 首先在buildroot里勾选上bluez5-utils,bluez-tools及blue-alsa
2. 在内核里勾选
[*]UART(H4) protocol support
[/*]Realtek Three-wireUART(H5) protocol support
系统启动时会显示如下信息:
Starting kernel ...
[ 0.000000] Booting Linux on physical CPU 0x0
[ 0.000000] Linux version 5.10.19 (xfdr@virtualbox) (arm-linux-gnueabihf-gcc (Linaro GCC 7.5-2019.12) 7.5.0, GNU ld (Linaro_Binutils-2019.12) 2.28.2.20170706) #13 SMP Fri Jul 23 12:00:59 CST 2021
[ 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] cma: Reserved 16 MiB at 0x41c00000
[ 0.000000] Zone ranges:
[ 0.000000] Normal [mem 0x0000000040000000-0x0000000043ffffff]
[ 0.000000] HighMem empty
[ 0.000000] Movable zone start for each node
[ 0.000000] Early memory node ranges
[ 0.000000] node 0: [mem 0x0000000040000000-0x0000000043ffffff]
[ 0.000000] Initmem setup node 0 [mem 0x0000000040000000-0x0000000043ffffff]
[ 0.000000] psci: probing for conduit method from DT.
[ 0.000000] psci: Using PSCI v0.1 Function IDs from DT
[ 0.000000] percpu: Embedded 15 pages/cpu s31052 r8192 d22196 u61440
[ 0.000000] Built 1 zonelists, mobility grouping on. Total pages: 16256
[ 0.000000] Kernel command line: console=ttyS0,115200 panic=5 console=ttyS0 rootwait vt.global_cursor_default=0 root=/dev/mmcblk0p2 earlyprintk rw
[ 0.000000] Dentry cache hash table entries: 8192 (order: 3, 32768 bytes, linear)
[ 0.000000] Inode-cache hash table entries: 4096 (order: 2, 16384 bytes, linear)
[ 0.000000] mem auto-init: stack:off, heap alloc:off, heap free:off
[ 0.000000] Memory: 34900K/65536K available (8192K kernel code, 918K rwdata, 2244K rodata, 1024K init, 284K bss, 14252K reserved, 16384K cma-reserved, 0K highmem)
[ 0.000000] SLUB: HWalign=64, Order=0-3, MinObjects=0, CPUs=1, Nodes=1
[ 0.000000] rcu: Hierarchical RCU implementation.
[ 0.000000] rcu: RCU restricting CPUs from NR_CPUS=8 to nr_cpu_ids=1.
[ 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=1
[ 0.000000] NR_IRQS: 16, nr_irqs: 16, preallocated irqs: 16
[ 0.000000] GIC: Using split EOI/Deactivate mode
[ 0.000000] random: get_random_bytes called from start_kernel+0x328/0x4c0 with crng_init=0
[ 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.000008] sched_clock: 56 bits at 24MHz, resolution 41ns, wraps every 4398046511097ns
[ 0.000022] Switching to timer-based delay loop, resolution 41ns
[ 0.000278] clocksource: timer: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 79635851949 ns
[ 0.000593] Console: colour dummy device 80x30
[ 0.000661] Calibrating delay loop (skipped), value calculated using timer frequency.. 48.00 BogoMIPS (lpj=240000)
[ 0.000684] pid_max: default: 32768 minimum: 301
[ 0.000852] Mount-cache hash table entries: 1024 (order: 0, 4096 bytes, linear)
[ 0.000873] Mountpoint-cache hash table entries: 1024 (order: 0, 4096 bytes, linear)
[ 0.001748] CPU: Testing write buffer coherency: ok
[ 0.002186] /cpus/cpu@0 missing clock-frequency property
[ 0.002218] CPU0: thread -1, cpu 0, socket 0, mpidr 80000000
[ 0.002989] Setting up static identity map for 0x40100000 - 0x40100060
[ 0.003218] rcu: Hierarchical SRCU implementation.
[ 0.003764] smp: Bringing up secondary CPUs ...
[ 0.003792] smp: Brought up 1 node, 1 CPU
[ 0.003802] SMP: Total of 1 processors activated (48.00 BogoMIPS).
[ 0.003811] CPU: All CPU(s) started in HYP mode.
[ 0.003818] CPU: Virtualization extensions available.
[ 0.004452] devtmpfs: initialized
[ 0.008373] VFP support v0.3: implementor 41 architecture 2 part 30 variant 7 rev 5
[ 0.008733] clocksource: jiffies: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 19112604462750000 ns
[ 0.008771] futex hash table entries: 256 (order: 2, 16384 bytes, linear)
[ 0.009561] pinctrl core: initialized pinctrl subsystem
[ 0.011091] NET: Registered protocol family 16
[ 0.012326] DMA: preallocated 256 KiB pool for atomic coherent allocations
[ 0.013612] thermal_sys: Registered thermal governor 'step_wise'
[ 0.014006] hw-breakpoint: found 5 (+1 reserved) breakpoint and 4 watchpoint registers.
[ 0.014032] hw-breakpoint: maximum watchpoint size is 8 bytes.
[ 0.036802] SCSI subsystem initialized
[ 0.037553] usbcore: registered new interface driver usbfs
[ 0.037622] usbcore: registered new interface driver hub
[ 0.037689] usbcore: registered new device driver usb
[ 0.037967] mc: Linux media interface: v0.10
[ 0.038015] videodev: Linux video capture interface: v2.00
[ 0.038161] pps_core: LinuxPPS API ver. 1 registered
[ 0.038174] pps_core: Software ver. 5.3.6 - Copyright 2005-2007 Rodolfo Giometti <giometti@linux.it>
[ 0.038198] PTP clock support registered
[ 0.038880] Advanced Linux Sound Architecture Driver Initialized.
[ 0.039575] Bluetooth: Core ver 2.22
[ 0.039667] NET: Registered protocol family 31
[ 0.039679] Bluetooth: HCI device and connection manager initialized
[ 0.039703] Bluetooth: HCI socket layer initialized
[ 0.039717] Bluetooth: L2CAP socket layer initialized
[ 0.039750] Bluetooth: SCO socket layer initialized
[ 0.040956] clocksource: Switched to clocksource arch_sys_counter
[ 0.052288] NET: Registered protocol family 2
[ 0.053034] tcp_listen_portaddr_hash hash table entries: 512 (order: 0, 6144 bytes, linear)
[ 0.053084] TCP established hash table entries: 1024 (order: 0, 4096 bytes, linear)
[ 0.053112] TCP bind hash table entries: 1024 (order: 1, 8192 bytes, linear)
[ 0.053136] TCP: Hash tables configured (established 1024 bind 1024)
[ 0.053298] UDP hash table entries: 256 (order: 1, 8192 bytes, linear)
[ 0.053357] UDP-Lite hash table entries: 256 (order: 1, 8192 bytes, linear)
[ 0.053602] NET: Registered protocol family 1
[ 0.054648] RPC: Registered named UNIX socket transport module.
[ 0.054681] RPC: Registered udp transport module.
[ 0.054690] RPC: Registered tcp transport module.
[ 0.054698] RPC: Registered tcp NFSv4.1 backchannel transport module.
[ 0.056301] Initialise system trusted keyrings
[ 0.056732] workingset: timestamp_bits=30 max_order=14 bucket_order=0
[ 0.063874] NFS: Registering the id_resolver key type
[ 0.063951] Key type id_resolver registered
[ 0.063960] Key type id_legacy registered
[ 0.064015] ntfs: driver 2.1.32 [Flags: R/W].
[ 0.163771] Key type asymmetric registered
[ 0.163804] Asymmetric key parser 'x509' registered
[ 0.163906] Block layer SCSI generic (bsg) driver version 0.4 loaded (major 246)
[ 0.163922] io scheduler mq-deadline registered
[ 0.163931] io scheduler kyber registered
[ 0.168836] sun8i-v3s-pinctrl 1c20800.pinctrl: initialized sunXi PIO driver
[ 0.169687] sun8i-v3s-pinctrl 1c20800.pinctrl: supply vcc-pb not found, using dummy regulator
[ 0.170628] pwm-backlight backlight: supply power not found, using dummy regulator
[ 0.171287] pwm-backlight backlight: invalid default brightness level: 100, using 6
[ 0.239906] Serial: 8250/16550 driver, 8 ports, IRQ sharing disabled
[ 0.244637] printk: console [ttyS0] disabled
[ 0.264964] 1c28000.serial: ttyS0 at MMIO 0x1c28000 (irq = 45, base_baud = 1500000) is a U6_16550A
[ 0.932953] printk: console [ttyS0] enabled
[ 0.938208] sun8i-v3s-pinctrl 1c20800.pinctrl: supply vcc-pe not found, using dummy regulator
[ 0.968606] 1c28400.serial: ttyS1 at MMIO 0x1c28400 (irq = 46, base_baud = 1500000) is a U6_16550A
[ 0.999932] 1c28800.serial: ttyS2 at MMIO 0x1c28800 (irq = 47, base_baud = 1500000) is a U6_16550A
[ 1.014962] panel-simple panel: supply power not found, using dummy regulator
[ 1.022545] panel-simple panel: Specify missing connector_type
[ 1.030391] libphy: Fixed MDIO Bus: probed
[ 1.035212] CAN device driver interface
[ 1.039657] dwmac-sun8i 1c30000.ethernet: IRQ eth_wake_irq not found
[ 1.046143] dwmac-sun8i 1c30000.ethernet: IRQ eth_lpi not found
[ 1.052210] dwmac-sun8i 1c30000.ethernet: No regulator found
[ 1.057984] dwmac-sun8i 1c30000.ethernet: PTP uses main clock
[ 1.064221] dwmac-sun8i 1c30000.ethernet: No HW DMA feature register supported
[ 1.071527] dwmac-sun8i 1c30000.ethernet: RX Checksum Offload Engine supported
[ 1.078747] dwmac-sun8i 1c30000.ethernet: COE Type 2
[ 1.083730] dwmac-sun8i 1c30000.ethernet: TX Checksum insertion supported
[ 1.090514] dwmac-sun8i 1c30000.ethernet: Normal descriptors
[ 1.096184] dwmac-sun8i 1c30000.ethernet: Chain mode enabled
[ 1.101867] dwmac-sun8i 1c30000.ethernet: device MAC address d6:56:90:e0:09:09
[ 1.109732] libphy: stmmac: probed
[ 1.114430] dwmac-sun8i 1c30000.ethernet: Found internal PHY node
[ 1.121248] libphy: mdio_mux: probed
[ 1.124869] dwmac-sun8i 1c30000.ethernet: Switch mux to internal PHY
[ 1.131286] dwmac-sun8i 1c30000.ethernet: Powering internal PHY
[ 1.139085] ehci_hcd: USB 2.0 'Enhanced' Host Controller (EHCI) Driver
[ 1.145759] ehci-platform: EHCI generic platform driver
[ 1.151239] ohci_hcd: USB 1.1 'Open' Host Controller (OHCI) Driver
[ 1.157465] ohci-platform: OHCI generic platform driver
[ 1.164161] input: 1c22800.lradc as /devices/platform/soc/1c22800.lradc/input/input0
[ 1.173440] rotary-encoder rotary@0: gray
[ 1.178460] input: rotary@0 as /devices/platform/rotary@0/input/input1
[ 1.187134] sun6i-rtc 1c20400.rtc: registered as rtc0
[ 1.192416] sun6i-rtc 1c20400.rtc: setting system clock to 1970-01-01T01:26:51 UTC (5211)
[ 1.200591] sun6i-rtc 1c20400.rtc: RTC enabled
[ 1.205482] i2c /dev entries driver
[ 1.210476] input: ns2009_ts as /devices/platform/soc/1c2ac00.i2c/i2c-0/0-0048/input/input2
[ 1.220426] Driver for 1-wire Dallas network protocol.
[ 1.227208] sunxi-wdt 1c20ca0.watchdog: Watchdog enabled (timeout=16 sec, nowayout=0)
[ 1.235342] Bluetooth: HCI UART driver ver 2.3
[ 1.239793] Bluetooth: HCI UART protocol H4 registered
[ 1.245041] Bluetooth: HCI UART protocol Three-wire (H5) registered
[ 1.252426] sun8i-v3s-pinctrl 1c20800.pinctrl: supply vcc-pf not found, using dummy regulator
[ 1.263407] sun8i-v3s-pinctrl 1c20800.pinctrl: supply vcc-pg not found, using dummy regulator
[ 1.274623] ledtrig-cpu: registered to indicate activity on CPUs
[ 1.281222] sun4i-ss 1c15000.crypto: Die ID 7
[ 1.288761] usbcore: registered new interface driver usbhid
[ 1.294484] usbhid: USB HID core driver
[ 1.299370] sunxi-mmc 1c0f000.mmc: initialized, max. request size: 16384 KB
[ 1.306740] sunxi-mmc 1c10000.mmc: initialized, max. request size: 16384 KB
[ 1.316119] sun4i-codec 1c22c00.codec: Failed to register our card
[ 1.324501] NET: Registered protocol family 17
[ 1.328998] can: controller area network core
[ 1.333627] NET: Registered protocol family 29
[ 1.338086] can: raw protocol
[ 1.341133] can: broadcast manager protocol
[ 1.345329] can: netlink gateway - max_hops=1
[ 1.350297] Bluetooth: RFCOMM TTY layer initialized
[ 1.355353] Bluetooth: RFCOMM socket layer initialized
[ 1.360538] Bluetooth: RFCOMM ver 1.11
[ 1.364363] Bluetooth: BNEP (Ethernet Emulation) ver 1.3
[ 1.369672] Bluetooth: BNEP filters: protocol multicast
[ 1.374928] Bluetooth: BNEP socket layer initialized
[ 1.379890] Bluetooth: HIDP (Human Interface Emulation) ver 1.2
[ 1.385825] Bluetooth: HIDP socket layer initialized
[ 1.391148] Key type dns_resolver registered
[ 1.395595] Registering SWP/SWPB emulation handler
[ 1.400448] Loading compiled-in X.509 certificates
[ 1.437437] sun4i-drm display-engine: bound 1100000.mixer (ops 0xc097c610)
[ 1.445077] sun4i-drm display-engine: bound 1c0c000.lcd-controller (ops 0xc097891c)
[ 1.453961] [drm] Initialized sun4i-drm 1.0.0 20150629 for display-engine on minor 0
[ 1.465480] sunxi-mmc 1c10000.mmc: card claims to support voltages below defined range
[ 1.475874] mmc1: new high speed SDIO card at address 0001
[ 1.493616] mmc0: host does not support reading read-only switch, assuming write-enable
[ 1.495706] mmc0: new high speed SDHC card at address 0002
[ 1.496918] mmcblk0: mmc0:0002 MSD20 3.73 GiB
[ 1.499651] mmcblk0: p1 p2 p3
[ 1.507412] Console: switching to colour frame buffer device 100x30
[ 1.566756] sun4i-drm display-engine: [drm] fb0: sun4i-drmdrmfb frame buffer device
[ 1.576864] debugfs: Directory '1c22c00.codec' with parent 'V3s Audio Codec' already present!
[ 1.591054] ALSA device list:
[ 1.594055] #0: V3s Audio Codec
[ 1.612781] EXT4-fs (mmcblk0p2): mounted filesystem with ordered data mode. Opts: (null)
[ 1.621158] VFS: Mounted root (ext4 filesystem) on device 179:2.
[ 1.629553] devtmpfs: mounted
[ 1.633946] Freeing unused kernel memory: 1024K
[ 1.638711] Run /sbin/init as init process
[ 1.690069] random: fast init done
[ 1.792914] EXT4-fs (mmcblk0p2): re-mounted. Opts: (null)
Starting syslogd: OK
Starting klogd: OK
Running sysctl: OK
Starting mdev... OK
[ 3.206544] cfg80211: Loading compiled-in X.509 certificates for regulatory database
[ 3.248879] cfg80211: Loaded X.509 cert 'sforshee: 00b28ddf47aef9cea7'
[ 3.258062] platform regulatory.0: Direct firmware load for regulatory.db failed with error -2
[ 3.266896] cfg80211: failed to load regulatory.db
[ 3.359658] 8723ds: module is from the staging directory, the quality is unknown, you have been warned.
Initializing random number generator: OK
Saving random seed: [ 3.742299] random: dd: uninitialized urandom read (512 bytes read)
OK
Starting system message bus: [ 3.812938] random: dbus-uuidgen: uninitialized urandom read (12 bytes read)
[ 3.820155] random: dbus-uuidgen: uninitialized urandom read (8 bytes read)
done
Starting bluetoothd: OK
Starting network: OK
[ 6.200965] random: crng init done
[ 6.204396] random: 3 urandom warning(s) missed due to ratelimiting
Starting sshd: OK
Welcome to Buildroot for the LicheePi Zero
licheepi-zero login:
3. UART2默认速率是9600可以使用cat /dev/ttyS2来测试串口是否正常
4. 使用rtk_hciattach绑定uart端口
rtk_hciattach -n -s 115200 /dev/ttyS2 rtk_h5 &
`注意这个过程需要加载固件才行,如果固件不存在、不匹配或者错误就会失败。需要把固件放到提示的位置`
5. 固件及配置文件加载完后
Realtek Bluetooth :Init Process finished
Realtek Bluetooth post process
Device setup complete
`出现这个说明蓝牙模块初始化完成 此时hci0蓝牙端口已经生成,使用hciconfig工具可以查看端口及状态`
6. hciconfig -a
hci0: Type: Primary Bus: UART
BD Address: 34:20:03:AA:A3:7E ACL MTU: 1021:8 SCO MTU: 255:12
UP RUNNING PSCAN ISCAN
RX bytes:165747 acl:159 sco:0 events:1160 errors:0
TX bytes:16622 acl:158 sco:0 commands:225 errors:0
Features: 0xff 0xff 0xff 0xfe 0xdb 0xfd 0x7b 0x87
Packet type: DM1 DM3 DM5 DH1 DH3 DH5 HV1 HV2 HV3
Link policy: RSWITCH HOLD SNIFF PARK
Link mode: SLAVE ACCEPT
Name: 'Sonavox-BT'
Class: 0x040428
Service Classes: Rendering
Device Class: Audio/Video, HiFi Audio Device
HCI Version: 4.1 (0x7) Revision: 0xaa7a
LMP Version: 4.1 (0x7) Subversion: 0x8cb2
Manufacturer: Realtek Semiconductor Corporation (93)
7. bluealsa -p a2dp-sink &
`建立bluez与alsa之前的桥梁,否则无法播放音频,只能连接上`
8. bluetoothd启动需要加载一些配置文件在/etc/bluetooth/main.conf 不加载也可以
#Default adaper name
#Defaults to 'BlueZ X.YZ'
Name = Sonavox-BT
#Default device class. Only the major and minor device class bits are
#considered. Defaults to '0x000000'.
Class = 0x000428
#How long to stay in discoverable mode before going back to non-discoverable
#The value is in seconds. Default is 180, i.e. 3 minutes.
#0 = disable timer, i.e. stay discoverable forever
DiscoverableTimeout = 0
#How long to stay in pairable mode before going back to non-discoverable
#The value is in seconds. Default is 0.
#0 = disable timer, i.e. stay pairable forever
PairableTimeout = 0
#Automatic connection for bonded devices driven by platform/user events.
#If a platform plugin uses this mechanism, automatic connections will be
#enabled during the interval defined below. Initially, this feature
#intends to be used to establish connections to ATT channels. Default is 60.
AutoConnectTimeout = 60
9. 使用蓝牙界的瑞士军刀bluetoothctl来调试蓝牙
10. 下面是可用的命令
Available commands:
-------------------
advertise Advertise Options Submenu
scan Scan Options Submenu
gatt Generic Attribute Submenu
list List available controllers
show [ctrl] Controller information
select <ctrl> Select default controller
devices List available devices
paired-devices List paired devices
system-alias <name> Set controller alias
reset-alias Reset controller alias
power <on/off> Set controller power
pairable <on/off> Set controller pairable mode
discoverable <on/off> Set controller discoverable mode
discoverable-timeout [value] Set discoverable timeout
agent <on/off/capability> Enable/disable agent with given capability
default-agent Set agent as the default one
advertise <on/off/type> Enable/disable advertising with given type
set-alias <alias> Set device alias
scan <on/off> Scan for devices
info [dev] Device information
pair [dev] Pair with device
cancel-pairing [dev] Cancel pairing with device
trust [dev] Trust device
untrust [dev] Untrust device
block [dev] Block device
unblock [dev] Unblock device
remove <dev> Remove device
connect <dev> Connect device
disconnect [dev] Disconnect device
menu <name> Select submenu
version Display version
quit Quit program
exit Quit program
help Display help about this program
export Print environment variables
11. 操作记录如下: trust dev 之后,再连接就不再提示密码了,直接连接上
[bluetooth]# discoverable on
Changing discoverable on succeeded
[bluetooth]# pairable on
Changing pairable on succeeded
[CHG] Device D8:8F:76:51:A7:87 Connected: yes
Request confirmation
[agent] Confirm passkey 151930 (yes/no): yes
Authorize service
[agent] Authorize service 0000110d-0000-1000-8000-00805f9b34fb (yes/no):
[CHG] Device D8:8F:76:51:A7:87 ServicesResolved: yes
[agent] Authorize service 0000110d-0000-1000-8000-00805f9b34fb (yes/no): yes
Authorize service
[agent] Authorize service 0000110e-0000-1000-8000-00805f9b34fb (yes/no): yes
[ 2681.328397] input: iPhone (AVRCP) as /devices/virtual/input/#input5
[iPhone]# list
Controller 34:20:03:AA:A3:7E Sonavox-BT [default]
[iPhone]# devices
Device D8:8F:76:51:A7:87 iPhone
[iPhone]# info
Device D8:8F:76:51:A7:87 (public)
Name: iPhone
Alias: iPhone
Class: 0x007a020c
Icon: phone
Paired: yes
Trusted: no
Blocked: no
Connected: yes
LegacyPairing: no
UUID: Vendor specific (00000000-deca-fade-deca-deafdecacafe)
UUID: Service Discovery Serve.. (00001000-0000-1000-8000-00805f9b34fb)
UUID: Audio Source (0000110a-0000-1000-8000-00805f9b34fb)
UUID: A/V Remote Control Target (0000110c-0000-1000-8000-00805f9b34fb)
UUID: Advanced Audio Distribu.. (0000110d-0000-1000-8000-00805f9b34fb)
UUID: A/V Remote Control (0000110e-0000-1000-8000-00805f9b34fb)
UUID: NAP (00001116-0000-1000-8000-00805f9b34fb)
UUID: Handsfree Audio Gateway (0000111f-0000-1000-8000-00805f9b34fb)
UUID: Phonebook Access Server (0000112f-0000-1000-8000-00805f9b34fb)
UUID: Message Access Server (00001132-0000-1000-8000-00805f9b34fb)
UUID: PnP Information (00001200-0000-1000-8000-00805f9b34fb)
UUID: Generic Access Profile (00001800-0000-1000-8000-00805f9b34fb)
UUID: Generic Attribute Profile (00001801-0000-1000-8000-00805f9b34fb)
UUID: Current Time Service (00001805-0000-1000-8000-00805f9b34fb)
UUID: Device Information (0000180a-0000-1000-8000-00805f9b34fb)
UUID: Battery Service (0000180f-0000-1000-8000-00805f9b34fb)
UUID: Vendor specific (02030302-1d19-415f-86f2-22a2106a0a77)
UUID: Vendor specific (7905f431-b5ce-4e99-a40f-4b1e122d00d0)
UUID: Vendor specific (89d3502b-0f36-433a-8ef4-c502ad55f8dc)
UUID: Vendor specific (9fa480e0-4967-4542-9390-d343dc5d04ae)
UUID: Vendor specific (d0611e78-bbb4-4591-a5f8-487910ae4366)
Modalias: bluetooth:v004Cp710Cd0E70
Battery Percentage: 0x55 (85)
[iPhone]# quit
# cat /proc/bus/input/devices
I: Bus=0019 Vendor=0001 Product=0001 Version=0100
N: Name="1c22800.lradc"
P: Phys=sun4i_lradc/input0
S: Sysfs=/devices/platform/soc/1c22800.lradc/input/input0
U: Uniq=
H: Handlers=kbd event0
B: PROP=0
B: EV=3
B: KEY=3 0 0 0 0 0 0 0 c0000 0 0 0
I: Bus=0019 Vendor=0000 Product=0000 Version=0000
N: Name="rotary@0"
P: Phys=
S: Sysfs=/devices/platform/rotary@0/input/input1
U: Uniq=
H: Handlers=event1
B: PROP=0
B: EV=5
B: REL=1
I: Bus=0018 Vendor=0000 Product=0000 Version=0000
N: Name="ns2009_ts"
P: Phys=input/ts
S: Sysfs=/devices/platform/soc/1c2ac00.i2c/i2c-0/0-0048/input/input2
U: Uniq=
H: Handlers=event2
B: PROP=0
B: EV=b
B: KEY=400 0 0 0 0 0 0 0 0 0 0
B: ABS=3
I: Bus=0005 Vendor=004c Product=710c Version=0e70
N: Name="iPhone (AVRCP)"
P: Phys=34:20:03:aa:a3:7e
S: Sysfs=/devices/virtual/input/input5
U: Uniq=
H: Handlers=kbd event3
B: PROP=0
B: EV=100007
B: KEY=2fc800 1452 0 0 0 0 10300 49e8 c00 e1680 f f8100000 10000ffc
B: REL=0
12. 通过AVRCP来控制手机上一曲,下一曲等 https://git.kernel.org/pub/scm/bluetooth/bluez.git/tree/doc/media-api.txt
`注意这里的蓝牙地址是你手机的,不是蓝牙模块的,因为要控制的是你的手机进行一一曲,下一曲的,地址不对会提示错误,就是这个原因,另外我测试除了不能调节音量外,其它的都能控制,不知道为什么?`
Error org.freedesktop.DBus.Error.UnknownObject: Method "Previous" with signature "" on interface "org.bluez.MediaControl1" doesn't exist
# dbus-send --system --print-reply --dest=org.bluez /org/bluez/hci0/dev_D8_8F_76_51_A7_87 org.bluez.MediaControl1.Pause
# dbus-send --system --print-reply --dest=org.bluez /org/bluez/hci0/dev_D8_8F_76_51_A7_87 org.bluez.MediaControl1.Play
# dbus-send --system --print-reply --dest=org.bluez /org/bluez/hci0/dev_D8_8F_76_51_A7_87 org.bluez.MediaControl1.Previous
# dbus-send --system --print-reply --dest=org.bluez /org/bluez/hci0/dev_D8_8F_76_51_A7_87 org.bluez.MediaControl1.Next
# dbus-send --system --print-reply --dest=org.bluez /org/bluez/hci0/dev_D8_8F_76_51_A7_87 org.bluez.MediaControl1.VolumeUp
# dbus-send --system --print-reply --dest=org.bluez /org/bluez/hci0/dev_D8_8F_76_51_A7_87 org.bluez.MediaControl1.VolumeDown
以下返回结果,可以看到"org.bluez.MediaControl1"已经注册了,但是提示已废弃,新的方法是"org.bluez.MediaPlay1",但是我这里用不了
<node>
<interface name="org.freedesktop.DBus.Introspectable">
<method name="Introspect">
<arg name="xml" type="s" direction="out"/>
</method>
</interface>
<interface name="org.bluez.Device1">
<method name="Disconnect"></method>
<method name="Connect"></method>
<method name="ConnectProfile">
<arg name="UUID" type="s" direction="in"/>
</method>
<method name="DisconnectProfile">
<arg name="UUID" type="s" direction="in"/>
</method>
<method name="Pair"></method>
<method name="CancelPairing"></method>
<property name="Address" type="s" access="read"></property>
<property name="AddressType" type="s" access="read"></property>
<property name="Name" type="s" access="read"></property>
<property name="Alias" type="s" access="readwrite"></property>
<property name="Class" type="u" access="read"></property>
<property name="Appearance" type="q" access="read"></property>
<property name="Icon" type="s" access="read"></property>
<property name="Paired" type="b" access="read"></property>
<property name="Trusted" type="b" access="readwrite"></property>
<property name="Blocked" type="b" access="readwrite"></property>
<property name="LegacyPairing" type="b" access="read"></property>
<property name="RSSI" type="n" access="read"></property>
<property name="Connected" type="b" access="read"></property>
<property name="UUIDs" type="as" access="read"></property>
<property name="Modalias" type="s" access="read"></property>
<property name="Adapter" type="o" access="read"></property>
<property name="ManufacturerData" type="a{qv}" access="read"></property>
<property name="ServiceData" type="a{sv}" access="read"></property>
<property name="TxPower" type="n" access="read"></property>
<property name="ServicesResolved" type="b" access="read"></property>
<property name="WakeAllowed" type="b" access="readwrite"></property>
</interface>
<interface name="org.freedesktop.DBus.Properties">
<method name="Get">
<arg name="interface" type="s" direction="in"/>
<arg name="name" type="s" direction="in"/>
<arg name="value" type="v" direction="out"/>
</method>
<method name="Set">
<arg name="interface" type="s" direction="in"/>
<arg name="name" type="s" direction="in"/>
<arg name="value" type="v" direction="in"/>
</method>
<method name="GetAll">
<arg name="interface" type="s" direction="in"/>
<arg name="properties" type="a{sv}" direction="out"/>
</method>
<signal name="PropertiesChanged">
<arg name="interface" type="s"/>
<arg name="changed_properties" type="a{sv}"/>
<arg name="invalidated_properties" type="as"/>
</signal>
</interface>
<interface name="org.bluez.Network1">
<method name="Connect">
<arg name="uuid" type="s" direction="in"/>
<arg name="interface" type="s" direction="out"/>
</method>
<method name="Disconnect"></method>
<property name="Connected" type="b" access="read"></property>
<property name="Interface" type="s" access="read"></property>
<property name="UUID" type="s" access="read"></property>
</interface>
<interface name="org.bluez.MediaControl1">
<method name="Play">
<annotation name="org.freedesktop.DBus.Deprecated" value="true"/>
</method>
<method name="Pause">
<annotation name="org.freedesktop.DBus.Deprecated" value="true"/>
</method>
<method name="Stop">
<annotation name="org.freedesktop.DBus.Deprecated" value="true"/>
</method>
<method name="Next">
<annotation name="org.freedesktop.DBus.Deprecated" value="true"/>
</method>
<method name="Previous">
<annotation name="org.freedesktop.DBus.Deprecated" value="true"/>
</method>
<method name="VolumeUp">
<annotation name="org.freedesktop.DBus.Deprecated" value="true"/>
</method>
<method name="VolumeDown">
<annotation name="org.freedesktop.DBus.Deprecated" value="true"/>
</method>
<method name="FastForward">
<annotation name="org.freedesktop.DBus.Deprecated" value="true"/>
</method>
<method name="Rewind">
<annotation name="org.freedesktop.DBus.Deprecated" value="true"/>
</method>
<property name="Connected" type="b" access="read"></property>
<property name="Player" type="o" access="read"></property>
</interface>
<interface name="org.bluez.Battery1">
<property name="Percentage" type="y" access="read"></property>
</interface>
<node name="fd1"/>
<node name="player2"/>
<node name="sep1"/>
<node name="sep2"/>
<node name="sep3"/>
<node name="sep4"/>
<node name="sep5"/>
<node name="sep6"/>
<node name="service0006"/>
<node name="service000a"/>
<node name="service000f"/>
<node name="service0014"/>
<node name="service0018"/>
<node name="service001e"/>
<node name="service0023"/>
<node name="service002d"/>
</node>"
13. 另外在蓝牙连接成功时会在/dev/input/目录下注册一个event3
I: Bus=0005 Vendor=004c Product=710c Version=0e70
N: Name="iPhone (AVRCP)"
P: Phys=34:20:03:aa:a3:7e
S: Sysfs=/devices/virtual/input/input5
U: Uniq=
H: Handlers=kbd event3
B: PROP=0
B: EV=100007
B: KEY=2fc800 1452 0 0 0 0 10300 49e8 c00 e1680 f f8100000 10000ffc
B: REL=0
我偿试过使用sendevent 去操作/dev/input/event3 但是没有任何反应,不知道能不能这样操作?
# ./sendevent /dev/input/event3 1 116 1
# ./sendevent /dev/input/event3 0 0 0
# ./sendevent /dev/input/event3 1 114 1
14. 至此,BLUETOOTH,DLNA,AIRPLAYER都可以通过Alsa声卡一起同时播放了
我也碰到了UART0无输出问题,我的板子可以 sunxi-fel 烧录,然后就没有然后了
xfdr@virtualbox:~/桌面/v3s_s3_fel_autorun_linux$ sudo sunxi-fel -p uboot u-boot-sunxi-with-spl.bin write 0x41000000 zImage write 0x41800000 sun8i-v3s-licheepi-zero-dock.dtb write 0x41900000 boot_fel_initrd.scr write 0x41A00000 rootfs.cpio.gz.uImage
[sudo] xfdr 的密码:
100% [================================================] 4195 kB, 446.0 kB/s
100% [================================================] 11 kB, 230.5 kB/s
100% [================================================] 0 kB, 8.5 kB/s
100% [================================================] 5185 kB, 447.8 kB/s
我手上有十几块全志A20的板子 ZK-A201AD200全志A20.pdf
可以提供给你两块 把折腾的过程记录下来就可以了 冒昧了
楼主,有链接吗? 买一块来研究学习一下
xfdr0805 说:luott 说:亲爱的楼主分享下v3s的lvgl8工程可以吗
可以,不过我上传总是提示不允许的类型,不知道怎么回事,
我也是根据本坛 https://whycan.com/t_2303.html 来进行修改的请问是什么后缀名文件呢?
tar或tar.xz
移植8.0到 STM32H750会进入HardFault_Handler, 在lv_refr.c的138行出问题,具体原因没找到
https://whycan.com/files/members/2275/微信截图_20210622112255.png
有没有哪位大佬比较熟悉,看是啥原因,
不懂,帮不上你
亲爱的楼主分享下v3s的lvgl8工程可以吗
可以,不过我上传总是提示不允许的类型,不知道怎么回事,
我也是根据本坛 https://whycan.com/t_2303.html 来进行修改的
此项目包含完整代码及原理图,使用W5500通过SPI连接,里边有MODBUS 主站,从站,webserver tcpserver,can
这个配置界面就一个比较简单,webpage采用了gzip压缩,参数都是POST 采用Ajax传递,参数解析本来是用cJSON的,后来取消了,自己定义数据来解析的,MCU内存只有20KB,太小了
(PS:开始玩Licheepi有几个月了,现在感觉V3S 64M内存好大,都不知道咋用了)
项目里RS485可以与MODBUS TCP 做为从机一起同时使用,演示见下图:
v8.0 带来了许多新功能,如简化和更强大的滚动,新的布局灵感来自CSS Flexbox和网格,简化和改进的小部件,更强大的事件,可上钩的绘图,等等。
v8是一个重大的变化,因此它不是向后兼容v7。
详情: https://blog.lvgl.io/2021-06-01/release_v8.0.0
LVGL-7:
LVGL-8:
LVGL8模拟器: win10 x64 编译
LVGL.Simulator.rar
再推荐一个3D模型的网站: https://grabcad.com/library
之前MCU我知道是从TCP获取到数据后,获取到ContentLength后,直接从\r\n\r\n处获取数据就可以了,现在在linux中是通过stdin获取的,能获取到长度,但是内容却获取不知道,不知道是什么原因
#include <stdio.h>
#include <stdlib.h>
int main(void)
{
long len;
char *lenstr, poststr[256];
lenstr = getenv("CONTENT_LENGTH");
// if(lenstr == NULL || len > MAXLEN)
if (lenstr == NULL)
printf("<P>表单提交错误.");
else
{
len = atoi(lenstr);
printf("data len:--->%d", len);
fgets(poststr, len + 1, stdin);
printf("post data:--->%s", poststr);
}
return 0;
}
2021-05-13更新
打的PCB回来了,不过料还没配齐,准备周末焊接一下。
https://makingfun.oss-cn-qingdao.aliyuncs.com/linux/F1C100S/PCB-FRONT-NO-CASE.jpg
https://makingfun.oss-cn-qingdao.aliyuncs.com/linux/F1C100S/PCB-FRONT-WITH-CASE.jpg(还没开始焊接就已经发现一些问题了,还是太菜了
看起来不是挻好的嘛?
确实是这个,记错了,顺道向大神学习一下
用 00:11:22:33:44:55 吧,
或这样
/* OUI 00-80-E1 STMICROELECTRONICS. */ stm32_eth_device.dev_addr[0] = 0x00; stm32_eth_device.dev_addr[1] = 0x80; stm32_eth_device.dev_addr[2] = 0xE1; /* generate MAC addr from 96bit unique ID (only for test). */ stm32_eth_device.dev_addr[3] = *(rt_uint8_t *)(UID_BASE + 4); stm32_eth_device.dev_addr[4] = *(rt_uint8_t *)(UID_BASE + 2); stm32_eth_device.dev_addr[5] = *(rt_uint8_t *)(UID_BASE + 0);
建议直接用 devmem 读写寄存器测试,看是不是驱动程序有bug?
仔细看了下输出内容,有下边2话
[ 0.070763] pwm-backlight backlight: supply power not found, using dummy regulator
[ 0.071204] pwm-backlight backlight: invalid default brightness level: 80, using 10
设备树直接改成这样
backlight: backlight {
compatible = "pwm-backlight";
pwms = <&pwm 0 1000000 0>;
brightness-levels = <0 10 20 30 40 50 60 70 80 90 100>;
default-brightness-level = <80>;
power-supply = <®_vcc3v3>;
enable-gpios = <&pio 1 4 0>;
post-pwm-on-delay-ms = <10>;
pwm-off-delay-ms = <10>;
};
# ls /sys/class/backlight/backlight/
actual_brightness device scale uevent
bl_power max_brightness subsystem
brightness power type
# echo 1 > /sys/class/backlight/backlight/bl_power 可以关闭背光
# echo 0 > /sys/class/backlight/backlight/bl_power 可以打开背光
# echo 6 > /sys/class/backlight/backlight/brightness 最大为6,设备树定义的没生效?
# echo 7 > /sys/class/backlight/backlight/brightness
sh: write error: Invalid argument
# cat /sys/class/backlight/backlight/max_brightness
6
设备树:
backlight: backlight {
compatible = "pwm-backlight";
pwms = <&pwm 0 1000000 0>;
brightness-levels = <0 30 40 50 60 70 100>;
default-brightness-level = <100>;
};