您尚未登录。

#1 Re: VMWare/Linux/Ubuntu/Fedora/CentOS/U-BOOT » 记录一下常用易忘的Linux日常操作 » 2023-02-20 17:18:24

find . -name *xxxxx* -type d -not -path "*/out/*"

不搜索某路径

#2 Re: 全志 SOC » 索智S3-EVB上QT5 GUI LCD无显示 » 2023-02-18 06:39:04

memory 说:

https://whycan.com/files/members/7106/2021-12-12_123528.png

是因为 全志SDK默认Framebuffer格式是 RGBA,有Alpha通道,这个通道要赋值才行。

修改 output/build/fb-test-app-rosetta-1.1.0/fb-test.c

        }else if (fb_info->var.bits_per_pixel== 32){
                unsigned char *p;
                p = (unsigned char *)fbmem + fb_info->fix.line_length *y + 4*x;
                *p++ = color;
                *p++ = color >> 8;
                *p++ = color >> 16;
                *p = 0xFF;



output/build/fbv-1.0b/fb_display.c

void* convertRGB2FB(int fh, unsigned char *rgbbuff, unsigned long count, int bpp, int *cpp)
{

加上:  0xFF000000

        case 32:
            *cpp = 4;
            i_fbbuff = (unsigned int *) malloc(count * sizeof(unsigned int));
            for(i = 0; i < count ; i++)
                i_fbbuff[i] = ((rgbbuff[i*3] << 16) & 0xFF0000) |
                            ((rgbbuff[i*3+1] << 8) & 0xFF00) |
                            (rgbbuff[i*3+2] & 0xFF) |
                            0xFF000000;
            fbbuff = (void *) i_fbbuff;
            break;

#3 Re: 上海航芯 » ACM32H5新产品需求及意见收集 » 2022-12-22 11:35:01

H23803331a2784db1b222249932f2c327H.png

考虑一下新唐 Nuc972df62y 这种半个手巴掌大的封装

#4 Re: 全志 SOC » 全志V3S主线uboot如何配置支持800*480 LCD » 2022-12-19 16:54:37

只能对比一下早期版本了,合并更新.

#5 Re: 全志 SOC » 简单的点灯求助 » 2022-11-25 16:47:40

写一个非常简单的 V3s@linux4.13-y 中断驱动
https://whycan.com/t_1261.html


再试一试中断呗

#8 Re: 全志 SOC » 加深认识V3s的GIC中断 » 2022-10-26 08:40:26

我的V3s tina3.x linux4.9  PB口可以中断,PG不能中断,请问是什么问题?

#9 Re: 全志 SOC » t113跑lvgl帧率 » 2022-10-26 08:20:47

楼主你是过来炫耀的吧?

#10 Re: 全志 SOC » T113-S3 rts 发送控制时序 » 2022-10-04 20:38:45

steelen 说:
cube 说:

用CTS

我看资料是RTS控制的啊
CTS是输入信号啊,拿它控制?
您试过?

抱歉,记错了,确实是RTS:

https://e2e.ti.com/support/microcontrol … enable-pin

#12 Re: 全志 SOC » /lib/firmware下的bin固件是怎么下载到网卡里面去的,这种下载方式linux标准吗 » 2022-09-28 08:44:51

3050311118 说:

不同厂家的wifi网卡,应该都有自己的下载方式吧
如果我要开发一个单片机外设,开机时候也用这种下载方式怎么做呢

随便找个linux下面的wifi网卡驱动程序就可以看到源码,电容触摸屏gt911驱动也是这么做的。

#13 Re: RK3288/RK3399/RK1108 » 帮出RK3399开发板,大车来了,2+16,量非常大,批量出,团购70元/片 » 2022-09-01 18:18:14

junyee 说:
xiang 说:

各位大侠们,老板涨价了,80一块,200块起出,能批量来的赶快,可能还会涨价,暂时不接个人,个人请自行找车

哈,
帮我转告老板,自己个留着慢慢涨吧.

坐地起价乃江湖大忌。。。

#15 Re: 全志 SOC » 问下linux的i2c挂了很多传感器,多个应用可以同时操作i2c吗 » 2022-08-20 11:29:20

在应用程序里面感觉不是独占,在驱动里面应该是独占的。

#20 Re: 上海航芯 » 请大家有关于航芯MCU的问题,留言在论坛的航芯板块,航芯会组织每周2次的统一解答。 » 2022-07-17 13:31:58

ACL16有几个问题请教楼主,

① QFN32 版本没有mode引脚,请问如何进入USB烧录模式?
② 量产版本芯片没有SWD功能吗?

#21 Re: 上海航芯 » Linux开发环境下试玩ACM32F403RET7开发板 » 2022-07-03 00:38:28

楼主你好,方便做个视频吗?我一直想搞Linux单片机开发,领导催了我好几次了,我一直不知道从哪里入手,文字教程又看不下去,总是感觉断片了一样,视频直观一些。用了楼主这一套,再也不担心律师函了。

#23 Re: 全志 SOC » v3s没有i2s外设 有没有什么spi sdio 等能转i2s信号的芯片 最好有现成的linux驱动的 » 2022-06-23 00:03:24

逸俊晨晖 说:
mango 说:

直接用v3s的真身S3L,外设全了,价格还比v3s低

bsd和主线有i2s驱动吗

bsp 有i2s驱动

#24 Re: 全志 SOC » 请教,编译v3s的uboot2022,使用spi flash启动uboot,结果检测不到spi flash。 » 2022-06-10 16:43:07

(V3s/V3x/S3/S3L/R11通吃)小智V3x开发板smallwitpi lite u-boot/linux/buildroot测试
https://whycan.com/t_7248.html


不建议折腾uboot,他只是一个引导程序,浪费的时间不值得。

#25 Re: 全志 SOC » 【小智出品】安卓4寸86面板开发板SW106开卖啦,2.54排针引出IO。 » 2022-06-07 18:09:37

david 说:

显屏带触摸么

有的,看 3# 的视频:

【小智出品】安卓4寸86面板开发板SW106开卖啦,2.54排针引出IO。
https://whycan.com/t_8276.html#p78898

#26 Re: 全志 SOC » 全志A33使用DDR2内存问题 » 2022-05-29 16:58:14

修改 sys_config.fex 里面 dram参数应该就可以了。

#28 Re: 全志 SOC » 开源 V3x模块化开发板 » 2022-05-20 15:06:17

V3x 摸起来几乎不发热,
V3s 烫手,

DDR3 比 DDR2 优秀太多!

#29 Re: BLDC电机驱动 » 画了个一体脱机机械臂驱动器 » 2022-05-12 00:24:47

aozima 说:

>全网在做机械臂了

好像错过了什么,这是有什么典故吗?

稚晖君

#30 Re: 全志 SOC » V3S SPINAND移植使用主线U-Boot和主线Linux » 2022-05-11 21:16:43

shawn.d 说:

SPI NAND好是好,但听说比较容易坏。

nand只读分区都有机会挂,用了nand就要做好接收返修机的准备,或者给客户一个重新刷机的机会。

#33 Re: 全志 SOC » 各位大神求教--(全志)门前转悠 » 2022-05-07 16:15:09

全志的官方SDK适合做产品,不适合搞研究。

#35 Re: RISC-V » 与 ARM 相比,Risc-V 有多好? » 2022-05-04 12:24:02

yobbo 说:

ARM 要授权费
RISC-V 开源架构

IP都要授权费吧?

#38 Re: 全志 SOC » allwinner D1-H ,anyone please help me with eMMC schematic connection? » 2022-04-22 14:49:13

@jagrutvaghela@vegg.co.in
按全志的惯例,SDC0和SDC2都可以引导系统,不过我还没看Datasheet。

#39 Re: 全志 SOC » 最近想开一个A133的坑,有人来一起填吗? » 2022-04-21 13:48:35

IMG_20220421_134709.jpg

刚刚并夕夕下单一台台电P85看下效果如何

#40 Re: 全志 SOC » 开源基于全志V3X & RP2040的3D打印机主板,klipper上下位机一体 » 2022-04-20 18:51:40

xiaok 说:
yixiuge 说:

请问楼主,这个上位机软件是怎样的呢?是在屏幕上面吗?

是网页控制的,屏幕也有,只不过这v3x带不动了....

是很吃内存,还是吃CPU,是3D渲染慢吗?

#41 Re: 全志 SOC » 开源基于全志V3X & RP2040的3D打印机主板,klipper上下位机一体 » 2022-04-20 18:34:43

xiaok 说:

@cube
是串口,也可以USB,但是USB要留出来烧录固件,就直接连了串口

我记得marlin固件也是做3D打印的吧?

#42 Re: 全志 SOC » 开源基于全志V3X & RP2040的3D打印机主板,klipper上下位机一体 » 2022-04-20 18:09:49

xiaok 说:
cube 说:

楼主优秀,可以直接用 V3x的PWM驱动电机吗?可以不用RP2040单片机吗?

可以驱动,但是2040是跑klipper固件的,开源3d打印机固件。
用上位机跑不太好,毕竟不是实时

原来如此,感谢大佬指教,上位机和下位机通过串口通信吗?

#43 Re: 全志 SOC » 开源基于全志V3X & RP2040的3D打印机主板,klipper上下位机一体 » 2022-04-20 17:42:11

楼主优秀,可以直接用 V3x的PWM驱动电机吗?可以不用RP2040单片机吗?

#44 Re: 硬件设计 KiCAD/Protel/DXP/PADS/ORCAD/EAGLE » 小公司EDA设计工具 » 2022-04-17 22:01:53

xfdr0805 说:

Kicad +1   运行流畅  插件丰富 免费开源 无版权风险

请教kicad哪个版本好用,我曾经用了一下,一天奔溃几次,然后就放弃治疗了。

#45 Re: 全志 SOC » 有用人F1C100s外接W5500实现以太网吗 » 2022-04-12 21:45:20

@romanljw
比较一下两个版本的驱动代码。

#52 Re: 全志 SOC » Linux时间戳到2038年后怎办? » 2022-03-31 18:14:56

和硬件的体系架构没有关系,这个是由软件处理的。

#53 Re: 全志 SOC » Linux时间戳到2038年后怎办? » 2022-03-31 17:58:32

现在 time_t 已经是64bit了,可以用到人类飞出太阳系那时候。

#54 Re: 华芯微特 » 爱她,就给她一个惊喜 » 2022-03-30 17:32:14

hotkey 说:
xfdr0805 说:

中间弄个16x16的矩阵  百家姓都塞的下😄

你说的很对!方便换下一任!

蚌埠住了,哈哈哈哈哈哈

#55 Re: 全志 SOC » f1c100s buildroot启动失败 » 2022-03-27 14:18:58

很可能gcc有问题,参考这个

buildroot-tiny200 (F1C100/200s) 开发包近期更新内容 * 已支持DVP摄像头 *
https://whycan.com/t_5221.html

#56 Re: 全志 SOC » 发现一个蛮有创意的二维码生成及展示方式,超级终端模式,我用来在系统上电时通过串口来展示芯片唯一ID了。 » 2022-03-21 18:35:28

cube 说:

道理我都懂,但是那个图片是怎么生成的?没有看明白。

看了楼上的代码,基本明白了,感谢楼主的骚操作。

#59 Re: 全志 SOC » 少儿编程玩具运行linux » 2022-03-18 15:50:09

鳝丝与螺丝 说:

对了,你们一般用什么软件连接ssh(官网推荐适用putty)

mobaxterm

#60 Re: 全志 SOC » 为新设备构建主线u-boot » 2022-03-16 21:31:10

bigbat 说:

大佬u-boot的DTS和linux的DTS是一种文件吗?

可以是,但是一般没有这样做,我看全志的a133 SDK就是用同一个dtb文件。

#61 Re: 全志 SOC » F1C600的资料(含User_Manual与Datasheet) » 2022-03-11 16:58:01

如何在本站发图片, 顺便吐槽功能弱智的phpbb半自动步木仑
https://whycan.com/t_588.html#p16351

#62 Re: 全志 SOC » F1C100s跑rtt+lvgl显示gif图片效果卡顿求助 » 2022-03-10 12:26:22

把那个帧率fps显示打开,看下现在是什么帧率?

#63 Re: 全志 SOC » F1C100s跑rtt+lvgl显示gif图片效果卡顿求助 » 2022-03-09 19:00:41

aozima 说:

要不用硬件jpg?

感觉是,没有在指定时间内完成图片解码导致帧率降低?

#66 Re: 全志 SOC » 我想把我们的FrameBuffer改成16Bit » 2022-03-05 11:53:05

因为这个芯片也是32位的,内存也是32位,现在要把帧缓冲改成16位的,那不是还要做一次转换,不会更慢吗?

#67 Re: 全志 SOC » V3S有人遇到过能启动FEL但是检测不到FLASH的情况吗? » 2022-03-04 10:34:58

那 D+/D- 直接飞线,这样干扰很小,可以试一试。

#68 Re: 全志 SOC » V3S有人遇到过能启动FEL但是检测不到FLASH的情况吗? » 2022-03-04 10:26:09

换电脑,换usb线,换荔枝派的开发板试一试。

大概率是板子usb布线有点问题。

#70 Re: 全志 SOC » 开源全志V3x工程,AD格式四层板,看了很多坛友的原理图,也参考了V3s的标案,准备打板验证 » 2022-02-28 22:54:23

① 芯片肚子记得可靠接地
② Vrtc 接3V3
③ 检查晶振有没有起振,如果没有示波器,可以用万用表量一下,约1.5v

#71 Re: 全志 SOC » 关于V3S 32M FLASH 空间 » 2022-02-28 14:07:12

yuanlwjt 说:

不是,芒果派的系统移植

淘宝上面那个对吧,看下日志是什么样的。

#76 Re: 全志 SOC » F1c100s 卡在Starting kernel ... » 2022-02-23 11:23:06

wuwuw 说:

已弄好

什么问题呢?

#77 Re: 全志 SOC » 分享一个用于烧录SD-NAND或EMMC的xfel版本,目前支持F133/D1S » 2022-02-23 11:20:14

xboot 说:

fes模式,uboot提供的一条命令sprite_test,之前还在思考是否要支持下fes模式。

那fes和fel在电脑端是同一个驱动吗?

#78 Re: 全志 SOC » 分享一个用于烧录SD-NAND或EMMC的xfel版本,目前支持F133/D1S » 2022-02-23 11:00:15

全志官方的烧录软件烧录到eMMC那速度相当快,不知道啥原理。

#79 Re: 全志 SOC » DKTool工具BUG提交汇总 » 2022-02-22 23:29:31

DEQ 说:

刚入坑一个MPi-R R3c 打开工具后显示 SOC: F1C200S   SPI FLASH: 0M  ,  为什么FLASH是0M啊

DDR坏了,或者DDR供电有问题

#80 Re: 全志 SOC » 开源个D1s核心板 » 2022-02-21 21:42:46

MajorTom 说:
XIVN1987 说:

楼主,,你的线都好细啊,,比芯片焊盘细好多,,这样会不会影响电路性能啊??

JLC做4mil还是可以的,这个板子也是4mil。
https://whycan.com/files/members/7124/20210411_205541.jpg

大佬,这个H3板子方便分享一下吗?

#82 Re: 全志 SOC » 小麻雀 Nezha-MQ 迎来双核A7版本128M内存(基于T113-s3) » 2022-02-16 17:45:51

shaoxi2010 说:

这么神奇的啊,话说RISCV的BROM在那个位置弄出来的啊

同求如何读brom固件方法。

#83 Re: 全志 SOC » 小麻雀 Nezha-MQ 迎来双核A7版本128M内存(基于T113-s3) » 2022-02-16 17:44:28

xboot 说:

RSICV核心在里面的,因为我可以dump T113的RISCV的brom,跟D1/F133的RISCV做了比较,一模一样。

那是用熔丝位做区分的?

#85 Re: 全志 SOC » 自制全志H3核心板 » 2022-02-09 21:48:01

xiaolibo 说:
cube 说:
xiaolibo 说:

嗯嗯,我的TF卡,是直接飞线的,还没有画底板

sunxi-fel 有一个uboot子命令,可以直接通过内存运行uboot,无需刷卡,你试一试。

嗯嗯,好的,我先看看

uboot里面把tf卡clk调低试一试。

#86 Re: 全志 SOC » 自制全志H3核心板 » 2022-02-09 21:07:58

xiaolibo 说:

嗯嗯,我的TF卡,是直接飞线的,还没有画底板

sunxi-fel 有一个uboot子命令,可以直接通过内存运行uboot,无需刷卡,你试一试。

#88 Re: 君正Ingenic/X1000/X2000/T10/T20/T30 » 君正 x2000 移植qt后无法设置断点 » 2022-02-06 22:44:23

lmjlzyljy 说:
cube 说:

@lmjlzyljy
建议先用gdb到x2000上面本机调试试一试,然后再用远程gdb。

我之前已经用Eclipse C++ 的远程GDB试过了(使用和QT同样配置的mips-linux-gun-gdb和gdb-multiarch)。可以设置断点。所以还是怀疑QT没有配置好?

怀疑你编译的可执行程序没有带调试信息。

#89 Re: 君正Ingenic/X1000/X2000/T10/T20/T30 » 君正 x2000 移植qt后无法设置断点 » 2022-02-06 21:55:49

@lmjlzyljy
建议先用gdb到x2000上面本机调试试一试,然后再用远程gdb。

#90 Re: 君正Ingenic/X1000/X2000/T10/T20/T30 » 君正 x2000 移植qt后无法设置断点 » 2022-02-06 20:45:48

lmjlzyljy 说:

在pro工程文件里添加如下内容:
  QMAKE_CXXFLAGS += -g
构建后下载到开发板并调试程序依然无法在设定的断点处停止?

step by step 使用gdb调试Linux平台应用程序
https://whycan.com/t_1210.html#p7384

#91 Re: 君正Ingenic/X1000/X2000/T10/T20/T30 » 君正 x2000 移植qt后无法设置断点 » 2022-02-06 18:45:35

lmjlzyljy 说:

@ubuntu :您是指x2000的交叉编译工具链mips-linux-gnu-gcc吗?如果是请问在QT Creator哪里设定?不胜感谢!!!(我用QT5版本qt5.12.2)

你是用 pro工程文件吗?貌似 在那里面加 -g

#92 Re: 全志 SOC » 请问S3这种单通道LVDS芯片可以点亮双通道17寸的友达 M170ETN01.1吗? » 2022-02-06 13:51:28

恐怕不行,S3只能点单通道的LVDS,双通道估计无能为力。

#96 Re: 全志 SOC » 全志A133/T509/AIC800 编译 longan SDK 出现这个错误 » 2022-01-31 17:35:24

cloudxxcloud 说:

aic800也凉凉了

没有凉,只是换马甲了而已。

#98 Re: VMWare/Linux/Ubuntu/Fedora/CentOS/U-BOOT » VirtualBox在win10下性能比较差的解决办法 » 2022-01-15 10:58:23

642242855 说:

还是习惯用VMWare,

我也是,以前用virtualbox,奔溃之后虚拟机都挂了。

#99 Re: 全志 SOC » v3s网络问题 » 2022-01-11 22:51:14

how0723 说:

为什么全志的驱动要放在stm里面 ?吐血

共用IP

#100 Re: 全志 SOC » 淘宝CP2102无法自动匹配驱动问题 » 2022-01-08 00:40:27

感谢分享!原因是因为JS翻新的芯片,那些OPT寄存器被写过了。

#101 Re: Qt/MSVC/MINGW/C++/MFC/GTK+/Delphi/BCB » QT开机速度优化 » 2022-01-08 00:13:55

或者一步到位用LVGL这些轻量级GUI,功能更强大。

#102 Re: Qt/MSVC/MINGW/C++/MFC/GTK+/Delphi/BCB » QT开机速度优化 » 2022-01-08 00:12:52

Qt的 可执行文件 + so文件 太大了,加载时间太久,适当剪裁Qt,把不要的功能都去掉,节省ROM。

#103 Re: 全志 SOC » 开源 全志f1c100s(200s)所有IO都引出 » 2022-01-05 14:57:49

mapleft 说:

F1C 中间那个大洞是用老散热的么?, 我看很多人画的PCB中间的洞都是这么大的

散热的功能是其次的,主要是节省引脚用,你看他四周都没有gnd脚,只有肚子上那个引脚是gnd。

#114 Re: 全志 SOC » 关于F1C100S屏幕RGB » 2021-12-10 00:18:25

可以的,搜一下tcon 那个swap rb寄存器

#115 Re: 全志 SOC » 全志r328快速启动实现(上电1.5秒进Shell) » 2021-12-09 09:32:29

@mengxp
至今我只见过D1/D1s的boot0开源。

#116 Re: 全志 SOC » 为方便大家研究全志RISCV D1芯片,花了点时间编写了一个精简版的裸机程序,方便大家学习参考。 » 2021-12-08 13:04:35

woolen 说:

@cube
从代码里面直接编译出来的bin,有执行mksunxi的,而且ddr初始化的部分有打印的,应该是已经被加载到了sram然后执行了一部分?

日志贴出来看看

#117 Re: 全志 SOC » 为方便大家研究全志RISCV D1芯片,花了点时间编写了一个精简版的裸机程序,方便大家学习参考。 » 2021-12-08 11:59:50

woolen 说:

请问我用xfel工具直接在DDR中运行d1-baremetal.bin,可以正常运行,但是烧录到d1自带spinand的0地址后,重启只有ddr初始化成功的打印,没有main的count循环打印,这个正常吗?我测过从spinand读出来24k确认已经烧录成功了。

估计是这个bin没有magic和crc,
可能brom不识别吧?

#124 Re: 全志 SOC » 子午线V3s路由器试玩 » 2021-11-23 08:49:20

sblpp 说:

上面可以挂液晶屏吗?如果能把液晶屏接上,就美滋滋啦~~

挂不上了,40p座子拆了。

#125 Re: 全志 SOC » 全志android 系统 uart驱动里面控制一个io脚实现rs485功能,应该如何修改 » 2021-11-22 13:37:07

swhkt 说:
哇酷小二 说:

应该是PH8 CTS控制RS485收发。

那按硬件的接法我们已经没有办法用全志现成的dts配置了? 只能把这个控制当是普通的GPIO来控制了,回到我一开始的问题了。

你现在硬件用哪个IO控制485收发?

#126 Re: 全志 SOC » 模块供电问题 » 2021-11-22 13:35:58

树莓学LINUX 说:

还有一个问题,v3s    zero中,使用的是电源管理芯片ea3036,我可不可以全使用线性IDO降压电路

可以,但是1V2那组发热会很大。

#127 Re: 全志 SOC » 模块供电问题 » 2021-11-22 13:35:26

树莓学LINUX 说:

在实际使用中,比如我用不到mipi接口,我可不可以不对该部分进行供电,不对该处引脚进行上下拉操作,如图所示:
https://whycan.com/files/members/7574/pic2.png

可以不供电,这组口没有复用。

#128 Re: 全志 SOC » 发现一个问题,荔枝派的SD卡引脚与串口0使用的是同一个引脚,这样做不会产生冲突吗? » 2021-11-21 23:12:20

没错,这就是端口复用啊,同一个io口通过寄存器配置可以指定其中一种复用。

#129 Re: 全志 SOC » 全志H3要用qt该怎么做? » 2021-11-16 10:11:21

@夜阑卧听
不好意思,我的表述不准确。

应该是说,如果想要效果好,帧率高,Qt的软刷太慢了,得用硬刷。

#130 Re: 全志 SOC » 全志H3要用qt该怎么做? » 2021-11-16 09:50:11

这个问题和Qt无关,要用硬件的分层显示。

通过Qt软刷,分辨率越大,帧率越低。

#131 Re: 全志 SOC » v3s lichee zero 单独usb供电,启动到uboot就没戏了? » 2021-11-14 21:46:19

地瓜红薯 说:

@cube
大师果然名不虚传,一下子就帮小弟出掉bug.

确定是这个问题吗?

#132 Re: 全志 SOC » v3s lichee zero 单独usb供电,启动到uboot就没戏了? » 2021-11-14 20:26:44

地瓜红薯 说:

小弟从早上玩这个奇葩主线uboot,主线linux,builtroot,发现我烧录成鱼落雁,闭月羞花的tf卡spl uboot是可以usb 供电启动的,我自己编译的spl uboot就不能通过usb供电启动.是不是有个什么pin使得usb进入fel下载模式?read the fucking code.

感觉cpu或者ddr要降频


参考:
(V3s/V3x/S3/S3L/R11通吃)小智V3x开发板smallwitpi lite u-boot/linux/buildroot测试
https://whycan.com/t_7248.html#p69168

#134 Re: 全志 SOC » SDIO ESP8089开源Linux驱动现在可以直接编译通过了, 有没有朋友一起试一试 » 2021-11-02 21:58:09

@司徒
今天发现一个更神奇的问题, ESP8089 SDIO 驱动装上了,可以ping, 然后我就CTRL + C 了,然后早上一看,网络什么都没干,系统也死了,dump信息和上面一模一样。

#135 Re: 全志 SOC » SDIO ESP8089开源Linux驱动现在可以直接编译通过了, 有没有朋友一起试一试 » 2021-11-01 23:49:36

#
#
#
# [ 7372.646195] esp_sdio_remove enter
[ 7372.651835] sif_disable_irq release irq failed
[ 7372.656546] ------------[ cut here ]------------
[ 7372.661218] WARNING: CPU: 0 PID: 231 at kernel/workqueue.c:3042 __flush_work+0x1f0/0x200
[ 7372.669388] Modules linked in: esp8089(O) rtc_hym8563 tsc2007
[ 7372.675162] CPU: 0 PID: 231 Comm: kworker/0:1 Tainted: G           O      5.4.70-smallwitpi #3
[ 7372.683759] Hardware name: Allwinner sun8i Family
[ 7372.688489] Workqueue: events_freezable mmc_rescan
[ 7372.693319] [<c010ec5c>] (unwind_backtrace) from [<c010b57c>] (show_stack+0x10/0x14)
[ 7372.701071] [<c010b57c>] (show_stack) from [<c0713f3c>] (dump_stack+0x94/0xa8)
[ 7372.708304] [<c0713f3c>] (dump_stack) from [<c011dba0>] (__warn+0xbc/0xd4)
[ 7372.715181] [<c011dba0>] (__warn) from [<c011dc68>] (warn_slowpath_fmt+0xb0/0xb8)
[ 7372.722665] [<c011dc68>] (warn_slowpath_fmt) from [<c0137e04>] (__flush_work+0x1f0/0x200)
[ 7372.730841] [<c0137e04>] (__flush_work) from [<c0138060>] (__cancel_work_timer+0x110/0x1f4)
[ 7372.739243] [<c0138060>] (__cancel_work_timer) from [<bf0126a4>] (sip_detach+0x88/0x1b4 [esp8089])
[ 7372.748239] [<bf0126a4>] (sip_detach [esp8089]) from [<bf00e058>] (esp_sdio_remove+0x64/0x1a4 [esp8089])
[ 7372.757743] [<bf00e058>] (esp_sdio_remove [esp8089]) from [<c0583880>] (sdio_bus_remove+0x30/0x11c)
[ 7372.766800] [<c0583880>] (sdio_bus_remove) from [<c047c644>] (device_release_driver_internal+0xe8/0x1b8)
[ 7372.776281] [<c047c644>] (device_release_driver_internal) from [<c047b0f4>] (bus_remove_device+0xcc/0xf8)
[ 7372.785847] [<c047b0f4>] (bus_remove_device) from [<c047766c>] (device_del+0x140/0x36c)
[ 7372.793851] [<c047766c>] (device_del) from [<c0583a94>] (sdio_remove_func+0x1c/0x28)
[ 7372.801594] [<c0583a94>] (sdio_remove_func) from [<c058180c>] (mmc_sdio_remove+0x38/0x64)
[ 7372.809769] [<c058180c>] (mmc_sdio_remove) from [<c0582aa8>] (mmc_sdio_detect+0x6c/0xf8)
[ 7372.817862] [<c0582aa8>] (mmc_sdio_detect) from [<c0579c58>] (mmc_rescan+0xc0/0x3f4)
[ 7372.825606] [<c0579c58>] (mmc_rescan) from [<c013674c>] (process_one_work+0x218/0x474)
[ 7372.833521] [<c013674c>] (process_one_work) from [<c01369ec>] (worker_thread+0x44/0x5d8)
[ 7372.841614] [<c01369ec>] (worker_thread) from [<c013cc54>] (kthread+0x14c/0x150)
[ 7372.849012] [<c013cc54>] (kthread) from [<c01010e8>] (ret_from_fork+0x14/0x2c)
[ 7372.856226] Exception stack(0xc68b3fb0 to 0xc68b3ff8)
[ 7372.861280] 3fa0:                                     00000000 00000000 00000000 00000000
[ 7372.869450] 3fc0: 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
[ 7372.877619] 3fe0: 00000000 00000000 00000000 00000000 00000013 00000000
[ 7372.884377] ---[ end trace 463d889c65379c21 ]---
[ 7372.889119] wlan0: deauthenticating from e4:26:8b:89:a9:f8 by local choice (Reason: 3=DEAUTH_LEAVING)
[ 7372.996701] mmc0: card 0001 removed
[ 7373.065437] mmc0: queuing unknown CIS tuple 0x01 (3 bytes)
[ 7373.084469] mmc0: queuing unknown CIS tuple 0x1a (5 bytes)
[ 7373.099565] mmc0: queuing unknown CIS tuple 0x1b (8 bytes)
[ 7373.118088] mmc0: queuing unknown CIS tuple 0x80 (1 bytes)
[ 7373.130367] mmc0: queuing unknown CIS tuple 0x81 (1 bytes)
[ 7373.146175] mmc0: queuing unknown CIS tuple 0x82 (1 bytes)
[ 7373.156157] mmc0: new high speed SDIO card at address 0001
[ 7373.176074] 8<--- cut here ---
[ 7373.179186] Unable to handle kernel NULL pointer dereference at virtual address 00000004
[ 7373.187445] pgd = e14de9ca
[ 7373.190147] [00000004] *pgd=00000000
[ 7373.193740] Internal error: Oops: 17 [#1] SMP ARM
[ 7373.198440] Modules linked in: esp8089(O) rtc_hym8563 tsc2007
[ 7373.204205] CPU: 0 PID: 231 Comm: kworker/0:1 Tainted: G        W  O      5.4.70-smallwitpi #3
[ 7373.212803] Hardware name: Allwinner sun8i Family
[ 7373.217543] Workqueue: events_freezable mmc_rescan
[ 7373.222388] PC is at esp_sdio_probe+0x48/0x3e0 [esp8089]
[ 7373.227711] LR is at sdio_bus_probe+0xbc/0x17c
[ 7373.232151] pc : [<bf00e1e0>]    lr : [<c0583790>]    psr: 200e0013
[ 7373.238409] sp : c68b3d90  ip : 3bc71000  fp : 00000396
[ 7373.243628] r10: 00000000  r9 : bf017190  r8 : bf017190
[ 7373.248846] r7 : c621ca00  r6 : bf01a080  r5 : bf0467c4  r4 : 00000000
[ 7373.255366] r3 : c621ca08  r2 : 00000003  r1 : 00000000  r0 : c621ca00
[ 7373.261889] Flags: nzCv  IRQs on  FIQs on  Mode SVC_32  ISA ARM  Segment none
[ 7373.269016] Control: 10c5387d  Table: 4624406a  DAC: 00000051
[ 7373.274755] Process kworker/0:1 (pid: 231, stack limit = 0x71c92228)
[ 7373.281105] Stack: (0xc68b3d90 to 0xc68b4000)
[ 7373.285463] 3d80:                                     0000000d 00000000 00000396 c621ca08
[ 7373.293636] 3da0: c621ca00 00000000 bf01a0ec bf017190 0000000d c0583790 c0ba2188 c621ca08
[ 7373.301808] 3dc0: c0ba218c 00000000 bf01a0ec c047bf44 c621ca08 bf01a0ec c047c3a0 c0b04e48
[ 7373.309980] 3de0: 00000001 00000000 c0b04e48 c047c1ec bf01a0ec c68b3e4c c621ca08 00000000
[ 7373.318151] 3e00: c68b3e4c c047c3a0 c0b04e48 00000001 00000000 c0b04e48 00000396 c047a344
[ 7373.326321] 3e20: 00000000 c693a26c c6225538 8daf25ec c0b04e48 c0b04e48 c621ca08 c621ca4c
[ 7373.334494] 3e40: c0b04e48 c047bcb8 c0b60f5c c621ca08 00000001 8daf25ec c621ca08 c621ca08
[ 7373.342665] 3e60: c0b58e98 c0b04e48 00000000 c047b020 c621ca08 c62cc808 00000000 c0477f74
[ 7373.350838] 3e80: c6002000 c0578fc0 c0b04e48 c621ca08 c6002000 8daf25ec c68b3eb0 c621ca00
[ 7373.359008] 3ea0: c621ca08 c6002000 c62cc800 c62cc800 00000001 c0583a64 00000000 00000001
[ 7373.367179] 3ec0: c6002000 c0582db4 00000000 c68b3edf 00000000 00000000 00000000 00000000
[ 7373.375350] 3ee0: 10ffff00 8daf25ec ffffff92 c6002294 00061a80 c6002000 c088c868 c088c874
[ 7373.383522] 3f00: 00000000 00000000 c7fdd900 c0579ed8 c6002294 c6225480 c7fdd900 c7fe0d00
[ 7373.391693] 3f20: 00000000 c013674c c0b03d00 c7fdd918 c6225480 c7fdd900 c6225494 c0b03d00
[ 7373.399865] 3f40: c7fdd918 ffffe000 00000008 c01369ec ffffe000 c0b61c29 c0916048 c6225480
[ 7373.408037] 3f60: c01369a8 c61a14c0 c61a1340 00000000 c68b2000 c6225480 c01369a8 c600fea4
[ 7373.416209] 3f80: c61a14dc c013cc54 000000b2 c61a1340 c013cb08 00000000 00000000 00000000
[ 7373.424380] 3fa0: 00000000 00000000 00000000 c01010e8 00000000 00000000 00000000 00000000
[ 7373.432552] 3fc0: 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
[ 7373.440723] 3fe0: 00000000 00000000 00000000 00000000 00000013 00000000 00000000 00000000
[ 7373.448942] [<bf00e1e0>] (esp_sdio_probe [esp8089]) from [<c0583790>] (sdio_bus_probe+0xbc/0x17c)
[ 7373.457831] [<c0583790>] (sdio_bus_probe) from [<c047bf44>] (really_probe+0x218/0x348)
[ 7373.465752] [<c047bf44>] (really_probe) from [<c047c1ec>] (driver_probe_device+0x60/0x164)
[ 7373.474017] [<c047c1ec>] (driver_probe_device) from [<c047a344>] (bus_for_each_drv+0x58/0xb8)
[ 7373.482540] [<c047a344>] (bus_for_each_drv) from [<c047bcb8>] (__device_attach+0xe0/0x14c)
[ 7373.490801] [<c047bcb8>] (__device_attach) from [<c047b020>] (bus_probe_device+0x84/0x8c)
[ 7373.498976] [<c047b020>] (bus_probe_device) from [<c0477f74>] (device_add+0x3b8/0x604)
[ 7373.506890] [<c0477f74>] (device_add) from [<c0583a64>] (sdio_add_func+0x5c/0x70)
[ 7373.514372] [<c0583a64>] (sdio_add_func) from [<c0582db4>] (mmc_attach_sdio+0x280/0x358)
[ 7373.522464] [<c0582db4>] (mmc_attach_sdio) from [<c0579ed8>] (mmc_rescan+0x340/0x3f4)
[ 7373.530302] [<c0579ed8>] (mmc_rescan) from [<c013674c>] (process_one_work+0x218/0x474)
[ 7373.538222] [<c013674c>] (process_one_work) from [<c01369ec>] (worker_thread+0x44/0x5d8)
[ 7373.546315] [<c01369ec>] (worker_thread) from [<c013cc54>] (kthread+0x14c/0x150)
[ 7373.553715] [<c013cc54>] (kthread) from [<c01010e8>] (ret_from_fork+0x14/0x2c)
[ 7373.560929] Exception stack(0xc68b3fb0 to 0xc68b3ff8)
[ 7373.565978] 3fa0:                                     00000000 00000000 00000000 00000000
[ 7373.574149] 3fc0: 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
[ 7373.582317] 3fe0: 00000000 00000000 00000000 00000000 00000013 00000000
[ 7373.588936] Code: e5954018 e3a01000 e5851018 e2873008 (e5948004)
[ 7373.595199] ---[ end trace 463d889c65379c22 ]---
#
#

诡异,放这里什么都没干,也挂了。

#136 Re: 全志 SOC » 请问一下,全志的A33芯片的串口是不是波特率高了就会出现数据错误啊!!! » 2021-11-01 11:30:13

jkl 说:
tigger 说:
jkl 说:

BSP

这么高波特率得用四线模式,bsp支持的。

四线模式???刚才百度,找不到相关概念,是不是说配置成这样https://whycan.com/files/members/2437/1635736079(1).png

是的,要通过编程接口启用四线模式,这样rts,cts才会起作用。

#137 Re: 全志 SOC » SDIO ESP8089开源Linux驱动现在可以直接编译通过了, 有没有朋友一起试一试 » 2021-11-01 09:36:14

@司徒

感谢司徒大佬回复,

#
#
# lsmod
Module                  Size  Used by    Tainted: G
esp8089               249856  0
tsc2007                16384  0
rtc_hym8563            16384  0
# rmmod esp8089
[ 1301.744604] esp_sdio_exit
[ 1301.747950] esp_sdio_remove enter
[ 1301.754145] ------------[ cut here ]------------
[ 1301.758986] WARNING: CPU: 0 PID: 184 at kernel/workqueue.c:3042 __flush_work+0x1f0/0x200
[ 1301.767119] Modules linked in: esp8089(O-) tsc2007 rtc_hym8563
[ 1301.772981] CPU: 0 PID: 184 Comm: rmmod Tainted: G           O      5.4.70-smallwitpi #3
[ 1301.781059] Hardware name: Allwinner sun8i Family
[ 1301.785810] [<c010ec5c>] (unwind_backtrace) from [<c010b57c>] (show_stack+0x10/0x14)
[ 1301.793564] [<c010b57c>] (show_stack) from [<c0713f3c>] (dump_stack+0x94/0xa8)
[ 1301.800797] [<c0713f3c>] (dump_stack) from [<c011dba0>] (__warn+0xbc/0xd4)
[ 1301.807671] [<c011dba0>] (__warn) from [<c011dc68>] (warn_slowpath_fmt+0xb0/0xb8)
[ 1301.815153] [<c011dc68>] (warn_slowpath_fmt) from [<c0137e04>] (__flush_work+0x1f0/0x200)
[ 1301.823330] [<c0137e04>] (__flush_work) from [<c0138060>] (__cancel_work_timer+0x110/0x1f4)
[ 1301.831739] [<c0138060>] (__cancel_work_timer) from [<bf0126a4>] (sip_detach+0x88/0x1b4 [esp8089])
[ 1301.840735] [<bf0126a4>] (sip_detach [esp8089]) from [<bf00e058>] (esp_sdio_remove+0x64/0x1a4 [esp8089])
[ 1301.850238] [<bf00e058>] (esp_sdio_remove [esp8089]) from [<c0583880>] (sdio_bus_remove+0x30/0x11c)
[ 1301.859295] [<c0583880>] (sdio_bus_remove) from [<c047c644>] (device_release_driver_internal+0xe8/0x1b8)
[ 1301.868780] [<c047c644>] (device_release_driver_internal) from [<c047c780>] (driver_detach+0x54/0xa0)
[ 1301.877998] [<c047c780>] (driver_detach) from [<c047b350>] (bus_remove_driver+0x4c/0xa4)
[ 1301.886104] [<c047b350>] (bus_remove_driver) from [<bf00e850>] (esp_sdio_exit+0x28/0x50 [esp8089])
[ 1301.895081] [<bf00e850>] (esp_sdio_exit [esp8089]) from [<c0197340>] (sys_delete_module+0x128/0x1f0)
[ 1301.904214] [<c0197340>] (sys_delete_module) from [<c0101000>] (ret_fast_syscall+0x0/0x54)
[ 1301.912471] Exception stack(0xc61c5fa8 to 0xc61c5ff0)
[ 1301.917526] 5fa0:                   b6e8e364 38707365 beee4bc8 00000880 00000000 beee4e28
[ 1301.925698] 5fc0: b6e8e364 38707365 00393830 00000081 00000000 00000000 b6f65000 00000000
[ 1301.933865] 5fe0: beee4bc0 beee4bb0 b6e8e22c b6e0b0e2
[ 1301.939038] ---[ end trace 76a1858765e054ce ]---
[ 1301.943743] wlan0: deauthenticating from e4:26:8b:89:a9:f8 by local choice (Reason: 3=DEAUTH_LEAVING)
[ 1302.047595] ESP8089 reset via GPIO 0
#
# insmod /lib/esp8089.ko
[ 1345.884022]
[ 1345.884022] ***** EAGLE DRIVER VER:bdf5087c3deb*****
[ 1345.884022]
[ 1345.892366] ESP8089 reset via GPIO 0
[ 1346.116240] esp_sdio_dummy_probe enter
[ 1346.335511] esp_sdio_init power up OK
[ 1346.375818] Set sdio block size 512 failed: -110)
[ 1346.380871] first error exit
[ 1346.383816] eagle_sdio: probe of mmc0:0001:1 failed with error -110
#
#

这个 insmod/rmmod 问题是因为 TF卡模块没有接RST 引起吗?

#138 Re: 全志 SOC » 小白自制Linux开发板(F1C200s)整理系列,持续更新中 » 2021-11-01 09:22:10

@twzy
SDIO ESP8089开源Linux驱动现在可以直接编译通过了, 有没有朋友一起试一试
https://whycan.com/t_4326.html#p69705


和我这情况一样了, 有人说是电源问题,一脸懵x。

#139 Re: 全志 SOC » SDIO ESP8089开源Linux驱动现在可以直接编译通过了, 有没有朋友一起试一试 » 2021-11-01 08:12:48

4104 bytes from 183.232.112.93: seq=35917 ttl=55 time=20.928 ms
4104 bytes from 183.232.112.93: seq=35918 ttl=55 time=21.404 ms
4104 bytes from 183.232.112.93: seq=35919 ttl=55 time=26.296 ms
4104 bytes from 183.232.112.93: seq=35920 ttl=55 time=22.180 ms
4104 bytes from 183.232.112.93: seq=35921 ttl=55 time=23.201 ms
4104 bytes from 183.232.112.93: seq=35922 ttl=55 time=23.273 ms
4104 bytes from 183.232.112.93: seq=35923 ttl=55 time=24.312 ms
4104 bytes from 183.232.112.93: seq=35924 ttl=55 time=21.870 ms
4104 bytes from 183.232.112.93: seq=35925 ttl=55 time=22.400 ms
4104 bytes from 183.232.112.93: seq=35926 ttl=55 time=28.128 ms
[36024.858388] wlan0: authenticate with e4:26:8b:89:a9:f8
[36024.863840] wlan0: send auth to e4:26:8b:89:a9:f8 (try 1/3)
[36025.075400] wlan0: send auth to e4:26:8b:89:a9:f8 (try 2/3)
[36025.285360] wlan0: send auth to e4:26:8b:89:a9:f8 (try 3/3)
[36025.495337] wlan0: authentication with e4:26:8b:89:a9:f8 timed out
[36973.133610] esp_sdio_remove enter
[36973.139131] sif_disable_irq release irq failed
[36973.143668] ------------[ cut here ]------------
[36973.148535] WARNING: CPU: 0 PID: 302 at kernel/workqueue.c:3042 __flush_work+0x1f0/0x200
[36973.156667] Modules linked in: esp8089(O) tsc2007 rtc_hym8563
[36973.162441] CPU: 0 PID: 302 Comm: kworker/0:1 Tainted: G           O      5.4.70-smallwitpi #3
[36973.171040] Hardware name: Allwinner sun8i Family
[36973.175768] Workqueue: events_freezable mmc_rescan
[36973.180602] [<c010ec5c>] (unwind_backtrace) from [<c010b57c>] (show_stack+0x10/0x14)
[36973.188355] [<c010b57c>] (show_stack) from [<c0713f3c>] (dump_stack+0x94/0xa8)
[36973.195587] [<c0713f3c>] (dump_stack) from [<c011dba0>] (__warn+0xbc/0xd4)
[36973.202462] [<c011dba0>] (__warn) from [<c011dc68>] (warn_slowpath_fmt+0xb0/0xb8)
[36973.209945] [<c011dc68>] (warn_slowpath_fmt) from [<c0137e04>] (__flush_work+0x1f0/0x200)
[36973.218122] [<c0137e04>] (__flush_work) from [<c0138060>] (__cancel_work_timer+0x110/0x1f4)
[36973.226527] [<c0138060>] (__cancel_work_timer) from [<bf0126a4>] (sip_detach+0x88/0x1b4 [esp8089])
[36973.235527] [<bf0126a4>] (sip_detach [esp8089]) from [<bf00e058>] (esp_sdio_remove+0x64/0x1a4 [esp8089])
[36973.245028] [<bf00e058>] (esp_sdio_remove [esp8089]) from [<c0583880>] (sdio_bus_remove+0x30/0x11c)
[36973.254085] [<c0583880>] (sdio_bus_remove) from [<c047c644>] (device_release_driver_internal+0xe8/0x1b8)
[36973.263567] [<c047c644>] (device_release_driver_internal) from [<c047b0f4>] (bus_remove_device+0xcc/0xf8)
[36973.273133] [<c047b0f4>] (bus_remove_device) from [<c047766c>] (device_del+0x140/0x36c)
[36973.281135] [<c047766c>] (device_del) from [<c0583a94>] (sdio_remove_func+0x1c/0x28)
[36973.288877] [<c0583a94>] (sdio_remove_func) from [<c058180c>] (mmc_sdio_remove+0x38/0x64)
[36973.297052] [<c058180c>] (mmc_sdio_remove) from [<c0582aa8>] (mmc_sdio_detect+0x6c/0xf8)
[36973.305142] [<c0582aa8>] (mmc_sdio_detect) from [<c0579c58>] (mmc_rescan+0xc0/0x3f4)
[36973.312887] [<c0579c58>] (mmc_rescan) from [<c013674c>] (process_one_work+0x218/0x474)
[36973.320803] [<c013674c>] (process_one_work) from [<c01369ec>] (worker_thread+0x44/0x5d8)
[36973.328896] [<c01369ec>] (worker_thread) from [<c013cc54>] (kthread+0x14c/0x150)
[36973.336295] [<c013cc54>] (kthread) from [<c01010e8>] (ret_from_fork+0x14/0x2c)
[36973.343510] Exception stack(0xc616bfb0 to 0xc616bff8)
[36973.348560] bfa0:                                     00000000 00000000 00000000 00000000
[36973.356731] bfc0: 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
[36973.364900] bfe0: 00000000 00000000 00000000 00000000 00000013 00000000
[36973.371676] ---[ end trace 47c0350e194c98ef ]---
[36973.389204] func sip_write_pkts err!!!!!!!!!: -123
[36973.417439] mmc0: card 0001 removed
[36973.490332] mmc0: queuing unknown CIS tuple 0x01 (3 bytes)
[36973.503468] mmc0: queuing unknown CIS tuple 0x1a (5 bytes)
[36973.512152] mmc0: queuing unknown CIS tuple 0x1b (8 bytes)
[36973.519781] mmc0: queuing unknown CIS tuple 0x80 (1 bytes)
[36973.525385] mmc0: queuing unknown CIS tuple 0x81 (1 bytes)
[36973.530925] mmc0: queuing unknown CIS tuple 0x82 (1 bytes)
[36973.536512] mmc0: new high speed SDIO card at address 0001
[36973.550474] 8<--- cut here ---
[36973.553575] Unable to handle kernel NULL pointer dereference at virtual address 00000004
[36973.561864] pgd = 13fb3490
[36973.564577] [00000004] *pgd=00000000
[36973.568222] Internal error: Oops: 17 [#1] SMP ARM
[36973.572927] Modules linked in: esp8089(O) tsc2007 rtc_hym8563
[36973.578694] CPU: 0 PID: 302 Comm: kworker/0:1 Tainted: G        W  O      5.4.70-smallwitpi #3
[36973.587292] Hardware name: Allwinner sun8i Family
[36973.592029] Workqueue: events_freezable mmc_rescan
[36973.596886] PC is at esp_sdio_probe+0x48/0x3e0 [esp8089]
[36973.602208] LR is at sdio_bus_probe+0xbc/0x17c
[36973.606646] pc : [<bf00e1e0>]    lr : [<c0583790>]    psr: 20000013
[36973.612905] sp : c616bd90  ip : de557a80  fp : 00000396
[36973.618123] r10: 00000000  r9 : bf017190  r8 : bf017190
[36973.623342] r7 : c6be5a00  r6 : bf01a080  r5 : bf0467c4  r4 : 00000000
[36973.629860] r3 : c6be5a08  r2 : 00000003  r1 : 00000000  r0 : c6be5a00
[36973.636384] Flags: nzCv  IRQs on  FIQs on  Mode SVC_32  ISA ARM  Segment none
[36973.643510] Control: 10c5387d  Table: 462d006a  DAC: 00000051
[36973.649252] Process kworker/0:1 (pid: 302, stack limit = 0xe2391612)
[36973.655601] Stack: (0xc616bd90 to 0xc616c000)
[36973.659957] bd80:                                     0000000d 00000000 00000396 c6be5a08
[36973.668129] bda0: c6be5a00 00000000 bf01a0ec bf017190 0000000d c0583790 c0ba2188 c6be5a08
[36973.676301] bdc0: c0ba218c 00000000 bf01a0ec c047bf44 c6be5a08 bf01a0ec c047c3a0 c0b04e48
[36973.684472] bde0: 00000001 00000000 c0b04e48 c047c1ec bf01a0ec c616be4c c6be5a08 00000000
[36973.692644] be00: c616be4c c047c3a0 c0b04e48 00000001 00000000 c0b04e48 00000396 c047a344
[36973.700816] be20: 00000000 c693a26c c6268738 8daf25ec c0b04e48 c0b04e48 c6be5a08 c6be5a4c
[36973.708988] be40: c0b04e48 c047bcb8 c0b60f5c c6be5a08 00000001 8daf25ec c6be5a08 c6be5a08
[36973.717160] be60: c0b58e98 c0b04e48 00000000 c047b020 c6be5a08 c62d8808 00000000 c0477f74
[36973.725331] be80: c6002000 c0578fc0 c0b04e48 c6be5a08 c6002000 8daf25ec c616beb0 c6be5a00
[36973.733503] bea0: c6be5a08 c6002000 c62d8800 c62d8800 00000001 c0583a64 00000000 00000001
[36973.741675] bec0: c6002000 c0582db4 00000000 c616bedf 00000000 00000000 00000000 00000000
[36973.749846] bee0: 10ffff00 8daf25ec ffffff92 c6002294 00061a80 c6002000 c088c868 c088c874
[36973.758018] bf00: 00000000 00000000 c7fdd900 c0579ed8 c6002294 c6268b80 c7fdd900 c7fe0d00
[36973.766191] bf20: 00000000 c013674c c0b03d00 c7fdd918 c6268b80 c7fdd900 c6268b94 c0b03d00
[36973.774362] bf40: c7fdd918 ffffe000 00000008 c01369ec ffffe000 c0b61c29 c0916048 c6268b80
[36973.782534] bf60: c01369a8 c615a100 c615a140 00000000 c616a000 c6268b80 c01369a8 c600fea4
[36973.790705] bf80: c615a11c c013cc54 00000007 c615a140 c013cb08 00000000 00000000 00000000
[36973.798876] bfa0: 00000000 00000000 00000000 c01010e8 00000000 00000000 00000000 00000000
[36973.807047] bfc0: 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
[36973.815218] bfe0: 00000000 00000000 00000000 00000000 00000013 00000000 00000000 00000000
[36973.823431] [<bf00e1e0>] (esp_sdio_probe [esp8089]) from [<c0583790>] (sdio_bus_probe+0xbc/0x17c)
[36973.832318] [<c0583790>] (sdio_bus_probe) from [<c047bf44>] (really_probe+0x218/0x348)
[36973.840240] [<c047bf44>] (really_probe) from [<c047c1ec>] (driver_probe_device+0x60/0x164)
[36973.848503] [<c047c1ec>] (driver_probe_device) from [<c047a344>] (bus_for_each_drv+0x58/0xb8)
[36973.857025] [<c047a344>] (bus_for_each_drv) from [<c047bcb8>] (__device_attach+0xe0/0x14c)
[36973.865287] [<c047bcb8>] (__device_attach) from [<c047b020>] (bus_probe_device+0x84/0x8c)
[36973.873462] [<c047b020>] (bus_probe_device) from [<c0477f74>] (device_add+0x3b8/0x604)
[36973.881376] [<c0477f74>] (device_add) from [<c0583a64>] (sdio_add_func+0x5c/0x70)
[36973.888857] [<c0583a64>] (sdio_add_func) from [<c0582db4>] (mmc_attach_sdio+0x280/0x358)
[36973.896949] [<c0582db4>] (mmc_attach_sdio) from [<c0579ed8>] (mmc_rescan+0x340/0x3f4)
[36973.904788] [<c0579ed8>] (mmc_rescan) from [<c013674c>] (process_one_work+0x218/0x474)
[36973.912706] [<c013674c>] (process_one_work) from [<c01369ec>] (worker_thread+0x44/0x5d8)
[36973.920798] [<c01369ec>] (worker_thread) from [<c013cc54>] (kthread+0x14c/0x150)
[36973.928200] [<c013cc54>] (kthread) from [<c01010e8>] (ret_from_fork+0x14/0x2c)
[36973.935416] Exception stack(0xc616bfb0 to 0xc616bff8)
[36973.940464] bfa0:                                     00000000 00000000 00000000 00000000
[36973.948634] bfc0: 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
[36973.956803] bfe0: 00000000 00000000 00000000 00000000 00000013 00000000
[36973.963422] Code: e5954018 e3a01000 e5851018 e2873008 (e5948004)
[36973.969669] ---[ end trace 47c0350e194c98f0 ]---
ping: sendto: Network is unreachable
#
#
#
#

奇怪,加了一个 3300uF 的大电容也会挂,只是现在没那么容易挂了。

发了 35926 个 4096 字节包之后挂。

#142 全志 SOC » 在主线Linux中支持无blob摄像头的开源全志V3 ISP驱动程序 https://cnx-software.cn/2021/10/14/ » 2021-10-30 16:02:57

cube
回复: 1

在主线Linux中支持无blob摄像头的开源全志V3 ISP驱动程序
https://cnx-software.cn/2021/10/14/open-source-allwinner-v3-isp-driver/

Allwinner SDK 原本是附带了几个二进制 blob的,也就是闭源二进制,但 Bootlin 公司正致力于淘汰这些blob。他们首先为V4L2 框架,以及 Rockchip PX30、RK1808、RK3128 和 RK3288 等处理器中的摄像头接口驱动程序开发了Allwinner A31、V3s/V3/S3 和 A83T MIPI CSI-2的支持,并在不久前实现了对 Omnivision OV8865 和 OV5648 图像传感器的支持。

#144 Re: 全志 SOC » 全志A33 , 4核,1.2G主频 » 2021-10-23 17:04:57

你的问题貌似就是缺一个32bit c库兼容包,20楼的方法试了吗?

由于历史问题,全志bsp包里面的二进制工具都是32bit的,而比较新的linux发行版本里面基本都是64bit,所以需要安装一个兼容包。

#149 Re: ESP32/ESP8266 » ESP8089就是ESP8266 ? » 2021-10-04 17:19:55

ESP8089真是ESP8266的马甲吗?

#151 Re: 全志 SOC » v3s,zero板子的spiflash启动,调用reboot起不来的问题 » 2021-09-27 22:44:56

像STM32的内部看门狗在动作的时候,会从内部拉低RESET引脚。不知道V3S是否也有?

我记得全志的看门狗不拉RST引脚

#154 Re: 全志 SOC » 請問 V3S 關於USB Device 問題? » 2021-09-16 12:52:52

echo 0 > /sys/class/udc/sunxi_usb_udc/device/otg_role


echo 1 > /sys/class/udc/sunxi_usb_udc/device/device_role

瞎猜的,得看下文档

#155 Re: 全志 SOC » Ubuntu使用RTL8723BS模块蓝牙功能总结 » 2021-09-16 12:52:21

inia 说:
哇酷小二 说:

可以用在V3s,好像有帖子,右上角搜一搜。

搞定了,非常感谢。这里面有一个坑,就是必须要用自己的编译环境重新编译一次,否则就没有办法运行。

应该是C库依赖

#156 Re: 全志 SOC » sunxi-fel直接启动u-boot fastboot » 2021-09-16 12:51:12

qianfan 说:
memory 说:

有点意思,这个 0x44000000  地址是怎么算出来的?

随便填个有效地址就行了

随便填怎么关联呢?

#160 Re: 全志 SOC » 执行Qt程序,提示库文件找不到。 » 2021-08-28 08:23:27

你应该是哪里勾选了 opengl,仔细检查一下吧。

#161 全志 SOC » 使用R329方案的小米xiaomi Sound高保真智能音箱拆解(转) » 2021-08-26 22:34:43

cube
回复: 1

mmexportd913acc5b96ded63546a5c6988227996_1629988181118.jpeg

使用R329方案的小米xiaomi Sound高保真智能音箱拆解(转)

转自: https://bbs.aw-ol.com/topic/351

#162 Re: 全志 SOC » 哪吒D1使用gstreamer硬解码 » 2021-08-26 09:37:08

gst-launch-1.0 filesrc location=bad_apple.mp4 ! qtdemux ! h264parse ! omxh264dec ! sunxifbsink


这个参数里面,叹号是管道的意思吗?

#163 Re: 全志 SOC » 请教一个初级问题,F1C100/F1C200 外接SPI FLASH的最小容量 » 2021-08-25 16:25:53

aozima 说:

>用STM32 模拟一个 SPI FLASH吧,哈哈哈。

bootrom的时序其实是固定的,因此根本不需要解析主机发来的命令,只需要测好时序,然后把数据准备好,并配好DMA,应该就行了。
不过bootrom里面要是改了,要重新配。

这操作够骚 :)

#165 Re: DIY/综合/Arduino/写字机/3D打印机/智能小车/平衡车/四轴飞行/MQTT/物联网 » 红米2(msm8916)的debian 11和主线内核(5.14-rc4)刷机包 » 2021-08-23 21:02:40

搜了一下闲鱼:

红米2高通处理器8g内存60- - 台

红米2高通处理器移动16g内存 70一台
红米2高通处理器移动联通双网16g 80 一台
红米2高通处理器电信16g 85一台

#168 Re: 全志 SOC » TSC2007 I2C触摸驱动有个地方没搞明白, 为什么IRQ引脚和GPIO检测PEN引脚状态可以是同一个 » 2021-08-15 22:24:16

mmexport1629037239206.png


从手册看,gpio输入和外部中断属于不同的复用。


只能这么认为了,中断复用的时候也能读?

#170 Re: 全志 SOC » MIPI CSI-2 中的 lane 怎么理解? » 2021-08-11 21:14:56

开个脑洞, mipi camera 和 mipi lcd 可以对接起来吗?

#172 Re: 全志 SOC » 画了个V3S,慢更语音助手(LUCKY) » 2021-08-10 18:52:43

感谢楼主分享, 已转载到:

[转载] 画了个V3S,慢更语音助手(LUCKY)
https://bbs.aw-ol.com/topic/288

#173 Re: 全志 SOC » 全志芯片主线Linux 启动 eMMC 8-bit 模式测试 » 2021-08-07 22:51:16

@powerpan
u-boot 的 pinctrl 没用起来, 所以得在 board.c 里面初始化管脚复用.

#174 Re: 全志 SOC » V3S 没有PA,是直接从PB开始的。这是为什么? » 2021-08-06 16:15:07

inia 说:

V3S 没有PA,是直接从PB开始的。这是为什么?

查一下V3的手册,可能有PA,或许是接DDR了。

#176 Re: 全志 SOC » 我也来试一试编译 A33 android sdk,编译环境Ubuntu18.04,make版本v4.1 » 2021-08-05 18:50:03

编译成功:

aapt: warning: **** string 'wimax_settings_summary' has no default or required localization for 'zu_ZA' in packages/apps/Settings/res
aapt: warning: **** string 'wimax_settings_summary' has no default or required localization for 'am_ET' in packages/apps/Settings/res
aapt: warning: **** string 'wimax_settings_summary' has no default or required localization for 'hi_IN' in packages/apps/Settings/res
aapt: warning: **** string 'wimax_settings_summary' has no default or required localization for 'en_XA' in packages/apps/Settings/res
aapt: warning: **** string 'wimax_settings_summary' has no default or required localization for 'ar_XB' in packages/apps/Settings/res
aapt: warning: **** string 'wimax_settings_summary' has no default or required localization for 'fr_CA' in packages/apps/Settings/res
aapt: warning: **** string 'wimax_settings_summary' has no default or required localization for 'xlarge' in packages/apps/Settings/res
aapt: warning: **** string 'wimax_settings_summary' has no default or required localization for 'hdpi' in packages/apps/Settings/res
aapt: warning: **** string 'wimax_settings_summary' has no default or required localization for 'xhdpi' in packages/apps/Settings/res
aapt: warning: **** string 'wimax_settings_summary' has no default or required localization for 'large' in packages/apps/Settings/res
aapt: warning: **** string 'wimax_settings_summary' has no default or required localization for 'nodpi' in packages/apps/Settings/res
Install: out/target/product/vstar/system/app/Gallery2.apk
Install: out/target/product/vstar/system/priv-app/Settings.apk
target Symbolic: libwebviewchromium (out/target/product/vstar/symbols/system/lib/libwebviewchromium.so)
target Strip: libwebviewchromium (out/target/product/vstar/obj/lib/libwebviewchromium.so)
Install: out/target/product/vstar/system/lib/libwebviewchromium.so
Install: out/target/product/vstar/system/framework/webviewchromium.jar
Install: out/target/product/vstar/fake_packages/webview-timestamp
build/tools/generate-notice-files.py  out/target/product/vstar/obj/NOTICE.txt  out/target/product/vstar/obj/NOTICE.html "Notices for files contained in the filesystem images in this directory:" out/target/product/vstar/obj/NOTICE_FILES/src
Combining NOTICE files into HTML
Combining NOTICE files into text
Installed file list: out/target/product/vstar/installed-files.txt
Target system fs image: out/target/product/vstar/obj/PACKAGING/systemimage_intermediates/system.img
Running:  mkuserimg.sh -s out/target/product/vstar/system out/target/product/vstar/obj/PACKAGING/systemimage_intermediates/system.img ext4 system 805306368 out/target/product/vstar/root/file_contexts
+ echo 'in mkuserimg.sh PATH=out/host/linux-x86/bin/:/usr/java/jdk1.6.0_45/bin:/usr/local/gnu-mcu-eclipse/riscv-none-gcc/7.2.0-4-20180606-1631/bin/:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin:/opt/a33/a33_android_sdk/android/out/host/linux-x86/bin:/opt/a33/a33_android_sdk/android/prebuilts/gcc/linux-x86/arm/arm-linux-androideabi-4.7/bin:/opt/a33/a33_android_sdk/android/prebuilts/gcc/linux-x86/arm/arm-eabi-4.7/bin:/opt/a33/a33_android_sdk/android/prebuilts/gcc/linux-x86/mips/mipsel-linux-android-4.7/bin:/opt/a33/a33_android_sdk/android/development/emulator/qtools:/opt/a33/a33_android_sdk/android/prebuilts/gcc/linux-x86/arm/arm-linux-androideabi-4.7/bin:/opt/a33/a33_android_sdk/android/prebuilts/gcc/linux-x86/arm/arm-eabi-4.7/bin:/opt/a33/a33_android_sdk/android/development/scripts:/opt/a33/a33_android_sdk/android/prebuilts/devtools/tools:'
in mkuserimg.sh PATH=out/host/linux-x86/bin/:/usr/java/jdk1.6.0_45/bin:/usr/local/gnu-mcu-eclipse/riscv-none-gcc/7.2.0-4-20180606-1631/bin/:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin:/opt/a33/a33_android_sdk/android/out/host/linux-x86/bin:/opt/a33/a33_android_sdk/android/prebuilts/gcc/linux-x86/arm/arm-linux-androideabi-4.7/bin:/opt/a33/a33_android_sdk/android/prebuilts/gcc/linux-x86/arm/arm-eabi-4.7/bin:/opt/a33/a33_android_sdk/android/prebuilts/gcc/linux-x86/mips/mipsel-linux-android-4.7/bin:/opt/a33/a33_android_sdk/android/development/emulator/qtools:/opt/a33/a33_android_sdk/android/prebuilts/gcc/linux-x86/arm/arm-linux-androideabi-4.7/bin:/opt/a33/a33_android_sdk/android/prebuilts/gcc/linux-x86/arm/arm-eabi-4.7/bin:/opt/a33/a33_android_sdk/android/development/scripts:/opt/a33/a33_android_sdk/android/prebuilts/devtools/tools:
+ ENABLE_SPARSE_IMAGE=
+ '[' -s = -s ']'
+ ENABLE_SPARSE_IMAGE=-s
+ shift
+ '[' 6 -ne 5 -a 6 -ne 6 ']'
+ SRC_DIR=out/target/product/vstar/system
+ '[' '!' -d out/target/product/vstar/system ']'
+ OUTPUT_FILE=out/target/product/vstar/obj/PACKAGING/systemimage_intermediates/system.img
+ EXT_VARIANT=ext4
+ MOUNT_POINT=system
+ SIZE=805306368
+ FC=out/target/product/vstar/root/file_contexts
+ case $EXT_VARIANT in
+ '[' -z system ']'
+ '[' -z 805306368 ']'
+ '[' -n out/target/product/vstar/root/file_contexts ']'
+ FCOPT='-S out/target/product/vstar/root/file_contexts'
+ MAKE_EXT4FS_CMD='make_ext4fs -s -S out/target/product/vstar/root/file_contexts -l 805306368 -a system out/target/product/vstar/obj/PACKAGING/systemimage_intermediates/system.img out/target/product/vstar/system'
+ echo make_ext4fs -s -S out/target/product/vstar/root/file_contexts -l 805306368 -a system out/target/product/vstar/obj/PACKAGING/systemimage_intermediates/system.img out/target/product/vstar/system
make_ext4fs -s -S out/target/product/vstar/root/file_contexts -l 805306368 -a system out/target/product/vstar/obj/PACKAGING/systemimage_intermediates/system.img out/target/product/vstar/system
+ make_ext4fs -s -S out/target/product/vstar/root/file_contexts -l 805306368 -a system out/target/product/vstar/obj/PACKAGING/systemimage_intermediates/system.img out/target/product/vstar/system
Creating filesystem with parameters:
    Size: 805306368
    Block size: 4096
    Blocks per group: 32768
    Inodes per group: 8192
    Inode size: 256
    Journal blocks: 3072
    Label:
    Blocks: 196608
    Block groups: 6
    Reserved block group size: 47
Created filesystem with 1596/49152 inodes and 87533/196608 blocks
+ '[' 0 -ne 0 ']'
Install system fs image: out/target/product/vstar/system.img
out/target/product/vstar/system.img+out/target/product/vstar/obj/PACKAGING/recovery_patch_intermediates/recovery_from_boot.p maxsize=822163584 blocksize=4224 total=349827018 reserve=8308608
cube@ubuntu:/opt/a33/a33_android_sdk/android$

打包成功:

cube@ubuntu:/opt/a33/a33_android_sdk/android$ pack
copying tools file
copying configs file
copying boot resource
copying boot file
packing for android
normal
/opt/a33/a33_android_sdk/lichee/tools/pack/pctools/linux/eDragonEx/
/opt/a33/a33_android_sdk/lichee/tools/pack/out
Begin Parse sys_partion.fex
Add partion boot-resource.fex BOOT-RESOURCE_FEX
Add partion very boot-resource.fex BOOT-RESOURCE_FEX
FilePath: boot-resource.fex
FileLength=4bec00Add partion env.fex ENV_FEX000000000
Add partion very env.fex ENV_FEX000000000
FilePath: env.fex
FileLength=20000Add partion boot.fex BOOT_FEX00000000
Add partion very boot.fex BOOT_FEX00000000
FilePath: boot.fex
FileLength=b09000Add partion system.fex SYSTEM_FEX000000
Add partion very system.fex SYSTEM_FEX000000
FilePath: system.fex
FileLength=14b64864Add partion recovery.fex RECOVERY_FEX0000
Add partion very recovery.fex RECOVERY_FEX0000
FilePath: recovery.fex
FileLength=dd1000Add partion diskfs.fex DISKFS_FEX000000
Add partion very diskfs.fex DISKFS_FEX000000
FilePath: diskfs.fex
FileLength=200sys_config.fex Len: 0xf8df
config.fex Len: 0x9c24
split_xxxx.fex Len: 0x200
sys_partition.fex Len: 0xf0a
boot0_nand.fex Len: 0x8000
boot0_sdcard.fex Len: 0x8000
u-boot.fex Len: 0xbc000
fes1.fex Len: 0x1fc0
usbtool.fex Len: 0x20600
aultools.fex Len: 0x25d92
aultls32.fex Len: 0x2295a
cardtool.fex Len: 0x14000
cardscript.fex Len: 0x6ea
sunxi_mbr.fex Len: 0x10000
dlinfo.fex Len: 0x4000
arisc.fex Len: 0x2ed88
boot-resource.fex Len: 0x4bec00
Vboot-resource.fex Len: 0x4
env.fex Len: 0x20000
Venv.fex Len: 0x4
boot.fex Len: 0xb09000
Vboot.fex Len: 0x4
system.fex Len: 0x14b64864
Vsystem.fex Len: 0x4
recovery.fex Len: 0xdd1000
Vrecovery.fex Len: 0x4
diskfs.fex Len: 0x200
Vdiskfs.fex Len: 0x4
BuildImg 0
Dragon execute image.cfg SUCCESS !
----------image is at----------

/opt/a33/a33_android_sdk/lichee/tools/pack/sun8iw5p1_android_vstar.img

pack finish
cube@ubuntu:/opt/a33/a33_android_sdk/android$

#177 Re: 全志 SOC » 我也来试一试编译 A33 android sdk,编译环境Ubuntu18.04,make版本v4.1 » 2021-08-05 18:47:54

test0001 说:

大佬sdk哪里下载的

链接: https://pan.baidu.com/s/1wWYHReHEUaYoES_EBDrE6Q
提取码:waku
--来自百度网盘超级会员V1的分享

#178 Re: 全志 SOC » 我也来试一试编译 A33 android sdk,编译环境Ubuntu18.04,make版本v4.1 » 2021-08-05 11:47:44

make 出现错误:

including ./sdk/hierarchyviewer/src/Android.mk ...
including ./sdk/monitor/Android.mk ...
including ./sdk/sdklauncher/Android.mk ...
including ./system/core/Android.mk ...
including ./system/extras/Android.mk ...
including ./system/media/audio_route/Android.mk ...
including ./system/media/audio_utils/Android.mk ...
including ./system/media/camera/src/Android.mk ...
including ./system/media/camera/tests/Android.mk ...
including ./system/netd/Android.mk ...
including ./system/security/keystore-engine/Android.mk ...
including ./system/security/keystore/Android.mk ...
including ./system/security/softkeymaster/Android.mk ...
including ./system/vold/Android.mk ...
including ./tools/external/fat32lib/Android.mk ...
No private recovery resources for TARGET_DEVICE vstar
build/core/main.mk:945: *** missing 'endif'.  Stop.

解决方案:
在 build/core/main.mk 945 行插入: endif



正在愉快地编译:

host C: libcrypto-host <= external/openssl/crypto/des/rpc_enc.c
host C: libcrypto-host <= external/openssl/crypto/des/set_key.c
host C: libcrypto-host <= external/openssl/crypto/des/str2key.c
host C: libcrypto-host <= external/openssl/crypto/des/xcbc_enc.c
host C: libcrypto-host <= external/openssl/crypto/dh/dh_ameth.c
host C: libcrypto-host <= external/openssl/crypto/dh/dh_asn1.c
host C: libcrypto-host <= external/openssl/crypto/dh/dh_check.c
external/openssl/crypto/dh/dh_ameth.c:500:2: warning: missing initializer [-Wmissing-field-initializers]
external/openssl/crypto/dh/dh_ameth.c:500:2: warning: (near initialization for 'dh_asn1_meth.old_priv_decode') [-Wmissing-field-initializers]
host C: libcrypto-host <= external/openssl/crypto/dh/dh_depr.c
host C: libcrypto-host <= external/openssl/crypto/dh/dh_err.c
host C: libcrypto-host <= external/openssl/crypto/dh/dh_gen.c
host C: libcrypto-host <= external/openssl/crypto/dh/dh_key.c
host C: libcrypto-host <= external/openssl/crypto/dh/dh_lib.c
host C: libcrypto-host <= external/openssl/crypto/dh/dh_pmeth.c
host C: libcrypto-host <= external/openssl/crypto/dsa/dsa_ameth.c
host C: libcrypto-host <= external/openssl/crypto/dsa/dsa_asn1.c
host C: libcrypto-host <= external/openssl/crypto/dsa/dsa_depr.c
host C: libcrypto-host <= external/openssl/crypto/dsa/dsa_err.c
external/openssl/crypto/dsa/dsa_ameth.c:650:3: warning: missing initializer [-Wmissing-field-initializers]
external/openssl/crypto/dsa/dsa_ameth.c:650:3: warning: (near initialization for 'dsa_asn1_meths[0].pem_str') [-Wmissing-field-initializers]
external/openssl/crypto/dsa/dsa_ameth.c:656:3: warning: missing initializer [-Wmissing-field-initializers]
external/openssl/crypto/dsa/dsa_ameth.c:656:3: warning: (near initialization for 'dsa_asn1_meths[1].pem_str') [-Wmissing-field-initializers]
external/openssl/crypto/dsa/dsa_ameth.c:662:3: warning: missing initializer [-Wmissing-field-initializers]
external/openssl/crypto/dsa/dsa_ameth.c:662:3: warning: (near initialization for 'dsa_asn1_meths[2].pem_str') [-Wmissing-field-initializers]
external/openssl/crypto/dsa/dsa_ameth.c:668:3: warning: missing initializer [-Wmissing-field-initializers]
external/openssl/crypto/dsa/dsa_ameth.c:668:3: warning: (near initialization for 'dsa_asn1_meths[3].pem_str') [-Wmissing-field-initializers]
external/openssl/crypto/dsa/dsa_ameth.c:702:3: warning: missing initializer [-Wmissing-field-initializers]
external/openssl/crypto/dsa/dsa_ameth.c:702:3: warning: (near initialization for 'dsa_asn1_meths[4].item_verify') [-Wmissing-field-initializers]
host C: libcrypto-host <= external/openssl/crypto/dsa/dsa_gen.c
host C: libcrypto-host <= external/openssl/crypto/dsa/dsa_key.c
host C: libcrypto-host <= external/openssl/crypto/dsa/dsa_lib.c
host C: libcrypto-host <= external/openssl/crypto/dsa/dsa_ossl.c
host C: libcrypto-host <= external/openssl/crypto/dsa/dsa_pmeth.c
host C: libcrypto-host <= external/openssl/crypto/dsa/dsa_prn.c

#179 Re: 全志 SOC » 我也来试一试编译 A33 android sdk,编译环境Ubuntu18.04,make版本v4.1 » 2021-08-05 11:27:41

cube@ubuntu:/opt/a33/a33_android_sdk/android$ make
build/core/main.mk:45: ********************************************************************************
build/core/main.mk:46: *  You are using version 4.1 of make.
build/core/main.mk:47: *  Android can only be built by versions 3.81 and 3.82.
build/core/main.mk:48: *  see https://source.android.com/source/download.html
build/core/main.mk:49: ********************************************************************************
build/core/main.mk:50: *** stopping.  Stop.

修改 build/core/main.mk

ifeq (,$(findstring CYGWIN,$(shell uname -sm)))
ifeq (0,$(shell expr $$(echo $(MAKE_VERSION) | sed "s/[^0-9\.].*//") = 3.81))
ifeq (0,$(shell expr $$(echo $(MAKE_VERSION) | sed "s/[^0-9\.].*//") = 3.82))
ifeq (0,$(shell expr $$(echo $(MAKE_VERSION) | sed "s/[^0-9\.].*//") = 4.1))

插入一行

#180 Re: 全志 SOC » 我也来试一试编译 A33 android sdk,编译环境Ubuntu18.04,make版本v4.1 » 2021-08-05 11:22:24

1. 下载 jdk-6u45-linux-x64.bin,解压到 /usr/java/ 目录

2. 导出环境变量:

export ANDROID_JAVA_HOME="/usr/java/jdk1.6.0_45"
export JAVA_HOME="/usr/java/jdk1.6.0_45"

搞定:

cube@ubuntu:/opt/a33/a33_android_sdk/android$ lunch

You're building on Linux

Lunch menu... pick a combo:
     1. aosp_arm-eng
     2. aosp_x86-eng
     3. aosp_mips-eng
     4. vbox_x86-eng
     5. aosp_hammerhead-userdebug
     6. aosp_mako-userdebug
     7. vstar-eng
     8. vstar-user
     9. astar_y3-eng
     10. astar_y3-user
     11. aosp_manta-userdebug
     12. aosp_deb-userdebug
     13. aosp_grouper-userdebug
     14. aosp_tilapia-userdebug
     15. aosp_flo-userdebug
     16. mini_x86-userdebug
     17. mini_mips-userdebug
     18. mini_armv7a_neon-userdebug

Which would you like? [aosp_arm-eng] 7

============================================
PLATFORM_VERSION_CODENAME=REL
PLATFORM_VERSION=4.4.2
TARGET_PRODUCT=vstar
TARGET_BUILD_VARIANT=eng
TARGET_BUILD_TYPE=release
TARGET_BUILD_APPS=
TARGET_ARCH=arm
TARGET_ARCH_VARIANT=armv7-a-neon
TARGET_CPU_VARIANT=cortex-a7
HOST_ARCH=x86
HOST_OS=linux
HOST_OS_EXTRA=Linux-5.4.0-80-generic-x86_64-with-Ubuntu-18.04-bionic
HOST_BUILD_TYPE=release
BUILD_ID=KVT49L
OUT_DIR=out
============================================

#181 全志 SOC » 我也来试一试编译 A33 android sdk,编译环境Ubuntu18.04,make版本v4.1 » 2021-08-05 11:16:16

cube
回复: 7
cube@ubuntu:/opt/a33/a33_android_sdk/android$ lunch

You're building on Linux

Lunch menu... pick a combo:
     1. aosp_arm-eng
     2. aosp_x86-eng
     3. aosp_mips-eng
     4. vbox_x86-eng
     5. aosp_hammerhead-userdebug
     6. aosp_mako-userdebug
     7. vstar-eng
     8. vstar-user
     9. astar_y3-eng
     10. astar_y3-user
     11. aosp_manta-userdebug
     12. aosp_deb-userdebug
     13. aosp_grouper-userdebug
     14. aosp_tilapia-userdebug
     15. aosp_flo-userdebug
     16. mini_x86-userdebug
     17. mini_mips-userdebug
     18. mini_armv7a_neon-userdebug

Which would you like? [aosp_arm-eng] 7
build/core/config.mk:365: *** Error: could not find jdk tools.jar, please install JDK6, which you can download from java.sun.com.  Stop.

** Don't have a product spec for: 'vstar'
** Do you have the right repo manifest?

cube@ubuntu:/opt/a33/a33_android_sdk/android$

Error: could not find jdk tools.jar, please install JDK6

出师不利, 开局就暴击, A33 android sdk 编译出现 jdk 相关错误的问题。

#182 Re: RISC-V » 看到沁恒的riscv单片机支持swd调试。 » 2021-08-04 19:14:07

metro 说:

这个帖子是我开的,当时二楼的回复是兼容ARM的SWD,后面他们自己删了😅

实际上真兼容吗?

#183 Re: 全志 SOC » 这个开发板要取消了吗? BeagleV Starlight RISC-V single board computer cancelled » 2021-08-03 15:28:12

挺可惜的,虽然是算是竞争对手,但是都是RISC-V大生态下的玩家,而且BeagledBoard和starfive的芯片和板子主要是面向PC及服务器领域,跟D1(AIoT领域)并不是直接对位的,我们还是希望大家都好,一起把生态做大做强。同时我们也深知RISC-V生态起步阶段的艰难,庆幸我们在产品落地方面有多年的成熟经验,所以BeagledBoard和starfive有需要经验交流或者帮助的,我们很乐意一起深入沟通,一起为生态添砖加瓦(Respect!


----------------
以上转自全志在线产品总监对于BeagledBoard和starfive RISC-V SBC项目失败的看法

#184 Re: 全志 SOC » 这个开发板要取消了吗? BeagleV Starlight RISC-V single board computer cancelled » 2021-08-03 14:58:14

这是今年初的新闻:



https://www.techradar.com/news/heres-a-new-well-stocked-risc-v-raspberry-pi-challenger 

总部位于深圳的开放硬件供应商 Seeed 发布了 BeagleV,这是一款可以运行Linux的信用卡大小的 RISC-V 单板计算机 (SBC) 。

BeagleV 是 Seeed 和 BeagleBoard.org 合作的结果,BeagleBoard.org 是总部位于密歇根州的非营利组织,为流行的同名系列开放 SBC 提供支持,以及来自上海 StarFive 的 RISC-V 专业知识。

在一次发布中,两家公司指出,“BeagleV 将开源推向了一个新的水平,并为开发人员提供了更多的自由和能力来创新和设计行业领先的解决方案,其入门价格为 149 美元,随后在后续版本中提供更低成本的变体。”

#185 全志 SOC » 这个开发板要取消了吗? BeagleV Starlight RISC-V single board computer cancelled » 2021-08-03 14:55:38

cube
回复: 3

BeagleV Starlight RISC-V single board computer cancelled :
https://www.geeky-gadgets.com/beaglev-02-08-2021/

BeagleV-Starlight-RISC-V-single-board-computer.png


Unfortunately the development team behind the BeagleV Starlight RISC-V single board computer first unveiled back in January 2021 has now been cancelled. But all is not last as the team at BeagleBoard is now working with Seeed Studio to design and manufacture a new RISC-V board which could be ready to ship as early as Q1 2022.



这个开发板要取消了吗?

#187 VMWare/Linux/Ubuntu/Fedora/CentOS/U-BOOT » 快速验证buildroot 生成的rootfs.ext2 文件系统镜像是否正常 【转载】 » 2021-08-03 10:22:09

cube
回复: 0

* 获取一个循环设备
sudo losetup -f

* 关联循环设备与镜像文件
sudo losetup /dev/loop22 output/images/rootfs.ext2

* 挂载到 /tmp/test
sudo mount /dev/loop22 /tmp/test

* 测试
ls /tmp/test

转自: https://bbs.aw-ol.com/topic/250

#188 Re: DIY/综合/Arduino/写字机/3D打印机/智能小车/平衡车/四轴飞行/MQTT/物联网 » 请问 X-powers AC108 I2S 接口四路麦克风采集是什么原理?pdf里面没有看到时序图,是不是I2S口需要两路输出? » 2021-07-31 09:32:05

le062 说:

一个IO配合LRCK可以传双通道
两个IO配合LRCK就能传四通道把

一般soc的i2s麦克风只支持立体声麦克风(2通道),如何接这四通道呢?那是不是不能用呢?

#189 Re: 全志 SOC » 全志V3S的网口与全志H3的网口问题(硬件类) » 2021-07-30 23:25:36

1. 产品建议加49.9,不加可能也通

2. 一种座子集成隔离变压器,另一种不集成。

#190 Re: BLDC电机驱动 » 画了个103RCT6的BLDC板子 » 2021-07-28 17:31:27

codetez 说:

板子很帅,现在RCT6不便宜吧

所以这是花式炫富?

#193 Re: RISC-V » 看到rode无线麦克的拆解用到的芯片是炬芯ats2833 » 2021-07-25 09:17:36

le062 说:

看了下硬件拆机图,有一颗专用的BLE芯片,一颗外置CODEC,感觉整体集成度偏低,
不过它的200米蓝牙通讯距离很厉害,值得学习。

200米,认真的吗?

#195 Re: 全志 SOC » XUI移植基本完成 https://gitee.com/891085309/xui , enjoy it! (转) » 2021-07-16 12:44:08

xboot 说:

如何使用xui,参考cmd-overview.c这个程序,用c写的。
lua没有绑定xui,两者完全独立的

https://github.com/xboot/xboot/blob/71158c7afb74ab0c13f026abba38b56bc3dace39/src/kernel/command/cmd-overview.c

原来如此。那xboot有没有xui 绑定 lua的计划呢?

#196 Re: 全志 SOC » XUI移植基本完成 https://gitee.com/891085309/xui , enjoy it! (转) » 2021-07-16 11:12:40

xboot 说:
raspberryman 说:

不是,这些demo是lua 框架的,非xui

怎么在xboot使用xui呢?

或者有没有lua绑定的demo?

#197 Re: 全志 SOC » 随便水一贴,电阻触摸屏校正 » 2021-07-15 19:59:17

随便水一下都这么有水平,认真起来是怎样的人?

#198 Re: 全志 SOC » QQ群看到的外设齐全,封装友好,内置64M ddr的RV64芯片全志F133,有没有哪位用过? » 2021-07-15 10:51:37

QQ群看到的外设齐全,封装友好,内置64M ddr的RV64芯片F133,有没有哪位用过?

转自: https://bbs.aw-ol.com/topic/202

#199 全志 SOC » QQ群看到的外设齐全,封装友好,内置64M ddr的RV64芯片全志F133,有没有哪位用过? » 2021-07-15 10:50:44

cube
回复: 14

QQ群看到的外设齐全,封装友好,内置64M ddr的RV64芯片F133,有没有哪位用过?

-16ca989f33369074.png

-4c56b07c7f000630.png

#202 Re: 全志 SOC » 求助,F1c100s 启动正常,但是一会儿就报错重启失败!? » 2021-07-14 15:02:18

lovexulu 说:
david 说:

二手芯片不良?

也怀疑是这种情况,都一个地方来的三片,一片烧坏了,另外两片都是这种情况。。

不用看照片了,说吧,多少钱买的?

#203 Re: ESP32/ESP8266 » 请问如何修改UDP数据包最大长度? » 2021-07-14 09:38:39

不如定一个应用程序的协议头,分包发送,每包固定大小,在接收端组合分包数据。

#205 Re: 全志 SOC » 我叫胡天成,XUI电子名片牌 » 2021-07-07 20:13:25

胡天成是什么梗,我去谷歌一下

#206 Re: DIY/综合/Arduino/写字机/3D打印机/智能小车/平衡车/四轴飞行/MQTT/物联网 » 请大家推荐一下串口屏,公司最近有个新的项目,迪文/大彩/欣瑞达/陶晶驰/昆仑 哪个性价比好,稳定性好,开发友好呢? » 2021-07-07 17:36:50

达克罗德 说:
xfdr0805 说:

用过陶晶驰,迪文屏,最近刚用大彩,开发实是太友好了,迪文屏开发垃圾的1B,价格不清楚

能说说大彩优点吗?我只用过陶晶驰。大彩比陶晶驰好在哪呢?

可以lua和minic编程,操作也比较人性化。

#207 Re: ESP32/ESP8266 » 使用ESP32可以成功获取到网络时间,怎么才能得到整形数据呢?我想显示到数码管上 » 2021-07-07 17:07:59

zhang235hai 说:
cube 说:

漂亮啊,有没有小白入门教程?

可以到B站搜一下ESP32   有很多视频可以参考  我是自己搞着好玩的

我看看去,感谢楼主。

#211 Re: 全志 SOC » Tiny200 SPINAND固件分享 » 2021-07-01 09:45:18

荔枝派默认那个驱动一开始确实这个误触不稳定。

我是基于荔枝派 V3s那个i2c轮询驱动改的,加强滤波,现在量产了几万台,很稳定。

只是有几个问题,cpu太忙了,按下拖动不好使。

#212 Re: 全志 SOC » 求助BGA焊接教程,以全志H3为例子,用钢网?风枪?焊油?锡膏? » 2021-06-29 10:24:21

@sunxiang
嗯,我听到好几个同行都是这么说的。
实际上我们公司也是这种情况,很多板子都要重新补焊V3s,或许是我们的合作厂技术不行吧。

最重要的是,TQFP128掉地上就废了,QFN88随便掉。

#213 Re: 全志 SOC » 求助BGA焊接教程,以全志H3为例子,用钢网?风枪?焊油?锡膏? » 2021-06-29 10:10:38

sunxiang 说:

V3S很好焊接的,我只需要一把刀头+锡丝,松香甚至都可以不要

其实这种TQFP128封装机器挺难焊的,容易短路断路,品控难做。

f1c200s那种 QFN88良率就更好了。

#214 Re: 全志 SOC » 求助BGA焊接教程,以全志H3为例子,用钢网?风枪?焊油?锡膏? » 2021-06-29 08:23:31

伍零壹 说:

BGA很好焊接的  我觉得比LQFP还简单  主要的是多练习  这个东西熟能生巧  看别人说 你是学不会的  多动手就行

对,这个问题犹如在岸上学游泳,就是学一百年掉水里一样要淹死。

(小鸭子怎么不用学呢,逃。。。

#215 Re: 全志 SOC » 今天索智说S3是V3+128MB DDR3,以前一直以为是v3s » 2021-06-28 17:00:28

@xiaoqianxiansheng
这个彩页看起来很漂亮,实物如何呢?

#217 Re: DIY/综合/Arduino/写字机/3D打印机/智能小车/平衡车/四轴飞行/MQTT/物联网 » 单片机按键识别篇---单击---双击----长按 (转载) » 2021-06-26 13:00:51

https://blog.csdn.net/qq_28877125/article/details/85158323

key_state_t key_state = {
	.key_time      = 0,
	.current_state = RELEASE,
	.state         = NO_PRESS,
};

// 1ms 定时器中断服务函数
void Timer0_IRQ_Handler(void)
{
	...

	if(key_state.current_state == RELEASE)          
	{  
		if(KEY_PIN == 0)  // 按键被按下
	    {  
	        key_state.current_state = MAY_PRESS;  
	        key_state.key_time = 0; 
	    }  
	}  
	else if(key_state.current_state == MAY_PRESS)  
	{  
		key_state.key_time++; // 累加每次为1ms
		
		if(KEY_PIN == 1)  // 按键释放
		{  
			// 由释放时的时间长短区分出长按与短按
			if((key_state.key_time > 10)&&(key_state.key_time < SHORTPRESS_THRESHOLD))
			{  
				key_state.state = SHORT_PRESS;  // 按下时间为:10ms~1500ms 判定为短按
				key_state.current_state = RELEASE;  
			}  
			else if(key_state.key_time > SHORTPRESS_THRESHOLD)  
			{  
				key_state.state = LONG_PRESS;  // 按下时间超过1500ms判定为长按
				key_state.current_state = RELEASE;  
			}  
			else // 按下时间小于10ms就释放视为杂波
			{
				key_state.current_state = RELEASE; 
			} 	  
		}  
	}
	...
}

#218 DIY/综合/Arduino/写字机/3D打印机/智能小车/平衡车/四轴飞行/MQTT/物联网 » 单片机按键识别篇---单击---双击----长按 (转载) » 2021-06-26 12:49:27

cube
回复: 1

https://www.cnblogs.com/UPUPDay2152/p/9673886.html

单片机按键识别篇---单击---双击----长按
  最近做一任务需要使用一个按键实现三种功能,分别是按键单击功能,按键双击功能和按键长按功能,可能之前没有接触过这类按键复用情况,顶多也只是简单识别单击和长按,没有想过双击以上按键功能,也是绞尽脑汁,想了半天,又上网看了些例程,算是对于按键的识别有点小小的了解,感觉这个功能挺实用,在此做个随笔。

一、思路

  1.识别长按操作思路:我们使用系统定时器定时,然后让系统每过一段时间去扫描按键I/O口状态,当扫描到按键按下I/O口状态超过设定长按时间的阀值,就判定这次按键操作为“长按”操作;

  2.识别单击操作思路:当系统扫描按键按下的I/O口时间小于我们设定的长按阀值,这时就可能出现两种情况,情况1.可能是单击;情况2.可能是双击;首先我们来说情况1,单击操作,这时我们可以检测按键按下后,按键弹起的时间到下次按键按下的时间间隔,当按键按下弹起到下次按键按下的时间超过某个值,则我们判定这次操作为“单击”操作;

  3.识别双击操作思路:上面刚说的情况1,这次来说情况2,:双击操作,当我们检测按键按弹起后在一定时间阀值内,又检测到按键I/O口有电平变化,则我们判断这次操作为“双击”操作

二、程序部分

unsigned char scan_key()  
{
/*
值key_return如下:
          1---------单击
          2---------双击
          3---------长按
*/
static unsigned char key_state=0;                           //按键状态
static unsigned char state=0;
static unsigned char time,time1,time2;    
static unsigned char key_up_flag=0;                           //按键弹起标志位
static unsigned char key_return;


  if(Key==0)                                                 //按键按下消抖
  { 
    delay(50);
     if(Key==0)
     { 
       key_state=0;
     } 
   }  
  else 
  {
    delay(50);                                                //按键松开消抖
    if(Key==1)
    {
     key_state=1;
     key_up_flag=0;
    }
  }
   if((state==0)&&(key_state==0)&&(key_up_flag==0))        //这里主要防止,按键在识别长按后,又会执行一遍单击操作                               
    {
             state=1;
             time=key_time;                                       //记录按键按下的时间为多少,做标记
    }
     if(state==1)
     {
          time1=key_time;
          time2=time1-time;                                 //计算按键按下时长
                
           if(time2>50)                                    //长按判断
             {
              state=2;
            } 
         if(key_state==1)                                //按键弹起
           {
              state=3;
              time=key_time;                                  //标志什么时间按键弹起的
           }
     }
     if(state==2)                                         //长按
      {
            state=0;                                     //重置状态
            key_up_flag=1;
            key_return=3;
      }
         if((state==3)&&(key_up_flag==0))
          {
               time1=key_time;
               time2=time1-time;                          //计算按键弹起后时间
                if(time2>6)                                //判断按键弹起后的时间,超过300ms,则说明为单击
                    {
                      state=0;
                    key_return=1;
                  }    
              else    if(key_state==0)                     //按键弹起后,300ms内又有按键按下
                 {
                      state=4;
                 }
           }
           if(state==4)
          {
                  if(key_state==1)                        //按键弹起
                  {
                     state=0;
                    key_return=2;
                   }
          }
          
     return key_return;          
}

void timer0() interrupt 1     //定时器T0中断函数入口
{
     TH0=0X9E;             //初值重载
     TL0=0X57;           //定时50ms=50000us; 50000/2=25000
     key_time++;        //50MS++

  
}

#219 Re: 全志 SOC » 求助BGA焊接教程,以全志H3为例子,用钢网?风枪?焊油?锡膏? » 2021-06-25 09:33:32

有些BGA引脚是标准的,淘宝可以买到通用又便宜的小钢网。

#220 全志 SOC » 发一个 widora tiny200 能跑的 air724 固件 » 2021-06-23 23:59:45

cube
回复: 0

QQ图片20210623235917.jpg







SPI NOR FLASH 版本: widora-tiny200-sysimage- spinor-20210623.7z (16M)

TF卡版本: widora-tiny200-sysimage-tfcard-20210623.7z


命令行执行: echo host > /sys/devices/platform/soc/1c13000.usb/musb-hdrc.1.auto/mode 切换到 USB HOST

执行 udhcpc -i eth0 从AIR724 获取IP地址.





参考:

主线Linux用shell命令切换 OTG(分享)tiny200/licheepi nano|zero均可以使用
https://whycan.com/t_6021.html

请问为什么AIR720 4G模块插入到V3s linux4.13系统, 只有一个 RNDIS 设备, 确没有像 Windows再多四个串口
https://whycan.com/t_3825.html#p61611

#221 Re: RISC-V » RISC-V代码密度相比Cortex-M差距明显 » 2021-06-22 20:05:22

echo 说:
kekemuyu 说:

这样比没有用的,编译器的因素影响太大。都用汇编还好点,不过理论上thum2的代码密度确实比riscv的精简指令要高。

RISC-V目前除了GCC还有其它编译器支持吗?

据说IAR支持了。

#223 Re: RISC-V » RISC-V代码密度相比Cortex-M差距明显 » 2021-06-22 17:45:09

压缩指令选项应该开了吧?RISCV指令精简程度比ARM更高,大一点也不奇怪。

#224 Re: 全志 SOC » 请问i2cdetect这个命令和设备树中的节点有没有关系 » 2021-06-21 21:37:34

基本可以确定i2c硬件有问题,最好用逻辑分析仪测试一下sda/scl

#225 Re: RISC-V » risc-v gcc 工具链编译 与 qemu 虚拟机 (ubuntu等发行版linux平台搭建RISCV模拟环境) » 2021-06-20 12:40:10

终于搞定, 不是设置LD_LIBRARY_PATH环境变量, 而是加 -L 参数:

$qemu-riscv64 -L /usr/riscv64-linux-gnu/ hello
hello
$

或者用 QEMU_LD_PREFIX 环境变量:

QEMU_LD_PREFIX=/usr/riscv64-linux-gnu/ qemu-riscv64 hello

参考: https://stackoverflow.com/questions/16158994/how-to-solve-error-while-loading-shared-libraries-when-trying-to-run-an-arm-bi

#226 Re: RISC-V » risc-v gcc 工具链编译 与 qemu 虚拟机 (ubuntu等发行版linux平台搭建RISCV模拟环境) » 2021-06-20 12:38:49

https://askubuntu.com/questions/1144537/arm-32-bit-elf-does-not-execute-using-qemu-arm

按这个加上  LD_LIBRARY_PATH 没用?

$ LD_LIBRARY_PATH=/usr/riscv64-linux-gnu/ qemu-riscv64 hello
qemu-riscv64: Could not open '/lib/ld-linux-riscv64-lp64d.so.1': No such file or directory
$
$ LD_LIBRARY_PATH=/usr/riscv64-linux-gnu/lib/ qemu-riscv64 hello
qemu-riscv64: Could not open '/lib/ld-linux-riscv64-lp64d.so.1': No such file or directory
$

#227 Re: RISC-V » risc-v gcc 工具链编译 与 qemu 虚拟机 (ubuntu等发行版linux平台搭建RISCV模拟环境) » 2021-06-20 12:35:55

好像一定要用静态链接, 否则会这样:

$ riscv64-linux-gnu-gcc -o hello hello.c
$
$ qemu-riscv64 hello
qemu-riscv64: Could not open '/lib/ld-linux-riscv64-lp64d.so.1': No such file or directory
$ 

#230 Re: 司徒开源 » 研究FC3000掌機的開源可行性 » 2021-06-18 14:28:21

🍀司徒🍀大佬真牛🐂

请问液晶的驱动芯片确定了吗?

#231 Re: 全志 SOC » 全志D1芯片之终极探索 » 2021-06-17 15:06:58

xboot 说:

也可以将_image_start变成全局标识,然后C里面去访问这个地址,再获取里面的值,就是觉得这样干,太不优雅了,总觉得很怪异。RISCV C编译器搞得这么绝吗?没留任何一种获取绝对链接地址的方式?

喔,原来如此,感谢大佬解惑。

#232 Re: 全志 SOC » 全志D1芯片之终极探索 » 2021-06-17 14:52:46

那可以通过汇编把 __image_start 当参数传递给C函数实现曲线救国吗?

#233 Re: 全志 SOC » 全志D1芯片之终极探索 » 2021-06-17 14:14:19

@xboot
既然.c不能实现绝对地址编码,

那 .S 的 copyself 能不能实现呢?

#234 Re: 全志 SOC » uboot直接操作IO » 2021-06-16 08:52:44

沉鱼 说:

进入 u-boot 终端,输入:

gpio clear 192
gpio clear 193
gpio clear 194

会有神奇的事情发生!
然后你跟踪一下代码

也可以 :
gpio set PG0
gpio clear PG0

#235 Re: 8051/STC8/AT89C51/N76E003 » 解决串口鼠标乱跳问题 » 2021-06-16 08:17:58

smartcar 说:

usb转的串口应该不会这样吧?

啊,我以为只有native串口才会呢。

#236 Re: 全志 SOC » V3s 重启 后 gpio按键 wifi功能 失灵 » 2021-06-13 22:08:35

@leeon231
RTC 和 PMU有什么关系吗?

#237 Re: 全志 SOC » V3s 重启 后 gpio按键 wifi功能 失灵 » 2021-06-13 17:18:16

mysteryli 说:

我也发现这个事了,只有第一次上电wifi是可以用的,期待楼主查出真正原因和解决办法,好多帖子都不了了之了

我也发现了,widora tiny200 tf卡插槽插 RTL8723BS模组,reboot命令热重启WIFI失效。

应该是WIFI模组需要重启或者复位。

#238 Re: 全志 SOC » 集齐F1C马甲就能召唤神龙吗? 我试一试 » 2021-06-12 17:01:42

F1C600 唱戏机主板包邮50元, 报哇酷网网友45元包邮, 可以接7寸(800x480)显示屏
https://whycan.com/t_6616.html#p64192
(出处:哇酷开发者社区)

#239 Re: 司徒开源 » 研究FC3000掌機的開源可行性 » 2021-06-12 14:50:03

1👈哈0OpdX6isw3P信  https://m.tb.cn/h.4ubAd45?sm=c24df6   十年老店FC3000掌上游戏机V2私模M3掌机复古SUP拳皇儿童双人手柄


司徒大佬,是这个吗?

#240 Re: 司徒开源 » 研究FC3000掌機的開源可行性 » 2021-06-11 20:57:10

@司徒
司徒大佬别介意,"套路"在大陆我认为是中性词,没有感情色彩。

#242 RISC-V » Risc-V Assembly Language Hello World » 2021-06-11 17:38:44

cube
回复: 1

https://www.google.com/amp/s/smist08.wordpress.com/2019/09/07/risc-v-assembly-language-hello-world/amp/

Hello World
First let’s present the program and then we’ll discuss it. This program works by making Linux system calls and like all Linux programs starts execution at the globally exported _start label. The program uses the Assembly directives specified in the GCC documentation.

#
# Risc-V Assembler program to print "Hello World!"
# to stdout.
#
# a0-a2 - parameters to linux function services
# a7 - linux function number
#

.global _start      # Provide program starting address to linker

# Setup the parameters to print hello world
# and then call Linux to do it.

_start: addi  a0, x0, 1      # 1 = StdOut
        la    a1, helloworld # load address of helloworld
        addi  a2, x0, 13     # length of our string
        addi  a7, x0, 64     # linux write system call
        ecall                # Call linux to output the string

# Setup the parameters to exit the program
# and then call Linux to do it.

        addi    a0, x0, 0   # Use 0 return code
        addi    a7, x0, 93  # Service command code 93 terminates
        ecall               # Call linux to terminate the program

.data
helloworld:      .ascii "Hello World!\n"

The ‘#’ character is the comment character and anything after it on a line is a comment.

#245 Re: 全志 SOC » 全志D1芯片之终极探索 » 2021-06-07 13:57:52

@xboot
请问xfel支持 spi nand/nor 读写了吗?

#247 Re: 哇酷地摊(跳蚤市场) » F1C600 唱戏机主板 » 2021-06-06 19:52:48

QQ图片20210606195220.jpg

QQ图片20210606195051.jpg

淘宝买了一台7寸唱戏机, 发现主板有点不同, 借按键怼上去也没用

#253 Re: 技术人生/软件使用技巧/破解经验/技术吐槽/灌水 » 玩一玩avr汇编,探究计算机的本质 » 2021-06-04 22:37:29

想要玩深入一点这是必经之路,汇编,Makefile, Linkscript, 体系结构都要涉猎。

#257 Re: RISC-V » 用汇编学习risc-v指令集,并在线仿真,点亮led » 2021-06-02 16:50:36

太有趣了, 可以用 html 单步调试, 挺直观的.

#258 Re: 全志 SOC » 关于Zero v3s驱动ST7701S IPS 480*480屏 SPI+RGB,有大佬写个入门教程吗? » 2021-06-02 16:49:25

用 IO 模拟 (9bit?) spi 初始化 LCD, 然乎就能用 SYNC RGB 驱动显示了.

#259 Re: DIY/综合/Arduino/写字机/3D打印机/智能小车/平衡车/四轴飞行/MQTT/物联网 » 这个十五年前的松下相机电池还能抢救一下吗? 放到冰箱-18℃里面冻了几天了。 » 2021-06-01 13:27:15

拉轰的脚踏车 说:

咦, 好像可以充进去了, 电池插相机里面, 现在电池图标显示满格, 至少不是一闪一闪的红色图标了.

看来急冻还真有用啊😱

#261 Re: 全志 SOC » v3s现在有办法通过jlink单步裸奔么? » 2021-05-31 09:45:47

ueiia 说:

RTT转成IAR成功了,但是IAR编译需要ICF链接文件,LDS要转成ICF真是头大

大佬方便分享iar工程吗?

#262 Re: 全志 SOC » 集齐F1C马甲就能召唤神龙吗? 我试一试 » 2021-05-29 23:26:23

F1C500s 是 32M DRAM:

[0]HELLO! BOOT0 is starting!
[2]boot0 commit : 80628dcde5dc4ecdc757a9e782c58d7cf1abf959
 
[60]dram size =32
[62]Reg pull reg_val=0x00000000,read=0x00000010
[66]Succeed in reading toc file head.
[69]The size of toc is 00054000.
[127]Reg pull reg_val=0x00000000,read=0x00000010
[136]Ready to disable icache.
[138]Jump to secend Boot.

F1C100s 和 F1C500s 只有一个寄存器值不同, DRAM大小一模一样.

tina sdk 可以直接跑在这两个芯片可能都会出错.

[0]HELLO! BOOT0 is starting!
[2]boot0 commit : 80628dcde5dc4ecdc757a9e782c58d7cf1abf959
 
[60]dram size =32
[62]Reg pull reg_val=0x00000000,read=0x00000010
[66]Succeed in reading toc file head.
[69]The size of toc is 00054000.
[127]Reg pull reg_val=0x00000000,read=0x00000010
[136]Ready to disable icache.
[138]Jump to secend Boot.


U-Boot 2014.07 (Aug 21 2019 - 14:53:43) Allwinner Technology 

uboot commit : 78cb55af380c57c0278162e241a9999cdc16e1d6
 
i2c_init: by cpux
[I2C-DEBUG]:i2c_set_clock() 354 
[I2C-ERROR]:twi_send_clk_9pulse() 136 SDA is still Stuck Low, failed. 
i2c_init ok
[0.187]pmbus:   ready
axp: get node[/soc/pmu0] error
axp_probe error
[0.193]PMU: cpux 408 Mhz,AXI=408 Mhz
PLL6=600 Mhz,AHB1=200 Mhz, APB1=100Mhz 
key value = 4294967295, fel_key = [256,426]
DRAM:  32 MiB
Relocation Offset is: 01580000
axp: get node[/soc/pmu0] error
int sunxi_dma_init---
irq enable
workmode = 0,storage type = 3
[0.260]spinor:	 0
flash size =0x4000 sectors
sunxi spinor is initing...int sunxi_dma_init---
irq enable
sunxi_dma_install_int ok
sunxi_dma_install_int ok
OK
spinor id:0x1840ef
spi_freq = 40000000
[0.278]sunxi flash init ok
spinor read: start 0x3e0, sector 0x20
used mbr [0], count = 8
spinor read: start 0x800, sector 0x200
env size is 256
env partition is too small!
can't enabled backup env functions
logo addr = 0x81f00000
spinor read: start 0x400, sector 0x400
sunxi_read_bootlogo: read bootlogo partition successful
do not find fastboot status flag
--------fastboot partitions--------
-total partitions:8-
-name-        -start-       -size-      
bootlogo    : 4000          80000       
env         : 84000         20000       
boot        : a4000         300000      
rootfs      : 3a4000        c00000      
rootfs_data : fa4000        180000      
misc        : 1124000       10000       
private     : 1134000       10000       
UDISK       : 1144000       0           
-----------------------------------
spinor read: start 0x8d00, sector 0x4
disable nand error: FDT_ERR_BADPATH
disable nand error: FDT_ERR_BADPATH
## error: update_fdt_dram_para : FDT_ERR_NOTFOUND
PowerBus = 0( 2:vBus 3:acBus other: not exist)
no battery exist
sunxi_bmp_logo_display
Hit any key to stop autoboot:  0 
spinor read: start 0x900, sector 0x40
spinor read: start 0x940, sector 0x1380
## Booting kernel from Legacy Image at 80007fc0 ...
   Image Name:   ARM OpenWrt Linux-3.10.65
   Image Type:   ARM Linux Kernel Image (uncompressed)
   Data Size:    2588104 Bytes = 2.5 MiB
   Load Address: 80008000
   Entry Point:  80008000
   XIP Kernel Image ... OK
   reserving fdt memory region: addr=81000000 size=10000
   Using Device Tree in place at 81000000, end 8100f49f

Starting kernel ...

[    0.000000] Booting Linux on physical CPU 0x0
[    0.000000] Initializing cgroup subsys cpuset
[    0.000000] Initializing cgroup subsys cpuacct
[    0.000000] Linux version 3.10.65 (cube@ubuntu) (gcc version 6.4.1 (OpenWrt/Linaro GCC 6.4-2017.11 2017-11) ) #203 Sat May 29 15:10:02 UTC 2021
[    0.000000] CPU: ARM926EJ-S [41069265] revision 5 (ARMv5TEJ), cr=00053177
[    0.000000] CPU: VIVT data cache, VIVT instruction cache
[    0.000000] Machine: Allwinner A1X (Device Tree), model: sun3iw1p1
[    0.000000] bootconsole [earlycon0] enabled
[    0.000000] cma: CMA: failed to reserve 32 MiB
[    0.000000] Memory policy: ECC disabled, Data cache writeback
[    0.000000] On node 0 totalpages: 8192
[    0.000000] free_area_init_node: node 0, pgdat c0546bcc, node_mem_map c0574000
[    0.000000]   Normal zone: 64 pages used for memmap
[    0.000000]   Normal zone: 0 pages reserved
[    0.000000]   Normal zone: 8192 pages, LIFO batch:0
[    0.000000] pcpu-alloc: s0 r0 d32768 u32768 alloc=1*32768
[    0.000000] pcpu-alloc: [0] 0 
[    0.000000] Built 1 zonelists in Zone order, mobility grouping on.  Total pages: 8128
[    0.000000] Kernel command line: enforcing=1 earlyprintk=sunxi-uart,0x01c25000 initcall_debug=0 console=ttyS1,115200 loglevel=8 root=/dev/mtdblock4 init=/pseudo_init rdinit=/rdinit partitions=bootlogo@mtdblock1:env@mtdblock2:boot@mtdblock3:rootfs@mtdblock4:rootfs_data@mtdblock5:misc@mtdblock6:private@mtdblock7:UDISK@mtdblock8 cma=32M fb_base=0x81f00000 androidboot.serialno=<NULL> boot_type=3
[    0.000000] PID hash table entries: 128 (order: -3, 512 bytes)
[    0.000000] Dentry cache hash table entries: 4096 (order: 2, 16384 bytes)
[    0.000000] Inode-cache hash table entries: 2048 (order: 1, 8192 bytes)
[    0.000000] Memory: 32MB = 32MB total
[    0.000000] Memory: 26748k/26748k available, 6020k reserved, 0K highmem
[    0.000000] Virtual kernel memory layout:
[    0.000000]     vector  : 0xffff0000 - 0xffff1000   (   4 kB)
[    0.000000]     fixmap  : 0xfff00000 - 0xfffe0000   ( 896 kB)
[    0.000000]     vmalloc : 0xc2800000 - 0xff000000   ( 968 MB)
[    0.000000]     lowmem  : 0xc0000000 - 0xc2000000   (  32 MB)
[    0.000000]     modules : 0xbf000000 - 0xc0000000   (  16 MB)
[    0.000000]       .text : 0xc0008000 - 0xc0441f84   (4328 kB)
[    0.000000]       .init : 0xc0442000 - 0xc046013c   ( 121 kB)
[    0.000000]       .data : 0xc0462000 - 0xc05474e8   ( 918 kB)
[    0.000000]        .bss : 0xc05474e8 - 0xc0573d00   ( 179 kB)
[    0.000000] SLUB: HWalign=32, Order=0-3, MinObjects=0, CPUs=1, Nodes=1
[    0.000000] NR_IRQS:256
[    0.000000] of_sunxi_clocks_init : sunxi_clk_base[0xf1c20000]
[    0.000000] pll_cpu-set_default_rate=552000000 success!
[    0.000000] pll_video-set_default_rate=297000000 success!
[    0.000000] pll_ddr-set_default_rate=312000000 success!
[    0.000000] timer_nr = 2 .......................
[    0.000000] timer_base = 0xF1C20C00, irq = 15 -----
[    0.000000] HZ = 100 JJJJJJJJJJJ 
[    0.000000] rate / (prescale * HZ) = 15000 
[    0.000000] sched_clock: 32 bits at 24MHz, resolution 41ns, wraps every 178956ms
[    0.000000] Console: colour dummy device 80x30
[    0.005324] Calibrating delay loop... 275.25 BogoMIPS (lpj=1376256)
[    0.075269] pid_max: default: 32768 minimum: 301
[    0.080445] Mount-cache hash table entries: 512
[    0.086432] CPU: Testing write buffer coherency: ok
[    0.092219] Setting up static identity map for 0xc0341dc0 - 0xc0341e18
[    0.101512] devtmpfs: initialized
[    0.106978] pinctrl core: initialized pinctrl subsystem
[    0.112842] NET: Registered protocol family 16
[    0.117992] DMA: failed to allocate 256 KiB pool for atomic coherent allocation
[    0.126064] dump_class_init,844, success
[    0.135040] sun3iw1p1-pinctrl pio: initialized sunXi PIO driver
[    0.158774] bio: create slab <bio-0> at 0
[    0.164297] pwm module init!
[    0.169095] SCSI subsystem initialized
[    0.173384] usbcore: registered new interface driver usbfs
[    0.179196] usbcore: registered new interface driver hub
[    0.185071] usbcore: registered new device driver usb
[    0.192771] gpio=140,mul_sel=6,pull=1,drv_level=-1,data=1
[    0.198732] sunxi_i2c_do_xfer()928 - [i2c0] incomplete xfer (status: 0x48, dev addr: 0x20)
[    0.207294] pcf857x 0-0020: retry commucation.7
[    0.212258] sunxi_i2c_do_xfer()928 - [i2c0] incomplete xfer (status: 0x48, dev addr: 0x20)
[    0.220785] pcf857x 0-0020: retry commucation.6
[    0.225764] sunxi_i2c_do_xfer()928 - [i2c0] incomplete xfer (status: 0x48, dev addr: 0x20)
[    0.234289] pcf857x 0-0020: retry commucation.5
[    0.239245] sunxi_i2c_do_xfer()928 - [i2c0] incomplete xfer (status: 0x48, dev addr: 0x20)
[    0.247766] pcf857x 0-0020: retry commucation.4
[    0.252744] sunxi_i2c_do_xfer()928 - [i2c0] incomplete xfer (status: 0x48, dev addr: 0x20)
[    0.261235] pcf857x 0-0020: retry commucation.3
[    0.266218] sunxi_i2c_do_xfer()928 - [i2c0] incomplete xfer (status: 0x48, dev addr: 0x20)
[    0.274740] pcf857x 0-0020: retry commucation.2
[    0.279699] sunxi_i2c_do_xfer()928 - [i2c0] incomplete xfer (status: 0x48, dev addr: 0x20)
[    0.288219] pcf857x 0-0020: retry commucation.1
[    0.293200] sunxi_i2c_do_xfer()928 - [i2c0] incomplete xfer (status: 0x48, dev addr: 0x20)
[    0.301723] pcf857x: probe of 0-0020 failed with error -70
[    0.309718] Linux video capture interface: v2.00
[    0.315105] Advanced Linux Sound Architecture Driver Initialized.
[    0.323321] cfg80211: Calling CRDA to update world regulatory domain
[    0.330754] Switching to clocksource sun3i high-res couter
[    0.356484] get det_vbus is fail, 84
[    0.361928] NET: Registered protocol family 2
[    0.368585] TCP established hash table entries: 512 (order: 0, 4096 bytes)
[    0.375701] TCP bind hash table entries: 512 (order: -1, 2048 bytes)
[    0.382367] TCP: Hash tables configured (established 512 bind 512)
[    0.388941] TCP: reno registered
[    0.392337] UDP hash table entries: 256 (order: 0, 4096 bytes)
[    0.398453] UDP-Lite hash table entries: 256 (order: 0, 4096 bytes)
[    0.405527] NET: Registered protocol family 1
[    0.423545] squashfs: version 4.0 (2009/01/31) Phillip Lougher
[    0.430206] jffs2: version 2.2. 漏 2001-2006 Red Hat, Inc.
[    0.436762] msgmni has been set to 52
[    0.443775] io scheduler noop registered
[    0.448068] io scheduler cfq registered (default)
[    0.452946] [pm]aw_pm_init!
[    0.456217] [pm]valid
[    0.458710] [pm]valid
[    0.461449] [DISP]disp_module_init
[    0.526640] pll_freq=297000000HZ, lcd_dclk_freq=20000000HZ, clk_div=14
[    0.534016] *******************************
[    0.538443] ***
[    0.540318] *** LCD Panel Parameter Check
[    0.544473] ***
[    0.546340] ***             by guozhenjie
[    0.550539] ***
[    0.552411] ********************************
[    0.556861] ***
[    0.558732] *** Interface:
[    0.561304] *** Parallel HV Panel
[    0.565028] *** Lcd Frm to RGB666
[    0.568513] ***
[    0.570382] *** Timing:
[    0.572955] *** lcd_x:      800
[    0.576231] *** lcd_y:      480
[    0.579540] *** lcd_ht:     928
[    0.582817] *** lcd_hbp:    88
[    0.586005] *** lcd_vt:     525
[    0.589311] *** lcd_vbp:    32
[    0.592501] *** lcd_hspw:   48
[    0.595688] *** lcd_vspw:   3
[    0.598820] *** lcd_frame_frq:  41Hz
[    0.602536] ***
[    0.604407] *** WRN03: Recommend "lcd_dclk_frq = 29"
[    0.609560] ***
[    0.611430] *** LCD Panel Parameter Check End
[    0.615938] *******************************
[    0.620387] num_screens=1
[    0.623176] screen_id=0
[    0.625754] para->mclk[MOD_CLK_LCD1CH0]=0xc180c300
[    0.630771] para->mclk[MOD_CLK_LCD1CH1]=0xc180c400
[    0.635725] disp tv init
[    0.638432] tcon_clk=0xc180c300, tcon_clk_parent=0x0
[    0.643567] tcon_clk=0xc180c300, tcon_clk_parent=0xc18043c0
[    0.649351] tve_clk=0xc180c400, tve_clk_parent=0xc18043c0
[    0.654919] disp al tv init
[    0.660585] fetch script datadisp.screen2_output_type fail
[    0.666663] fetch script datadisp.screen2_output_mode fail
[    0.674907] fetch script datadisp.fb2_format fail
[    0.680160] fetch script datadisp.fb2_scaler_mode_enable fail
[    0.686390] fetch script datadisp.fb2_width fail
[    0.691546] fetch script datadisp.fb2_height fail
[    0.696450] disp_malloc fail, size=0x2ee000
[    0.700855] disp_malloc fail!
[    0.704288] Unable to handle kernel paging request at virtual address 0005dfc0
[    0.711847] pgd = c0004000
[    0.714694] [0005dfc0] *pgd=00000000
[    0.718502] Internal error: Oops: 805 [#1] ARM
[    0.723102] Modules linked in:
[    0.726315] CPU: 0 PID: 1 Comm: swapper Not tainted 3.10.65 #203
[    0.732507] task: c1832000 ti: c1834000 task.ti: c1834000
[    0.738097] PC is at memcpy+0x244/0x330
[    0.742087] LR is at 0xadc8ff9e
[    0.745376] pc : [<c0125564>]    lr : [<adc8ff9e>]    psr: 20000013
[    0.745376] sp : c1835c40  ip : ff9eaec8  fp : c1835d7c
[    0.757200] r10: 000000ef  r9 : ff9dacc8  r8 : ff99a8c7
[    0.762595] r7 : ff97a6c6  r6 : ff96a5c7  r5 : ff94a2c4  r4 : ff93a2c4
[    0.769310] r3 : ff9ca7c2  r2 : 00000460  r1 : c2854b58  r0 : 0005dfc0
[    0.776027] Flags: nzCv  IRQs on  FIQs on  Mode SVC_32  ISA ARM  Segment kernel
[    0.783535] Control: 0005317f  Table: 80004000  DAC: 00000017
[    0.789454] 
[    0.789454] PC: 0xc01254e4:
[    0.793966] 54e4  cafffff9 e2411003 eaffffba e252201c ba00001f e92d03e0 f5d1f000 e2522060
[    0.802457] 5504  f5d1f01c ba000002 f5d1f03c f5d1f05c f5d1f07c e8b100f0 e1a0382e e2522020
[    0.810942] 5524  e8b15300 e1833804 e1a04824 e1844805 e1a05825 e1855806 e1a06826 e1866807
[    0.819425] 5544  e1a07827 e1877808 e1a08828 e1888809 e1a09829 e189980c e1a0c82c e18cc80e
[    0.827909] 5564  e8a013f8 aaffffe9 e3720060 aaffffe8 e8bd03e0 e212c01c 0a000005 e1a0382e
[    0.836393] 5584  e491e004 e25cc004 e183380e e4803004 cafffff9 e2411002 eaffff8e e252201c
[    0.844878] 55a4  ba00001f e92d03e0 f5d1f000 e2522060 f5d1f01c ba000002 f5d1f03c f5d1f05c
[    0.853363] 55c4  f5d1f07c e8b100f0 e1a03c2e e2522020 e8b15300 e1833404 e1a04c24 e1844405
[    0.861850] 
[    0.861850] SP: 0xc1835bc0:
[    0.866362] 5bc0  c0546bcc 81f00000 c1835bfc c1835bd8 c006e17c c006d4e4 c0125564 20000013
[    0.874846] 5be0  ffffffff c1835c2c c1835d7c c1835bf8 c000f4b8 c000a1a0 0005dfc0 c2854b58
[    0.883329] 5c00  00000460 ff9ca7c2 ff93a2c4 ff94a2c4 ff96a5c7 ff97a6c6 ff99a8c7 ff9dacc8
[    0.891813] 5c20  000000ef c1835d7c ff9eaec8 c1835c40 adc8ff9e c0125564 20000013 ffffffff
[    0.900297] 5c40  0005dfc0 c1835d88 000001e0 0004b036 00000000 0005dfc0 c18f0800 c0158590
[    0.908780] 5c60  c054abf8 00000000 00000001 00000140 00000140 000000f0 c280a000 c280a036
[    0.917264] 5c80  000001e0 00000320 00000000 00000320 c001c89c 00000000 00000000 00000000
[    0.925748] 5ca0  00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
[    0.934232] 
[    0.934232] IP: 0xff9eae48:
[    0.938745] ae48  ******** ******** ******** ******** ******** ******** ******** ********
[    0.947239] ae68  ******** ******** ******** ******** ******** ******** ******** ********
[    0.955723] ae88  ******** ******** ******** ******** ******** ******** ******** ********
[    0.964207] aea8  ******** ******** ******** ******** ******** ******** ******** ********
[    0.972691] aec8  ******** ******** ******** ******** ******** ******** ******** ********
[    0.981174] aee8  ******** ******** ******** ******** ******** ******** ******** ********
[    0.989658] af08  ******** ******** ******** ******** ******** ******** ******** ********
[    0.998141] af28  ******** ******** ******** ******** ******** ******** ******** ********
[    1.006627] 
[    1.006627] FP: 0xc1835cfc:
[    1.011141] 5cfc  000001e0 ffffffff 00000000 00000000 00000320 000001e0 00000000 00000000
[    1.019623] 5d1c  00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
[    1.028104] 5d3c  00000320 000001e0 00000000 00000000 00000000 00000000 c05592f8 00000000
[    1.036586] 5d5c  00000000 c0559568 c0559570 c0559568 00000004 c1835ddc c1835d80 c0159300
[    1.045070] 5d7c  c0157e10 c0559570 00000001 00000000 00000000 00000002 00000320 000001e0
[    1.053552] 5d9c  00000320 000001e0 00000000 00000000 00000000 c0154b30 c05592f8 c185f800
[    1.062035] 5dbc  c185f810 c047ce34 00000000 c045bf18 00000000 c1835dfc c1835de0 c0156540
[    1.070519] 5ddc  c01588a8 c185f810 c055cbc4 00000000 c047ce34 c1835e0c c1835e00 c01a4744
[    1.079005] 
[    1.079005] R1: 0xc2854ad8:
[    1.083517] 4ad8  2376ff0e 2073ff0d 2173ff0b 2372ff0b 2273ff0b 2272ff0b 2170ff0b 206fff0a
[    1.092004] 4af8  2170ff0c 2170ff0c 206dff0c 206cff0c 206cff0d 206cff0d 206aff0d 1f6aff0d
[    1.100492] 4b18  1f6aff0d 216aff0d 1f68ff0d 1e65ff0b 1e65ff0a 1f66ff0a 6c94ff0b a7c2ff62
[    1.108980] 4b38  a2c4ff9c a2c4ff93 a5c7ff94 a6c6ff96 a8c7ff97 acc8ff99 aec8ff9d adc8ff9e
[    1.117468] 4b58  adc8ff9f b1cbff9f b1ccffa3 b1ccffa3 b4ceffa5 b2ccffa8 b3ceffa6 b8cdffa7
[    1.125956] 4b78  bbcfffad bcd0ffb0 bed2ffb1 bed0ffb3 bfd1ffb3 c1d3ffb4 c3d5ffb6 c5d5ffb8
[    1.134444] 4b98  c8d9ffbb c9daffbf cbdcffc0 c8d8ffc2 cad9ffbf ccdbffc1 cddcffc3 cedeffc4
[    1.142932] 4bb8  d0e0ffc3 d0e0ffc4 d0e0ffc4 d2e3ffc4 d1e3ffc8 d3e4ffc8 d1e2ffca d0e0ffc8
[    1.151423] 
[    1.151423] R3: 0xff9ca742:
[    1.155935] a740  ******** ******** ******** ******** ******** ******** ******** ********
[    1.164420] a760  ******** ******** ******** ******** ******** ******** ******** ********
[    1.172904] a780  ******** ******** ******** ******** ******** ******** ******** ********
[    1.181388] a7a0  ******** ******** ******** ******** ******** ******** ******** ********
[    1.189871] a7c0  ******** ******** ******** ******** ******** ******** ******** ********
[    1.198355] a7e0  ******** ******** ******** ******** ******** ******** ******** ********
[    1.206838] a800  ******** ******** ******** ******** ******** ******** ******** ********
[    1.215322] a820  ******** ******** ******** ******** ******** ******** ******** ********
[    1.223805] a840  ******** ******** ******** ******** ******** ******** ******** ********
[    1.232291] 
[    1.232291] R4: 0xff93a244:
[    1.236803] a244  ******** ******** ******** ******** ******** ******** ******** ********
[    1.245287] a264  ******** ******** ******** ******** ******** ******** ******** ********
[    1.253770] a284  ******** ******** ******** ******** ******** ******** ******** ********
[    1.262254] a2a4  ******** ******** ******** ******** ******** ******** ******** ********
[    1.270738] a2c4  ******** ******** ******** ******** ******** ******** ******** ********
[    1.279222] a2e4  ******** ******** ******** ******** ******** ******** ******** ********
[    1.287705] a304  ******** ******** ******** ******** ******** ******** ******** ********
[    1.296189] a324  ******** ******** ******** ******** ******** ******** ******** ********
[    1.304675] 
[    1.304675] R5: 0xff94a244:
[    1.309188] a244  ******** ******** ******** ******** ******** ******** ******** ********
[    1.317672] a264  ******** ******** ******** ******** ******** ******** ******** ********
[    1.326155] a284  ******** ******** ******** ******** ******** ******** ******** ********
[    1.334639] a2a4  ******** ******** ******** ******** ******** ******** ******** ********
[    1.343122] a2c4  ******** ******** ******** ******** ******** ******** ******** ********
[    1.351605] a2e4  ******** ******** ******** ******** ******** ******** ******** ********
[    1.360090] a304  ******** ******** ******** ******** ******** ******** ******** ********
[    1.368573] a324  ******** ******** ******** ******** ******** ******** ******** ********
[    1.377060] 
[    1.377060] R6: 0xff96a547:
[    1.381572] a544  ******** ******** ******** ******** ******** ******** ******** ********
[    1.390055] a564  ******** ******** ******** ******** ******** ******** ******** ********
[    1.398539] a584  ******** ******** ******** ******** ******** ******** ******** ********
[    1.407023] a5a4  ******** ******** ******** ******** ******** ******** ******** ********
[    1.415507] a5c4  ******** ******** ******** ******** ******** ******** ******** ********
[    1.423990] a5e4  ******** ******** ******** ******** ******** ******** ******** ********
[    1.432475] a604  ******** ******** ******** ******** ******** ******** ******** ********
[    1.440959] a624  ******** ******** ******** ******** ******** ******** ******** ********
[    1.449443] a644  ******** ******** ******** ******** ******** ******** ******** ********
[    1.457929] 
[    1.457929] R7: 0xff97a646:
[    1.462441] a644  ******** ******** ******** ******** ******** ******** ******** ********
[    1.470925] a664  ******** ******** ******** ******** ******** ******** ******** ********
[    1.479408] a684  ******** ******** ******** ******** ******** ******** ******** ********
[    1.487891] a6a4  ******** ******** ******** ******** ******** ******** ******** ********
[    1.496374] a6c4  ******** ******** ******** ******** ******** ******** ******** ********
[    1.504858] a6e4  ******** ******** ******** ******** ******** ******** ******** ********
[    1.513342] a704  ******** ******** ******** ******** ******** ******** ******** ********
[    1.521826] a724  ******** ******** ******** ******** ******** ******** ******** ********
[    1.530309] a744  ******** ******** ******** ******** ******** ******** ******** ********
[    1.538796] 
[    1.538796] R8: 0xff99a847:
[    1.543308] a844  ******** ******** ******** ******** ******** ******** ******** ********
[    1.551792] a864  ******** ******** ******** ******** ******** ******** ******** ********
[    1.560276] a884  ******** ******** ******** ******** ******** ******** ******** ********
[    1.568760] a8a4  ******** ******** ******** ******** ******** ******** ******** ********
[    1.577243] a8c4  ******** ******** ******** ******** ******** ******** ******** ********
[    1.585726] a8e4  ******** ******** ******** ******** ******** ******** ******** ********
[    1.594209] a904  ******** ******** ******** ******** ******** ******** ******** ********
[    1.602694] a924  ******** ******** ******** ******** ******** ******** ******** ********
[    1.611177] a944  ******** ******** ******** ******** ******** ******** ******** ********
[    1.619664] 
[    1.619664] R9: 0xff9dac48:
[    1.624176] ac48  ******** ******** ******** ******** ******** ******** ******** ********
[    1.632660] ac68  ******** ******** ******** ******** ******** ******** ******** ********
[    1.641144] ac88  ******** ******** ******** ******** ******** ******** ******** ********
[    1.649628] aca8  ******** ******** ******** ******** ******** ******** ******** ********
[    1.658112] acc8  ******** ******** ******** ******** ******** ******** ******** ********
[    1.666595] ace8  ******** ******** ******** ******** ******** ******** ******** ********
[    1.675079] ad08  ******** ******** ******** ******** ******** ******** ******** ********
[    1.683563] ad28  ******** ******** ******** ******** ******** ******** ******** ********
[    1.692056] Process swapper (pid: 1, stack limit = 0xc18341b8)
[    1.698066] Stack: (0xc1835c40 to 0xc1836000)
[    1.702599] 5c40: 0005dfc0 c1835d88 000001e0 0004b036 00000000 0005dfc0 c18f0800 c0158590
[    1.711002] 5c60: c054abf8 00000000 00000001 00000140 00000140 000000f0 c280a000 c280a036
[    1.719403] 5c80: 000001e0 00000320 00000000 00000320 c001c89c 00000000 00000000 00000000
[    1.727803] 5ca0: 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
[    1.736203] 5cc0: 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
[    1.744603] 5ce0: 00000000 00000000 ff000001 00000000 00000000 00000000 00000320 000001e0
[    1.753003] 5d00: ffffffff 00000000 00000000 00000320 000001e0 00000000 00000000 00000000
[    1.761404] 5d20: 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000320
[    1.769804] 5d40: 000001e0 00000000 00000000 00000000 00000000 c05592f8 00000000 00000000
[    1.778207] 5d60: c0559568 c0559570 c0559568 00000004 c1835ddc c1835d80 c0159300 c0157e10
[    1.786607] 5d80: c0559570 00000001 00000000 00000000 00000002 00000320 000001e0 00000320
[    1.795009] 5da0: 000001e0 00000000 00000000 00000000 c0154b30 c05592f8 c185f800 c185f810
[    1.803412] 5dc0: c047ce34 00000000 c045bf18 00000000 c1835dfc c1835de0 c0156540 c01588a8
[    1.811815] 5de0: c185f810 c055cbc4 00000000 c047ce34 c1835e0c c1835e00 c01a4744 c01563e0
[    1.820218] 5e00: c1835e34 c1835e10 c01a3518 c01a4738 c185f810 c185f844 c047ce34 00000000
[    1.828621] 5e20: 00000000 c045bf18 c1835e54 c1835e38 c01a366c c01a33e4 00000000 c047ce34
[    1.837024] 5e40: c01a3618 00000000 c1835e7c c1835e58 c01a1b68 c01a3628 c1823f4c c185c870
[    1.845428] 5e60: c18d4e14 c047ce34 c18d4de0 c0537f48 c1835e8c c1835e80 c01a2fc8 c01a1af0
[    1.853832] 5e80: c1835ebc c1835e90 c01a2bf8 c01a2fb8 c03f672a c0460008 c1835ebc c047ce34
[    1.862235] 5ea0: c03f672a 00000000 c0460008 00000000 c1835ee4 c1835ec0 c01a3c1c c01a2ac0
[    1.870638] 5ec0: c0559080 c03f672a 00000000 c0460008 00000000 c045bf18 c1835ef4 c1835ee8
[    1.879041] 5ee0: c01a4ca4 c01a3b84 c1835f1c c1835ef8 c044f410 c01a4c68 c03f672a c01a3b84
[    1.887445] 5f00: c1835f1c c1834000 c044f334 c0547500 c1835f5c c1835f20 c000a4d4 c044f344
[    1.895847] 5f20: 00000006 00000006 0000005a c05c4169 c003b8a0 00000007 c0547500 0000005a
[    1.904251] 5f40: c0460008 c045bf10 c045bf18 00000000 c1835f94 c1835f60 c0442c0c c000a3c8
[    1.912652] 5f60: 00000006 00000006 c04424d0 00000000 00000000 c033cb4c 00000000 00000000
[    1.921054] 5f80: 00000000 00000000 c1835fac c1835f98 c033cb5c c0442a78 00000000 c033cb4c
[    1.929455] 5fa0: 00000000 c1835fb0 c000f930 c033cb5c 00000000 00000000 00000000 00000000
[    1.937855] 5fc0: 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
[    1.946255] 5fe0: 00000000 00000000 00000000 00000000 00000013 00000000 00000000 00000000
[    1.954634] Backtrace: 
[    1.957276] [<c0157e00>] (Display_Fb_Request+0x0/0x814) from [<c0159300>] (Fb_Init+0xa68/0xc24)
[    1.966220] [<c0158898>] (Fb_Init+0x0/0xc24) from [<c0156540>] (disp_probe+0x170/0x1f0)
[    1.974466] [<c01563d0>] (disp_probe+0x0/0x1f0) from [<c01a4744>] (platform_drv_probe+0x1c/0x20)
[    1.983468]  r7:c047ce34 r6:00000000 r5:c055cbc4 r4:c185f810
[    1.989378] [<c01a4728>] (platform_drv_probe+0x0/0x20) from [<c01a3518>] (driver_probe_device+0x144/0x1f8)
[    1.999283] [<c01a33d4>] (driver_probe_device+0x0/0x1f8) from [<c01a366c>] (__driver_attach+0x54/0x94)
[    2.008811]  r9:c045bf18 r8:00000000 r7:00000000 r6:c047ce34 r5:c185f844
r4:c185f810
[    2.017027] [<c01a3618>] (__driver_attach+0x0/0x94) from [<c01a1b68>] (bus_for_each_dev+0x88/0x98)
[    2.026204]  r7:00000000 r6:c01a3618 r5:c047ce34 r4:00000000
[    2.032105] [<c01a1ae0>] (bus_for_each_dev+0x0/0x98) from [<c01a2fc8>] (driver_attach+0x20/0x28)
[    2.041105]  r6:c0537f48 r5:c18d4de0 r4:c047ce34
[    2.045935] [<c01a2fa8>] (driver_attach+0x0/0x28) from [<c01a2bf8>] (bus_add_driver+0x148/0x220)
[    2.054957] [<c01a2ab0>] (bus_add_driver+0x0/0x220) from [<c01a3c1c>] (driver_register+0xa8/0x124)
[    2.064132]  r8:00000000 r7:c0460008 r6:00000000 r5:c03f672a r4:c047ce34
[    2.071110] [<c01a3b74>] (driver_register+0x0/0x124) from [<c01a4ca4>] (platform_driver_register+0x4c/0x60)
[    2.081078]  r9:c045bf18 r8:00000000 r7:c0460008 r6:00000000 r5:c03f672a
r4:c0559080
[    2.089322] [<c01a4c58>] (platform_driver_register+0x0/0x60) from [<c044f410>] (disp_module_init+0xdc/0x128)
[    2.099409] [<c044f334>] (disp_module_init+0x0/0x128) from [<c000a4d4>] (do_one_initcall+0x11c/0x148)
[    2.108850]  r6:c0547500 r5:c044f334 r4:c1834000
[    2.113689] [<c000a3b8>] (do_one_initcall+0x0/0x148) from [<c0442c0c>] (kernel_init_freeable+0x1a4/0x1e4)
[    2.123513] [<c0442a68>] (kernel_init_freeable+0x0/0x1e4) from [<c033cb5c>] (kernel_init+0x10/0xe8)
[    2.132776]  r9:00000000 r8:00000000 r7:00000000 r6:00000000 r5:c033cb4c
r4:00000000
[    2.141006] [<c033cb4c>] (kernel_init+0x0/0xe8) from [<c000f930>] (ret_from_fork+0x14/0x24)
[    2.149567]  r5:c033cb4c r4:00000000
[    2.153324] Code: e1a09829 e189980c e1a0c82c e18cc80e (e8a013f8) 
[    2.159782] ---[ end trace 7c1a1d285d2959a2 ]---
[    2.164615] Kernel panic - not syncing: Attempted to kill init! exitcode=0x0000000b
[    2.164615] 

#265 Re: Nuvoton N32905/N32926/NUC972/N9H20/N9H26/N9H30 » step by step 全志 f1c100s MDK 裸奔各种外设(参考N3290x) » 2021-05-29 15:17:19

#include <stdio.h>
#include "types.h"
#include "io.h"
#include "reg-ccu.h"

typedef unsigned int u32_t; 

#define     __O     volatile     
#define     __IO    volatile 

#define CPU_PORT_BASE 0x01C20800

#define GPIOG_BASE (CPU_PORT_BASE + 0xD8)
#define GPIOG_INTERRUPT_BASE (GPIO_CPU_INTERRUPT_BASE + 0x20)

typedef struct{
   __IO u32_t CFG[4];
   __IO u32_t DAT;
   __IO u32_t DRV[2];
   __IO u32_t PUL[2];
}GPIO_Typedef;

#define GPIOG ((GPIO_Typedef *)GPIOG_BASE)



static void wait_pll_stable(u32_t base)
{
	u32_t rval = 0;
	u32_t time = 0xfff;

	do {
		rval = read32(base);
		time--;
	} while(time && !(rval & (1 << 28)));
}

static void clock_set_pll_cpu(u32_t clk)
{
	u32_t n, k, m, p;
	u32_t rval = 0;
	u32_t div = 0;

	if(clk > 720000000)
		clk = 720000000;

	if((clk % 24000000) == 0)
	{
		div = clk / 24000000;
		n = div - 1;
		k = 0;
		m = 0;
		p = 0;
	}
	else if((clk % 12000000) == 0)
	{
		m = 1;
		div = clk / 12000000;
		if((div % 3) == 0)
			k = 2;
		else if((div % 4) == 0)
			k = 3;
		else
			k = 1;
		n = (div / (k + 1)) - 1;
		p = 0;
	}
	else
	{
		div = clk / 24000000;
		n = div - 1;
		k = 0;
		m = 0;
		p = 0;
	}

	rval = read32(F1C100S_CCU_BASE + CCU_PLL_CPU_CTRL);
	rval &= ~((0x3 << 16) | (0x1f << 8) | (0x3 << 4) | (0x3 << 0));
	rval |= (1U << 31) | (p << 16) | (n << 8) | (k << 4) | m;
	write32(F1C100S_CCU_BASE + CCU_PLL_CPU_CTRL, rval);
	wait_pll_stable(F1C100S_CCU_BASE + CCU_PLL_CPU_CTRL);
}

void sys_clock_init(void)
{
	write32(F1C100S_CCU_BASE + CCU_PLL_STABLE_TIME0, 0x1ff);
	write32(F1C100S_CCU_BASE + CCU_PLL_STABLE_TIME1, 0x1ff);
	write32(F1C100S_CCU_BASE + CCU_CPU_CFG, 0x00020000);
	write32(F1C100S_CCU_BASE + CCU_AHB_APB_CFG, 0x00012110);

	clock_set_pll_cpu(408000000);
}

void sys_uart_init(void)
{
	u32_t addr;
	u32_t val;

	/* Config GPIOF4 and GPIOF2 to txd0 and rxd0 */
//  addr = 0x01c208b4 + 0x00;//uart0 base
    addr = 0x01c20800 + 0x00;//uart1 base
	val = read32(addr);
	//val &= ~(0xf << ((4 & 0x7) << 2));
	//val |= ((0x3 & 0x7) << ((4 & 0x7) << 2));
    val &= ~((0xf << 8) | (0xf << 12));
    val |= (0x05 << 8) | (0x05 << 12);
	write32(addr, val);

	//val = read32(addr);
	//val &= ~(0xf << ((2 & 0x7) << 2));
	//val |= ((0x3 & 0x7) << ((2 & 0x7) << 2));
	//write32(addr, val);
	
	addr = 0x01c20068;
	val = read32(addr);
//	val |= 1 << 20; /* Open the clock gate for uart0 */
    val |= 1 << 21; /* Open the clock gate for uart1 */
	write32(addr, val);


	addr = 0x01c202d0; 
	val = read32(addr);
//	val |= 1 << 20; /* Deassert uart0 reset */
    val |= 1 << 21; /* Deassert uart1 reset */
	write32(addr, val);

	/* Config uart to 115200-8-1-0 */
//  addr = 0x01c25000; //uart0 base
    addr = 0x01c25400; //uart1 base
	write32(addr + 0x04, 0x0);
	write32(addr + 0x08, 0xf7);
	write32(addr + 0x10, 0x0);
	val = read32(addr + 0x0c);
	val |= (1 << 7);
	write32(addr + 0x0c, val);
	write32(addr + 0x00, 0x37 & 0xff);
	write32(addr + 0x04, (0x37 >> 8) & 0xff);
	val = read32(addr + 0x0c);
	val &= ~(1 << 7);
	write32(addr + 0x0c, val);
	val = read32(addr + 0x0c);
	val &= ~0x1f;
	val |= (0x3 << 0) | (0 << 2) | (0x0 << 3);
	write32(addr + 0x0c, val);
}

void sys_uart_putc(char c)
{
//	u32_t addr = 0x01c25000;//uart0 base
    u32_t addr = 0x01c25400;//uart1 base

	while((read32(addr + 0x7c) & (0x1 << 1)) == 0);
	write32(addr + 0x00, c);
}



int main(void)
{
    sys_clock_init();
    sys_uart_init();

    while(1)
    {
        sys_uart_putc('A');
    }


    return 0;
}

MDK widora r3 裸奔 工程, UART1 (PA2, PA3)输出A:

widora_r3_uart1_pa2_pa3_20210529.zip

#266 Re: SigmaStar/SSD201/SSD202/SSD212 » SSD20X直接编译lvgl7.10带双缓(附源码) » 2021-05-29 00:10:03

duanchangstar 说:

已经搞定了AWTK的双缓冲,使用了楼主的方法。感谢~

方便分享一下diff差异文件吗?

#267 Re: SigmaStar/SSD201/SSD202/SSD212 » SSD20X直接编译lvgl7.10带双缓(附源码) » 2021-05-28 22:16:32

TeveT 说:

咋说,awtk 本地编译有包吗,我弄来看看

duanchangstar 说:

楼主很厉害啊,可以顺便搞一下AWTK的双缓冲吗

https://github.com/zlgopen/awtk

#268 全志 SOC » 请教melis 2.0命令行怎么打开回显? » 2021-05-26 11:53:31

cube
回复: 0

不回显就不知道输入是否正确

#269 Re: 全志 SOC » 请问哪里能找到荔枝派的gpio库呢 » 2021-04-28 08:25:02

新手报道,请问荔枝派如何使用定时器和GPIO呢?
http://whycan.com/t_2439.html#p18892
(出处:哇酷开发者社区)

#270 Re: 全志 SOC » 老人家,碰到新问题,mmcblk2变成了mmcblk1 » 2021-04-22 21:10:59

uboot可以跑脚本的,先判断mmc2是否存在,然后可以生成不同的 bootargs,然后再boot


大佬这个脚本写得太刁了:
buildroot-tiny200 (F1C100/200s) 开发包近期更新内容 * 已支持DVP摄像头 *
http://whycan.com/t_5221.html

#273 Re: VMWare/Linux/Ubuntu/Fedora/CentOS/U-BOOT » 记录一下常用易忘的Linux日常操作 » 2021-04-15 17:57:33

openwrt 修改了某package的配置, 强制编译:

如tslib强制编译:

make package/libs/tslib/clean

make package/libs/tslib/compile

#274 Re: 全志 SOC » 写一个非常简单的 V3s@linux4.13-y 中断驱动 » 2021-04-15 14:44:09

感谢楼主, 测试了一下, 一楼的代码在 tiny200 tina3.5 linux 也可以跑.

#275 Re: 全志 SOC » tiny200播放音频失败 » 2021-04-09 15:53:45

# tinymix contents
Number of controls: 25
ctl     type    num     name                                    value
0       INT     1       DAC Playback Volume                     63 (range 0->63)
1       INT     1       Headphone Playback Volume               32 (range 0->63)
2       BOOL    2       Headphone Playback Switch               On, On
3       INT     1       Line In Playback Volume                 0 (range 0->7)
4       INT     1       FM In Playback Volume                   0 (range 0->7)
5       INT     1       Mic In Playback Volume                  3 (range 0->7)
6       INT     1       Mic Boost Volume                        7 (range 0->7)
7       INT     1       ADC Capture Volume                      3 (range 0->7)
8       BOOL    1       ADC Mixer Right Out Capture Switch      Off
9       BOOL    1       ADC Mixer Left Out Capture Switch       Off
10      BOOL    1       ADC Mixer Line In Capture Switch        Off
11      BOOL    1       ADC Mixer Right FM In Capture Switch    Off
12      BOOL    1       ADC Mixer Left FM In Capture Switch     Off
13      BOOL    1       ADC Mixer Mic Capture Switch            On
14      BOOL    1       Left Mixer Right DAC Playback Switch    Off
15      BOOL    1       Left Mixer Left DAC Playback Switch     Off
16      BOOL    1       Left Mixer FM In Playback Switch        Off
17      BOOL    1       Left Mixer Line In Playback Switch      Off
18      BOOL    1       Left Mixer Mic In Playback Switch       On
19      BOOL    1       Right Mixer Left DAC Playback Switch    Off
20      BOOL    1       Right Mixer Right DAC Playback Switch   Off
21      BOOL    1       Right Mixer FM In Playback Switch       Off
22      BOOL    1       Right Mixer Line In Playback Switch     Off
23      BOOL    1       Right Mixer Mic In Playback Switch      Off
24      ENUM    2       Headphone Source Playback Route         , DACMixer, , DACMixer
#
# tinycap /tmp/test.wav
Capturing sample: 2 ch, 48000 hz, 16 bit
^CCaptured 421920 frames
#
#
# tinyplay  /tmp/test.wav
playing '/tmp/test.wav': 2 ch, 48000 hz, 16 bit
#

搞定, 感谢楼主, 只是底噪声音有点大, 不知道是F1C200s声卡本身问题, 还是PCB的滤波没做好?

#276 Re: 全志 SOC » TINY200开发板 SDC1 / SDIO1 使用1bit SD NAND 【分享】 » 2021-04-09 11:57:27

QQ截图20210420224949A.png


启动日志:

=>
=>
=> ums 0 mmc 1:0
UMS: LUN 0, dev 1, hwpart 0, sector 0x0, count 0xf6000
\musb-hdrc: peripheral reset irq lost!
/
U-Boot SPL 2020.07 (Oct 20 2020 - 11:09:37 +0800)
DRAM: 64 MiB
Trying to boot from MMC1
Card did not respond to voltage select!
spl: mmc init failed with error: -95
Trying to boot from MMC2


U-Boot 2020.07 (Oct 20 2020 - 11:09:37 +0800) Allwinner Technology

CPU:   Allwinner F Series (SUNIV)
Model: Allwinner F1C100s Generic Device
DRAM:  64 MiB
MMC:   mmc@1c0f000: 0, mmc@1c10000: 1
Setting up a 800x480 lcd console (overscan 0x0)
In:    serial
Out:   vga
Err:   vga
Allwinner mUSB OTG (Peripheral)
Hit any key to stop autoboot:  0
Card did not respond to voltage select!
switch to partitions #0, OK
mmc1 is current device
=========================
Boot Device: mmc1
Boot Slot 0: empty
Boot Slot 1: mmc1
=========================
DFU waiting on MMC1...
switch to partitions #0, OK
mmc1 is current device
musb-hdrc: peripheral reset irq lost!
switch to partitions #0, OK
mmc1 is current device
Booting from MMC1...
4687296 bytes read in 1555 ms (2.9 MiB/s)
15537 bytes read in 9 ms (1.6 MiB/s)
## Flattened Device Tree blob at 80700000
   Booting using the fdt blob at 0x80700000
   Loading Device Tree to 816f9000, end 816ffcb0 ... OK
Cannot setup simplefb: node not found

Starting kernel ...

[    0.000000] Booting Linux on physical CPU 0x0
[    0.000000] Linux version 5.4.66 (cube@ubuntu) (gcc version 8.4.0 (Buildroot 2020.02.4-00005-g9d84975a2d)) #4 Sat Apr 10 10:38:29 CST 2021
[    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: Widora MangoPi R3
[    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 consoleblank=0 net.ifnames=0 biosdevname=0 root=/dev/mmcblk1p3
[    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: 37700K/65536K available (7168K kernel code, 256K rwdata, 1796K rodata, 1024K init, 229K bss, 11452K 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/0x444 with crng_init=0
[    0.000050] sched_clock: 32 bits at 24MHz, resolution 41ns, wraps every 89478484971ns
[    0.000142] clocksource: timer: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 79635851949 ns
[    0.000890] Console: colour dummy device 80x30
[    0.000995] Calibrating delay loop... 203.16 BogoMIPS (lpj=1015808)
[    0.070264] pid_max: default: 32768 minimum: 301
[    0.070792] Mount-cache hash table entries: 1024 (order: 0, 4096 bytes, linear)
[    0.070837] Mountpoint-cache hash table entries: 1024 (order: 0, 4096 bytes, linear)
[    0.072654] CPU: Testing write buffer coherency: ok
[    0.074798] Setting up static identity map for 0x80100000 - 0x80100058
[    0.076112] devtmpfs: initialized
[    0.087917] clocksource: jiffies: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 19112604462750000 ns
[    0.087981] futex hash table entries: 256 (order: -1, 3072 bytes, linear)
[    0.092122] pinctrl core: initialized pinctrl subsystem
[    0.094847] NET: Registered protocol family 16
[    0.098589] DMA: preallocated 256 KiB pool for atomic coherent allocations
[    0.100974] cpuidle: using governor menu
[    0.150566] SCSI subsystem initialized
[    0.151257] usbcore: registered new interface driver usbfs
[    0.151454] usbcore: registered new interface driver hub
[    0.151677] usbcore: registered new device driver usb
[    0.152155] mc: Linux media interface: v0.10
[    0.152270] videodev: Linux video capture interface: v2.00
[    0.152396] pps_core: LinuxPPS API ver. 1 registered
[    0.152420] pps_core: Software ver. 5.3.6 - Copyright 2005-2007 Rodolfo Giometti <giometti@linux.it>
[    0.152483] PTP clock support registered
[    0.153584] ion_parse_dt_heap_common: id 4 type 4 name cma align 1000
[    0.154579] Advanced Linux Sound Architecture Driver Initialized.
[    0.157006] clocksource: Switched to clocksource timer
[    0.188590] thermal_sys: Registered thermal governor 'step_wise'
[    0.189373] NET: Registered protocol family 2
[    0.191001] tcp_listen_portaddr_hash hash table entries: 512 (order: 0, 4096 bytes, linear)
[    0.191096] TCP established hash table entries: 1024 (order: 0, 4096 bytes, linear)
[    0.191152] TCP bind hash table entries: 1024 (order: 0, 4096 bytes, linear)
[    0.191201] TCP: Hash tables configured (established 1024 bind 1024)
[    0.191540] UDP hash table entries: 256 (order: 0, 4096 bytes, linear)
[    0.191606] UDP-Lite hash table entries: 256 (order: 0, 4096 bytes, linear)
[    0.192128] NET: Registered protocol family 1
[    0.194809] NetWinder Floating Point Emulator V0.97 (double precision)
[    0.196685] Initialise system trusted keyrings
[    0.197462] workingset: timestamp_bits=30 max_order=14 bucket_order=0
[    0.219547] squashfs: version 4.0 (2009/01/31) Phillip Lougher
[    0.220149] jffs2: version 2.2. (NAND) (SUMMARY)  © 2001-2006 Red Hat, Inc.
[    0.334515] Key type asymmetric registered
[    0.334559] Asymmetric key parser 'x509' registered
[    0.334742] Block layer SCSI generic (bsg) driver version 0.4 loaded (major 249)
[    0.334771] io scheduler mq-deadline registered
[    0.334791] io scheduler kyber registered
[    0.350352] suniv-f1c100s-pinctrl 1c20800.pinctrl: initialized sunXi PIO driver
[    0.374739] Serial: 8250/16550 driver, 8 ports, IRQ sharing disabled
[    0.381056] suniv-f1c100s-pinctrl 1c20800.pinctrl: 1c20800.pinctrl supply vcc-pa not found, using dummy regulator
[    0.382387] printk: console [ttyS0] disabled
[    0.402720] 1c25400.serial: ttyS0 at MMIO 0x1c25400 (irq = 28, base_baud = 6250000) is a 16550A
[    0.832944] printk: console [ttyS0] enabled
[    0.842777] suniv-f1c100s-pinctrl 1c20800.pinctrl: 1c20800.pinctrl supply vcc-pd not found, using dummy regulator
[    0.864150] panel-simple panel: panel supply power not found, using dummy regulator
[    0.873857] SCSI Media Changer driver v0.25
[    0.880356] libphy: Fixed MDIO Bus: probed
[    0.884634] usbcore: registered new interface driver rndis_wlan
[    0.890813] usbcore: registered new interface driver asix
[    0.896317] usbcore: registered new interface driver ax88179_178a
[    0.902600] usbcore: registered new interface driver cdc_ether
[    0.908641] usbcore: registered new interface driver net1080
[    0.914398] usbcore: registered new interface driver rndis_host
[    0.920500] usbcore: registered new interface driver cdc_subset
[    0.926509] usbcore: registered new interface driver zaurus
[    0.932312] usbcore: registered new interface driver cdc_ncm
[    0.938039] ehci_hcd: USB 2.0 'Enhanced' Host Controller (EHCI) Driver
[    0.944553] ehci-platform: EHCI generic platform driver
[    0.950225] ohci_hcd: USB 1.1 'Open' Host Controller (OHCI) Driver
[    0.956452] ohci-platform: OHCI generic platform driver
[    0.962326] usbcore: registered new interface driver usb-storage
[    0.968720] usbcore: registered new interface driver usbserial_generic
[    0.975312] usbserial: USB Serial support registered for generic
[    0.982406] usb_phy_generic usb_phy_generic.0.auto: usb_phy_generic.0.auto supply vcc not found, using dummy regulator
[    0.994295] musb-hdrc musb-hdrc.1.auto: MUSB HDRC host driver
[    1.000270] musb-hdrc musb-hdrc.1.auto: new USB bus registered, assigned bus number 1
[    1.010325] hub 1-0:1.0: USB hub found
[    1.014222] hub 1-0:1.0: 1 port detected
[    1.021316] i2c /dev entries driver
[    1.025440] suniv-f1c100s-pinctrl 1c20800.pinctrl: 1c20800.pinctrl supply vcc-pd not found, using dummy regulator
[    1.039215] suniv-f1c100s-pinctrl 1c20800.pinctrl: 1c20800.pinctrl supply vcc-pe not found, using dummy regulator
[    1.050186] sun4i-csi 1cb0000.csi: Packed (RAW) format enabled.
[    1.058081] sunxi-wdt 1c20ca0.watchdog: Watchdog enabled (timeout=16 sec, nowayout=0)
[    1.068224] suniv-f1c100s-pinctrl 1c20800.pinctrl: 1c20800.pinctrl supply vcc-pf not found, using dummy regulator
[    1.106198] sunxi-mmc 1c0f000.mmc: initialized, max. request size: 16384 KB
[    1.113713] suniv-f1c100s-pinctrl 1c20800.pinctrl: 1c20800.pinctrl supply vcc-pc not found, using dummy regulator
[    1.151841] sunxi-mmc 1c10000.mmc: initialized, max. request size: 16384 KB
[    1.161385] usbcore: registered new interface driver usbhid
[    1.166962] usbhid: USB HID core driver
[    1.171250] sunxi-cedar 1c0e000.video-codec: sunxi cedar version 0.01alpha
[    1.178586] sunxi-cedar 1c0e000.video-codec: cedar-ve the get irq is 19
[    1.190016] debugfs: Directory '1c23c00.codec' with parent 'F1C100s Audio Codec' already present!
[    1.204029] sun4i-codec 1c23c00.codec: Codec <-> 1c23c00.codec mapping ok
[    1.220473] NET: Registered protocol family 17
[    1.225033] Key type dns_resolver registered
[    1.230567] Loading compiled-in X.509 certificates
[    1.254655] sun4i-drm soc:display-engine: bound 1e00000.display-frontend (ops 0xc083d0a0)
[    1.263758] sun4i-drm soc:display-engine: bound 1e60000.display-backend (ops 0xc083c8e0)
[    1.273348] sun4i-drm soc:display-engine: bound 1c0c000.lcd-controller (ops 0xc083b480)
[    1.281963] sun4i-drm soc:display-engine: bound 1c0a000.tv-encoder (ops 0xc083c1a0)
[    1.289742] [drm] Supports vblank timestamp caching Rev 2 (21.10.2013).
[    1.296344] [drm] No driver support for vblank timestamp query.
[    1.304148] [drm] Initialized sun4i-drm 1.0.0 20150629 for soc:display-engine on minor 0
[    1.313183] [drm] kms: can't enable cloning when we probably wanted to.
[    1.343782] mmc1: host does not support reading read-only switch, assuming write-enable
[    1.345550] mmc1: Problem switching card into high-speed mode!
[    1.345823] mmc1: new SD card at address 211f
[    1.348299] mmcblk1: mmc1:211f APPSD 492 MiB
[    1.354863]  mmcblk1: p1 p2 p3
[    1.385100] Console: switching to colour frame buffer device 100x30
[    1.449668] sun4i-drm soc:display-engine: fb0: sun4i-drmdrmfb frame buffer device
[    1.458889] cfg80211: Loading compiled-in X.509 certificates for regulatory database
[    1.476711] cfg80211: Loaded X.509 cert 'sforshee: 00b28ddf47aef9cea7'
[    1.483637] ALSA device list:
[    1.486630]   #0: F1C100s Audio Codec
[    1.490987] platform regulatory.0: Direct firmware load for regulatory.db failed with error -2
[    1.499764] cfg80211: failed to load regulatory.db
[    1.528073] EXT4-fs (mmcblk1p3): mounted filesystem with ordered data mode. Opts: (null)
[    1.536307] VFS: Mounted root (ext4 filesystem) readonly on device 179:3.
[    1.544877] devtmpfs: mounted
[    1.554425] Freeing unused kernel memory: 1024K
[    1.559152] Run /sbin/init as init process
[    1.607922] random: fast init done
[    2.416759] EXT4-fs (mmcblk1p3): re-mounted. Opts: (null)
Mounting OverlayFS: Skip
Starting syslogd: OK
Starting klogd: OK
Running sysctl: OK
Populating /dev using udev: [    3.341323] udevd[97]: starting version 3.2.9
[    3.412996] random: udevd: uninitialized urandom read (16 bytes read)
[    3.423602] random: udevd: uninitialized urandom read (16 bytes read)
[    3.431874] random: udevd: uninitialized urandom read (16 bytes read)
[    3.533460] udevd[98]: starting eudev-3.2.9
[    5.339444] Goodix-TS 0-005d: 0-005d supply AVDD28 not found, using dummy regulator
[    5.347616] Goodix-TS 0-005d: 0-005d supply VDDIO not found, using dummy regulator
[    5.363105] ov2640 0-0030: Product ID error fa:fa
[    5.487591] Goodix-TS 0-005d: i2c test failed attempt 1: -6
[    5.527671] Goodix-TS 0-005d: i2c test failed attempt 2: -6
[    5.567421] Goodix-TS 0-005d: I2C communication failure: -6
done
Saving random seed: [    6.300976] random: dd: uninitialized urandom read (512 bytes read)
OK
Starting system message bus: [    6.620491] random: dbus-uuidgen: uninitialized urandom read (12 bytes read)
[    6.628152] random: dbus-uuidgen: uninitialized urandom read (8 bytes read)
done
Starting network: OK
modprobe: module usb_f_rndis not found in modules.dep
modprobe: module usb_f_mass_storage not found in modules.dep
[    7.188584] using random self ethernet address
[    7.193063] using random host ethernet address
[    7.214159] Mass Storage Function, version: 2009/09/11
[    7.219479] LUN: removable file: (no medium)
[    7.226145] mass_storage.ms0/lun.0: unable to open backing file: /dev/mmcblk0
sh: write error: No such file or directory
[    7.319131] usb0: HOST MAC 16:22:92:5a:bb:ad
[    7.323561] usb0: MAC 5a:de:b0:37:cc:f4
Starting DHCP server: [    7.676138] configfs-gadget gadget: high-speed config #1: c
OK
Starting uMTPrd: mount: mounting none on /sys/kernel/config failed: Device or resource busy
[    8.571633] file system registered
[    8.726522] read descriptors
[    8.729717] read strings
OK
MJPG Streamer Version: git rev: 9d84975a2da97b17a4fe5eb7c85faa6b005cadae
 i: Using V4L2 device.: (null)
 i: Desired Resolution: 640 x 480
 i: Frames Per Second.: 15
 i: Format............: YUYV
 i: JPEG Quality......: 80
 i: TV-Norm...........: DEFAULT
 i: init_VideoIn failed
# [   31.847106] vcc3v0: disabling
[   31.850109] vcc5v0: disabling

# [

#277 全志 SOC » TINY200开发板 SDC1 / SDIO1 使用1bit SD NAND 【分享】 » 2021-04-09 11:54:41

cube
回复: 7

0. 下载 zadig 和 sunxi-fel.exe :

    编译、安装Windows版本sunxi-fel步骤 (32M spi flash补丁,支持W25Q256/MX25L256)
    http://whycan.com/t_444.html




1. 把SD NAND芯片焊到转接板上, 再把转接板焊到 TINY200主板

2. 修改 board/widora/mangopi/r3/devicetree/linux/devicetree.dts

屏蔽spi0:

 &spi0 {
-       status = "okay";
+       status = "disabled";

使能mmc1:

+&mmc1 {
+       status = "okay";
+       broken-cd;
+};
+

然后make打包成固件 output/images/sysimage-sdcard.img

3. 烧录

进入usb fel模式, windows命令行运行 "D:\sunxi-tools-win32support_f1c100s_v3s_201812219\F1C100s\sunxi-fel.exe" uboot u-boot-sunxi-with-spl.bin

uboot下载: u-boot-sunxi-with-spl.7z

u-boot命令行输入: ums 0 mmc 1:0

这时电脑出现一个U盘, 用win32imager烧录 sysimage-sdcard.img即可。

烧录固件下载: sysimage-sdcard-1bit.7z

IMG_20210331_100643.jpg

#278 Re: 全志 SOC » usb camera » 2021-04-08 21:15:34

可以进入usb fel 模式吗?可以用sunxi-fel 烧录吗?

#280 Re: DIY/综合/Arduino/写字机/3D打印机/智能小车/平衡车/四轴飞行/MQTT/物联网 » 8051 + RTL819AS ISA 网卡 [扔旧硬盘前备份] » 2021-04-08 11:14:39

1. google一下uip,点击进入主页 http://www.sics.se/~adam/uip/index.php/Main_Page
   当前最新的uIP版本是 1.0,这个版本比较复杂,所以还是移植历史版本吧.
   打开 http://www.sics.se/~adam/old-uip/ 下载0.9版:
   http://www.sics.se/~adam/download/?f=uip-0.9.tar.gz

2. 打开Keil新建项目uIP0.9.uv2, 设置项目属性.
   memory_model 设置为large 模式,这样默认的存储方式是xdata
     因为uIP0.9编译后占用20K rom, 所以必须选一个32K(>20K)的rom的单片机,
   比如Device可设置为SST89x58或者SST89x516xx,
   解压缩官方下载的uIP0.9压缩包,添加文件至项目,   
   需添加至项目的文件有:uip\uip.c, uip.c\uip.h, uip.c\uip_arch.h,
     uip.c\uip_arp.c,uip.c\uip_arp.h     
     unix\main.c, unix\uip_arch.c, unix\uipopt.h,
     apps\httpd\所有文件

3. 因为data是系统关键字, 所以标识符data => dat
   以下文件需要改动:   fs.h, fsdata.h,httpd.c

4. 为RTL8019AS 编写驱动程序(具体如何操作寄存器老古的网站有详细的教程),
      内容在压缩包中的RTL8019AS.c, RTL8019AS.h
     需要更改main.h中的如下地方:
     include "tapdev.h" => #include "rtl8019as.h"
     tapdev_init() -> rtl8019as_init()
     tapdev_send() -> rtl8019as_send()
     tapdev_read() -> rtl8019as_read()

5. fsdata.c 首行添加 #include "fsdata.h"
   关键字替换:
   static const char -> const char code
   const struct fsdata_file -> const struct fsdata_file code
   
   fsdata.h 文件末尾添加:

	#define FS_ROOT file_tcp_header_html
	#define FS_NUMFILES 14
	
	const char code data_cgi_files[];
	const char code data_cgi_stats[];
	const char code data_cgi_tcp[];
	const char code data_img_bg_png[];
	const char code data_about_html[];
	const char code data_control_html[];
	const char code data_404_html[];
	const char code data_files_footer_plain[];
	const char code data_files_header_html[];
	const char code data_index_html[];
	const char code data_stats_footer_plain[];
	const char code data_stats_header_html[];
	const char code data_tcp_footer_plain[];
	const char code data_tcp_header_html[];
	const struct fsdata_file code file_cgi_files[];
	const struct fsdata_file code file_cgi_stats[];
	const struct fsdata_file code file_cgi_tcp[];
	const struct fsdata_file code file_img_bg_png[];
	const struct fsdata_file code file_about_html[];
	const struct fsdata_file code file_control_html[];
	const struct fsdata_file code file_404_html[];
	const struct fsdata_file code file_files_footer_plain[];
	const struct fsdata_file code file_files_header_html[];
	const struct fsdata_file code file_index_html[];
	const struct fsdata_file code file_stats_footer_plain[];
	const struct fsdata_file code file_stats_header_html[];
	const struct fsdata_file code file_tcp_footer_plain[];
	const struct fsdata_file code file_tcp_header_html[];   

6. fs.c 第55行删除: #include "fsdata.c"

7. uipopt.h

    181行: #define UIP_FIXEDETHADDR 0 -> 1
    299行: #define UIP_ACTIVE_OPEN 1 ->0
    497行: #define BYTE_ORDER     LITTLE_ENDIAN -> BIG_ENDIAN
    280行: #define UIP_UDP_APPCALL  udp_appcall -> httpd_appcall

     
    更改单片机的IP地址和子网掩码(比如我的demo项目改为192.168.2.254,255.255.0.0)
    文件末尾添加:
    #ifndef NULL
    #define NULL (void *)0
    #endif /* NULL */
   

8. httpd.c
   删除以下内容:
                   extern const struct fsdata_file file_index_html;
                   extern const struct fsdata_file file_404_html;
   220行更改:
        fs_open(file_index_html.name, &fsfile);    =>   file_index_html->name
   224行同上更改
   
9. 烧录,运行。
   命令提示符下运行 c:\>ping 192.168.2.254

#283 Re: 全志 SOC » f1c200s运行tina抖屏问题,请大家支支招 » 2021-04-07 23:00:57

上面录像的视频因为手机录像帧率和显示帧率不一致引起,实际上并不闪。

做个小广告,有音视频方案产品需要开发可以加我微信:cube_work

#285 Re: 全志 SOC » tina编译错误 » 2021-04-05 21:04:36

cat: checkout: No such file or directory
/*
 * f_rndis.c -- RNDIS link function driver
 *
 * Copyright (C) 2003-2005,2008 David Brownell
 * Copyright (C) 2003-2004 Robert Schwebel, Benedikt Spranger
 * Copyright (C) 2008 Nokia Corporation
 * Copyright (C) 2009 Samsung Electronics
 *                    Author: Michal Nazarewicz (mina86@mina86.com)
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation; either version 2 of the License, or
 * (at your option) any later version.
 */

/* #define VERBOSE_DEBUG */

#include <linux/slab.h>
#include <linux/kernel.h>
#include <linux/device.h>
#include <linux/etherdevice.h>

#include <linux/atomic.h>

#include "u_ether.h"
#include "rndis.h"


/*
 * This function is an RNDIS Ethernet port -- a Microsoft protocol that's
 * been promoted instead of the standard CDC Ethernet.  The published RNDIS
 * spec is ambiguous, incomplete, and needlessly complex.  Variants such as
 * ActiveSync have even worse status in terms of specification.
 *
 * In short:  it's a protocol controlled by (and for) Microsoft, not for an
 * Open ecosystem or markets.  Linux supports it *only* because Microsoft
 * doesn't support the CDC Ethernet standard.
 *
 * The RNDIS data transfer model is complex, with multiple Ethernet packets
 * per USB message, and out of band data.  The control model is built around
 * what's essentially an "RNDIS RPC" protocol.  It's all wrapped in a CDC ACM
 * (modem, not Ethernet) veneer, with those ACM descriptors being entirely
 * useless (they're ignored).  RNDIS expects to be the only function in its
 * configuration, so it's no real help if you need composite devices; and
 * it expects to be the first configuration too.
 *
 * There is a single technical advantage of RNDIS over CDC Ethernet, if you
 * discount the fluff that its RPC can be made to deliver: it doesn't need
 * a NOP altsetting for the data interface.  That lets it work on some of the
 * "so smart it's stupid" hardware which takes over configuration changes
 * from the software, and adds restrictions like "no altsettings".
 *
 * Unfortunately MSFT's RNDIS drivers are buggy.  They hang or oops, and
 * have all sorts of contrary-to-specification oddities that can prevent
 * them from working sanely.  Since bugfixes (or accurate specs, letting
 * Linux work around those bugs) are unlikely to ever come from MSFT, you
 * may want to avoid using RNDIS on purely operational grounds.
 *
 * Omissions from the RNDIS 1.0 specification include:
 *
 *   - Power management ... references data that's scattered around lots
 *     of other documentation, which is incorrect/incomplete there too.
 *
 *   - There are various undocumented protocol requirements, like the need
 *     to send garbage in some control-OUT messages.
 *
 *   - MS-Windows drivers sometimes emit undocumented requests.
 */

struct f_rndis {
        struct gether                   port;
        u8                              ctrl_id, data_id;
        u8                              ethaddr[ETH_ALEN];
        u32                             vendorID;
        const char                      *manufacturer;
        int                             config;

        struct usb_ep                   *notify;
        struct usb_request              *notify_req;
        atomic_t                        notify_count;
};

static inline struct f_rndis *func_to_rndis(struct usb_function *f)
{
        return container_of(f, struct f_rndis, port.func);
}

/* peak (theoretical) bulk transfer rate in bits-per-second */
static unsigned int bitrate(struct usb_gadget *g)
{
        if (gadget_is_superspeed(g) && g->speed == USB_SPEED_SUPER)
                return 13 * 1024 * 8 * 1000 * 8;
        else if (gadget_is_dualspeed(g) && g->speed == USB_SPEED_HIGH)
                return 13 * 512 * 8 * 1000 * 8;
        else
                return 19 * 64 * 1 * 1000 * 8;
}

/*-------------------------------------------------------------------------*/

/*
 */

#define RNDIS_STATUS_INTERVAL_MS        32
#define STATUS_BYTECOUNT                8       /* 8 bytes data */


/* interface descriptor: */

static struct usb_interface_descriptor rndis_control_intf = {
        .bLength =              sizeof rndis_control_intf,
        .bDescriptorType =      USB_DT_INTERFACE,

        /* .bInterfaceNumber = DYNAMIC */
        /* status endpoint is optional; this could be patched later */
        .bNumEndpoints =        1,
        .bInterfaceClass =      USB_CLASS_COMM,
        .bInterfaceSubClass =   USB_CDC_SUBCLASS_ACM,
        .bInterfaceProtocol =   USB_CDC_ACM_PROTO_VENDOR,
        /* .iInterface = DYNAMIC */
};

static struct usb_cdc_header_desc header_desc = {
        .bLength =              sizeof header_desc,
        .bDescriptorType =      USB_DT_CS_INTERFACE,
        .bDescriptorSubType =   USB_CDC_HEADER_TYPE,

        .bcdCDC =               cpu_to_le16(0x0110),
};

static struct usb_cdc_call_mgmt_descriptor call_mgmt_descriptor = {
        .bLength =              sizeof call_mgmt_descriptor,
        .bDescriptorType =      USB_DT_CS_INTERFACE,
        .bDescriptorSubType =   USB_CDC_CALL_MANAGEMENT_TYPE,

        .bmCapabilities =       0x00,
        .bDataInterface =       0x01,
};

static struct usb_cdc_acm_descriptor rndis_acm_descriptor = {
        .bLength =              sizeof rndis_acm_descriptor,
        .bDescriptorType =      USB_DT_CS_INTERFACE,
        .bDescriptorSubType =   USB_CDC_ACM_TYPE,

        .bmCapabilities =       0x00,
};

static struct usb_cdc_union_desc rndis_union_desc = {
        .bLength =              sizeof(rndis_union_desc),
        .bDescriptorType =      USB_DT_CS_INTERFACE,
        .bDescriptorSubType =   USB_CDC_UNION_TYPE,
        /* .bMasterInterface0 = DYNAMIC */
        /* .bSlaveInterface0 =  DYNAMIC */
};

/* the data interface has two bulk endpoints */

static struct usb_interface_descriptor rndis_data_intf = {
        .bLength =              sizeof rndis_data_intf,
        .bDescriptorType =      USB_DT_INTERFACE,

        /* .bInterfaceNumber = DYNAMIC */
        .bNumEndpoints =        2,
        .bInterfaceClass =      USB_CLASS_CDC_DATA,
        .bInterfaceSubClass =   0,
        .bInterfaceProtocol =   0,
        /* .iInterface = DYNAMIC */
};


static struct usb_interface_assoc_descriptor
rndis_iad_descriptor = {
        .bLength =              sizeof rndis_iad_descriptor,
        .bDescriptorType =      USB_DT_INTERFACE_ASSOCIATION,

        .bFirstInterface =      0, /* XXX, hardcoded */
        .bInterfaceCount =      2,      // control + data
        .bFunctionClass =       USB_CLASS_COMM,
        .bFunctionSubClass =    USB_CDC_SUBCLASS_ETHERNET,
        .bFunctionProtocol =    USB_CDC_PROTO_NONE,
        /* .iFunction = DYNAMIC */
};

/* full speed support: */

static struct usb_endpoint_descriptor fs_notify_desc = {
        .bLength =              USB_DT_ENDPOINT_SIZE,
        .bDescriptorType =      USB_DT_ENDPOINT,

        .bEndpointAddress =     USB_DIR_IN,
        .bmAttributes =         USB_ENDPOINT_XFER_INT,
        .wMaxPacketSize =       cpu_to_le16(STATUS_BYTECOUNT),
        .bInterval =            RNDIS_STATUS_INTERVAL_MS,
};

static struct usb_endpoint_descriptor fs_in_desc = {
        .bLength =              USB_DT_ENDPOINT_SIZE,
        .bDescriptorType =      USB_DT_ENDPOINT,

        .bEndpointAddress =     USB_DIR_IN,
        .bmAttributes =         USB_ENDPOINT_XFER_BULK,
};

static struct usb_endpoint_descriptor fs_out_desc = {
        .bLength =              USB_DT_ENDPOINT_SIZE,
        .bDescriptorType =      USB_DT_ENDPOINT,

        .bEndpointAddress =     USB_DIR_OUT,
        .bmAttributes =         USB_ENDPOINT_XFER_BULK,
};

static struct usb_descriptor_header *eth_fs_function[] = {
        (struct usb_descriptor_header *) &rndis_iad_descriptor,

        /* control interface matches ACM, not Ethernet */
        (struct usb_descriptor_header *) &rndis_control_intf,
        (struct usb_descriptor_header *) &header_desc,
        (struct usb_descriptor_header *) &call_mgmt_descriptor,
        (struct usb_descriptor_header *) &rndis_acm_descriptor,
        (struct usb_descriptor_header *) &rndis_union_desc,
        (struct usb_descriptor_header *) &fs_notify_desc,

        /* data interface has no altsetting */
        (struct usb_descriptor_header *) &rndis_data_intf,
        (struct usb_descriptor_header *) &fs_in_desc,
        (struct usb_descriptor_header *) &fs_out_desc,
        NULL,
};

/* high speed support: */

static struct usb_endpoint_descriptor hs_notify_desc = {
        .bLength =              USB_DT_ENDPOINT_SIZE,
        .bDescriptorType =      USB_DT_ENDPOINT,

        .bEndpointAddress =     USB_DIR_IN,
        .bmAttributes =         USB_ENDPOINT_XFER_INT,
        .wMaxPacketSize =       cpu_to_le16(STATUS_BYTECOUNT),
        .bInterval =            USB_MS_TO_HS_INTERVAL(RNDIS_STATUS_INTERVAL_MS)
};

static struct usb_endpoint_descriptor hs_in_desc = {
        .bLength =              USB_DT_ENDPOINT_SIZE,
        .bDescriptorType =      USB_DT_ENDPOINT,

        .bEndpointAddress =     USB_DIR_IN,
        .bmAttributes =         USB_ENDPOINT_XFER_BULK,
        .wMaxPacketSize =       cpu_to_le16(512),
};

static struct usb_endpoint_descriptor hs_out_desc = {
        .bLength =              USB_DT_ENDPOINT_SIZE,
        .bDescriptorType =      USB_DT_ENDPOINT,

        .bEndpointAddress =     USB_DIR_OUT,
        .bmAttributes =         USB_ENDPOINT_XFER_BULK,
        .wMaxPacketSize =       cpu_to_le16(512),
};

static struct usb_descriptor_header *eth_hs_function[] = {
        (struct usb_descriptor_header *) &rndis_iad_descriptor,

        /* control interface matches ACM, not Ethernet */
        (struct usb_descriptor_header *) &rndis_control_intf,
        (struct usb_descriptor_header *) &header_desc,
        (struct usb_descriptor_header *) &call_mgmt_descriptor,
        (struct usb_descriptor_header *) &rndis_acm_descriptor,
        (struct usb_descriptor_header *) &rndis_union_desc,
        (struct usb_descriptor_header *) &hs_notify_desc,

        /* data interface has no altsetting */
        (struct usb_descriptor_header *) &rndis_data_intf,
        (struct usb_descriptor_header *) &hs_in_desc,
        (struct usb_descriptor_header *) &hs_out_desc,
        NULL,
};

/* super speed support: */

static struct usb_endpoint_descriptor ss_notify_desc = {
        .bLength =              USB_DT_ENDPOINT_SIZE,
        .bDescriptorType =      USB_DT_ENDPOINT,

        .bEndpointAddress =     USB_DIR_IN,
        .bmAttributes =         USB_ENDPOINT_XFER_INT,
        .wMaxPacketSize =       cpu_to_le16(STATUS_BYTECOUNT),
        .bInterval =            USB_MS_TO_HS_INTERVAL(RNDIS_STATUS_INTERVAL_MS)
};

static struct usb_ss_ep_comp_descriptor ss_intr_comp_desc = {
        .bLength =              sizeof ss_intr_comp_desc,
        .bDescriptorType =      USB_DT_SS_ENDPOINT_COMP,

        /* the following 3 values can be tweaked if necessary */
        /* .bMaxBurst =         0, */
        /* .bmAttributes =      0, */
        .wBytesPerInterval =    cpu_to_le16(STATUS_BYTECOUNT),
};

static struct usb_endpoint_descriptor ss_in_desc = {
        .bLength =              USB_DT_ENDPOINT_SIZE,
        .bDescriptorType =      USB_DT_ENDPOINT,

        .bEndpointAddress =     USB_DIR_IN,
        .bmAttributes =         USB_ENDPOINT_XFER_BULK,
        .wMaxPacketSize =       cpu_to_le16(1024),
};

static struct usb_endpoint_descriptor ss_out_desc = {
        .bLength =              USB_DT_ENDPOINT_SIZE,
        .bDescriptorType =      USB_DT_ENDPOINT,

        .bEndpointAddress =     USB_DIR_OUT,
        .bmAttributes =         USB_ENDPOINT_XFER_BULK,
        .wMaxPacketSize =       cpu_to_le16(1024),
};

static struct usb_ss_ep_comp_descriptor ss_bulk_comp_desc = {
        .bLength =              sizeof ss_bulk_comp_desc,
        .bDescriptorType =      USB_DT_SS_ENDPOINT_COMP,

        /* the following 2 values can be tweaked if necessary */
        /* .bMaxBurst =         0, */
        /* .bmAttributes =      0, */
};

static struct usb_descriptor_header *eth_ss_function[] = {
        (struct usb_descriptor_header *) &rndis_iad_descriptor,

        /* control interface matches ACM, not Ethernet */
        (struct usb_descriptor_header *) &rndis_control_intf,
        (struct usb_descriptor_header *) &header_desc,
        (struct usb_descriptor_header *) &call_mgmt_descriptor,
        (struct usb_descriptor_header *) &rndis_acm_descriptor,
        (struct usb_descriptor_header *) &rndis_union_desc,
        (struct usb_descriptor_header *) &ss_notify_desc,
        (struct usb_descriptor_header *) &ss_intr_comp_desc,

        /* data interface has no altsetting */
        (struct usb_descriptor_header *) &rndis_data_intf,
        (struct usb_descriptor_header *) &ss_in_desc,
        (struct usb_descriptor_header *) &ss_bulk_comp_desc,
        (struct usb_descriptor_header *) &ss_out_desc,
        (struct usb_descriptor_header *) &ss_bulk_comp_desc,
        NULL,
};

/* string descriptors: */

static struct usb_string rndis_string_defs[] = {
        [0].s = "RNDIS Communications Control",
        [1].s = "RNDIS Ethernet Data",
        [2].s = "RNDIS",
        {  } /* end of list */
};

static struct usb_gadget_strings rndis_string_table = {
        .language =             0x0409, /* en-us */
        .strings =              rndis_string_defs,
};

static struct usb_gadget_strings *rndis_strings[] = {
        &rndis_string_table,
        NULL,
};

/*-------------------------------------------------------------------------*/

static struct sk_buff *rndis_add_header(struct gether *port,
                                        struct sk_buff *skb)
{
        struct sk_buff *skb2;

        skb2 = skb_realloc_headroom(skb, sizeof(struct rndis_packet_msg_type));
        if (skb2)
                rndis_add_hdr(skb2);

        dev_kfree_skb_any(skb);
        return skb2;
}

static void rndis_response_available(void *_rndis)
{
        struct f_rndis                  *rndis = _rndis;
        struct usb_request              *req = rndis->notify_req;
        struct usb_composite_dev        *cdev = rndis->port.func.config->cdev;
        __le32                          *data = req->buf;
        int                             status;

        if (atomic_inc_return(&rndis->notify_count) != 1)
                return;

        /* Send RNDIS RESPONSE_AVAILABLE notification; a
         * USB_CDC_NOTIFY_RESPONSE_AVAILABLE "should" work too
         *
         * This is the only notification defined by RNDIS.
         */
        data[0] = cpu_to_le32(1);
        data[1] = cpu_to_le32(0);

        status = usb_ep_queue(rndis->notify, req, GFP_ATOMIC);
        if (status) {
                atomic_dec(&rndis->notify_count);
                DBG(cdev, "notify/0 --> %d\n", status);
        }
}

static void rndis_response_complete(struct usb_ep *ep, struct usb_request *req)
{
        struct f_rndis                  *rndis = req->context;
        struct usb_composite_dev        *cdev = rndis->port.func.config->cdev;
        int                             status = req->status;

        /* after TX:
         *  - USB_CDC_GET_ENCAPSULATED_RESPONSE (ep0/control)
         *  - RNDIS_RESPONSE_AVAILABLE (status/irq)
         */
        switch (status) {
        case -ECONNRESET:
        case -ESHUTDOWN:
                /* connection gone */
                atomic_set(&rndis->notify_count, 0);
                break;
        default:
                DBG(cdev, "RNDIS %s response error %d, %d/%d\n",
                        ep->name, status,
                        req->actual, req->length);
                /* FALLTHROUGH */
        case 0:
                if (ep != rndis->notify)
                        break;

                /* handle multiple pending RNDIS_RESPONSE_AVAILABLE
                 * notifications by resending until we're done
                 */
                if (atomic_dec_and_test(&rndis->notify_count))
                        break;
                status = usb_ep_queue(rndis->notify, req, GFP_ATOMIC);
                if (status) {
                        atomic_dec(&rndis->notify_count);
                        DBG(cdev, "notify/1 --> %d\n", status);
                }
                break;
        }
}

static void rndis_command_complete(struct usb_ep *ep, struct usb_request *req)
{
        struct f_rndis                  *rndis = req->context;
        int                             status;

        /* received RNDIS command from USB_CDC_SEND_ENCAPSULATED_COMMAND */
//      spin_lock(&dev->lock);
        status = rndis_msg_parser(rndis->config, (u8 *) req->buf);
        if (status < 0)
                pr_err("RNDIS command error %d, %d/%d\n",
                        status, req->actual, req->length);
//      spin_unlock(&dev->lock);
}

static int
rndis_setup(struct usb_function *f, const struct usb_ctrlrequest *ctrl)
{
        struct f_rndis          *rndis = func_to_rndis(f);
        struct usb_composite_dev *cdev = f->config->cdev;
        struct usb_request      *req = cdev->req;
        int                     value = -EOPNOTSUPP;
        u16                     w_index = le16_to_cpu(ctrl->wIndex);
        u16                     w_value = le16_to_cpu(ctrl->wValue);
        u16                     w_length = le16_to_cpu(ctrl->wLength);

        /* composite driver infrastructure handles everything except
         * CDC class messages; interface activation uses set_alt().
         */
        switch ((ctrl->bRequestType << 8) | ctrl->bRequest) {

        /* RNDIS uses the CDC command encapsulation mechanism to implement
         * an RPC scheme, with much getting/setting of attributes by OID.
         */
        case ((USB_DIR_OUT | USB_TYPE_CLASS | USB_RECIP_INTERFACE) << 8)
                        | USB_CDC_SEND_ENCAPSULATED_COMMAND:
                if (w_value || w_index != rndis->ctrl_id)
                        goto invalid;
                /* read the request; process it later */
                value = w_length;
                req->complete = rndis_command_complete;
                req->context = rndis;
                /* later, rndis_response_available() sends a notification */
                break;

        case ((USB_DIR_IN | USB_TYPE_CLASS | USB_RECIP_INTERFACE) << 8)
                        | USB_CDC_GET_ENCAPSULATED_RESPONSE:
                if (w_value || w_index != rndis->ctrl_id)
                        goto invalid;
                else {
                        u8 *buf;
                        u32 n;

                        /* return the result */
                        buf = rndis_get_next_response(rndis->config, &n);
                        if (buf) {
                                memcpy(req->buf, buf, n);
                                req->complete = rndis_response_complete;
                                req->context = rndis;
                                rndis_free_response(rndis->config, buf);
                                value = n;
                        }
                        /* else stalls ... spec says to avoid that */
                }
                break;

        default:
invalid:
                VDBG(cdev, "invalid control req%02x.%02x v%04x i%04x l%d\n",
                        ctrl->bRequestType, ctrl->bRequest,
                        w_value, w_index, w_length);
        }

        /* respond with data transfer or status phase? */
        if (value >= 0) {
                DBG(cdev, "rndis req%02x.%02x v%04x i%04x l%d\n",
                        ctrl->bRequestType, ctrl->bRequest,
                        w_value, w_index, w_length);
                req->zero = (value < w_length);
                req->length = value;
                value = usb_ep_queue(cdev->gadget->ep0, req, GFP_ATOMIC);
                if (value < 0)
                        ERROR(cdev, "rndis response on err %d\n", value);
        }

        /* device either stalls (value < 0) or reports success */
        return value;
}


static int rndis_set_alt(struct usb_function *f, unsigned intf, unsigned alt)
{
        struct f_rndis          *rndis = func_to_rndis(f);
        struct usb_composite_dev *cdev = f->config->cdev;

        /* we know alt == 0 */

        if (intf == rndis->ctrl_id) {
                if (rndis->notify->driver_data) {
                        VDBG(cdev, "reset rndis control %d\n", intf);
                        usb_ep_disable(rndis->notify);
                }
                if (!rndis->notify->desc) {
                        VDBG(cdev, "init rndis ctrl %d\n", intf);
                        if (config_ep_by_speed(cdev->gadget, f, rndis->notify))
                                goto fail;
                }
                usb_ep_enable(rndis->notify);
                rndis->notify->driver_data = rndis;

        } else if (intf == rndis->data_id) {
                struct net_device       *net;

                if (rndis->port.in_ep->driver_data) {
                        DBG(cdev, "reset rndis\n");
                        gether_disconnect(&rndis->port);
                }

                if (!rndis->port.in_ep->desc || !rndis->port.out_ep->desc) {
                        DBG(cdev, "init rndis\n");
                        if (config_ep_by_speed(cdev->gadget, f,
                                               rndis->port.in_ep) ||
                            config_ep_by_speed(cdev->gadget, f,
                                               rndis->port.out_ep)) {
                                rndis->port.in_ep->desc = NULL;
                                rndis->port.out_ep->desc = NULL;
                                goto fail;
                        }
                }

                /* Avoid ZLPs; they can be troublesome. */
                rndis->port.is_zlp_ok = false;

                /* RNDIS should be in the "RNDIS uninitialized" state,
                 * either never activated or after rndis_uninit().
                 *
                 * We don't want data to flow here until a nonzero packet
                 * filter is set, at which point it enters "RNDIS data
                 * initialized" state ... but we do want the endpoints
                 * to be activated.  It's a strange little state.
                 *
                 * REVISIT the RNDIS gadget code has done this wrong for a
                 * very long time.  We need another call to the link layer
                 * code -- gether_updown(...bool) maybe -- to do it right.
                 */
                rndis->port.cdc_filter = 0;

                DBG(cdev, "RNDIS RX/TX early activation ... \n");
                net = gether_connect(&rndis->port);
                if (IS_ERR(net))
                        return PTR_ERR(net);

                rndis_set_param_dev(rndis->config, net,
                                &rndis->port.cdc_filter);
        } else
                goto fail;

        return 0;
fail:
        return -EINVAL;
}

static void rndis_disable(struct usb_function *f)
{
        struct f_rndis          *rndis = func_to_rndis(f);
        struct usb_composite_dev *cdev = f->config->cdev;

        if (!rndis->notify->driver_data)
                return;

        DBG(cdev, "rndis deactivated\n");

        rndis_uninit(rndis->config);
        gether_disconnect(&rndis->port);

        usb_ep_disable(rndis->notify);
        rndis->notify->driver_data = NULL;
}

/*-------------------------------------------------------------------------*/

/*
 * This isn't quite the same mechanism as CDC Ethernet, since the
 * notification scheme passes less data, but the same set of link
 * states must be tested.  A key difference is that altsettings are
 * not used to tell whether the link should send packets or not.
 */

static void rndis_open(struct gether *geth)
{
        struct f_rndis          *rndis = func_to_rndis(&geth->func);
        struct usb_composite_dev *cdev = geth->func.config->cdev;

        DBG(cdev, "%s\n", __func__);

        rndis_set_param_medium(rndis->config, RNDIS_MEDIUM_802_3,
                                bitrate(cdev->gadget) / 100);
        rndis_signal_connect(rndis->config);
}

static void rndis_close(struct gether *geth)
{
        struct f_rndis          *rndis = func_to_rndis(&geth->func);

        DBG(geth->func.config->cdev, "%s\n", __func__);

        rndis_set_param_medium(rndis->config, RNDIS_MEDIUM_802_3, 0);
        rndis_signal_disconnect(rndis->config);
}

/*-------------------------------------------------------------------------*/

/* ethernet function driver setup/binding */

static int
rndis_bind(struct usb_configuration *c, struct usb_function *f)
{
        struct usb_composite_dev *cdev = c->cdev;
        struct f_rndis          *rndis = func_to_rndis(f);
        int                     status;
        struct usb_ep           *ep;

        /* allocate instance-specific interface IDs */
        status = usb_interface_id(c, f);
        if (status < 0)
                goto fail;
        rndis->ctrl_id = status;
        rndis_iad_descriptor.bFirstInterface = status;

        rndis_control_intf.bInterfaceNumber = status;
        rndis_union_desc.bMasterInterface0 = status;

        status = usb_interface_id(c, f);
        if (status < 0)
                goto fail;
        rndis->data_id = status;

        rndis_data_intf.bInterfaceNumber = status;
        rndis_union_desc.bSlaveInterface0 = status;

        status = -ENODEV;

        /* allocate instance-specific endpoints */
        ep = usb_ep_autoconfig(cdev->gadget, &fs_in_desc);
        if (!ep)
                goto fail;
        rndis->port.in_ep = ep;
        ep->driver_data = cdev; /* claim */

        ep = usb_ep_autoconfig(cdev->gadget, &fs_out_desc);
        if (!ep)
                goto fail;
        rndis->port.out_ep = ep;
        ep->driver_data = cdev; /* claim */

        /* NOTE:  a status/notification endpoint is, strictly speaking,
         * optional.  We don't treat it that way though!  It's simpler,
         * and some newer profiles don't treat it as optional.
         */
        ep = usb_ep_autoconfig(cdev->gadget, &fs_notify_desc);
        if (!ep)
                goto fail;
        rndis->notify = ep;
        ep->driver_data = cdev; /* claim */

        status = -ENOMEM;

        /* allocate notification request and buffer */
        rndis->notify_req = usb_ep_alloc_request(ep, GFP_KERNEL);
        if (!rndis->notify_req)
                goto fail;
        rndis->notify_req->buf = kmalloc(STATUS_BYTECOUNT, GFP_KERNEL);
        if (!rndis->notify_req->buf)
                goto fail;
        rndis->notify_req->length = STATUS_BYTECOUNT;
        rndis->notify_req->context = rndis;
        rndis->notify_req->complete = rndis_response_complete;

        /* support all relevant hardware speeds... we expect that when
         * hardware is dual speed, all bulk-capable endpoints work at
         * both speeds
         */
        hs_in_desc.bEndpointAddress = fs_in_desc.bEndpointAddress;
        hs_out_desc.bEndpointAddress = fs_out_desc.bEndpointAddress;
        hs_notify_desc.bEndpointAddress = fs_notify_desc.bEndpointAddress;

        ss_in_desc.bEndpointAddress = fs_in_desc.bEndpointAddress;
        ss_out_desc.bEndpointAddress = fs_out_desc.bEndpointAddress;
        ss_notify_desc.bEndpointAddress = fs_notify_desc.bEndpointAddress;

        status = usb_assign_descriptors(f, eth_fs_function, eth_hs_function,
                        eth_ss_function);
        if (status)
                goto fail;

        rndis->port.open = rndis_open;
        rndis->port.close = rndis_close;

        status = rndis_register(rndis_response_available, rndis);
        if (status < 0)
                goto fail;
        rndis->config = status;

        rndis_set_param_medium(rndis->config, RNDIS_MEDIUM_802_3, 0);
        rndis_set_host_mac(rndis->config, rndis->ethaddr);

        if (rndis->manufacturer && rndis->vendorID &&
                        rndis_set_param_vendor(rndis->config, rndis->vendorID,
                                               rndis->manufacturer))
                goto fail;

        /* NOTE:  all that is done without knowing or caring about
         * the network link ... which is unavailable to this code
         * until we're activated via set_alt().
         */

        DBG(cdev, "RNDIS: %s speed IN/%s OUT/%s NOTIFY/%s\n",
                        gadget_is_superspeed(c->cdev->gadget) ? "super" :
                        gadget_is_dualspeed(c->cdev->gadget) ? "dual" : "full",
                        rndis->port.in_ep->name, rndis->port.out_ep->name,
                        rndis->notify->name);
        return 0;

fail:
        usb_free_all_descriptors(f);

        if (rndis->notify_req) {
                kfree(rndis->notify_req->buf);
                usb_ep_free_request(rndis->notify, rndis->notify_req);
        }

        /* we might as well release our claims on endpoints */
        if (rndis->notify)
                rndis->notify->driver_data = NULL;
        if (rndis->port.out_ep)
                rndis->port.out_ep->driver_data = NULL;
        if (rndis->port.in_ep)
                rndis->port.in_ep->driver_data = NULL;

        ERROR(cdev, "%s: can't bind, err %d\n", f->name, status);

        return status;
}

static void
rndis_unbind(struct usb_configuration *c, struct usb_function *f)
{
        struct f_rndis          *rndis = func_to_rndis(f);

        rndis_deregister(rndis->config);
        rndis_exit();

        rndis_string_defs[0].id = 0;
        usb_free_all_descriptors(f);

        kfree(rndis->notify_req->buf);
        usb_ep_free_request(rndis->notify, rndis->notify_req);

        kfree(rndis);
}

/* Some controllers can't support RNDIS ... */
static inline bool can_support_rndis(struct usb_configuration *c)
{
        /* everything else is *presumably* fine */
        return true;
}

int
rndis_bind_config_vendor(struct usb_configuration *c, u8 ethaddr[ETH_ALEN],
                u32 vendorID, const char *manufacturer, struct eth_dev *dev)
{
        struct f_rndis  *rndis;
        int             status;

        if (!can_support_rndis(c) || !ethaddr)
                return -EINVAL;

        if (rndis_string_defs[0].id == 0) {
                /* ... and setup RNDIS itself */
                status = rndis_init();
                if (status < 0)
                        return status;

                status = usb_string_ids_tab(c->cdev, rndis_string_defs);
                if (status)
                        return status;

                rndis_control_intf.iInterface = rndis_string_defs[0].id;
                rndis_data_intf.iInterface = rndis_string_defs[1].id;
                rndis_iad_descriptor.iFunction = rndis_string_defs[2].id;
        }

        /* allocate and initialize one new instance */
        status = -ENOMEM;
        rndis = kzalloc(sizeof *rndis, GFP_KERNEL);
        if (!rndis)
                goto fail;

        memcpy(rndis->ethaddr, ethaddr, ETH_ALEN);
        rndis->vendorID = vendorID;
        rndis->manufacturer = manufacturer;

        rndis->port.ioport = dev;
        /* RNDIS activates when the host changes this filter */
        rndis->port.cdc_filter = 0;

        /* RNDIS has special (and complex) framing */
        rndis->port.header_len = sizeof(struct rndis_packet_msg_type);
        rndis->port.wrap = rndis_add_header;
        rndis->port.unwrap = rndis_rm_hdr;

        rndis->port.func.name = "rndis";
        rndis->port.func.strings = rndis_strings;
        /* descriptors are per-instance copies */
        rndis->port.func.bind = rndis_bind;
        rndis->port.func.unbind = rndis_unbind;
        rndis->port.func.set_alt = rndis_set_alt;
        rndis->port.func.setup = rndis_setup;
        rndis->port.func.disable = rndis_disable;

        status = usb_add_function(c, &rndis->port.func);
        if (status) {
                kfree(rndis);
fail:
                rndis_exit();
        }
        return status;
}

直接替换这个文件试一试: drivers/usb/gadget/f_rndis.c

#286 Re: 全志 SOC » f1c200s运行tina抖屏问题,请大家支支招 » 2021-04-04 18:27:02

这是我们公司用tiny200 做的广告机原型, 感觉挺流畅的,没有你们说的抖屏问题.

运行的是tina3.5

#288 Re: 全志 SOC » 小智x3 开发板 有从spi flash启动成功的吗? » 2021-03-11 09:30:52

我们的产品没有录音功能,也没有音乐播放,所以没有研究过呢。 现在具体是什么情况呢?你用tina还是主线?

#289 Re: 技术人生/软件使用技巧/破解经验/技术吐槽/灌水 » 开个脑洞,如果stm32f103zet6涨到1000元,还有人买吗? » 2021-03-11 09:13:45

STM32这波涨价,国产兼容芯片受益不少吧,以前扯着嗓子都卖不掉,现在都是客户上面催货。

#290 Re: 全志 SOC » 小智x3 开发板 有从spi flash启动成功的吗? » 2021-03-11 09:09:24

这是我们公司做的TF卡烧SPI NOR的量产固件: smallwit_x3_tfcard_自动烧录spinor.tgz

你可以烧到TF卡启动试一试。

一开始是在小智开发板做的,现在都是公司自己做板子了,参考了小智X3的原理图。

页脚

工信部备案:粤ICP备20025096号 Powered by FluxBB

感谢为中文互联网持续输出优质内容的各位老铁们。 QQ: 516333132, 微信(wechat): whycan_cn (哇酷网/挖坑网/填坑网) service@whycan.cn