有人试过6.6内核吗, 现在用6.6别的都正常, 就差声卡了. 打了Mesih Kilinc的补丁, 声卡设备是认了, 但是没有声音出, 没有头绪了.
buildroot-tiny200 (F1C100/200s) 开发包近期更新内容 * 已支持DVP摄像头 *,支持SPI NAND
https://whycan.com/t_5221.html
可以先用这个测试
下载需要积分 怎么获得积分呢?
ubuntu@ubuntu:/opt$
ubuntu@ubuntu:/opt$ cat /etc/issue
Ubuntu 22.04.3 LTS \n \l
ubuntu@ubuntu:/opt$
ubuntu@ubuntu:/opt$
ubuntu@ubuntu:/opt$ export |grep UTF-8
declare -x LANG="en_US.UTF-8"
declare -x LC_ADDRESS="zh_CN.UTF-8"
declare -x LC_IDENTIFICATION="zh_CN.UTF-8"
declare -x LC_MEASUREMENT="zh_CN.UTF-8"
declare -x LC_MONETARY="zh_CN.UTF-8"
declare -x LC_NAME="zh_CN.UTF-8"
declare -x LC_NUMERIC="zh_CN.UTF-8"
declare -x LC_PAPER="zh_CN.UTF-8"
declare -x LC_TELEPHONE="zh_CN.UTF-8"
declare -x LC_TIME="zh_CN.UTF-8"
ubuntu@ubuntu:/opt$
ubuntu@ubuntu:/opt$
ubuntu@ubuntu:/opt$
ubuntu@ubuntu:/opt$ ls /mnt/hgfs/D/*.txt -l
-rwxrwxrwx 1 root root 6853 8月 14 21:51 /mnt/hgfs/D/1.txt
-rwxrwxrwx 1 root root 27295 8月 14 21:52 /mnt/hgfs/D/2.txt
-rwxrwxrwx 1 root root 2348 8月 14 22:02 /mnt/hgfs/D/3.txt
-rwxrwxrwx 1 root root 3317 8月 14 22:02 /mnt/hgfs/D/4.txt
-rwxrwxrwx 1 root root 16537 8月 13 09:17 /mnt/hgfs/D/5.txt
-rwxrwxrwx 1 root root 66847 7月 14 21:09 /mnt/hgfs/D/t113_i_nezha_error.txt
-rwxrwxrwx 1 root root 34186 7月 14 20:51 /mnt/hgfs/D/t113_s3_sw113_error.txt
-rwxrwxrwx 1 root root 39927 7月 14 20:53 /mnt/hgfs/D/t113_s3_sw113_ok.txt
-rwxrwxrwx 1 root root 923 7月 13 15:56 /mnt/hgfs/D/test.txt
-rwxrwxrwx 1 root root 0 6月 3 17:21 /mnt/hgfs/D/中国.txt
-rwxrwxrwx 1 root root 13826 8月 5 11:27 '/mnt/hgfs/D/新文件 24.txt'
-rwxrwxrwx 1 root root 35635 8月 5 11:27 '/mnt/hgfs/D/新文件 25.txt'
-rwxrwxrwx 1 root root 37255 8月 5 11:36 '/mnt/hgfs/D/新文件 26.txt'
-rwxrwxrwx 1 root root 87707 8月 5 11:55 '/mnt/hgfs/D/新文件 27.txt'
-rwxrwxrwx 1 root root 93467 8月 5 11:57 '/mnt/hgfs/D/新文件 28.txt'
-rwxrwxrwx 1 root root 35862 8月 5 12:21 '/mnt/hgfs/D/新文件 29.txt'
ubuntu@ubuntu:/opt$
ubuntu@ubuntu:/opt$
"en_US.UTF-8" 不应该是 "zh_CN.UTF-8" 吗?
应该是主线linux吧,uname -a 的output:
Linux orangepi3-lts 5.10.75-sun50iw6 #2.2.2 SMP Wed Apr 20 09:45:07 CST 2022 aarch64 aarch64 aarch64 GNU/Linux
参考这个看看:请问下主线 V3s Linux 如何在程序运行中自动切换USB模式: otg/host/peripheral
不能贴图吗?
如何在本站发图片
https://whycan.com/t_588.html
我说的就是这意思啊,为啥不把tf卡芯片封装成卡座那种9针的,直接往卡座上一焊就行了,这些厂家非要自己搞个两排八脚的封装出来,通用性差了十万八千里,搞成通用封装所有的产品只要把卡座拆掉,都不用改板子
每个用户需求不同,可以考虑自己做一个转接板,类似这种:
设计一片 SD NAND + JTAG(全志soc) 转接板 [切记切记0.8mm厚度]
https://whycan.com/t_2025.html
改成半孔的
这是A523 ddr调整方法:
1. 查看DDR频点
a523-pro:/ # cat /sys/class/devfreq/3120000.dmcfreq/available_frequencies
154000000 528000000 739200000 924000000
2. 查看实时频率参数的节点
echo 1 > /sys/module/sun55iw3_devfreq/parameters/dbg_level
或者
echo > 1 /sys/module/ccu_ddr/parameters/dbg_level
如果还是找不到,就到/sys/module/下find -name dbg_level找到具体的路径执行echo 1即可
响应的串口打印[ 434.856467][ T496] drate:154M load:57 rw:705M total:1232M
[ 434.870411][ T496] drate:154M load:55 rw:684M total:1232M
[ 434.889498][ T496] drate:154M load:42 rw:521M total:1232M
[ 434.899553][ T496] drate:154M load:62 rw:771M total:1232M
[ 434.909495][ T496] drate:154M load:41 rw:506M total:1232M
可以看到当前的DDR频率是154MHz
T113芯片可能不支持
https://whycan.cn/t_542.html#p12585
找到 /etc/inittab 文件的
console::respawn:/sbin/getty -L console 0 vt100 # GENERIC_SERIAL
修改为:
console::respawn:-/bin/sh
重启后就没有恼人的 login 提示了.
这里有个问题,会导致没有加载用户配置,没有$HOME 环境变量。
改成这样:
console::respawn:/bin/login -f root
解决$HOME环境变量问题。
# export
export EDITOR='/bin/vi'
export HOME='/root'
export LOGNAME='root'
export PATH='/bin:/sbin:/usr/bin:/usr/sbin'
export PS1='# '
export PWD='/root'
export SHELL='/bin/sh'
export SHLVL='1'
export TERM='vt102'
export USER='root'
#
https://whycan.com/files/members/14964/sshot-1.png
晕哥编译v3s的uboot的时候有遇到过這个问题吗?
没记错的话,binman 是一个 python2.x 版本,先检查一下 python2.7 有没有安装?或者看下 /usr/bin/python 是不是软链接到 python3.x 了?
参考这个帖子:d1 lvds dual
首先在dts中配置lvds1的gpio,大致是下面这样的
lvds1_pins_a: lvds1@0 {
pins = "PD10", "PD11", "PD12", "PD13", "PD14", "PD15", "PD16", "PD17", "PD18", "PD19";
function = "lvds1";
drive-strength = <30>;
bias-disable;
};
lvds1_pins_b: lvds1@1 {
pins = "PD10", "PD11", "PD12", "PD13", "PD14", "PD15", "PD16", "PD17", "PD18", "PD19";
function = "io_disabled";
drive-strength = <30>;
bias-disable;
};
然后在dts中配置dual lvds,主要是lcd_lvds_if与pinctrl-0
&lcd0 {
lcd_used = <1>;
lcd_driver_name = "default_lcd";
lcd_backlight = <50>;
lcd_if = <3>;
lcd_x = <640>;
lcd_y = <2560>;
lcd_width = <150>;
lcd_height = <94>;
lcd_dclk_freq = <117>;
lcd_pwm_used = <0>;
lcd_pwm_ch = <7>;
lcd_pwm_freq = <50000>;
lcd_pwm_pol = <1>;
lcd_pwm_max_limit = <255>;
lcd_hbp = <40>;
lcd_ht = <720>;
lcd_hspw = <20>;
lcd_vbp = <20>;
lcd_vt = <2600>;
lcd_vspw = <10>;
lcd_lvds_if = <1>;
lcd_lvds_colordepth = <0>;
lcd_lvds_mode = <0>;
lcd_frm = <0>;
lcd_hv_clk_phase = <0>;
lcd_hv_sync_polarity= <0>;
lcd_gamma_en = <0>;
lcd_bright_curve_en = <0>;
lcd_cmap_en = <0>;
deu_mode = <0>;
lcdgamma4iep = <22>;
smart_color = <90>;
pinctrl-0 = <&lvds0_pins_a &lvds1_pins_a>;
pinctrl-1 = <&lvds0_pins_b &lvds1_pins_b>;
};
把20条腿都复用为LVDS:
pinctrl-0 = <&lvds0_pins_a &lvds1_pins_a>;
驱动配置为双8:
lcd_lvds_if = <1>;
Linux启动后查看引脚复用状态:
# cat /sys/kernel/debug/pinctrl/pio/pinmux-pins
Pinmux settings per pin
Format: pin (name): mux_owner|gpio_owner (strict) hog?
pin 32 (PB0): device 2502800.twi function gpio_in group PB0
pin 33 (PB1): device 2502800.twi function gpio_in group PB1
pin 34 (PB2): UNCLAIMED
pin 35 (PB3): UNCLAIMED
pin 36 (PB4): UNCLAIMED
pin 37 (PB5): UNCLAIMED
pin 38 (PB6): UNCLAIMED
pin 39 (PB7): UNCLAIMED
pin 40 (PB8): device 2500000.uart function uart0 group PB8
pin 41 (PB9): device 2500000.uart function uart0 group PB9
pin 42 (PB10): GPIO pio:42
pin 43 (PB11): GPIO pio:43
pin 44 (PB12): GPIO pio:44
pin 64 (PC0): device 2008000.ledc function ledc group PC0
pin 65 (PC1): UNCLAIMED
pin 66 (PC2): device 4025000.spi function spi0 group PC2
pin 67 (PC3): device 4025000.spi function spi0 group PC3
pin 68 (PC4): device 4025000.spi function spi0 group PC4
pin 69 (PC5): device 4025000.spi function spi0 group PC5
pin 70 (PC6): device 4025000.spi function spi0 group PC6
pin 71 (PC7): device 4025000.spi function spi0 group PC7
pin 96 (PD0): UNCLAIMED
pin 97 (PD1): UNCLAIMED
pin 98 (PD2): UNCLAIMED
pin 99 (PD3): UNCLAIMED
pin 100 (PD4): UNCLAIMED
pin 101 (PD5): UNCLAIMED
pin 102 (PD6): UNCLAIMED
pin 103 (PD7): UNCLAIMED
pin 104 (PD8): UNCLAIMED
pin 105 (PD9): UNCLAIMED
pin 106 (PD10): UNCLAIMED
pin 107 (PD11): UNCLAIMED
pin 108 (PD12): UNCLAIMED
pin 109 (PD13): UNCLAIMED
pin 110 (PD14): UNCLAIMED
pin 111 (PD15): UNCLAIMED
pin 112 (PD16): UNCLAIMED
pin 113 (PD17): UNCLAIMED
pin 114 (PD18): UNCLAIMED
pin 115 (PD19): UNCLAIMED
pin 116 (PD20): UNCLAIMED
pin 117 (PD21): UNCLAIMED
pin 118 (PD22): UNCLAIMED
pin 128 (PE0): device 4500000.eth function gmac0 group PE0
pin 129 (PE1): device 4500000.eth function gmac0 group PE1
pin 130 (PE2): device 4500000.eth function gmac0 group PE2
pin 131 (PE3): device 4500000.eth function gmac0 group PE3
pin 132 (PE4): device 4500000.eth function gmac0 group PE4
pin 133 (PE5): device 4500000.eth function gmac0 group PE5
pin 134 (PE6): device 4500000.eth function gmac0 group PE6
pin 135 (PE7): device 4500000.eth function gmac0 group PE7
pin 136 (PE8): device 4500000.eth function gmac0 group PE8
pin 137 (PE9): device 4500000.eth function gmac0 group PE9
pin 138 (PE10): device 4500000.eth function gmac0 group PE10
pin 139 (PE11): device 4500000.eth function gmac0 group PE11
pin 140 (PE12): device 4500000.eth function gmac0 group PE12
pin 141 (PE13): device 4500000.eth function gmac0 group PE13
pin 142 (PE14): device 4500000.eth function gmac0 group PE14
pin 143 (PE15): device 4500000.eth function gmac0 group PE15
pin 144 (PE16): GPIO pio:144
pin 145 (PE17): UNCLAIMED
pin 160 (PF0): device 4020000.sdmmc function sdc0 group PF0
pin 161 (PF1): device 4020000.sdmmc function sdc0 group PF1
pin 162 (PF2): device 4020000.sdmmc function sdc0 group PF2
pin 163 (PF3): device 4020000.sdmmc function sdc0 group PF3
pin 164 (PF4): device 4020000.sdmmc function sdc0 group PF4
pin 165 (PF5): device 4020000.sdmmc function sdc0 group PF5
pin 166 (PF6): GPIO pio:166
pin 192 (PG0): device 4021000.sdmmc function sdc1 group PG0
pin 193 (PG1): device 4021000.sdmmc function sdc1 group PG1
pin 194 (PG2): device 4021000.sdmmc function sdc1 group PG2
pin 195 (PG3): device 4021000.sdmmc function sdc1 group PG3
pin 196 (PG4): device 4021000.sdmmc function sdc1 group PG4
pin 197 (PG5): device 4021000.sdmmc function sdc1 group PG5
pin 198 (PG6): device 2500400.uart function uart1 group PG6
pin 199 (PG7): device 2500400.uart function uart1 group PG7
pin 200 (PG8): device 2500400.uart function uart1 group PG8
pin 201 (PG9): device 2500400.uart function uart1 group PG9
pin 202 (PG10): GPIO pio:202
pin 203 (PG11): device soc@3000000:rfkill@0 function clk_fanout1 group PG11
pin 204 (PG12): GPIO pio:204
pin 205 (PG13): UNCLAIMED
pin 206 (PG14): UNCLAIMED
pin 207 (PG15): GPIO pio:207
pin 208 (PG16): GPIO pio:208
pin 209 (PG17): GPIO pio:209
pin 210 (PG18): GPIO pio:210
如果文件/sys/kernel/debug/pinctrl/pio/pinmux-pins不存在,先执行这个命令:
mount -t debugfs none /sys/kernel/debug;
晕哥 说:建议用日志型(ext4,jffs2...)的文件系统,按时间段分文件存储。
如果没有后备电池和断电检测,做好最后一个文件阵亡的心理准备。
我这不是linux系统啊,是rtt,目前看sdk里默认打开了fatfs和littlefs。
那建议优先使用Littlefs文件系统,按时间段分文件存储。
LittleFS 是一种日志结构化的文件系统。它结合了日志结构(log-structured)文件系统和Copy-on-Write (COW)文件系统的特点。在日志结构的文件系统中,新的数据总是被写入到空闲或新分配的空间中,而不是直接覆盖旧的数据,这有助于减少对闪存介质的磨损并提供更好的掉电恢复能力。
大概是 g2d_driver_enh.h 这个头文件与驱动不匹配,检查一下
参考:LVGL8打开G2D报错
用这个:
(V3s/V3x/S3/S3L/R11通吃)小智V3x开发板smallwitpi lite u-boot/linux/buildroot测试
https://whycan.com/t_7248.html
改大这个初始化参数试一试: VideoConf.nVbvBufferSize
if(Decoder->ScaleDownEn > 0){
VideoConf.nVbvBufferSize = 1*1024*1024;
VideoConf.bScaleDownEn = 1;
VideoConf.nHorizonScaleDownRatio = 1;
VideoConf.nVerticalScaleDownRatio = 1;
}
VideoConf.eOutputPixelFormat = Decoder->decode_format;
VideoConf.nDeInterlaceHoldingFrameBufferNum = GetConfigParamterInt("pic_4di_num", 2);
VideoConf.nDisplayHoldingFrameBufferNum = GetConfigParamterInt("pic_4list_num", 3);
VideoConf.nRotateHoldingFrameBufferNum = GetConfigParamterInt("pic_4rotate_num", 0);
VideoConf.nDecodeSmoothFrameBufferNum = GetConfigParamterInt("pic_4smooth_num", 3);
VideoConf.memops = Decoder->memops;
nRet = InitializeVideoDecoder(Decoder->pVideoDec, &VideoInfo, &VideoConf);
设计一片 SD NAND + JTAG(全志soc) 转接板 [切记切记0.8mm厚度]
https://whycan.com/t_2025.html
malloc ok, count=146
malloc ok, count=147
malloc ok, count=148
malloc ok, count=149
malloc ok, count=150
malloc ok, count=151
malloc ok, count=152
malloc ok, count=153
[ 216.137338] mem_test invoked oom-killer: gfp_mask=0x24200ca(GFP_HIGHUSER_MOVABLE), nodemask=0, order=0, oom_score_adj=0
[ 216.150768] CPU: 0 PID: 1703 Comm: mem_test Not tainted 4.9.118 #183
[ 216.164815] Hardware name: sun8iw8
[ 216.168650] [<c010c7cc>] (unwind_backtrace) from [<c010a6f4>] (show_stack+0x10/0x14)
[ 216.179140] [<c010a6f4>] (show_stack) from [<c01da458>] (dump_header.constprop.3+0x64/0x1ac)
[ 216.190381] [<c01da458>] (dump_header.constprop.3) from [<c01975a4>] (oom_kill_process+0xec/0x4a8)
[ 216.208704] [<c01975a4>] (oom_kill_process) from [<c0197e28>] (out_of_memory+0x348/0x3f0)
[ 216.217901] [<c0197e28>] (out_of_memory) from [<c019c0ec>] (__alloc_pages_nodemask+0x950/0xa28)
[ 216.234830] [<c019c0ec>] (__alloc_pages_nodemask) from [<c01ba94c>] (handle_mm_fault+0x140/0xb70)
[ 216.245960] [<c01ba94c>] (handle_mm_fault) from [<c010ec34>] (do_page_fault+0x210/0x2a8)
[ 216.256745] [<c010ec34>] (do_page_fault) from [<c01012d4>] (do_DataAbort+0x38/0xb8)
[ 216.271863] [<c01012d4>] (do_DataAbort) from [<c010b39c>] (__dabt_usr+0x3c/0x40)
[ 216.281845] Exception stack(0xc2393fb0 to 0xc2393ff8)
[ 216.294763] 3fa0: ad371010 00006b7f ad448028 00007fff
[ 216.304956] 3fc0: 00000000 00000000 00000000 00000000 00000001 00000000 00000020 beda4e34
[ 216.316019] 3fe0: ad37101c beda4df0 00000000 b6f72774 20000010 ffffffff
[ 216.330038] [ pid ] uid tgid total_vm rss nr_ptes nr_pmds swapents oom_score_adj name
[ 216.341363] [ 720] 0 720 330 1 4 0 6 0 syslogd
[ 216.359483] [ 724] 0 724 329 1 4 0 6 0 klogd
[ 216.369134] [ 736] 0 736 333 1 5 0 13 0 mdev
[ 216.383525] [ 780] 0 780 1657 11 7 0 754 0 haveged
[ 216.395798] [ 786] 1001 786 331 0 4 0 18 0 dbus-daemon
[ 216.407732] [ 792] 0 792 1110 27 6 0 81 0 ntpd
[ 216.424769] [ 805] 0 805 223 1 4 0 9 0 dropbear
[ 216.435459] [ 808] 0 808 168315 19 8 0 211 0 allxbee
[ 216.446949] [ 812] 0 812 167906 32 7 0 313 0 iotWatchdog
[ 216.464755] [ 952] 0 952 332 1 4 0 10 0 sh
[ 216.474740] [ 1616] 0 1616 329 1 3 0 6 0 udhcpc
[ 216.486136] [ 1703] 0 1703 40009 8503 82 0 31313 0 mem_test
[ 216.502559] Out of memory: Kill process 1703 (mem_test) score 836 or sacrifice child
[ 216.512924] Killed process 1703 (mem_test) total-vm:160036kB, anon-rss:33956kB, file-rss:56kB, shmem-rss:0kB
[ 216.602368] oom_reaper: reaped process 1703 (mem_test), now anon-rss:4kB, file-rss:0kB, shmem-rss:0kB
Killed
# bg
-sh: bg: No current job
#
#
# free
total used free shared buff/cache available
Mem: 53960 12648 21936 8 19376 37272
Swap: 131068 5320 125748
#
V3s可以申请到153M 内存
刚刚开机,没有swap:
|_ _||_| ___ _ _ | | |_| ___ _ _ _ _
| | _ | || | | |__ | || || | ||_'_|
| | | || | || _ | |_____||_||_|_||___||_,_|
|_| |_||_|_||_|_| Tina is Based on OpenWrt!
----------------------------------------------
Tina Linux (5.0, r0-6ada511)
----------------------------------------------
nodev debugfs
root@TinaLinux:/#
root@TinaLinux:/#
root@TinaLinux:/# free
total used free shared buff/cache available
Mem: 233780 15596 210488 0 7696 211804
Swap: 0 0 0
root@TinaLinux:/#
root@TinaLinux:/#
root@TinaLinux:/#
编译一个没有护栏的测试程序,每次动态申请1M内存,第二个参数是申请次数:
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include <unistd.h>
void main(int argc, char* argv[])
{
static int count = 0;
int times = atoi(argv[1]);
for(int i =0; i<times; i++)
{
void* ptr = malloc(1*1024*1024);
if(ptr == NULL)
{
printf("malloc error");
}
else
{
memset(ptr, 0, 1*1024*1024);
printf("malloc ok, count=%3d\n", count++);
}
}
while (1)
{
printf("sleep\n");
usleep(1000*1000);
}
}
申请大约200M内存的时候挂了:
root@TinaLinux:/#
root@TinaLinux:/# free
total used free shared buff/cache available
Mem: 233780 15788 204344 5948 13648 205664
Swap: 0 0 0
root@TinaLinux:/#
root@TinaLinux:/#
root@TinaLinux:/#
root@TinaLinux:/#
root@TinaLinux:/# chmod +x /tmp/test && /tmp/test 206
malloc ok, count=0
malloc ok, count=1
... ...
malloc ok, count=197
malloc ok, count=198
malloc ok, count=199
malloc ok, count=200
[ 167.228684] test invoked oom-killer: gfp_mask=0x1100cca(GFP_HIGHUSER_MOVABLE|0x1000000), order=0, oom_score_adj=0
[ 167.240249] CPU: 1 PID: 1296 Comm: test Not tainted 5.4.61 #1
[ 167.246694] Hardware name: Generic DT based system
[ 167.252092] [<c010e318>] (unwind_backtrace) from [<c010a8dc>] (show_stack+0x10/0x14)
[ 167.260798] [<c010a8dc>] (show_stack) from [<c0785f90>] (dump_stack+0x7c/0x98)
[ 167.260815] [<c0785f90>] (dump_stack) from [<c0195914>] (dump_header+0x54/0x270)
[ 167.277204] [<c0195914>] (dump_header) from [<c0195d88>] (oom_kill_process+0x78/0x2bc)
[ 167.286088] [<c0195d88>] (oom_kill_process) from [<c019676c>] (out_of_memory+0x318/0x384)
[ 167.295270] [<c019676c>] (out_of_memory) from [<c01c82e4>] (__alloc_pages_nodemask+0x758/0x9b0)
[ 167.305037] [<c01c82e4>] (__alloc_pages_nodemask) from [<c01b37ac>] (alloc_zeroed_user_highpage_movable+0x14/0x3c)
[ 167.316657] [<c01b37ac>] (alloc_zeroed_user_highpage_movable) from [<c01b6264>] (handle_mm_fault+0x214/0x7c0)
[ 167.327787] [<c01b6264>] (handle_mm_fault) from [<c010f1ac>] (do_page_fault+0x13c/0x29c)
[ 167.336872] [<c010f1ac>] (do_page_fault) from [<c010f468>] (do_DataAbort+0x34/0xb4)
[ 167.345468] [<c010f468>] (do_DataAbort) from [<c010255c>] (__dabt_usr+0x3c/0x40)
[ 167.353768] Exception stack(0xce1fffb0 to 0xce1ffff8)
[ 167.359436] ffa0: aa452008 00000000 00006000 aa54c000
[ 167.368612] ffc0: 00010bd4 00010c68 00000000 00010134 00000000 00010134 00079470 bea9cb84
[ 167.377793] ffe0: 00000000 bea9cb68 000104fc 00027908 20070010 ffffffff
[ 167.385280] Mem-Info:
[ 167.387840] active_anon:52056 inactive_anon:1486 isolated_anon:0
[ 167.387840] active_file:9 inactive_file:9 isolated_file:0
[ 167.387840] unevictable:0 dirty:0 writeback:0 unstable:0
[ 167.387840] slab_reclaimable:562 slab_unreclaimable:2552
[ 167.387840] mapped:88 shmem:1487 pagetables:139 bounce:0
[ 167.387840] free:478 free_pcp:103 free_cma:0
[ 167.423747] Node 0 active_anon:208224kB inactive_anon:5944kB active_file:36kB inactive_file:36kB unevictable:0kB isolated(anon):0kB isolated(file):0kB mapped:352kB dirty:0kB writeback:0kB shmem:5948kB writeback_tmp:0kB unstable:0kB all_unreclaimable? yes
[ 167.423767] Normal free:1912kB min:1916kB low:2392kB high:2868kB active_anon:208224kB inactive_anon:5944kB active_file:36kB inactive_file:36kB unevictable:0kB writepending:0kB present:254400kB managed:233780kB mlocked:0kB kernel_stack:560kB pagetables:556kB bounce:0kB free_pcp:412kB local_pcp:112kB free_cma:0kB
[ 167.479940] lowmem_reserve[]: 0 0
[ 167.479952] Normal: 14*4kB (UM) 12*8kB (UM) 2*16kB (UE) 0*32kB 1*64kB (M) 1*128kB (M) 2*256kB (ME) 0*512kB 1*1024kB (M) 0*2048kB 0*4096kB = 1912kB
[ 167.498408] Free pages count per migrate typeat order: 0 1 2 3 4 5 6 7 8 9 10
[ 167.511744] zone Normal, type Unmovable 13 11 1 0 0 0 0 0 0 0 0
[ 167.524168] zone Normal, type Movable 1 1 0 0 1 1 1 0 1 0 0
[ 167.536584] zone Normal, type Reclaimable 0 0 1 0 0 0 1 0 0 0 0
[ 167.549007] zone Normal, type CMA 0 0 0 0 0 0 0 0 0 0 0
[ 167.561421] zone Normal, type HighAtomic 0 0 0 0 0 0 0 0 0 0 0
[ 167.573839] zone Normal, type Isolate 0 0 0 0 0 0 0 0 0 0 0
[ 167.586255] 1501 total pagecache pages
[ 167.590458] 0 pages in swap cache
[ 167.594173] Swap cache stats: add 0, delete 0, find 0/0
[ 167.600066] Free swap = 0kB
[ 167.603293] Total swap = 0kB
[ 167.606533] 63600 pages RAM
[ 167.609661] 0 pages HighMem/MovableOnly
[ 167.613957] 5155 pages reserved
[ 167.617487] 2048 pages cma reserved
[ 167.621396] Tasks state (memory values in pages):
[ 167.626678] [ pid ] uid tgid total_vm rss pgtables_bytes swapents oom_score_adj name
[ 167.636364] [ 1211] 0 1211 9461 49 18432 0 0 adbd
[ 167.645462] [ 1254] 0 1254 782 31 10240 0 0 sh
[ 167.645472] [ 1255] 0 1255 751 27 10240 0 0 init
[ 167.663433] [ 1256] 0 1256 751 27 10240 0 0 init
[ 167.672521] [ 1257] 0 1257 751 27 10240 0 0 init
[ 167.681611] [ 1296] 0 1296 52073 51958 215040 0 0 test
[ 167.690698] oom-kill:constraint=CONSTRAINT_NONE,nodemask=(null),task=test,pid=1296,uid=0
[ 167.699814] Out of memory: Killed process 1296 (test) total-vm:208292kB, anon-rss:207480kB, file-rss:0kB, shmem-rss:352kB, UID:0 pgtables:210kB oom_score_adj:0
[ 167.766642] oom_reaper: reaped process 1296 (test), now anon-rss:0kB, file-rss:0kB, shmem-rss:0kB
Killed
root@TinaLinux:/#
下面开启交换分区:
mkswap /dev/by-name/swapper && swapon /dev/by-name/swapper
开启完成:
root@TinaLinux:/#
root@TinaLinux:/#
root@TinaLinux:/# mkswap /dev/by-name/swapper && swapon /dev/by-name/swapper
Setting up swapspace version 1, size = 536866816 bytes
[ 317.944647] Adding 524284k swap on /dev/by-name/swapper. Priority:-2 extents:1 across:524284k SS
root@TinaLinux:/#
root@TinaLinux:/#
root@TinaLinux:/#
测试申请700M,系统正常:
malloc ok, count=0
malloc ok, count=1
... ...
malloc ok, count=691
malloc ok, count=692
malloc ok, count=693
malloc ok, count=694
malloc ok, count=695
malloc ok, count=696
malloc ok, count=697
malloc ok, count=698
malloc ok, count=699
sleep
sleep
sleep
free命令看下内存占用:
root@TinaLinux:/# free
total used free shared buff/cache available
Mem: 233780 221724 6532 92 5524 6400
Swap: 524284 524284 0
申请703M的时候,OOM炸了:
root@TinaLinux:/#
root@TinaLinux:/# chmod +x /tmp/test && /tmp/test 720
malloc ok, count=0
malloc ok, count=1
... ...
malloc ok, count=701
malloc ok, count=702
[24017.015074] test invoked oom-killer: gfp_mask=0x1100cca(GFP_HIGHUSER_MOVABLE|0x1000000), order=0, oom_score_adj=0
[24017.026721] CPU: 1 PID: 1412 Comm: test Not tainted 5.4.61 #1
[24017.033176] Hardware name: Generic DT based system
[24017.033206] [<c010e318>] (unwind_backtrace) from [<c010a8dc>] (show_stack+0x10/0x14)
[24017.033221] [<c010a8dc>] (show_stack) from [<c0785f90>] (dump_stack+0x7c/0x98)
[24017.033237] [<c0785f90>] (dump_stack) from [<c0195914>] (dump_header+0x54/0x270)
[24017.033250] [<c0195914>] (dump_header) from [<c0195d88>] (oom_kill_process+0x78/0x2bc)
[24017.033262] [<c0195d88>] (oom_kill_process) from [<c019676c>] (out_of_memory+0x318/0x384)
[24017.033277] [<c019676c>] (out_of_memory) from [<c01c82e4>] (__alloc_pages_nodemask+0x758/0x9b0)
[24017.033292] [<c01c82e4>] (__alloc_pages_nodemask) from [<c01b37ac>] (alloc_zeroed_user_highpage_movable+0x14/0x3c)
[24017.033305] [<c01b37ac>] (alloc_zeroed_user_highpage_movable) from [<c01b6264>] (handle_mm_fault+0x214/0x7c0)
[24017.033318] [<c01b6264>] (handle_mm_fault) from [<c010f1ac>] (do_page_fault+0x13c/0x29c)
[24017.033332] [<c010f1ac>] (do_page_fault) from [<c010f468>] (do_DataAbort+0x34/0xb4)
[24017.033344] [<c010f468>] (do_DataAbort) from [<c010255c>] (__dabt_usr+0x3c/0x40)
[24017.033349] Exception stack(0xce22ffb0 to 0xce22fff8)
[24017.033358] ffa0: 8ac74008 00000000 00007000 8ad6d000
[24017.033368] ffc0: 00010bd4 00010c68 00000000 00010134 00000000 00010134 00079470 beef1b84
[24017.033377] ffe0: 00000000 beef1b68 000104fc 00027908 20070010 ffffffff
[24017.033381] Mem-Info:
[24017.033398] active_anon:25811 inactive_anon:25853 isolated_anon:0
[24017.033398] active_file:6 inactive_file:4 isolated_file:0
[24017.033398] unevictable:0 dirty:0 writeback:127 unstable:0
[24017.033398] slab_reclaimable:628 slab_unreclaimable:3241
[24017.033398] mapped:19 shmem:19 pagetables:399 bounce:0
[24017.033398] free:1366 free_pcp:0 free_cma:0
[24017.033412] Node 0 active_anon:103244kB inactive_anon:103412kB active_file:24kB inactive_file:16kB unevictable:0kB isolated(anon):0kB isolated(file):0kB map ped:76kB dirty:0kB writeback:508kB shmem:76kB writeback_tmp:0kB unstable:0kB all_unreclaimable? no
[24017.033428] Normal free:5464kB min:1916kB low:2392kB high:2868kB active_anon:103300kB inactive_anon:103328kB active_file:24kB inactive_file:16kB unevictable :0kB writepending:488kB present:254400kB managed:233780kB mlocked:0kB kernel_stack:536kB pagetables:1596kB bounce:0kB free_pcp:0kB local_pcp:0kB free_cma:0kB
[24017.033431] lowmem_reserve[]: 0 0
[24017.033438] Normal: 199*4kB (UME) 141*8kB (UME) 85*16kB (UME) 37*32kB (ME) 16*64kB (ME) 1*128kB (M) 0*256kB 0*512kB 0*1024kB 0*2048kB 0*4096kB = 5620kB
[24017.033474] Free pages count per migrate typeat order: 0 1 2 3 4 5 6 7 8 9 10
[24017.033496] zone Normal, type Unmovable 61 34 8 0 0 0 0 0 0 0 0
[24017.033531] zone Normal, type Movable 98 82 60 25 13 1 0 0 0 0 0
[24017.033580] zone Normal, type Reclaimable 40 25 17 12 3 0 0 0 0 0 0
[24017.033612] zone Normal, type CMA 0 0 0 0 0 0 0 0 0 0 0
[24017.033632] zone Normal, type HighAtomic 0 0 0 0 0 0 0 0 0 0 0
[24017.033652] zone Normal, type Isolate 0 0 0 0 0 0 0 0 0 0 0
[24017.033671] 178 total pagecache pages
[24017.033678] 146 pages in swap cache
[24017.033683] Swap cache stats: add 424365, delete 424256, find 343/587
[24017.033686] Free swap = 0kB
[24017.033689] Total swap = 524284kB
[24017.033693] 63600 pages RAM
[24017.033696] 0 pages HighMem/MovableOnly
[24017.033699] 5155 pages reserved
[24017.033702] 2048 pages cma reserved
[24017.033705] Tasks state (memory values in pages):
[24017.033708] [ pid ] uid tgid total_vm rss pgtables_bytes swapents oom_score_adj name
[24017.033730] [ 1211] 0 1211 11510 0 24576 77 0 adbd
[24017.033738] [ 1254] 0 1254 782 0 10240 36 0 sh
[24017.033747] [ 1255] 0 1255 751 0 10240 27 0 init
[24017.033755] [ 1256] 0 1256 751 0 10240 27 0 init
[24017.033764] [ 1257] 0 1257 751 0 10240 27 0 init
[24017.033772] [ 1277] 0 1277 782 0 10240 40 0 sh
[24017.033781] [ 1412] 0 1412 181087 51492 731136 129420 0 test
[24017.033787] oom-kill:constraint=CONSTRAINT_NONE,nodemask=(null),task=test,pid=1412,uid=0
[24017.033813] Out of memory: Killed process 1412 (test) total-vm:724348kB, anon-rss:205892kB, file-rss:0kB, shmem-rss:76kB, UID:0 pgtables:714kB oom_score_adj :0
[24017.260905] oom_reaper: reaped process 1412 (test), now anon-rss:0kB, file-rss:0kB, shmem-rss:0kB
Killed
root@TinaLinux:/#
root@TinaLinux:/#
root@TinaLinux:/#
@jxmlegend 这个xfel怎么编译,我现在板上的SPINAND flash的ID在这个xfel-v1.3.2里面没有,我在文件里加上了我的SPINAND flash的ID,但是不知道该怎么编译代码生成exe
用 MSVC2017 编译 XFEL 项目
https://whycan.com/t_6660.html
@lmnb
$ grep mysql_install_db -r /opt/buildroot/buildroot-2024-aarch64/package/
/opt/buildroot/buildroot-2024-aarch64/package/mariadb/S97mysqld: $MYSQL_BIN/mysql_install_db --basedir=/usr \
/opt/buildroot/buildroot-2024-aarch64/package/mariadb/mysqld.service:ExecStartPre=/bin/sh -c 'test "`ls -1 /var/lib/mysql | wc -l`" != "0" ||
$ grep mysqld_safe -r /opt/buildroot/buildroot-2024-aarch64/package/
/opt/buildroot/buildroot-2024-aarch64/package/mariadb/S97mysqld: $MYSQL_BIN/mysqld_safe --pid-file=$MYSQL_PIDFILE --user=mysql \
/opt/buildroot/buildroot-2024-aarch64/package/mariadb/mysqld.service:ExecStart=/usr/bin/mysqld_safe --log-error=/var/log/mysql/mysqld.log
MySQL的package确实没有你说的这两个,但是mariadb里面有,用buildroot 2024.02 可以试一试。
韦老师店里面看看:
可能是SDK问题:
--来自百度网盘超级会员V4的分享
hi,这是我用百度网盘分享的内容~复制这段内容打开「百度网盘」APP即可获取
链接: https://pan.baidu.com/s/1tADvigD1xtOWqieJmcuPkA?pwd=awol
提取码:awol
大佬有啥参考案例吗
D1_Linux_AUDIOCODEC_开发指南.pdf
这里有耳机插拔检测说明
buildroot-tiny200 (F1C100/200s) 开发包近期更新内容 * 已支持DVP摄像头 *,支持SPI NAND
https://whycan.com/t_5221.html
用这个吧,基本非常完善了,一键编译出所有烧录固件。
哇酷小二 说:DragonFace V4.1.0 或者以后的版本应该可以。
我必应、谷歌、duckduckgo,全都找了,就是找不到。:(
链接: https://pan.baidu.com/s/12d_495y_8UIK5p2hLBh_fA?pwd=face
提取码:face
感谢@晕哥邀请和测试,发布一个widora tiny200 480x272 5寸电阻屏TF卡固件, 开机跑 emwin,账号root,无密码
https://whycan.com/t_3206.html
分享一个 5寸的 800x480 的 f1c100s 固件, 感谢 @xm1994, 调试串口UART0 (PB8/PB9)
https://whycan.com/t_2689.html
linux3.4 bsp linux 摄像头NV12格式原始视频格式数据采集源码:
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <assert.h>
#include <getopt.h>
#include <fcntl.h>
#include <unistd.h>
#include <errno.h>
#include <malloc.h>
#include <sys/stat.h>
#include <sys/types.h>
#include <sys/time.h>
#include <sys/mman.h>
#include <sys/ioctl.h>
#include <asm/types.h>
#include <linux/videodev2.h>
#define BUF_NUM 4
#define FRAMESINBUF 1
struct CJ_Buffer {
void *memory;
int length;
};
struct CJ_Buffer *gpV4l2Buf;
int gMemMapLen;
int file_fd;
char *dev_name = "/dev/video0";
int fd;
int getFullSize(int * full_w, int * full_h)
{
struct v4l2_frmsizeenum size_enum;
size_enum.type = V4L2_BUF_TYPE_VIDEO_CAPTURE;
size_enum.pixel_format = V4L2_PIX_FMT_NV12;
size_enum.index = 0;
if (-1 == ioctl(fd, VIDIOC_ENUM_FRAMESIZES, &size_enum))
{
perror("VIDIOC_ENUM_FRAMESIZES failed");
return 0;
}
*full_w = size_enum.discrete.width;
*full_h = size_enum.discrete.height;
printf("getFullSize: %dx%d\n", *full_w, *full_h);
return 1;
}
int tryFmtSize(int *width, int *height)
{
int ret = -1;
struct v4l2_format fmt;
printf("%dx%d", *width, *height);
memset(&fmt, 0, sizeof(fmt));
fmt.type = V4L2_BUF_TYPE_VIDEO_CAPTURE;
fmt.fmt.pix.width = *width;
fmt.fmt.pix.height = *height;
//fmt.fmt.pix.pixelformat = V4L2_PIX_FMT_YUYV;
//fmt.fmt.pix.pixelformat = V4L2_PIX_FMT_MJPEG;
//fmt.fmt.pix.pixelformat = V4L2_PIX_FMT_H264;
fmt.fmt.pix.pixelformat = V4L2_PIX_FMT_NV12;
fmt.fmt.pix.field = V4L2_FIELD_NONE;
ret = ioctl(fd, VIDIOC_TRY_FMT, &fmt);
if (ret < 0)
{
perror("VIDIOC_TRY_FMT failed");
return ret;
}
// driver surpport this size
*width = fmt.fmt.pix.width;
*height = fmt.fmt.pix.height;
return 0;
}
int setContrastValue(int value)
{
int ret = -1;
struct v4l2_control ctrl;
ctrl.id = V4L2_CID_CONTRAST;
ctrl.value = value;
ret = ioctl(fd, VIDIOC_S_CTRL, &ctrl);
if (ret < 0) {
perror("VIDIOC_S_CTRL failed");
} else {
printf("setContrastValue ok\n");
}
return ret;
}
int setBrightnessValue(int value)
{
struct v4l2_control ctrl;
int ret = -1;
ctrl.id = V4L2_CID_BRIGHTNESS;
ctrl.value = value;
ret = ioctl(fd, VIDIOC_S_CTRL, &ctrl);
if (ret < 0) {
perror("VIDIOC_S_CTRL failed");
} else {
printf("setBrightnessValue ok\n");
}
return ret;
}
int setSaturationValue(int value)
{
struct v4l2_control ctrl;
int ret = -1;
ctrl.id = V4L2_CID_SATURATION;
ctrl.value = value;
ret = ioctl(fd, VIDIOC_S_CTRL, &ctrl);
if (ret < 0) {
perror("VIDIOC_S_CTRL failed");
} else {
printf("setSaturationValue ok\n");
}
return ret;
}
int setSharpnessValue(int value)
{
struct v4l2_control ctrl;
int ret = -1;
ctrl.id = V4L2_CID_SHARPNESS;
ctrl.value = value;
ret = ioctl(fd, VIDIOC_S_CTRL, &ctrl);
if (ret < 0) {
perror("VIDIOC_S_CTRL failed");
} else {
printf("setSharpnessValue ok\n");
}
return ret;
}
int setHueValue(int value)
{
struct v4l2_control ctrl;
int ret = -1;
ctrl.id = V4L2_CID_HUE;
ctrl.value = value;
ret = ioctl(fd, VIDIOC_S_CTRL, &ctrl);
if (ret < 0) {
perror("VIDIOC_S_CTRL failed");
} else {
printf("setHueValue ok\n");
}
return ret;
}
int setHflip(int value)
{
struct v4l2_control ctrl;
int ret = -1;
ctrl.id = V4L2_CID_HFLIP_THUMB;
ctrl.value = value;
printf("V4L2CameraDevice::setHflip value=%d\n", value);
ret = ioctl(fd, VIDIOC_S_CTRL, &ctrl);
if (ret < 0)
{
//setSharpnessValue failed
perror("setHflip thumb failed\n");
}
ctrl.id = V4L2_CID_HFLIP;
ctrl.value = value;
printf("V4L2CameraDevice::setHflip value=%d\n", value);
ret = ioctl(fd, VIDIOC_S_CTRL, &ctrl);
if (ret < 0)
{
//setSharpnessValue failed
perror("setHflip failed\n");
}
return ret;
}
int setVflip(int value)
{
struct v4l2_control ctrl;
int ret = -1;
ctrl.id = V4L2_CID_VFLIP_THUMB;
ctrl.value = value;
printf("V4L2CameraDevice::setVflip value=%d\n", value);
ret = ioctl(fd, VIDIOC_S_CTRL, &ctrl);
if (ret < 0)
{
//setSharpnessValue failed
perror("setVflip thumb failed111\n");
}
ctrl.id = V4L2_CID_VFLIP;
ctrl.value = value;
printf("V4L2CameraDevice::setVflip value=%d\n", value);
ret = ioctl(fd, VIDIOC_S_CTRL, &ctrl);
if (ret < 0)
{
//setSharpnessValue failed
perror("setVflip failed111\n");
}
return ret;
}
int v4l2setCaptureParams(int framerate)
{
printf("framerate=%d", framerate);
int ret = -1;
struct v4l2_streamparm params;
params.parm.capture.timeperframe.numerator = 1;
params.parm.capture.timeperframe.denominator = framerate;
params.type = V4L2_BUF_TYPE_VIDEO_CAPTURE;
params.parm.capture.capturemode = V4L2_MODE_VIDEO;
printf("VIDIOC_S_PARM mFrameRate: %d, capture mode: %d\n", framerate, params.parm.capture.capturemode);
ret = ioctl(fd, VIDIOC_S_PARM, ¶ms);
if (ret < 0) {
perror("VIDIOC_S_PARM failed");
} else {
printf("v4l2setCaptureParams ok\n");
}
return ret;
}
void v4l2SetVideoParams(int width, int height, int sub_w, int sub_h, unsigned int pix_fmt)
{
struct v4l2_format format;
printf("main:%dx%d, sub:%dx%d, pfmt: 0x%x\n", width, height, sub_w, sub_h, pix_fmt);
memset(&format, 0, sizeof(format));
format.type = V4L2_BUF_TYPE_VIDEO_CAPTURE;
format.fmt.pix.width = width;
format.fmt.pix.height = height;
//format.fmt.pix.pixelformat = V4L2_PIX_FMT_YUYV;
//format.fmt.pix.pixelformat = V4L2_PIX_FMT_MJPEG;
//format.fmt.pix.pixelformat = V4L2_PIX_FMT_H264;
format.fmt.pix.pixelformat = V4L2_PIX_FMT_NV12;
format.fmt.pix.field = V4L2_FIELD_NONE;
if ((sub_w > 0 && sub_w < width) && (sub_h > 0 && sub_h < height)) {
struct v4l2_pix_format sub_fmt;
memset(&sub_fmt, 0, sizeof(sub_fmt));
format.fmt.pix.subchannel = &sub_fmt;
format.fmt.pix.subchannel->width = sub_w;
format.fmt.pix.subchannel->height = sub_h;
format.fmt.pix.subchannel->pixelformat = pix_fmt;
format.fmt.pix.subchannel->field = V4L2_FIELD_NONE;
format.fmt.pix.subchannel->rot_angle = 0;
printf("sub_w=%d, sub_h=%d\n", sub_w, sub_h);
}
if (ioctl(fd, VIDIOC_S_FMT, &format) < 0)
{
perror("VIDIOC_S_FMT failed");
return;
}
return;
}
void initV4l2Buffer()
{
gpV4l2Buf = (struct CJ_Buffer *)malloc(sizeof(struct CJ_Buffer) * BUF_NUM);
if (gpV4l2Buf == NULL) {
perror("alloc V4l2Buffer_tag error!!");
return;
}
memset(gpV4l2Buf, 0, sizeof(struct CJ_Buffer) * BUF_NUM);
}
void setFramesInV4L2BufNum()
{
unsigned int nFramesInBuf = FRAMESINBUF;
printf("mFramesInV4l2buf=%u\n", FRAMESINBUF);
if (ioctl (fd, VIDIOC_SET_NFRAME_BUF, &nFramesInBuf) < 0) {
perror("VIDIOC_SET_NFRAME_BUF failed");
}
}
int v4l2ReqBufs(int * buf_cnt)
{
int ret = 0;
struct v4l2_requestbuffers rb;
printf("TO VIDIOC_REQBUFS count: %d\n", *buf_cnt);
memset(&rb, 0, sizeof(rb));
rb.type = V4L2_BUF_TYPE_VIDEO_CAPTURE;
rb.memory = V4L2_MEMORY_MMAP;
rb.count = *buf_cnt;
ret = ioctl(fd, VIDIOC_REQBUFS, &rb);
if (ret < 0)
{
perror("VIDIOC_REQBUFS failed");
return ret;
}
*buf_cnt = rb.count;
printf("VIDIOC_REQBUFS count: %d\n", *buf_cnt);
return 1;
}
int v4l2QueryBuf()
{
int i;
int ret = 0;
struct v4l2_buffer buf;
for (i = 0; i < BUF_NUM; i++)
{
memset (&buf, 0, sizeof (struct v4l2_buffer));
buf.type = V4L2_BUF_TYPE_VIDEO_CAPTURE;
buf.memory = V4L2_MEMORY_MMAP;
buf.index = i;
ret = ioctl (fd, VIDIOC_QUERYBUF, &buf);
if (ret < 0)
{
perror("VIDIOC_QUERYBUF failed");
return ret;
}
gpV4l2Buf[i].memory = mmap(0, buf.length,
PROT_READ | PROT_WRITE,
MAP_SHARED,
fd,
buf.m.offset);
gMemMapLen = buf.length;
printf("index: %d, mem: %x, len: %d, offset: %x\n", i, (int)gpV4l2Buf[i].memory, buf.length, buf.m.offset);
if (gpV4l2Buf[i].memory == MAP_FAILED)
{
perror("mmap failed");
return -1;
}
}
for (i = 0; i < BUF_NUM; i++)
{
memset (&buf, 0, sizeof (struct v4l2_buffer));
buf.type = V4L2_BUF_TYPE_VIDEO_CAPTURE;
buf.memory = V4L2_MEMORY_MMAP;
buf.index = i;
// start with all buffers in queue
ret = ioctl(fd, VIDIOC_QBUF, &buf);
if (ret < 0)
{
perror("VIDIOC_QBUF failed");
return ret;
}
}
return 1;
}
int v4l2StartStreaming()
{
int ret = 0;
enum v4l2_buf_type type = V4L2_BUF_TYPE_VIDEO_CAPTURE;
ret = ioctl (fd, VIDIOC_STREAMON, &type);
if (ret < 0)
{
perror("VIDIOC_STREAMON failed");
return ret;
}
return 1;
}
int v4l2StopStreaming()
{
int ret = 0;
enum v4l2_buf_type type = V4L2_BUF_TYPE_VIDEO_CAPTURE;
ret = ioctl (fd, VIDIOC_STREAMOFF, &type);
if (ret < 0)
{
perror("VIDIOC_STREAMOFF failed");
return ret;
}
printf("V4L2Camera::v4l2StopStreaming ok\n");
return 1;
}
int v4l2UnmapBuf()
{
int i;
int ret = 0;
for (i = 0; i < BUF_NUM; i++)
{
ret = munmap(gpV4l2Buf[i].memory, gMemMapLen);
if (ret < 0)
{
perror("munmap failed");
return ret;
}
gpV4l2Buf[i].memory = NULL;
}
return 1;
}
int main (int argc,char ** argv)
{
struct v4l2_capability cap;
struct v4l2_format fmt;
struct v4l2_pix_format sub_fmt;
struct v4l2_requestbuffers req;
struct v4l2_buffer buf;
struct v4l2_input inp;
unsigned int i;
enum v4l2_buf_type type;
int width, height;
fd = open(dev_name, O_RDWR | O_NONBLOCK, 0);
ioctl (fd, VIDIOC_QUERYCAP, &cap);
printf("Driver Name:%s\n Card Name:%s\n Bus info:%s\n\n", cap.driver, cap.card, cap.bus_info);
printf("capabilities:%d\n", cap.capabilities);
if ((cap.capabilities & V4L2_CAP_VIDEO_CAPTURE) == 0 &&
(cap.capabilities & V4L2_CAP_STREAMING) == 0)
{
perror("cap capabilities format fail");
return -2 ;
}
inp.index = 0;
if (-1 == ioctl(fd, VIDIOC_S_INPUT, &inp))
{
perror("VIDIOC_S_INPUT error!");
return -2 ;
}
getFullSize(&width, &height);
width = 640; height = 480;
/*tryFmtSize(&width, &height);
setContrastValue(50);
setBrightnessValue(50);
setSaturationValue(0);
setSharpnessValue(10);
setHueValue(30);
setHflip(0);
setVflip(0);*/
v4l2setCaptureParams(30);
v4l2SetVideoParams(640, 480, 320, 240, V4L2_PIX_FMT_NV12);
initV4l2Buffer();
setFramesInV4L2BufNum();
int buf_cnt = BUF_NUM;
v4l2ReqBufs(&buf_cnt);
v4l2QueryBuf();
v4l2StartStreaming();
//for (i = 0; i < 10; i++)
// sleep(1);
//struct v4l2_control ctrl;
// ctrl.id = V4L2_CID_TAKE_PICTURE;
//if (ioctl(fd, VIDIOC_S_CTRL, &ctrl) < 0) {
// perror("VIDIOC_S_CTRL failed");
// } else {
// perror("setTakePictureCtrl ok\n");
// }
FILE* fp = fopen("test2.nv12", "w");
if(fp == NULL)
{
printf("open file error.\n");
goto end;
}
for (i = 0; i < 200; i++)
{
fd_set fds;
FD_ZERO(&fds);
FD_SET(fd, &fds);
select(fd + 1, &fds, NULL, NULL, NULL);
memset(&buf, 0, sizeof(struct v4l2_buffer));
buf.type = V4L2_BUF_TYPE_VIDEO_CAPTURE;
buf.memory = V4L2_MEMORY_MMAP;
ioctl(fd, VIDIOC_DQBUF, &buf);
void *pMem = gpV4l2Buf[buf.index].memory;
printf("frame addr = %x, length=%d, %d\n", (unsigned int)pMem, gpV4l2Buf[buf.index].length, buf.length);
fwrite(pMem, 640 * 480 * 3 / 2, 1, fp);
#if 0
if (i == 199)
{
file_fd = open("test.jpg", O_RDWR | O_CREAT, 0777);
write(file_fd, pMem, 640 * 480 * 3 / 2);
close (file_fd);
printf("frame index = %d, size = %d.\n", buf.index, buf.length);
}
#endif
ioctl(fd, VIDIOC_QBUF, &buf);
}
end:
fclose(fp);
v4l2StopStreaming();
v4l2UnmapBuf();
close (fd);
printf("Camera Done.\n");
return 0;
}
NV12录像文件下载: nv12_data.7z
想请问下晕哥,以前只有STM32基础。如何切换到这个F1C100S跑LINUX的学习上来?论坛有没有入门级的资料供我这种初学者学习?
这个教程不错: https://whycan.cn/t_3138.html
收藏本帖,目前正在新增使用spi nand flash,启动引导主线Linux 4.19,各种学习中。。。
这个帖子更有参考价值: https://whycan.cn/t_3123.html
配置sunxi-fel工具出现了如下问题:
fel.c:32:18: fatal error: zlib.h: 没有那个文件或目录
compilation terminated.
fel_lib.c:26:20: fatal error: libusb.h: 没有那个文件或目录
这个怎么破
从网上搜索的资料看,应该是 MySQL Server不支持4字节unicode码引起
https://blog.51cto.com/suifu/1853864
https://stackoverflow.com/questions/36894731/mysqli-not-setting-charset-to-utf8mb4
vc++6.0文件失效了吗?
一楼的下载链接已修复: VC6绿色版下载: vc++6.0_green.7z
已换,感谢大佬提醒。
$ find . |grep SerialPort |grep \\.so
./output/build/qt5serialport-5.12.4/lib/libQt5SerialPort.so.5.12.4
./output/build/qt5serialport-5.12.4/lib/libQt5SerialPort.so.5.12
./output/build/qt5serialport-5.12.4/lib/libQt5SerialPort.so.5
./output/build/qt5serialport-5.12.4/lib/libQt5SerialPort.so
./output/host/arm-buildroot-linux-uclibcgnueabi/sysroot/usr/lib/libQt5SerialPort.so.5.12.4
./output/host/arm-buildroot-linux-uclibcgnueabi/sysroot/usr/lib/libQt5SerialPort.so.5.12
./output/host/arm-buildroot-linux-uclibcgnueabi/sysroot/usr/lib/libQt5SerialPort.so.5
./output/host/arm-buildroot-linux-uclibcgnueabi/sysroot/usr/lib/libQt5SerialPort.so
./output/target/usr/lib/libQt5SerialPort.so.5.12.4
./output/target/usr/lib/libQt5SerialPort.so.5.12
./output/target/usr/lib/libQt5SerialPort.so.5
用 find 命令搜索 SerialPort 相关文件是否存在。
先检查自己操作的问题吧: https://whycan.cn/t_3426.html#p30402
电脑版购买链接:
https://2.taobao.com/item.htm?id=615375166331
淘宝手机app购买:
我在闲鱼发布了【闲鱼被禁言中 4元一个全新720P互联网网关监控摄像头 摄像】椱ァ製这段描述后,打开闲鱼€hbXu1kChb0O€后打开闲鱼
关于运费:
10元*数量+运费,运费首重通通通按10计,每4个超重加5元
第一套友情价,15包邮(记得留言:whycan)
------------------------
仅发布信息,不承担任何质量等其他问题.
仅发布信息,不承担任何质量等其他问题.
仅发布信息,不承担任何质量等其他问题.
https://github.com/torvalds/linux/blob/master/arch/arm/boot/dts/sun8i-v3s-licheepi-zero.dts
compatible = "gpio-leds";
drivers/leds/Makefile:obj-$(CONFIG_LEDS_GPIO) += leds-gpio.o
这个 CONFIG_LEDS_GPIO 驱动有没有勾选?
backlight {
compatible = "pwm-backlight";
pwms = <&pwm 0 5000000>;brightness-levels = <0 4 8 16 32 64 128 255>;
default-brightness-level = <6>;power-supply = <&vdd_bl_reg>;
enable-gpios = <&gpio 58 0>;
post-pwm-on-delay-ms = <10>;
pwm-off-delay-ms = <10>;
};
凭感觉 /sys/class/backlight/pwm-backlight/bl_power 应该对应是 enable-gpios
https://whycan.cn/t_2376.html#p18090
用同一公司同一版本的 gcc 编译器就行,也就是说文件系统的gcc和windows编译app的gcc版本要一致。
否则你的app只能静态链接。
还有帖子链接吗,我没搜到
@达克罗德 大神的: https://whycan.cn/t_3380.html
可能这组TF卡引脚和他的复用功能冲突, 详细情况查看你的dts: https://whycan.cn/t_636.html#p13068