ai代码如下
#include <Arduino.h>
#define SLAVE_ID 15
#define BAUDRATE 2400
#define TIMEOUT 1000
#define TX_ENABLE_PIN 4
// MODBUS function codes
#define READ_HOLDING_REGISTERS 0x03
// Registers addresses
#define ADDR_ENERGY 0x0000
#define ADDR_VOLTAGE 0x0300
#define ADDR_CURRENT 0x0303
#define ADDR_POWER 0x0306
// Registers lengths
#define LEN_ENERGY 2
#define LEN_VOLTAGE 1
#define LEN_CURRENT 1
#define LEN_POWER 1
void setup() {
Serial.begin(BAUDRATE, SERIAL_8E1); // 偶校验
pinMode(TX_ENABLE_PIN, OUTPUT);
}
void loop() {
float energy = readRegister(ADDR_ENERGY, LEN_ENERGY) * 0.01; // kWh
float voltage = readRegister(ADDR_VOLTAGE, LEN_VOLTAGE) * 0.1; // V
float current = readRegister(ADDR_CURRENT, LEN_CURRENT) * 0.01; // A
float power = readRegister(ADDR_POWER, LEN_POWER) * 0.01; // kW
if (current > 1.0) {
digitalWrite(TX_ENABLE_PIN, HIGH);
} else {
digitalWrite(TX_ENABLE_PIN, LOW);
}
// 延时一段时间后再次读取
delay(5000);
}
long readRegister(unsigned int addr, unsigned char len) {
unsigned char buf[8];
buf[0] = SLAVE_ID; // Slave Address
buf[1] = READ_HOLDING_REGISTERS; // Function Code
buf[2] = highByte(addr); // Starting Address High
buf[3] = lowByte(addr); // Starting Address Low
buf[4] = 0x00; // Number of Registers High
buf[5] = len; // Number of Registers Low
unsigned int crc = calculateCRC(buf, 6);
buf[6] = lowByte(crc); // CRC Low
buf[7] = highByte(crc); // CRC High
sendRequest(buf, 8);
delay(100);
if (Serial.available()) {
// Read the response
// TODO: Add code to parse the response
}
return 0; // Placeholder for actual value
}
void sendRequest(unsigned char *packet, unsigned char packetLength) {
digitalWrite(TX_ENABLE_PIN, HIGH);
for (unsigned char i = 0; i < packetLength; i++) {
Serial.write(packet[i]);
}
Serial.flush();
digitalWrite(TX_ENABLE_PIN, LOW);
}
unsigned int calculateCRC(unsigned char *buf, unsigned char len) {
unsigned int crc = 0xFFFF;
for (unsigned int pos = 0; pos < len; pos++) {
crc ^= (unsigned int)buf[pos];
for (int i = 8; i != 0; i--) {
if ((crc & 0x0001) != 0) {
crc >>= 1;
crc ^= 0xA001;
} else {
crc >>= 1;
}
}
}
return crc;
}
我也是要读这个电表,真是太tmd坎坷了。
本来用的天问的asrpro模块,想着它带喇叭可以语音说话,我想做个当电流超多少时自动语音报警(因为家里是速热热水器,开起来最大到32A,我限制了水流到20A,家里总断路器才32A的,如果这时候烧水或是干啥容易超电流跳闸,我自己会注意,家人不太懂电这东西),结果他们的芯片有问题,偶校验2400波特率走modbus模块,发送数据是正常的,但收数据就是大概率误码,如果我读电量,电流电压功率,大概率电压能读出来,如果我只读电压,是一次正确一次误码。后来测试自收自发还误码,真狗,浪费了2天休息日的大好时光。然后图省事,试了试手里的arduino nano,和nodemcu8266,但都是只有一个串口,没法看调试信息,后来用nano那一个串口测试,和esp8266测试,都是用的arduino,也是不行,真狗,这两个模块用示波器测了下,原来是rx脚被板载USB串口芯片的tx拉高了,果断把nano上的ch340焊下来。果然好了,太tm坎坷了。
代码我是直接对AI提的编程需求,粘上就能用。问法如下。我的硬件是Arduino Nano。我需要使用串口以MODBUS RTU协议读取电表的电压 电流 功率 电量。电量的地址是0x0000,数据长度为2。电压的地址是0x0300,数据长度为1。电流的地址是0x0303,数据长度为1。功率的地址是0x0306,数据长度为1。modbus的读参量用03H号命令。电表的modbus地址为15。电量数据是高位在前,低位在后,若读出值为0012D687H(1234567),则电能计量值为 1234567×0.01=12345.67kWh。电能表中所测电压值固定为 1 位小数,数据格式为 XXX.X,单位为 V,若通讯读出,电压值为 0897H(2199),则电压的实际值为 219.9V;所测电流值固定为 2 位小数数据格式为 XXX.XX,单位 A,若通讯读出电流值为 0096H(150), 则电流的实际值为 1.50A。电能表的有功率值固定为 2 位小数,数据格式为 XXX.XX,单位为 kW, 若通讯读出有功功
率值为 0020H(32),则有功率的实际值为 0.32kW。 帮我写出对应功能的arduino程序。 调试信息不打印。注意,接电表的串口使用偶校验。当电流大于1A时,控制4脚输出高,低于1A时输出低。请不要使用modbus库,请使用代码实现modbus的发送及接收。
最近看到这个开源项目挺不错的
https://github.com/scottbez1/smartknob
志辉那个FOC嘛,一样的功能。
考虑再加一块屏幕
1.PDA手持机
之前考虑是用f1c200s做,当时是看中了芯片便宜,才12.5元。
现在贵了,也就没动力做了,而且资源也不丰富,
引脚紧缺,跑Linux可玩的东西,内存64MB太小,USB不能接hub的缺陷严重,
结构有些复杂。
种种原因,一直处于鸽的状态。
若是用A133 4G做PDA,可玩性就比较高了,也不用担心资源问题。
价格还不算太贵,最小系统140块的样子。
2.家用智能屏
样式最好是相框的形式,可以挂在墙上,
通过感知人是否在家,来将结婚照片或名画等循环显示。
还可以做语音交互的东西,
天气,情况,
地图路线,
语音定闹钟提醒,日历事件提醒,大事件新闻提醒等等。
这个也用A133+4G来做应该也够用的
多谢大佬分享,是个参考项!
SN65LVDS049 这个应该正好
http://www.ti.com/cn/lit/gpn/sn65lvds049
我看了TI的lvds类转换芯片,价格比较贵,所以排除了。
出发点:需要做个可扩展的控制器,类似PLC,IO点不够可以增加扩展模块来扩充IO,没有485等串口,可以增加扩展模块来扩充。
西门子 PLC图片如下:
CPU主控打算用全志T113系列,
考虑扩展模块上芯片不会用太高端,所以只能从UART、SPI、I2C、RS485、CAN这类的去考虑,
1、需要多从机
2、需要高速
3、需要远距离抗干扰,比如CPU挂10个扩展模块,线长都出去了半米了。
综合考虑,T113处选择SPI接口,
使用将SPI改为3线,使用CLK、MOSI、MISO
考虑远距离传输的抗干扰性,将3根信号线变为差分信号。
T113连接CPLD,CPLD将单端信号变为两个端口输出,来模拟差分线。
在接收端,使用高速比较器进行接收数据,市面在售的7ns比较器比较便宜。
增加总线的地址机制,每个从设备都有地址,当收到自己地址的数据需要发送时才会进行发送,否则发送为高阻态。
下面是初版设计原理图,
将本固件功能做成windows上的UI软件,方便大家使用。
DKTool2021哇酷网特别版.7z
由于项目需要,以及市面上各种难用的模块,不得不自己造轮子。
先从需求说起,需求就是以太网IO模块、光源控制器、相机触发模块多种用途的一个小模块。
考虑到以太网的需求,采用CH579M是最好不过的了。
对于输入采集,直接用光耦就好了,这个简单。
主要是输出,想弄高边输出,而不是开漏输出。
对于开漏输出,基本都是下图这种形式。
想做高边输出,比如用PMOS,IRF9540N这个管子便宜还普及,感觉比较好。
但遇到了个问题,我想应用于电源电压12V、24V、32V都能用的场景。
网上大多数关于PMOS的驱动电路都是这个样子的:
栅极耐压是±20V,用24V或32V的话直接将栅极拉低到GND其实是超压了。
又找到类似这样的电路,通过电阻分压的方式可以控制PMOS,但大多都是用作高边电源开关,
不能用作PWM输出,因为分压电阻的阻值比较大,给PWM会使得MOS大部分出于临界状态,发热严重直至烧毁。
我想搜一些高边PWM输出的电路怎么驱动,啥都没有,居然搜到了PMOS高速PWM输出的专利....
关于高边输出,卡了半年,也就是一直没有进行。
得把flash拆了吧,这条不能没有
抱歉,忘记了老贴了,最新版本是哇酷特别版,没有过期。
链接在这 https://whycan.com/t_5733.html
随便画的
文件在这立创EDA工程Project_远程开机卡LAN_2021-01-19_22-08-51.rar
软件使用sunxi-fel为烧写工具,可以读写w25qxx系列的芯片,可以读写DDR和寄存器。
更添加了晕哥的大招,可以将板载TF 、EMMC、SD NAND、W25Qxx系列Nor Flash 模拟成U盘。使用win32diskimager进行烧录。
同时一键打开任务管理器,设备管理器,可方便查看COM口。
只有一个exe文件,方便使用。
内置Win32DiskImager,用于烧写模拟成U盘的设备。
内置Zadig驱动安装工具,
内置Putty终端调试软件。
内置F1C200S的数据手册和用户手册。
下载地址:DKTool哇酷网特别版--密码是哇酷网址.rar (解压密码: whycan.cn)
下载的留个言,支持下。
软件随便用,个人用或者公司用,附图软件工具时,需要与作者协商,软件版权归迪卡所有。
可以定制软件功能。
以下由 @哇酷小二 添加:
----------------------------
解压密码: whycan.cn
##############
#####显示屏#####
##############
显示屏部分呢,用的是一个MIPI+RGB的显示屏,按照配置接法是RGB模式。
供电来自AXP199的3.3V,和SOC的3.3V共用,
这个屏需要初始化,
涉及
LCD_CS
LCD_SCL
LCD_SDA
实际上呀,他是按照SPI走的,但屏厂为啥按照I2C的命名就不懂了。不管它,反正按照屏厂的初始化代码拉IO就行了。
LCD_RST是复位屏控制器的,这种无关紧要的我就给到AXP199去控制。
背光,一定要注意输出端用的电容耐压值,
这个升压能达到50V,!!!
电源来自AXP199的IPSOUT,背光控制由N76E003来控制,因为AXP199的PWM的高电平是2.5V.
最难搞定的就是IO的分配,每个小功能倒是能确定的了。
一个一个来。先从电容触摸屏开始。
##############
####电容触摸#####
##############
I2C接口是连接F1C200S和N76E003和AXP199还有这个电容触摸的,还有摄像头!!!。
供电取自N76E003的供电,因为主控有掉电状态,考虑可以双击触摸屏来启动相关操作。
N76E003的供电直接来自电池然后LDO3.3
CTP_EINT是触摸中断,当你的手点到屏幕时,会持续触发中断,你快速的点一下,就能达到几十甚至上百个中断。
我将中断连接到N76E003,而不是给F1C200S,因为F1C200S只有1个脚可以用来做中断了。
N76E003也起到中断控制器的作用......任务艰巨,不仅管按键,还管电源,还管中断。
CTP_RST是电容触摸的复位,这个无关紧要,但还是加上,所以给到了AXP199去控制。
写帖子时候,不能看到图片,不好说明,在此说明一下。
CH340->MCUTTL MCUTTL->CH340
是我标注串口的习惯,免得TX RX搞反了,我直接标注谁到谁。
这个串口的用途是,
1.更新MCU的固件
N76E003出厂不内置bootloader,所以需要先用ICP烧写一下。之后就可以用串口进行烧写了。
2.调试MCU程序使用,看串口信息来调试MCU程序(在PDA已经封装成整机的情况下)
3.PC上位机通过该串口,获得版本号或是状态,可以设置让soc复位,或者让soc复位到fel模式,只要MCU能控制采集的东西,都可以搞。
BAT_ADC
单片机的ADC脚去采集电池电压,当然是电阻分压出来的,不用太精确,别太没电了就行,有个采集,在界面上可以显示下电量。
LCD_CS LCD_SDA LCD_SCL LCD_RST
这4个脚是初始化LCD显示屏用的,LCD默认是MIPI模式,需要通过SPI接口去初始化变成RGB模式。我也不懂为啥屏厂对SPI脚的命名方式和I2C一样
ICP_DAT ICP_CLK ICP_RST
这3个脚是烧录单片机用的,ICP烧录接口,包括复位
在这里,LCD_CS和ICP_DAT复用了,但没有问题;在烧录bootloader的时候,屏幕排线是不插的。
SW A B
这3个脚是滚轮编码器的3个脚,我接了中断脚。这个滚轮编码器真是漂亮啊,但是也真贵 9块钱一个!
CTP_EINT
这个脚是电容屏触摸中断脚,我已经用单片机试过了,如果你用手摸电容板的话,这个脚会一直脉冲输出,哪怕我以最快的速度点一下屏幕,都好几十个中断。
长按一会就好多万。
我是通过单片机转一下这个中断,再到F1C200S。F1C200S的SOCEINT检测到中断后,先I2C读N76E003,到底是哪个脚发生了中断。
TWI0_SDA TWI0_SCK
这两个脚就是上面说的,F1C200S要I2C去读单片机,到底是什么中断发生了。还可以通过I2C去读电池电压等,去设置屏幕PWM背光,亮屏关屏等MCU可以干的事。
SOCEINT
F1C200S只剩下这一个中断脚了,所以我这相当于用N76E003做了一个中断控制器。emmmm....(N76E003AQ20:"你是想累死谁!!")
EMMC_EN
这个脚用来控制EMMC的使能,因为F1C200S复位后,如果识别到sdio里又固件,就直接运行了,我们的操作就是让F1C200S访问不到SDIO设备。这样F1C200S就能复位进入到fel模式了。
CTP_RST WIFI_INT
CTP_RST这个就是电容屏的复位脚了,其实不接也行,但有人说,有时候万一它不好用了,复位一下就好了。
WIFI_INT是ESP8266在下载固件时候需要用到的,其实不接也行的,软件驱动方面改一改,我就没有接,也没有改,就能跑起来,啊哈哈。
LCD_PWM
背光调节
CH_USB
看过上面功能图的应该知道,这个脚是用来控制USB的交叉开关的,
1.可以将GL852给F1C200S用,PC还能继续使用串口去看F1C200S的串口终端。
2.可以将GL825给PC用,这样所有USB设备都由PC控制,F1C200S是slave模式。当然,模式的切换我是考虑用一个隐形的IO,毕竟1片N76E003可以模拟很多个PCF8574
SOC_RESET
F1C200S的复位脚,在烧写时候,复位也无所谓,不用管SOC,之后MCU就控制F1C200S复位就好了(N76E003:"mmp,还让我当复位芯片")
RY1303_EN
这次更改,我的电源直接从BAT上取,控制1.2 2.5 3.3的电压输出和关闭,(MCU是独立供电,不受影响)
迪卡告诉你如何将24个IO塞到只有18个IO的N76E003上面
我们现在的需求是这个样子的
我们先把固定不能动的画上
单片机的RST复位脚只有在烧录bootloader时候才用的上,所以把F1C200S的复位脚和单片机的RST连到一起,
当烧录完N76E003后,单片机的RST脚只做IO就可以了。这样只负责控制主控是否复位。用于上位机控制复位F1C200S进入fel状态。
将检测电池电压的ADC先定下来, 毕竟支持ADC的脚不多,还有背光的PWM也先定下来,电容屏中断也找一个带中断的脚接上。
还有RY1303电源控制脚也得固定,不能复用,要不来回开关电源,可就真成了“开关电源了”
初始化LCD用的SPI接口的CS脚,去和ICP烧写单片机的DAT脚复用,
尽量保证复用的脚是屏幕部分的,因为烧写bootloader时候,可以不接屏幕
因为实在不够用了,CS脚在对屏幕失效的时候,SPI的MOSI和CLK是可以复用干别的事,当作输出用。
先把对SOC的中断和SPI的MOSI复用吧。
分配到现在还剩余2个IO
先看一下大概的功能,只看网络标号可能看不出来干啥用的。
最后分完了。
emmc读写速度测试
写入速度测试
root@dika-pc:~# dd if=/dev/zero bs=1k count=10000 of=./savefile
10000+0 records in
10000+0 records out
10240000 bytes (10 MB, 9.8 MiB) copied, 1.02184 s, 10.0 MB/s
root@dika-pc:~# dd if=/dev/zero bs=2k count=5000 of=./savefile
5000+0 records in
5000+0 records out
10240000 bytes (10 MB, 9.8 MiB) copied, 0.727644 s, 14.1 MB/s
root@dika-pc:~# dd if=/dev/zero bs=4k count=2500 of=./savefile
2500+0 records in
2500+0 records out
10240000 bytes (10 MB, 9.8 MiB) copied, 0.570808 s, 17.9 MB/s
root@dika-pc:~# dd if=/dev/zero bs=8k count=1250 of=./savefile
1250+0 records in
1250+0 records out
10240000 bytes (10 MB, 9.8 MiB) copied, 0.580831 s, 17.6 MB/s
root@dika-pc:~# dd if=/dev/zero bs=32k count=1250 of=./savefile
1250+0 records in
1250+0 records out
40960000 bytes (41 MB, 39 MiB) copied, 2.38199 s, 17.2 MB/s
root@dika-pc:~#
读取速度测试
root@dika-pc:~# dd if=./40MB.file of=/dev/null bs=1k
32000+0 records in
32000+0 records out
32768000 bytes (33 MB, 31 MiB) copied, 1.46465 s, 22.4 MB/s
root@dika-pc:~# dd if=./40MB.file of=/dev/null bs=4k
8000+0 records in
8000+0 records out
32768000 bytes (33 MB, 31 MiB) copied, 1.2441 s, 26.3 MB/s
root@dika-pc:~# dd if=./40MB.file of=/dev/null bs=8k
4000+0 records in
4000+0 records out
32768000 bytes (33 MB, 31 MiB) copied, 1.17389 s, 27.9 MB/s
root@dika-pc:~# dd if=./40MB.file of=/dev/null bs=16k
2000+0 records in
2000+0 records out
32768000 bytes (33 MB, 31 MiB) copied, 1.13172 s, 29.0 MB/s
root@dika-pc:~# dd if=./40MB.file of=/dev/null bs=32k
1000+0 records in
1000+0 records out
32768000 bytes (33 MB, 31 MiB) copied, 1.12216 s, 29.2 MB/s
root@dika-pc:~# dd if=./40MB.file of=/dev/null bs=64k
500+0 records in
500+0 records out
32768000 bytes (33 MB, 31 MiB) copied, 1.1215 s, 29.2 MB/s
root@dika-pc:~#
我有6个USB摄像头,接到PC机上,我使用opencv和qt,能全部同时打开,并imshow
显示出图像,并保持30fps的帧率,
我每个USB摄像头使用了1个线程去读取摄像头数据,然后显示出来。
我想将采集的图片一张一张无损的保存在本地png格式,但是当我在读取的线程中imwrite保存的时候,就会降低帧率(摄像头保持30FPS,PC的读取帧率降低)
我改变了思路,我创建了6个队列,每一个线程去获取图片,然后扔到对应的队列里面,然后创建6个线程去读取队列并保存。
我发现帧率还是降低的,并不能保证满帧率,
因为PC机是4核8线程,即使加了很多线程,都是在轮询执行,保存图片的线程占用了读取图片线程的时间。
有没有大佬有好的解决办法呢,我想30fps不丢帧的保存下来摄像头拍摄的图片,并且图片需要无损的方式。
全网搜,无资料,arecord录音报错,
https://whycan.cn/t_2041.html
这个帖子里的大佬们,你们是怎么能录音的??
我是5.2内核
root@dika-pc:~# ./tinymix contents
Number of controls: 97
ctl type num name value
0 INT 1 PCM Rate Shift 100000 100000 (range 80000->120000)
1 BOOL 1 PCM Notify On
2 BOOL 1 PCM Slave Active Off
3 INT 1 PCM Slave Format 2 (range 0->52)
4 INT 1 PCM Slave Rate 48000 (range 0->192000)
5 INT 1 PCM Slave Channels 2 (range 1->1024)
6 INT 1 PCM Rate Shift 100000 100000 (range 80000->120000)
7 BOOL 1 PCM Notify On
8 BOOL 1 PCM Slave Active Off
9 INT 1 PCM Slave Format 2 (range 0->52)
10 INT 1 PCM Slave Rate 48000 (range 0->192000)
11 INT 1 PCM Slave Channels 2 (range 1->1024)
12 INT 1 PCM Rate Shift 100000 100000 (range 80000->120000)
13 BOOL 1 PCM Notify On
14 BOOL 1 PCM Slave Active Off
15 INT 1 PCM Slave Format 2 (range 0->52)
16 INT 1 PCM Slave Rate 48000 (range 0->192000)
17 INT 1 PCM Slave Channels 2 (range 1->1024)
18 INT 1 PCM Rate Shift 100000 100000 (range 80000->120000)
19 BOOL 1 PCM Notify On
20 BOOL 1 PCM Slave Active Off
21 INT 1 PCM Slave Format 2 (range 0->52)
22 INT 1 PCM Slave Rate 48000 (range 0->192000)
23 INT 1 PCM Slave Channels 2 (range 1->1024)
24 INT 1 PCM Rate Shift 100000 100000 (range 80000->120000)
25 BOOL 1 PCM Notify On
26 BOOL 1 PCM Slave Active Off
27 INT 1 PCM Slave Format 2 (range 0->52)
28 INT 1 PCM Slave Rate 48000 (range 0->192000)
29 INT 1 PCM Slave Channels 2 (range 1->1024)
30 INT 1 PCM Rate Shift 100000 100000 (range 80000->120000)
31 BOOL 1 PCM Notify On
32 BOOL 1 PCM Slave Active Off
33 INT 1 PCM Slave Format 2 (range 0->52)
34 INT 1 PCM Slave Rate 48000 (range 0->192000)
35 INT 1 PCM Slave Channels 2 (range 1->1024)
36 INT 1 PCM Rate Shift 100000 100000 (range 80000->120000)
37 BOOL 1 PCM Notify On
38 BOOL 1 PCM Slave Active Off
39 INT 1 PCM Slave Format 2 (range 0->52)
40 INT 1 PCM Slave Rate 48000 (range 0->192000)
41 INT 1 PCM Slave Channels 2 (range 1->1024)
42 INT 1 PCM Rate Shift 100000 100000 (range 80000->120000)
43 BOOL 1 PCM Notify On
44 BOOL 1 PCM Slave Active Off
45 INT 1 PCM Slave Format 2 (range 0->52)
46 INT 1 PCM Slave Rate 48000 (range 0->192000)
47 INT 1 PCM Slave Channels 2 (range 1->1024)
48 INT 1 PCM Rate Shift 100000 100000 (range 80000->120000)
49 BOOL 1 PCM Notify On
50 BOOL 1 PCM Slave Active Off
51 INT 1 PCM Slave Format 2 (range 0->52)
52 INT 1 PCM Slave Rate 48000 (range 0->192000)
53 INT 1 PCM Slave Channels 2 (range 1->1024)
54 INT 1 PCM Rate Shift 100000 100000 (range 80000->120000)
55 BOOL 1 PCM Notify On
56 BOOL 1 PCM Slave Active Off
57 INT 1 PCM Slave Format 2 (range 0->52)
58 INT 1 PCM Slave Rate 48000 (range 0->192000)
59 INT 1 PCM Slave Channels 2 (range 1->1024)
60 INT 1 PCM Rate Shift 100000 100000 (range 80000->120000)
61 BOOL 1 PCM Notify On
62 BOOL 1 PCM Slave Active Off
63 INT 1 PCM Slave Format 2 (range 0->52)
64 INT 1 PCM Slave Rate 48000 (range 0->192000)
65 INT 1 PCM Slave Channels 2 (range 1->1024)
66 INT 1 PCM Rate Shift 100000 100000 (range 80000->120000)
67 BOOL 1 PCM Notify On
68 BOOL 1 PCM Slave Active Off
69 INT 1 PCM Slave Format 2 (range 0->52)
70 INT 1 PCM Slave Rate 48000 (range 0->192000)
71 INT 1 PCM Slave Channels 2 (range 1->1024)
72 INT 1 PCM Rate Shift 100000 100000 (range 80000->120000)
73 BOOL 1 PCM Notify On
74 BOOL 1 PCM Slave Active Off
75 INT 1 PCM Slave Format 2 (range 0->52)
76 INT 1 PCM Slave Rate 48000 (range 0->192000)
77 INT 1 PCM Slave Channels 2 (range 1->1024)
78 INT 1 PCM Rate Shift 100000 100000 (range 80000->120000)
79 BOOL 1 PCM Notify On
80 BOOL 1 PCM Slave Active Off
81 INT 1 PCM Slave Format 2 (range 0->52)
82 INT 1 PCM Slave Rate 48000 (range 0->192000)
83 INT 1 PCM Slave Channels 2 (range 1->1024)
84 INT 1 PCM Rate Shift 100000 100000 (range 80000->120000)
85 BOOL 1 PCM Notify On
86 BOOL 1 PCM Slave Active Off
87 INT 1 PCM Slave Format 2 (range 0->52)
88 INT 1 PCM Slave Rate 48000 (range 0->192000)
89 INT 1 PCM Slave Channels 2 (range 1->1024)
90 INT 1 PCM Rate Shift 100000 100000 (range 80000->120000)
91 BOOL 1 PCM Notify On
92 BOOL 1 PCM Slave Active Off
93 INT 1 PCM Slave Format 2 (range 0->52)
94 INT 1 PCM Slave Rate 48000 (range 0->192000)
95 INT 1 PCM Slave Channels 2 (range 1->1024)
96 INT 2 PCM Playback Volume 255, 255 (range 0->255)
root@dika-pc:~#
root@dika-pc:~# ./tinymix controls
Number of controls: 97
ctl type num name
0 INT 1 PCM Rate Shift 100000
1 BOOL 1 PCM Notify
2 BOOL 1 PCM Slave Active
3 INT 1 PCM Slave Format
4 INT 1 PCM Slave Rate
5 INT 1 PCM Slave Channels
6 INT 1 PCM Rate Shift 100000
7 BOOL 1 PCM Notify
8 BOOL 1 PCM Slave Active
9 INT 1 PCM Slave Format
10 INT 1 PCM Slave Rate
11 INT 1 PCM Slave Channels
12 INT 1 PCM Rate Shift 100000
13 BOOL 1 PCM Notify
14 BOOL 1 PCM Slave Active
15 INT 1 PCM Slave Format
16 INT 1 PCM Slave Rate
17 INT 1 PCM Slave Channels
18 INT 1 PCM Rate Shift 100000
19 BOOL 1 PCM Notify
20 BOOL 1 PCM Slave Active
21 INT 1 PCM Slave Format
22 INT 1 PCM Slave Rate
23 INT 1 PCM Slave Channels
24 INT 1 PCM Rate Shift 100000
25 BOOL 1 PCM Notify
26 BOOL 1 PCM Slave Active
27 INT 1 PCM Slave Format
28 INT 1 PCM Slave Rate
29 INT 1 PCM Slave Channels
30 INT 1 PCM Rate Shift 100000
31 BOOL 1 PCM Notify
32 BOOL 1 PCM Slave Active
33 INT 1 PCM Slave Format
34 INT 1 PCM Slave Rate
35 INT 1 PCM Slave Channels
36 INT 1 PCM Rate Shift 100000
37 BOOL 1 PCM Notify
38 BOOL 1 PCM Slave Active
39 INT 1 PCM Slave Format
40 INT 1 PCM Slave Rate
41 INT 1 PCM Slave Channels
42 INT 1 PCM Rate Shift 100000
43 BOOL 1 PCM Notify
44 BOOL 1 PCM Slave Active
45 INT 1 PCM Slave Format
46 INT 1 PCM Slave Rate
47 INT 1 PCM Slave Channels
48 INT 1 PCM Rate Shift 100000
49 BOOL 1 PCM Notify
50 BOOL 1 PCM Slave Active
51 INT 1 PCM Slave Format
52 INT 1 PCM Slave Rate
53 INT 1 PCM Slave Channels
54 INT 1 PCM Rate Shift 100000
55 BOOL 1 PCM Notify
56 BOOL 1 PCM Slave Active
57 INT 1 PCM Slave Format
58 INT 1 PCM Slave Rate
59 INT 1 PCM Slave Channels
60 INT 1 PCM Rate Shift 100000
61 BOOL 1 PCM Notify
62 BOOL 1 PCM Slave Active
63 INT 1 PCM Slave Format
64 INT 1 PCM Slave Rate
65 INT 1 PCM Slave Channels
66 INT 1 PCM Rate Shift 100000
67 BOOL 1 PCM Notify
68 BOOL 1 PCM Slave Active
69 INT 1 PCM Slave Format
70 INT 1 PCM Slave Rate
71 INT 1 PCM Slave Channels
72 INT 1 PCM Rate Shift 100000
73 BOOL 1 PCM Notify
74 BOOL 1 PCM Slave Active
75 INT 1 PCM Slave Format
76 INT 1 PCM Slave Rate
77 INT 1 PCM Slave Channels
78 INT 1 PCM Rate Shift 100000
79 BOOL 1 PCM Notify
80 BOOL 1 PCM Slave Active
81 INT 1 PCM Slave Format
82 INT 1 PCM Slave Rate
83 INT 1 PCM Slave Channels
84 INT 1 PCM Rate Shift 100000
85 BOOL 1 PCM Notify
86 BOOL 1 PCM Slave Active
87 INT 1 PCM Slave Format
88 INT 1 PCM Slave Rate
89 INT 1 PCM Slave Channels
90 INT 1 PCM Rate Shift 100000
91 BOOL 1 PCM Notify
92 BOOL 1 PCM Slave Active
93 INT 1 PCM Slave Format
94 INT 1 PCM Slave Rate
95 INT 1 PCM Slave Channels
96 INT 2 PCM Playback Volume
按照https://whycan.cn/t_2041.html第13楼的补丁,将对应的文件进行替换和更改,包括设备树,都直接复制的
并在内核配置中,开启了以下部分。
设备树如下
.dtsi文件
dma: dma-controller@1c02000 {
compatible = "allwinner,suniv-dma";
reg = <0x01c02000 0x1000>;
interrupts = <18>;
clocks = <&ccu CLK_BUS_DMA>;
resets = <&ccu RST_BUS_DMA>;
#dma-cells = <2>;
};
codec: codec@1c23c00 {
compatible = "allwinner,suniv-codec";
reg = <0x01c23c00 0x400>;
interrupts = <21>;
clocks = <&ccu CLK_BUS_CODEC>,
<&ccu CLK_CODEC>;
clock-names = "apb", "codec";
resets = <&ccu RST_BUS_CODEC>;
dmas = <&dma 0 12>, <&dma 0 12>;
dma-names = "rx", "tx";
status = "disabled";
};
.dst文件
&codec {
allwinner,audio-routing =
"Headphone", "HP",
"Headphone", "HPCOM",
"MIC", "Mic";
status = "okay";
};
研究了一下怎么给N76E003分配引脚,因为实在是太紧缺了
考虑将ICP占用1个脚,烧录进BootLoader之后就用串口下载程序了。
3个脚,ICP烧录的DAT CLK RST,占用一个DAT脚用来切换UART
2个脚,I2C接口
1个脚,CH_USB 用来切换USB
1个脚,SOC_RESET 用来复位F1C200S
1个脚,PWR_5306,用来控制供电
3个脚,A B SW 编码器
3个脚,LCD_SDA LCD_SCL LCD_CS 其中 LCD_SDA在初始化屏完毕后做输入脚,接受CH340E的RTS状态
2个脚,UART 用来烧录单片机程序
1个脚,CH340CTS SDnand_OR_TF 监控TF卡插入状态,若未插入TF卡,则可以复位SOC到FEL模式,可以与PC做交互
1个脚,LCD_PWM 屏幕的背光
2个脚,VDD和GND
共20个脚
这样应该就可以了。。。
关于USB接口切换,切换的模式是,SOC的USB作为从接到HUB上,HUB给PC用, 另一个是SOC的USB作为主接到HUB上,HUB给SOC用。
同时USBTTL模块始终都是给PC用的。
关于UART接口切换,切换的模式是,USBTTL接到SOC还是N76E003,是调试SOC用,还是烧写N76E003用。
关于电源控制部分,不知道大家有啥好的建议没有,PWR_5306脚我现在是开漏输出串电阻接到了IP5306的KEY脚,通过输出0来模拟按键按下的操作,可实现单击或双击,进而控制IP5306的输出和关闭。
但是我发现了个问题,IP5306关闭状态并不是绝对关闭,还有很低的电压,当电流大于45mA时,就自动打开输出。
我可以操作关闭屏幕背关等,让电流小于45mA使得IP5306不开启,但是还是有几十毫安的电流输出。
我考虑是不是不控制IP5306了,去控制一个MOS管给EA3036的供电。毕竟5V只是接到了EA3036和USB接口。
非常感谢,我有个问题,
如下操作中,我能看的明白,gpiochip504就是将pcf8574驱动编进内核后的效果,
我想知道这个504编号是怎么来的呢?
soc自带的gpio是从A B C D这样排下来的,我会计算出PB12就是1*32+12 = 44
不懂504是来自哪里,我看驱动源码中也没有这个数字。
还是要再感谢一下
[armadillo ~]# ls /sys/class/gpio/
export gpiochip128 gpiochip504 gpiochip96
gpiochip0 gpiochip32 gpiochip64 unexport
[armadillo ~]# echo 504 > /sys/class/gpio/export
[armadillo ~]# echo 505 > /sys/class/gpio/export
[armadillo ~]# echo 506 > /sys/class/gpio/export
[armadillo ~]# echo 507 > /sys/class/gpio/export
[armadillo ~]# echo 508 > /sys/class/gpio/export
[armadillo ~]# echo 509 > /sys/class/gpio/export
[armadillo ~]# echo 510 > /sys/class/gpio/export
[armadillo ~]# echo 511 > /sys/class/gpio/export
http://blog.mangolovecarrot.net/2018/10/24/51/
关于N76E003使用串口烧写程序。
考虑更改电路,将CH340即可以给F1C200S下载程序也可以给单片机下载程序。但好像复位会麻烦一些。
关于电容触摸部分,今天测了一下,
也看了看我自己的电路。
电容触摸屏无需初始化,上电就能用,点屏幕就会触发CTP中断。
我打算把F1C200S唯一一个中断脚PE12留给CTP使用,
N76E003不给中断了,
因为N76E003的功能如下:
1、控制液晶屏的背光,默认的上电就亮,还有可配置成F1C去I2C控制它亮,可设置PWM值。
2、编码器功能,编码器分上转,下转,按下,再细分一些连续转,多次按下,长按等操作。存储在单片机内部。F1C通过I2C去读状态,读后清空,超时覆盖清空。还有强制开机关机等操作。
3、接收上位机控制的CH340的烧写信号交互,将F1C复位到fel模式。
4、初始化LCD屏,I2C可设置LCD屏的180度旋转显示
5、切换USB连接位置,将HUB给F1C还是给PC。可I2C控制
6、复位CTP,LCD,CAMERA的RST脚
有什么建议希望大家提一下
测试了一下客厅路由器到厨房,12米距离,速度依旧
root@dika-pc:~# wget ftp://172.16.1.104:3721/Downloads/ViE.zip -O /dev/null
--2020-06-11 23:56:39-- ftp://172.16.1.104:3721/Downloads/ViE.zip
=> ‘/dev/null’
Connecting to 172.16.1.104:3721... connected.
Logging in as anonymous ... Logged in!
==> SYST ... done. ==> PWD ... done.
==> TYPE I ... done. ==> CWD (1) /Downloads ... done.
==> SIZE ViE.zip ... 280209081
==> PASV ... done. ==> RETR ViE.zip ... done.
Length: 280209081 (267M) (unauthoritative)
ViE.zip 60%[===========> ] 160.66M 1020KB/s eta 2m 2s
# while [ 1 ]; do
> data;wget ftp://192.168.43.1:3721/Downloads/DKTool_0229.rar -O /dev/null ;data
;
> done;
本想用wget试试速度,
结果没有wget。
好吧,下载一个
apt-get install wget
root@dika-pc:~# free
total used free shared buff/cache available
Mem: 56204 16808 7320 2216 32076 32980
Swap: 524284 0 524284
root@dika-pc:~# apt-get install wget
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following additional packages will be installed:
libpcre2-8-0
The following NEW packages will be installed:
libpcre2-8-0 wget
0 upgraded, 2 newly installed, 0 to remove and 0 not upgraded.
Need to get 1062 kB of archives.
After this operation, 3821 kB of additional disk space will be used.
Do you want to continue? [Y/n] y
Get:1 http://mirrors.huaweicloud.com/debian buster/main armel libpcre2-8-0 armel 10.32-5 [185 kB]
Get:2 http://mirrors.huaweicloud.com/debian buster/main armel wget armel 1.20.1-1.1 [878 kB]
Fetched 1062 kB in 8s (127 kB/s)
Selecting previously unselected package libpcre2-8-0:armel.
(Reading database ... 21447 files and directories currently installed.)
Preparing to unpack .../libpcre2-8-0_10.32-5_armel.deb ...
Unpacking libpcre2-8-0:armel (10.32-5) ...
Selecting previously unselected package wget.
Preparing to unpack .../wget_1.20.1-1.1_armel.deb ...
Unpacking wget (1.20.1-1.1) ...
Setting up libpcre2-8-0:armel (10.32-5) ...
Setting up wget (1.20.1-1.1) ...
Processing triggers for libc-bin (2.28-10) ...
root@dika-pc:~#
测试板载WIFI成功
root@dika-pc:/etc# ping www.dika.ren 3
PING www.dika.ren (149.129.80.46) 56(84) bytes of data.
64 bytes from 149.129.80.46 (149.129.80.46): icmp_seq=1 ttl=47 time=67.9 ms
64 bytes from 149.129.80.46 (149.129.80.46): icmp_seq=2 ttl=47 time=98.4 ms
64 bytes from 149.129.80.46 (149.129.80.46): icmp_seq=3 ttl=47 time=76.8 ms
64 bytes from 149.129.80.46 (149.129.80.46): icmp_seq=4 ttl=47 time=80.6 ms
^C
--- www.dika.ren ping statistics ---
4 packets transmitted, 4 received, 0% packet loss, time 18ms
rtt min/avg/max/mdev = 67.855/80.913/98.383/11.106 ms
root@dika-pc:/etc#
但是我的debian是什么鬼
systemd[1]: Set hostname to <dika-pc>.
[ 6.520524] systemd[1]: File /lib/systemd/system/systemd-journald.service:12 configures an IP firewall (IPAddre ssDeny=any), but the local system does not support BPF/cgroup based firewalling.
[ 6.613146] systemd[1]: Proceeding WITHOUT firewalling in effect! (This warning is only shown for the first loa ded unit using IP firewalling.)
[ 8.007412] systemd[1]: Failed to allocate notification socket: Address family not supported by protocol
[!!!!!!] Failed to start up manager.
[ 8.180889] systemd[1]: Freezing execution.
[ 79.130392] random: crng init done
测试wifi。
由于原来编译的内核丢了,所以。
出现了如下画面:
root@dika-pc:~# insmod esp8089-spi.ko
[ 100.338733] esp8089_spi: loading out-of-tree module taints kernel.
[ 100.354129] esp8089_spi: Unknown symbol ieee80211_stop_tx_ba_session (err -2)
[ 100.362176] esp8089_spi: Unknown symbol ieee80211_start_tx_ba_cb_irqsafe (err -2)
[ 100.370582] esp8089_spi: Unknown symbol ieee80211_free_hw (err -2)
[ 100.377478] esp8089_spi: Unknown symbol ieee80211_start_tx_ba_session (err -2 )
[ 100.385390] esp8089_spi: Unknown symbol ieee80211_register_hw (err -2)
[ 100.392687] esp8089_spi: Unknown symbol ieee80211_get_buffered_bc (err -2)
[ 100.400330] esp8089_spi: Unknown symbol wiphy_rfkill_set_hw_state (err -2)
[ 100.407942] esp8089_spi: Unknown symbol ieee80211_stop_tx_ba_cb_irqsafe (err -2)
[ 100.416192] esp8089_spi: Unknown symbol ieee80211_remain_on_channel_expired ( err -2)
[ 100.424674] esp8089_spi: Unknown symbol ieee80211_wake_queues (err -2)
[ 100.431931] esp8089_spi: Unknown symbol ieee80211_alloc_hw_nm (err -2)
[ 100.439192] esp8089_spi: Unknown symbol ieee80211_tx_status (err -2)
[ 100.446214] esp8089_spi: Unknown symbol ieee80211_ready_on_channel (err -2)
[ 100.453801] esp8089_spi: Unknown symbol ieee80211_stop_queues (err -2)
[ 100.461036] esp8089_spi: Unknown symbol wiphy_rfkill_start_polling (err -2)
[ 100.468717] esp8089_spi: Unknown symbol ieee80211_scan_completed (err -2)
[ 100.476257] esp8089_spi: Unknown symbol ieee80211_unregister_hw (err -2)
[ 100.483570] esp8089_spi: Unknown symbol ieee80211_beacon_get_tim (err -2)
[ 100.491063] esp8089_spi: Unknown symbol ieee80211_hdrlen (err -2)
[ 100.497814] esp8089_spi: Unknown symbol ieee80211_queue_work (err -2)
[ 100.504897] esp8089_spi: Unknown symbol ieee80211_rx_napi (err -2)
insmod: ERROR: could not insert module esp8089-spi.ko: Unknown symbol in module
root@dika-pc:~#
我需要重新确定到底勾选哪个配置
发现WhyCan已经很久了,刚刚才注册。就分享一个最近开发的CH552的Arduino开发包吧。
https://github.com/DeqingSun/ch55xduino
CH552价钱便宜,支持USB。只是51核心支持的编译器少,而且每次烧程序需要按按钮不方便。ch55xduino把编译器和核心库打包成Arduino安装包,直接支持USB串口,可以一键编译和烧录。
目前支持的函数不多,包括 delay, millis, 和 digital analog 读写函数,后期会逐渐增加。
开发版用什么都可以,过几天我打的板子送到后也会同步更新。
想跟大佬学习如何移植一款芯片到arduino ide中。
错误信息如下
使用4.15内核和5.2内核都是如此
# modprobe g_ffs idVendor=0x18d1 idProduct=0x4e42 iSerialNumber="buildroot"
[ 106.405645] file system registered
# mkdir -p /dev/usb-ffs/adb
# mount -t functionfs adb /dev/usb-ffs/adb -o uid=2000,gid=2000
# adbd
install_listener('tcp:5037','*sm[ 125.327467] read descriptors
artsocket*')
[ 125.331128] read strings
[ 125.334996] udc-core: couldn't find an available UDC - added [g_ffs] to list of pending drivers
在uboot启动时候,我们会看到,打印信息如下
U-Boot SPL 2018.01 (May 31 2020 - 12:17:27)
DRAM: 32 MiB
Trying to boot from MMC1
U-Boot 2018.01 (May 31 2020 - 12:17:27 +0800) Allwinner Technology
CPU: Allwinner F Series (SUNIV)
Model: Lichee Pi Nano
DRAM: 32 MiB
MMC: SUNXI SD/MMC: 0
*** Warning - bad CRC, using default environment
In: serial@1c25400
Out: serial@1c25400
Err: serial@1c25400
Net: No ethernet found.
starting USB...
No controllers found
Hit any key to stop autoboot: 0
其实uboot是进行了启动usb的操作,但是呢,uboot没有找到USB的控制器。
我在uboot menuconfig中也添加了fastboot部分也可以编译成功的。
那么如何才能让uboot找到usb控制器呢?
F1C100S只有一个USB接口,在实际应用中加hub成为必须,最近在调试使用4G模块进行联网,发现把4G模块直接接到OTG接口上使用正常,经过USB Hub之后就不正常了,现象是设备正常枚举,但往 ttyUSB 发AT命令没任何响应,测试了SIM7600和EC200S结果都一样。系统是主线linux-5.2,使用V3S(也是主线linux-5.2)进行测试却没有出现类似问题,是否可以确定是F1C100S芯片的问题?被这个问题困扰好久了,应该怎么定位和解决?希望各路大神帮忙分析指点一下,非常感谢!
你在晕哥群吗?我最近在画板子,把HUB画上了,如果真的如何都不能用 那可就太难了
试了通过hub接3个U盘或者USB转串口模块都可以正常枚举和读写,因为V3S相同的内核以及配置都能正常使用,所以我不太怀疑是内核配置的问题,试过把OTG关掉只作HOST也是不行。我还对比了一下V3S和F1C100S中USB驱动源码(sunxi-usb.c和phy-sun4i-usb.c),里面对于USB端点数的配置两者也是一样的。我也怀疑过芯片USB端点数量的问题,看了F1C600的芯片手册,USB端点数和V3S是一样有8个,所以买了F1C200S和F1C600来替换,结果都一样,真是不知道怎么办了。
你好,能把详细到对照哪些文件也发上来吗?
我不太清楚V3S有几个端点,
但是你说V3S和F1C200S的端点一样多,
所以我想看一下源码啥的,看看怎么回事
F1C100S只有一个USB接口,在实际应用中加hub成为必须,最近在调试使用4G模块进行联网,发现把4G模块直接接到OTG接口上使用正常,经过USB Hub之后就不正常了,现象是设备正常枚举,但往 ttyUSB 发AT命令没任何响应,测试了SIM7600和EC200S结果都一样。系统是主线linux-5.2,使用V3S(也是主线linux-5.2)进行测试却没有出现类似问题,是否可以确定是F1C100S芯片的问题?被这个问题困扰好久了,应该怎么定位和解决?希望各路大神帮忙分析指点一下,非常感谢!
你用的是什么hub芯片?
再问一下,你换一下4.15内核试试
因闲鱼最多只能发布50个,所以在淘宝店里也放了一些
覆置这行话¥y4bb1K2j2jD¥打開??宝?或點击链街
https://m.tb.cn/h.VkopDWx?sm=98e4de
至瀏lan嘂..【迪卡实验室】
注释的
root@dika-pc:~# insmod esp8089-spi.ko
[ 54.669147] esp8089_spi: loading out-of-tree module taints kernel.
[ 54.684727] esp8089_spi: EAGLE DRIVER VER bdf5087c3deb
[ 54.690480] esp8089_spi: poweron
[ 55.294695] esp8089_spi: esp_spi_dummy_probe enter
[ 55.300136] esp8089_spi: I will go dead
[ 55.304497] esp8089_spi: I am OK
[ 55.308054] esp8089_spi: register board OK
[ 55.312607] esp8089_spi: sem_timeout = 0
[ 55.531980] esp8089_spi: ESP8089 power up OK
[ 55.537324] esp8089_spi: esp_spi_probe ENTER
[ 55.542201] esp8089_spi: esp_setup_spi
[ 55.546358] esp8089_spi: sif_spi_protocol_init
[ 55.551210] esp8089_spi: /home/dika/DVPM_linux-5.2/spiwifi1/ESP8089-SPI-master/spi_sif_esp.c, 1559
[ 55.561021] esp8089_spi: fail_count = 0
[ 55.692091] rx:[0xff],[0xff],[0xff],[0xff],[0xff],[0xff],[0xff],[0xff],[0xff],[0xff]
[ 55.800619] esp8089_spi: /home/dika/DVPM_linux-5.2/spiwifi1/ESP8089-SPI-master/spi_sif_esp.c, 1559
[ 55.810433] esp8089_spi: fail_count = 1
[ 55.922643] rx:[0xff],[0x09],[0xff],[0xff],[0xff],[0xff],[0xff],[0xff],[0xff],[0xff]
[ 56.031229] esp8089_spi: /home/dika/DVPM_linux-5.2/spiwifi1/ESP8089-SPI-master/spi_sif_esp.c, 1559
[ 56.041045] esp8089_spi: fail_count = 2
[ 56.153565] rx:[0xff],[0xff],[0x01],[0xff],[0xff],[0xff],[0xff],[0xff],[0xff],[0xff]
[ 56.761553] esp8089_spi: /home/dika/DVPM_linux-5.2/spiwifi1/ESP8089-SPI-master/spi_sif_esp.c, 1578
[ 56.778179] rx:[0xff],[0xff],[0x01],[0x10],[0xff],[0xff],[0x00],[0xff],[0xff],[0xff]
[ 57.286414] esp8089_spi: /home/dika/DVPM_linux-5.2/spiwifi1/ESP8089-SPI-master/spi_sif_esp.c, 1591
[ 57.303044] rx:[0xff],[0xff],[0x00],[0x90],[0xff],[0xff],[0x00],[0xff],[0xff],[0xff]
[ 57.811272] esp8089_spi: /home/dika/DVPM_linux-5.2/spiwifi1/ESP8089-SPI-master/spi_sif_esp.c, 1603
[ 57.828048] rx:[0xff],[0x00],[0x02],[0xff],[0xff],[0xff],[0xff],[0xff],[0xff],[0xff]
[ 58.336241] esp8089_spi: /home/dika/DVPM_linux-5.2/spiwifi1/ESP8089-SPI-master/spi_sif_esp.c, 1617
[ 58.351534] rx:[0xff],[0x00],[0x03],[0xff],[0xff],[0xff],[0xff],[0xff],[0xff],[0xff]
[ 58.859752] esp8089_spi: /home/dika/DVPM_linux-5.2/spiwifi1/ESP8089-SPI-master/spi_sif_esp.c, 1630
[ 58.888941] rx:[0xff],[0x00],[0x02],[0xff],[0xff],[0xff],[0xff],[0xff],[0xff],[0xff]
[ 59.397107] esp8089_spi: /home/dika/DVPM_linux-5.2/spiwifi1/ESP8089-SPI-master/spi_sif_esp.c, 1643
[ 59.430476] rx:[0xff],[0x00],[0x03],[0xff],[0xff],[0xff],[0xff],[0xff],[0xff],[0xff]
[ 59.974777] esp8089_spi: /home/dika/DVPM_linux-5.2/spiwifi1/ESP8089-SPI-master/spi_sif_esp.c, 1655
[ 60.026648] rx:[0xff],[0xff],[0x00],[0x00],[0xff],[0xff],[0xff],[0xff],[0xff],[0xff]
[ 60.571363] esp8089_spi: /home/dika/DVPM_linux-5.2/spiwifi1/ESP8089-SPI-master/spi_sif_esp.c, 1655
[ 60.624304] rx:[0xff],[0xff],[0x00],[0x25],[0xff],[0xff],[0xff],[0xff],[0xff],[0xff]
[ 61.170744] esp8089_spi: /home/dika/DVPM_linux-5.2/spiwifi1/ESP8089-SPI-master/spi_sif_esp.c, 1655
[ 61.225841] rx:[0xff],[0xff],[0x00],[0x10],[0xff],[0xff],[0xff],[0xff],[0xff],[0xff]
[ 61.774241] esp8089_spi: /home/dika/DVPM_linux-5.2/spiwifi1/ESP8089-SPI-master/spi_sif_esp.c, 1655
[ 61.831059] rx:[0xff],[0xff],[0x00],[0x12],[0xff],[0xff],[0xff],[0xff],[0xff],[0xff]
[ 62.380644] esp8089_spi: /home/dika/DVPM_linux-5.2/spiwifi1/ESP8089-SPI-master/spi_sif_esp.c, 1655
[ 62.438487] rx:[0xff],[0xff],[0x00],[0x00],[0xff],[0xff],[0xff],[0xff],[0xff],[0xff]
[ 62.988421] esp8089_spi: /home/dika/DVPM_linux-5.2/spiwifi1/ESP8089-SPI-master/spi_sif_esp.c, 1655
[ 63.047642] rx:[0xff],[0xff],[0x00],[0x06],[0xff],[0xff],[0xff],[0xff],[0xff],[0xff]
[ 63.597803] esp8089_spi: /home/dika/DVPM_linux-5.2/spiwifi1/ESP8089-SPI-master/spi_sif_esp.c, 1655
[ 63.655841] rx:[0xff],[0xff],[0x00],[0x00],[0xff],[0xff],[0xff],[0xff],[0xff],[0xff]
[ 64.206337] esp8089_spi: /home/dika/DVPM_linux-5.2/spiwifi1/ESP8089-SPI-master/spi_sif_esp.c, 1655
[ 64.264346] rx:[0xff],[0xff],[0x00],[0x00],[0xff],[0xff],[0xff],[0xff],[0xff],[0xff]
[ 64.814901] esp8089_spi: /home/dika/DVPM_linux-5.2/spiwifi1/ESP8089-SPI-master/spi_sif_esp.c, 1668
[ 64.873001] rx:[0xff],[0x00],[0x00],[0xff],[0xff],[0xff],[0xff],[0xff],[0xff],[0xff]
[ 64.923916] esp8089_spi: /home/dika/DVPM_linux-5.2/spiwifi1/ESP8089-SPI-master/spi_sif_esp.c, 1681
[ 64.981589] rx:[0xff],[0x00],[0x02],[0xff],[0xff],[0xff],[0xff],[0xff],[0xff],[0xff]
[ 65.032581] esp8089_spi: /home/dika/DVPM_linux-5.2/spiwifi1/ESP8089-SPI-master/spi_sif_esp.c, 1694
[ 65.089883] rx:[0xff],[0x00],[0x01],[0xff],[0xff],[0xff],[0xff],[0xff],[0xff],[0xff]
[ 66.146896] esp8089_spi: esp_pub_init_all
[ 66.172604] esp8089_spi: downloadesp_download_fw
[ 66.337374] random: crng init done
[ 69.540394] esp8089_spi: first normal exit
[ 69.565672] esp8089_spi: esp_spi_probe EXIT
[ 69.591165] esp8089_spi: sem_timeout = 0
[ 69.615827] esp8089_spi: esp_spi_remove
[ 69.752243] esp8089_spi: esp_spi_probe ENTER
[ 69.776637] esp8089_spi: esp_setup_spi
[ 69.800169] esp8089_spi: sif_spi_protocol_init
[ 69.824209] esp8089_spi: /home/dika/DVPM_linux-5.2/spiwifi1/ESP8089-SPI-master/spi_sif_esp.c, 1559
[ 69.871830] esp8089_spi: fail_count = 0
[ 70.006603] rx:[0xff],[0xff],[0x00],[0xff],[0xff],[0xff],[0xff],[0xff],[0xff],[0xff]
[ 70.152729] esp8089_spi: /home/dika/DVPM_linux-5.2/spiwifi1/ESP8089-SPI-master/spi_sif_esp.c, 1559
[ 70.199998] esp8089_spi: fail_count = 1
[ 70.331260] rx:[0xff],[0xff],[0x00],[0xff],[0xff],[0xff],[0xff],[0xff],[0xff],[0xff]
[ 70.476976] esp8089_spi: /home/dika/DVPM_linux-5.2/spiwifi1/ESP8089-SPI-master/spi_sif_esp.c, 1559
[ 70.523961] esp8089_spi: fail_count = 2
[ 70.655079] rx:[0xff],[0xff],[0x00],[0xff],[0xff],[0xff],[0xff],[0xff],[0xff],[0xff]
[ 70.800530] esp8089_spi: /home/dika/DVPM_linux-5.2/spiwifi1/ESP8089-SPI-master/spi_sif_esp.c, 1559
[ 70.847144] esp8089_spi: fail_count = 3
[ 70.978064] rx:[0xff],[0xff],[0x00],[0xff],[0xff],[0xff],[0xff],[0xff],[0xff],[0xff]
[ 71.123087] esp8089_spi: /home/dika/DVPM_linux-5.2/spiwifi1/ESP8089-SPI-master/spi_sif_esp.c, 1559
[ 71.169345] esp8089_spi: fail_count = 4
[ 71.299906] rx:[0xff],[0xff],[0x00],[0xff],[0xff],[0xff],[0xff],[0xff],[0xff],[0xff]
[ 71.444655] esp8089_spi: /home/dika/DVPM_linux-5.2/spiwifi1/ESP8089-SPI-master/spi_sif_esp.c, 1559
[ 71.490520] esp8089_spi: fail_count = 5
[ 71.621241] rx:[0xff],[0xff],[0x00],[0xff],[0xff],[0xff],[0xff],[0xff],[0xff],[0xff]
[ 71.765606] esp8089_spi: /home/dika/DVPM_linux-5.2/spiwifi1/ESP8089-SPI-master/spi_sif_esp.c, 1559
[ 71.811168] esp8089_spi: fail_count = 6
[ 71.941996] rx:[0xff],[0xff],[0x00],[0xff],[0xff],[0xff],[0xff],[0xff],[0xff],[0xff]
[ 72.086032] esp8089_spi: /home/dika/DVPM_linux-5.2/spiwifi1/ESP8089-SPI-master/spi_sif_esp.c, 1559
[ 72.131192] esp8089_spi: fail_count = 7
[ 72.261107] rx:[0xff],[0xff],[0x00],[0xff],[0xff],[0xff],[0xff],[0xff],[0xff],[0xff]
[ 72.404730] esp8089_spi: /home/dika/DVPM_linux-5.2/spiwifi1/ESP8089-SPI-master/spi_sif_esp.c, 1559
[ 72.449561] esp8089_spi: fail_count = 8
[ 72.579921] rx:[0xff],[0xff],[0x00],[0xff],[0xff],[0xff],[0xff],[0xff],[0xff],[0xff]
[ 72.723926] esp8089_spi: /home/dika/DVPM_linux-5.2/spiwifi1/ESP8089-SPI-master/spi_sif_esp.c, 1559
[ 72.769761] esp8089_spi: fail_count = 9
[ 72.910199] rx:[0xff],[0xff],[0x00],[0xff],[0xff],[0xff],[0xff],[0xff],[0xff],[0xff]
[ 73.056031] esp8089_spi: /home/dika/DVPM_linux-5.2/spiwifi1/ESP8089-SPI-master/spi_sif_esp.c, 1559
[ 73.104049] esp8089_spi: fail_count = 10
[ 73.236265] rx:[0xff],[0xff],[0x00],[0xff],[0xff],[0xff],[0xff],[0xff],[0xff],[0xff]
[ 73.383368] esp8089_spi: esp_spi_remove
[ 73.407044] esp8089_spi: esp_spi_remove no sctrl
[ 73.431183] eagle: probe of spi0.0 failed with error -110
[ 73.456373] esp8089_spi: esp_spi_init err 0
root@dika-pc:~#
没有注释的
iroot@dika-pc:~# insmod esp8089-spi.ko
[ 65.213159] esp8089_spi: loading out-of-tree module taints kernel.
[ 65.228569] esp8089_spi: EAGLE DRIVER VER bdf5087c3deb
[ 65.234474] esp8089_spi: poweron
[ 65.838454] esp8089_spi: esp_spi_dummy_probe enter
[ 65.844056] esp8089_spi: I will go dead
[ 65.848284] esp8089_spi: I am OK
[ 65.851806] esp8089_spi: register board OK
[ 65.856390] esp8089_spi: sem_timeout = 0
[ 66.072035] esp8089_spi: ESP8089 power up OK
[ 66.077361] esp8089_spi: esp_spi_probe ENTER
[ 66.082243] esp8089_spi: esp_setup_spi
[ 66.086392] esp8089_spi: sif_spi_protocol_init
[ 66.091242] esp8089_spi: /home/dika/DVPM_linux-5.2/spiwifi1/ESP8089-SPI-master/spi_sif_esp.c, 1559
[ 66.101061] esp8089_spi: fail_count = 0
[ 66.231834] rx:[0xff],[0xff],[0xff],[0xff],[0xff],[0xff],[0xff],[0xff],[0xff],[0xff]
[ 66.340450] esp8089_spi: /home/dika/DVPM_linux-5.2/spiwifi1/ESP8089-SPI-master/spi_sif_esp.c, 1559
[ 66.350274] esp8089_spi: fail_count = 1
[ 66.463608] rx:[0xff],[0x09],[0xff],[0xff],[0xff],[0xff],[0xff],[0xff],[0xff],[0xff]
[ 66.572247] esp8089_spi: /home/dika/DVPM_linux-5.2/spiwifi1/ESP8089-SPI-master/spi_sif_esp.c, 1559
[ 66.582060] esp8089_spi: fail_count = 2
[ 66.694617] rx:[0xff],[0xff],[0x01],[0xff],[0xff],[0xff],[0xff],[0xff],[0xff],[0xff]
[ 67.302569] esp8089_spi: /home/dika/DVPM_linux-5.2/spiwifi1/ESP8089-SPI-master/spi_sif_esp.c, 1578
[ 67.317987] rx:[0xff],[0xff],[0x01],[0x10],[0xff],[0xff],[0x00],[0xff],[0xff],[0xff]
[ 67.826062] esp8089_spi: /home/dika/DVPM_linux-5.2/spiwifi1/ESP8089-SPI-master/spi_sif_esp.c, 1591
[ 67.841357] rx:[0xff],[0xff],[0x00],[0x90],[0xff],[0xff],[0x00],[0xff],[0xff],[0xff]
[ 68.349446] esp8089_spi: /home/dika/DVPM_linux-5.2/spiwifi1/ESP8089-SPI-master/spi_sif_esp.c, 1603
[ 68.365341] rx:[0xff],[0x00],[0x02],[0xff],[0xff],[0xff],[0xff],[0xff],[0xff],[0xff]
[ 68.873472] esp8089_spi: /home/dika/DVPM_linux-5.2/spiwifi1/ESP8089-SPI-master/spi_sif_esp.c, 1617
[ 68.888651] rx:[0xff],[0x00],[0x03],[0xff],[0xff],[0xff],[0xff],[0xff],[0xff],[0xff]
[ 69.396793] esp8089_spi: /home/dika/DVPM_linux-5.2/spiwifi1/ESP8089-SPI-master/spi_sif_esp.c, 1630
[ 69.425463] rx:[0xff],[0x00],[0x02],[0xff],[0xff],[0xff],[0xff],[0xff],[0xff],[0xff]
[ 69.933547] esp8089_spi: /home/dika/DVPM_linux-5.2/spiwifi1/ESP8089-SPI-master/spi_sif_esp.c, 1643
[ 69.967208] rx:[0xff],[0x00],[0x03],[0xff],[0xff],[0xff],[0xff],[0xff],[0xff],[0xff]
[ 70.511327] esp8089_spi: /home/dika/DVPM_linux-5.2/spiwifi1/ESP8089-SPI-master/spi_sif_esp.c, 1655
[ 70.563405] rx:[0xff],[0xff],[0x00],[0x00],[0xff],[0xff],[0xff],[0xff],[0xff],[0xff]
[ 71.108057] esp8089_spi: /home/dika/DVPM_linux-5.2/spiwifi1/ESP8089-SPI-master/spi_sif_esp.c, 1655
[ 71.160695] rx:[0xff],[0xff],[0x00],[0x25],[0xff],[0xff],[0xff],[0xff],[0xff],[0xff]
[ 71.707169] esp8089_spi: /home/dika/DVPM_linux-5.2/spiwifi1/ESP8089-SPI-master/spi_sif_esp.c, 1655
[ 71.763010] rx:[0xff],[0xff],[0x00],[0x10],[0xff],[0xff],[0xff],[0xff],[0xff],[0xff]
[ 72.311245] esp8089_spi: /home/dika/DVPM_linux-5.2/spiwifi1/ESP8089-SPI-master/spi_sif_esp.c, 1655
[ 72.368811] rx:[0xff],[0xff],[0x00],[0x12],[0xff],[0xff],[0xff],[0xff],[0xff],[0xff]
[ 72.918426] esp8089_spi: /home/dika/DVPM_linux-5.2/spiwifi1/ESP8089-SPI-master/spi_sif_esp.c, 1655
[ 72.976042] rx:[0xff],[0xff],[0x00],[0x00],[0xff],[0xff],[0xff],[0xff],[0xff],[0xff]
[ 73.525712] esp8089_spi: /home/dika/DVPM_linux-5.2/spiwifi1/ESP8089-SPI-master/spi_sif_esp.c, 1655
[ 73.583312] rx:[0xff],[0xff],[0x00],[0x06],[0xff],[0xff],[0xff],[0xff],[0xff],[0xff]
[ 74.133500] esp8089_spi: /home/dika/DVPM_linux-5.2/spiwifi1/ESP8089-SPI-master/spi_sif_esp.c, 1655
[ 74.191117] rx:[0xff],[0xff],[0x00],[0x00],[0xff],[0xff],[0xff],[0xff],[0xff],[0xff]
[ 74.741480] esp8089_spi: /home/dika/DVPM_linux-5.2/spiwifi1/ESP8089-SPI-master/spi_sif_esp.c, 1655
[ 74.799126] rx:[0xff],[0xff],[0x00],[0x00],[0xff],[0xff],[0xff],[0xff],[0xff],[0xff]
[ 75.349603] esp8089_spi: /home/dika/DVPM_linux-5.2/spiwifi1/ESP8089-SPI-master/spi_sif_esp.c, 1668
[ 75.407202] rx:[0xff],[0x00],[0x00],[0xff],[0xff],[0xff],[0xff],[0xff],[0xff],[0xff]
[ 75.458201] esp8089_spi: /home/dika/DVPM_linux-5.2/spiwifi1/ESP8089-SPI-master/spi_sif_esp.c, 1681
[ 75.515852] rx:[0xff],[0x00],[0x02],[0xff],[0xff],[0xff],[0xff],[0xff],[0xff],[0xff]
[ 75.566801] esp8089_spi: /home/dika/DVPM_linux-5.2/spiwifi1/ESP8089-SPI-master/spi_sif_esp.c, 1694
[ 75.624272] rx:[0xff],[0x00],[0x01],[0xff],[0xff],[0xff],[0xff],[0xff],[0xff],[0xff]
[ 76.680657] esp8089_spi: esp_pub_init_all
[ 76.706385] esp8089_spi: downloadesp_download_fw
[ 76.857114] random: crng init done
[ 76.881730] random: 7 urandom warning(s) missed due to ratelimiting
[ 80.223072] esp8089_spi: sif_platform_irq_init enter
[ 80.527507] esp_host:bdf5087c3deb
[ 80.527507] esp_target: e826c2b3c9fd 57 18202
[ 80.527507]
[ 80.598417] esp_readwrite_file: file /system/lib/modules/test_results filp_open error
[ 80.654330] esp8089_spi: first normal exit
[ 80.678966] esp8089_spi: esp_spi_probe EXIT
[ 80.703763] esp8089_spi: sem_timeout = 0
[ 80.727807] esp8089_spi: esp_spi_remove
[ 80.922225] esp8089_spi: esp_spi_probe ENTER
[ 80.946062] esp8089_spi: esp_setup_spi
[ 80.968991] esp8089_spi: sif_spi_protocol_init
[ 80.992377] esp8089_spi: /home/dika/DVPM_linux-5.2/spiwifi1/ESP8089-SPI-master/spi_sif_esp.c, 1559
[ 81.038581] esp8089_spi: fail_count = 0
[ 81.172482] rx:[0xff],[0xff],[0xff],[0xff],[0xff],[0xff],[0xff],[0xff],[0xff],[0xff]
[ 81.317245] esp8089_spi: /home/dika/DVPM_linux-5.2/spiwifi1/ESP8089-SPI-master/spi_sif_esp.c, 1559
[ 81.363166] esp8089_spi: fail_count = 1
[ 81.493955] rx:[0xff],[0x09],[0xff],[0xff],[0xff],[0xff],[0xff],[0xff],[0xff],[0xff]
[ 81.638384] esp8089_spi: /home/dika/DVPM_linux-5.2/spiwifi1/ESP8089-SPI-master/spi_sif_esp.c, 1559
[ 81.683966] esp8089_spi: fail_count = 2
[ 81.814245] rx:[0xff],[0xff],[0x01],[0xff],[0xff],[0xff],[0xff],[0xff],[0xff],[0xff]
[ 82.457645] esp8089_spi: /home/dika/DVPM_linux-5.2/spiwifi1/ESP8089-SPI-master/spi_sif_esp.c, 1578
[ 82.508701] rx:[0xff],[0xff],[0x01],[0x10],[0xff],[0xff],[0x00],[0xff],[0xff],[0xff]
[ 83.052275] esp8089_spi: /home/dika/DVPM_linux-5.2/spiwifi1/ESP8089-SPI-master/spi_sif_esp.c, 1591
[ 83.103360] rx:[0xff],[0xff],[0x00],[0x90],[0xff],[0xff],[0x00],[0xff],[0xff],[0xff]
[ 83.646886] esp8089_spi: /home/dika/DVPM_linux-5.2/spiwifi1/ESP8089-SPI-master/spi_sif_esp.c, 1603
[ 83.697736] rx:[0xff],[0x00],[0x02],[0xff],[0xff],[0xff],[0xff],[0xff],[0xff],[0xff]
[ 84.241324] esp8089_spi: /home/dika/DVPM_linux-5.2/spiwifi1/ESP8089-SPI-master/spi_sif_esp.c, 1617
[ 84.292412] rx:[0xff],[0x00],[0x03],[0xff],[0xff],[0xff],[0xff],[0xff],[0xff],[0xff]
[ 84.835998] esp8089_spi: /home/dika/DVPM_linux-5.2/spiwifi1/ESP8089-SPI-master/spi_sif_esp.c, 1630
[ 84.896748] rx:[0xff],[0x00],[0x02],[0xff],[0xff],[0xff],[0xff],[0xff],[0xff],[0xff]
[ 85.440487] esp8089_spi: /home/dika/DVPM_linux-5.2/spiwifi1/ESP8089-SPI-master/spi_sif_esp.c, 1643
[ 85.493332] rx:[0xff],[0x00],[0x03],[0xff],[0xff],[0xff],[0xff],[0xff],[0xff],[0xff]
[ 86.038020] esp8089_spi: /home/dika/DVPM_linux-5.2/spiwifi1/ESP8089-SPI-master/spi_sif_esp.c, 1655
[ 86.091099] rx:[0xff],[0xff],[0x00],[0x00],[0xff],[0xff],[0xff],[0xff],[0xff],[0xff]
[ 86.636770] esp8089_spi: /home/dika/DVPM_linux-5.2/spiwifi1/ESP8089-SPI-master/spi_sif_esp.c, 1655
[ 86.690563] rx:[0xff],[0xff],[0x00],[0x25],[0xff],[0xff],[0xff],[0xff],[0xff],[0xff]
[ 87.236891] esp8089_spi: /home/dika/DVPM_linux-5.2/spiwifi1/ESP8089-SPI-master/spi_sif_esp.c, 1655
[ 87.291195] rx:[0xff],[0xff],[0x00],[0x10],[0xff],[0xff],[0xff],[0xff],[0xff],[0xff]
[ 87.839591] esp8089_spi: /home/dika/DVPM_linux-5.2/spiwifi1/ESP8089-SPI-master/spi_sif_esp.c, 1655
[ 87.896524] rx:[0xff],[0xff],[0x00],[0x12],[0xff],[0xff],[0xff],[0xff],[0xff],[0xff]
[ 88.445959] esp8089_spi: /home/dika/DVPM_linux-5.2/spiwifi1/ESP8089-SPI-master/spi_sif_esp.c, 1655
[ 88.503078] rx:[0xff],[0xff],[0x00],[0x00],[0xff],[0xff],[0xff],[0xff],[0xff],[0xff]
[ 89.052786] esp8089_spi: /home/dika/DVPM_linux-5.2/spiwifi1/ESP8089-SPI-master/spi_sif_esp.c, 1655
[ 89.110293] rx:[0xff],[0xff],[0x00],[0x06],[0xff],[0xff],[0xff],[0xff],[0xff],[0xff]
[ 89.660406] esp8089_spi: /home/dika/DVPM_linux-5.2/spiwifi1/ESP8089-SPI-master/spi_sif_esp.c, 1655
[ 89.718079] rx:[0xff],[0xff],[0x00],[0x00],[0xff],[0xff],[0xff],[0xff],[0xff],[0xff]
[ 90.268586] esp8089_spi: /home/dika/DVPM_linux-5.2/spiwifi1/ESP8089-SPI-master/spi_sif_esp.c, 1655
[ 90.326790] rx:[0xff],[0xff],[0x00],[0x00],[0xff],[0xff],[0xff],[0xff],[0xff],[0xff]
[ 90.877317] esp8089_spi: /home/dika/DVPM_linux-5.2/spiwifi1/ESP8089-SPI-master/spi_sif_esp.c, 1668
[ 90.935472] rx:[0xff],[0x00],[0x00],[0xff],[0xff],[0xff],[0xff],[0xff],[0xff],[0xff]
[ 90.986449] esp8089_spi: /home/dika/DVPM_linux-5.2/spiwifi1/ESP8089-SPI-master/spi_sif_esp.c, 1681
[ 91.044053] rx:[0xff],[0x00],[0x02],[0xff],[0xff],[0xff],[0xff],[0xff],[0xff],[0xff]
[ 91.094952] esp8089_spi: /home/dika/DVPM_linux-5.2/spiwifi1/ESP8089-SPI-master/spi_sif_esp.c, 1694
[ 91.153159] rx:[0xff],[0x00],[0x01],[0xff],[0xff],[0xff],[0xff],[0xff],[0xff],[0xff]
[ 92.209866] esp8089_spi: esp_pub_init_all
[ 92.235656] esp8089_spi: downloadesp_download_fw
[ 95.764156] esp8089_spi: sif_platform_irq_init enter
[ 95.824475] esp8089_spi: esp_spi_probe EXIT
[ 95.850211] esp8089_spi: esp_spi_init err 0
[ 95.892594] esp_host:bdf5087c3deb
[ 95.892594] esp_target: e826c2b3c9fd 57 18202
[ 95.892594]
我试了一下,去掉中断不可以呢。
把这部分屏蔽不行呢。在esp_main.c
gl_bootup_cplx = &complete;
epub->wait_reset = 0;
sif_enable_irq(epub);
if(epub->sdio_state == ESP_SDIO_STATE_SECOND_INIT || sif_get_ate_config() == 1){
ret = sip_poll_bootup_event(epub->sip);
} else {
ret = sip_poll_resetting_event(epub->sip);
if (ret == 0) {
sif_lock_bus(epub);
sif_interrupt_target(epub, 7);
sif_unlock_bus(epub);
}
}
gl_bootup_cplx = NULL;
if (sif_get_ate_config() == 1)
ret = -EOPNOTSUPP;
感谢迪大大的回复,原来还可以这样算的,我基础知识太差了
之前直接接排针容易掉,找了个nodemcu的板子给焊上去了,但是rx输出还是一样的,一直是00
root@OpenWrt:~# insmod esp8089-spi.ko esp_reset_gpio=36 esp_interrupt=37 [ 35.284414] esp8089_spi: loading out-of-tree module taints kernel. [ 35.293242] esp8089_spi: EAGLE DRIVER VER bdf5087c3deb [ 35.898977] esp8089_spi: esp_spi_dummy_probe enter [ 35.903832] esp8089_spi: register board OK [ 35.907996] esp8089_spi: sem_timeout = 0 [ 36.125445] esp8089_spi: ESP8089 power up OK [ 36.130047] esp8089_spi: esp_spi_probe ENTER [ 36.134346] esp8089_spi: esp_setup_spi [ 36.138168] esp8089_spi: sif_spi_protocol_init [ 36.142609] esp8089_spi: /home/mjc/test/ESP8089-SPI/spi_sif_esp.c, 1559 [ 36.149234] esp8089_spi: fail_count = 0 [ 36.255791] rx:[0x00],[0x00],[0x00],[0x00],[0x00],[0x00],[0x00],[0x00],[0x00],[0x00] [ 36.363546] esp8089_spi: /home/mjc/test/ESP8089-SPI/spi_sif_esp.c, 1559 [ 36.370163] esp8089_spi: fail_count = 1 [ 36.475697] rx:[0x00],[0x00],[0x00],[0x00],[0x00],[0x00],[0x00],[0x00],[0x00],[0x00] [ 36.583461] esp8089_spi: /home/mjc/test/ESP8089-SPI/spi_sif_esp.c, 1559 [ 36.590079] esp8089_spi: fail_count = 2 [ 36.697425] rx:[0x00],[0x00],[0x00],[0x00],[0x00],[0x00],[0x00],[0x00],[0x00],[0x00] [ 36.805183] esp8089_spi: /home/mjc/test/ESP8089-SPI/spi_sif_esp.c, 1559 [ 36.811798] esp8089_spi: fail_count = 3 [ 36.917287] rx:[0x00],[0x00],[0x00],[0x00],[0x00],[0x00],[0x00],[0x00],[0x00],[0x00] [ 37.025043] esp8089_spi: /home/mjc/test/ESP8089-SPI/spi_sif_esp.c, 1559 [ 37.031662] esp8089_spi: fail_count = 4 [ 37.137145] rx:[0x00],[0x00],[0x00],[0x00],[0x00],[0x00],[0x00],[0x00],[0x00],[0x00] [ 37.244897] esp8089_spi: /home/mjc/test/ESP8089-SPI/spi_sif_esp.c, 1559 [ 37.251512] esp8089_spi: fail_count = 5 [ 37.356994] rx:[0x00],[0x00],[0x00],[0x00],[0x00],[0x00],[0x00],[0x00],[0x00],[0x00] [ 37.464749] esp8089_spi: /home/mjc/test/ESP8089-SPI/spi_sif_esp.c, 1559 [ 37.471366] esp8089_spi: fail_count = 6 [ 37.577472] rx:[0x00],[0x00],[0x00],[0x00],[0x00],[0x00],[0x00],[0x00],[0x00],[0x00] [ 37.685211] esp8089_spi: /home/mjc/test/ESP8089-SPI/spi_sif_esp.c, 1559 [ 37.691827] esp8089_spi: fail_count = 7 [ 37.797296] rx:[0x00],[0x00],[0x00],[0x00],[0x00],[0x00],[0x00],[0x00],[0x00],[0x00] [ 37.905036] esp8089_spi: /home/mjc/test/ESP8089-SPI/spi_sif_esp.c, 1559 [ 37.911651] esp8089_spi: fail_count = 8 [ 38.017126] rx:[0x00],[0x00],[0x00],[0x00],[0x00],[0x00],[0x00],[0x00],[0x00],[0x00] [ 38.124866] esp8089_spi: /home/mjc/test/ESP8089-SPI/spi_sif_esp.c, 1559 [ 38.131481] esp8089_spi: fail_count = 9 [ 38.236956] rx:[0x00],[0x00],[0x00],[0x00],[0x00],[0x00],[0x00],[0x00],[0x00],[0x00] [ 38.344697] esp8089_spi: /home/mjc/test/ESP8089-SPI/spi_sif_esp.c, 1559 [ 38.351312] esp8089_spi: fail_count = 10 [ 38.456870] rx:[0x00],[0x00],[0x00],[0x00],[0x00],[0x00],[0x00],[0x00],[0x00],[0x00] [ 38.564619] esp8089_spi: first error exit [ 38.568638] esp8089_spi: esp_spi_probe EXIT [ 38.572852] eagle: probe of spi0.0 failed with error -110 [ 38.578399] esp8089_spi: sem_timeout = 0 [ 38.582322] esp8089_spi: esp_spi_init err 0
https://whycan.cn/files/members/2303/_20200508164806.png
https://whycan.cn/files/members/2303/_20200508164625.jpg
https://whycan.cn/files/members/2303/_20200508164620.jpg
https://whycan.cn/files/members/2303/_20200508164634.jpg
板子不错,这样焊比较整洁
C#工程在这儿,
大家可以用来测试自己手上的串口。
里面有编译好的EXE可以直接上手测试
private void button6_Click(object sender, EventArgs e)
{
serialPort1.DtrEnable = true;
}
private void button7_Click(object sender, EventArgs e)
{
serialPort1.RtsEnable = true;
}
private void button4_Click(object sender, EventArgs e)
{
serialPort1.DtrEnable = false;
}
private void button5_Click(object sender, EventArgs e)
{
serialPort1.RtsEnable = false;
}
https://blog.csdn.net/u012577474/article/details/104795000
大佬可以试一下跑一下桌面看一下效果
累计100多分钟测试
[ 5] 6150.0-6160.0 sec 8.01 MBytes 6.72 Mbits/sec
[ 5] 6160.0-6170.0 sec 9.01 MBytes 7.56 Mbits/sec
[ 5] 6170.0-6180.0 sec 8.76 MBytes 7.35 Mbits/sec
[ 5] 6180.0-6190.0 sec 9.32 MBytes 7.82 Mbits/sec
[ 5] 6190.0-6200.0 sec 9.35 MBytes 7.84 Mbits/sec
[ 5] 6200.0-6210.0 sec 9.19 MBytes 7.71 Mbits/sec
[ 5] 6210.0-6220.0 sec 9.87 MBytes 8.28 Mbits/sec
[ 5] 6220.0-6230.0 sec 9.18 MBytes 7.70 Mbits/sec
[ 5] 6230.0-6240.0 sec 8.94 MBytes 7.50 Mbits/sec
[ 5] 6240.0-6250.0 sec 8.79 MBytes 7.37 Mbits/sec
[ 5] 6250.0-6260.0 sec 8.11 MBytes 6.81 Mbits/sec
[ 5] 6260.0-6270.0 sec 8.71 MBytes 7.31 Mbits/sec
[ 5] 6270.0-6280.0 sec 7.77 MBytes 6.52 Mbits/sec
[ 5] 6280.0-6290.0 sec 11.6 MBytes 9.74 Mbits/sec
[ 5] 6290.0-6300.0 sec 10.7 MBytes 8.98 Mbits/sec
[ 5] 6300.0-6310.0 sec 11.5 MBytes 9.63 Mbits/sec
[ 5] 6310.0-6320.0 sec 11.4 MBytes 9.56 Mbits/sec
[ 5] 6320.0-6330.0 sec 11.0 MBytes 9.22 Mbits/sec
[ 5] 6330.0-6340.0 sec 11.6 MBytes 9.75 Mbits/sec
[ 5] 6340.0-6350.0 sec 11.6 MBytes 9.75 Mbits/sec
[ 5] 6350.0-6360.0 sec 11.5 MBytes 9.62 Mbits/sec
[ 5] 6360.0-6370.0 sec 11.5 MBytes 9.66 Mbits/sec
[ 5] 6370.0-6380.0 sec 11.6 MBytes 9.75 Mbits/sec
[ 5] 6380.0-6390.0 sec 11.5 MBytes 9.68 Mbits/sec
[ 5] 6390.0-6400.0 sec 11.5 MBytes 9.65 Mbits/sec
[ 5] 6400.0-6410.0 sec 11.6 MBytes 9.73 Mbits/sec
[ 5] 6410.0-6420.0 sec 11.6 MBytes 9.75 Mbits/sec
[ 5] 6420.0-6430.0 sec 10.9 MBytes 9.15 Mbits/sec
[ 5] 6430.0-6440.0 sec 10.6 MBytes 8.88 Mbits/sec
[ 5] 6440.0-6450.0 sec 10.2 MBytes 8.60 Mbits/sec
[ 5] 6450.0-6460.0 sec 11.0 MBytes 9.25 Mbits/sec
[ 5] 6460.0-6470.0 sec 9.50 MBytes 7.97 Mbits/sec
[ 5] 6470.0-6480.0 sec 10.9 MBytes 9.14 Mbits/sec
[ 5] 6480.0-6490.0 sec 10.1 MBytes 8.44 Mbits/sec
[ 5] 6490.0-6500.0 sec 10.2 MBytes 8.56 Mbits/sec
[ 5] 6500.0-6510.0 sec 10.1 MBytes 8.44 Mbits/sec
[ 5] 6510.0-6520.0 sec 10.5 MBytes 8.83 Mbits/sec
[ 5] 6520.0-6530.0 sec 11.5 MBytes 9.65 Mbits/sec
板子与8266连接的测试照片在这里
http://www.dika.ren/
[ 4] local 172.16.1.110 port 5001 connected with 172.16.1.109 port 58502
[ 4] 0.0-10.0 sec 9.91 MBytes 8.31 Mbits/sec
[ 4] 10.0-20.0 sec 10.8 MBytes 9.08 Mbits/sec
[ 4] 20.0-30.0 sec 11.5 MBytes 9.68 Mbits/sec
[ 4] 30.0-40.0 sec 10.7 MBytes 8.98 Mbits/sec
[ 4] 40.0-50.0 sec 10.8 MBytes 9.04 Mbits/sec
[ 4] 50.0-60.0 sec 10.9 MBytes 9.18 Mbits/sec
[ 4] 60.0-70.0 sec 11.7 MBytes 9.80 Mbits/sec
[ 4] 70.0-80.0 sec 11.7 MBytes 9.79 Mbits/sec
[ 4] 80.0-90.0 sec 11.7 MBytes 9.85 Mbits/sec
[ 4] 90.0-100.0 sec 11.6 MBytes 9.71 Mbits/sec
[ 4] 100.0-110.0 sec 11.6 MBytes 9.74 Mbits/sec
[ 4] 110.0-120.0 sec 11.7 MBytes 9.82 Mbits/sec
[ 4] 120.0-130.0 sec 11.6 MBytes 9.76 Mbits/sec
[ 4] 130.0-140.0 sec 11.6 MBytes 9.76 Mbits/sec
[ 4] 140.0-150.0 sec 11.6 MBytes 9.73 Mbits/sec
[ 4] 150.0-160.0 sec 11.6 MBytes 9.70 Mbits/sec
[ 4] 160.0-170.0 sec 11.4 MBytes 9.53 Mbits/sec
[ 4] 170.0-180.0 sec 11.6 MBytes 9.69 Mbits/sec
[ 4] 180.0-190.0 sec 10.7 MBytes 8.99 Mbits/sec
[ 4] 190.0-200.0 sec 11.7 MBytes 9.83 Mbits/sec
[ 4] 200.0-210.0 sec 11.8 MBytes 9.91 Mbits/sec
[ 4] 210.0-220.0 sec 11.7 MBytes 9.79 Mbits/sec
[ 4] 220.0-230.0 sec 11.7 MBytes 9.78 Mbits/sec
[ 4] 230.0-240.0 sec 11.7 MBytes 9.85 Mbits/sec
[ 4] 240.0-250.0 sec 11.8 MBytes 9.93 Mbits/sec
[ 4] 250.0-260.0 sec 11.7 MBytes 9.81 Mbits/sec
[ 4] 260.0-270.0 sec 11.9 MBytes 9.97 Mbits/sec
[ 4] 270.0-280.0 sec 11.9 MBytes 9.94 Mbits/sec
[ 4] 280.0-290.0 sec 11.8 MBytes 9.86 Mbits/sec
[ 4] 290.0-300.0 sec 11.8 MBytes 9.91 Mbits/sec
[ 4] 300.0-310.0 sec 11.8 MBytes 9.91 Mbits/sec
[ 4] 310.0-320.0 sec 11.9 MBytes 9.94 Mbits/sec
[ 4] 320.0-330.0 sec 11.6 MBytes 9.72 Mbits/sec
[ 4] 330.0-340.0 sec 10.7 MBytes 8.98 Mbits/sec
[ 4] 340.0-350.0 sec 11.1 MBytes 9.27 Mbits/sec
[ 4] 350.0-360.0 sec 11.7 MBytes 9.78 Mbits/sec
[ 4] 360.0-370.0 sec 11.0 MBytes 9.22 Mbits/sec
[ 4] 370.0-380.0 sec 11.6 MBytes 9.77 Mbits/sec
[ 4] 380.0-390.0 sec 11.8 MBytes 9.89 Mbits/sec
[ 4] 390.0-400.0 sec 11.6 MBytes 9.75 Mbits/sec
[ 4] 400.0-410.0 sec 11.6 MBytes 9.74 Mbits/sec
[ 4] 410.0-420.0 sec 11.8 MBytes 9.86 Mbits/sec
[ 4] 420.0-430.0 sec 11.4 MBytes 9.59 Mbits/sec
[ 4] 430.0-440.0 sec 11.5 MBytes 9.62 Mbits/sec
[ 4] 440.0-450.0 sec 11.6 MBytes 9.72 Mbits/sec
[ 4] 450.0-460.0 sec 11.6 MBytes 9.76 Mbits/sec
[ 4] 460.0-470.0 sec 9.71 MBytes 8.15 Mbits/sec
[ 4] 470.0-480.0 sec 10.7 MBytes 8.94 Mbits/sec
我将VMware的Ubuntu16.04的网络与主机变为桥接模式,
板子的wifi连接家里的路由器,这样,板子就和ubuntu在一个局域网里了。
在ubuntu上打开iperf服务,我的ubuntu的ip是172.16.1.110
# iperf -s
在板子上运行iperf客户端
root@dika-pc:~# iperf -c 172.16.1.110 -t 60
PC端测试结果如下
[ 4] local 172.16.1.110 port 5001 connected with 172.16.1.109 port 46440
[ ID] Interval Transfer Bandwidth
[ 4] 0.0-60.2 sec 71.6 MBytes 9.97 Mbits/sec
板子端测试结果如下
root@dika-pc:~# iperf -c 172.16.1.110 -t 60
------------------------------------------------------------
Client connecting to 172.16.1.110, TCP port 5001
TCP window size: 43.8 KByte (default)
------------------------------------------------------------
[ 3] local 172.16.1.109 port 46440 connected with 172.16.1.110 port 5001
[ ID] Interval Transfer Bandwidth
[ 3] 0.0-60.0 sec 71.6 MBytes 10.0 Mbits/sec
多测试几遍
基本上就是10Mbps,转换为MB/S就是1.2MB/s
使用wpa_supplicant连接wifi。
创建配置文件
/etc/wpa_supplicant.conf
可以使用vi来编写此文件,我还特地去学了一下,如何改光标位置,如何删除,如何保存。
内容为
network={
ssid="我的热点"
psk="我的密码"
}
然后
wpa_supplicant -B -d -i wlan0 -c /etc/wpa_supplicant.conf就OK了
root@dika-pc:~# wpa_supplicant -B -i wlan0 -c /etc/wpa_supplicant.conf
Successfully initialized wpa_supplicant
rfkill: Cannot open RFKILL control device
root@dika-pc:~# [ 444.817608] wlan0: authenticate with e4:67:1e:02:33:c0
[ 444.843208] wlan0: send auth to e4:67:1e:02:33:c0 (try 1/3)
[ 444.900867] wlan0: authenticated
[ 444.935561] wlan0: associate with e4:67:1e:02:33:c0 (try 1/3)
[ 444.986874] wlan0: RX AssocResp from e4:67:1e:02:33:c0 (capab=0x411 status=0 aid=4)
[ 445.033483] wlan0: associated
[ 446.047125] IPv6: ADDRCONF(NETDEV_CHANGE): wlan0: link becomes ready
^C
root@dika-pc:~# udhcpc -i wlan0
udhcpc: started, v1.30.1
udhcpc: sending discover
udhcpc: sending select for 172.16.1.106
udhcpc: lease of 172.16.1.106 obtained, lease time 43200
root@dika-pc:~# ping www.dika.ren
PING www.dika.ren (149.129.80.46) 56(84) bytes of data.
64 bytes from 149.129.80.46: icmp_seq=3 ttl=45 time=217 ms
64 bytes from 149.129.80.46: icmp_seq=4 ttl=45 time=417 ms
64 bytes from 149.129.80.46: icmp_seq=5 ttl=45 time=102 ms
64 bytes from 149.129.80.46: icmp_seq=6 ttl=45 time=108 ms
^C
--- www.dika.ren ping statistics ---
6 packets transmitted, 4 received, 33.3333% packet loss, time 346ms
rtt min/avg/max/mdev = 102.009/211.020/417.367/127.586 ms
构建debian文件系统,作为记录,最小rootfs在180MB左右。
安装构建文件系统的工具,一个是用来chroot,一个是用来构建文件系统
sudo apt install qemu-user-static -y
sudo apt install debootstrap -y
mkdir rootfs
构建文件系统之前,你要知道你想要构建哪个版本的文件系统,
我从https://www.debian.org/mirror/list.zh-cn.html这里,选择了我访问速度快的源,
并且该源有armel。
我看华为源挺快的,就用这个了mirrors.huaweicloud.com
然后就是debian的版本,我尝试一下最新的,buster
sudo debootstrap --foreign --verbose --arch=armel buster rootfs http://mirrors.huaweicloud.com/debian/
构建完成之后,需要chroot进去修改密码等配置
cd rootfs
sudo mount --bind /dev dev/
sudo mount --bind /sys sys/
sudo mount --bind /proc proc/
sudo mount --bind /dev/pts dev/pts/
cd ..
sudo cp /usr/bin/qemu-arm-static rootfs/usr/bin/
sudo chmod +x rootfs/usr/bin/qemu-arm-static
sudo LC_ALL=C LANGUAGE=C LANG=C chroot rootfs /debootstrap/debootstrap --second-stage --verbose
sudo LC_ALL=C LANGUAGE=C LANG=C chroot rootfs
最后一条命令chroot完成,
此时可以先apt-get等给你的文件系统安装你需要的软件包
修改root登录密码的方式如下
passwd 你的密码
修改源
sudo gedit rootfs/etc/apt/sourc.list
改为deb http://mirrors.huaweicloud.com/debian buster main
这部操作不知道是干什么,应该和登录有关
sudo gedit rootfs/etc/ssh/sshd_config
添加PermitRootLogin yes
清理缓存,打包之后就可以替换你的文件系统了
apt-cache clean #删除安装包
exit #退出chroot
rm rootfs/usr/bin/qemu-arm-static
unmount all point 2 did. ---- but all documents not mention this.
cd rootfs #进到文件系统目录
tar cvf ../rootfs.tar . #要注意那个. 代表当前目录
生成的rootfs.tar任意解压到文件系统即可
# while [ 1 ]; do
> data;wget ftp://192.168.43.1:3721/Downloads/DKTool_0229.rar -O /dev/null ;data
;
> done;
iw只能连接无密码的WIFI,现在的wifi协议不支持
# iw wlan0 connect huawei3
# [ 723.742594] wlan0: authenticate with e0:a3:ac:1d:7d:5b
[ 723.768122] wlan0: send auth to e0:a3:ac:1d:7d:5b (try 1/3)
[ 723.823034] wlan0: authenticated
[ 723.852631] wlan0: associate with e0:a3:ac:1d:7d:5b (try 1/3)
[ 723.908738] wlan0: RX AssocResp from e0:a3:ac:1d:7d:5b (capab=0x401 status=0 aid=1)
[ 723.955519] wlan0: associated
[ 723.979399] IPv6: ADDRCONF(NETDEV_CHANGE): wlan0: link becomes ready
连上了我手机的热点
请问,这是跑起来了吗?
# ifconfig wlan0 up
[ 569.902089] esp_op_add_interface STA
# ifconfig
lo Link encap:Local Loopback
inet addr:127.0.0.1 Mask:255.0.0.0
inet6 addr: ::1/128 Scope:Host
UP LOOPBACK RUNNING MTU:65536 Metric:1
RX packets:0 errors:0 dropped:0 overruns:0 frame:0
TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:0 (0.0 B) TX bytes:0 (0.0 B)
wlan0 Link encap:Ethernet HWaddr AC:D0:74:70:73:35
UP BROADCAST MULTICAST MTU:1500 Metric:1
RX packets:0 errors:0 dropped:0 overruns:0 frame:0
TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:0 (0.0 B) TX bytes:0 (0.0 B)
#
woc,是不是起来了呀,CS脚工作起来了好像一直在运行,,
首先对比一下/dev目录的东西,挂载前和挂载后,
挂载前的/dev
# ls
adsp ptyv8 ttyda
audio ptyv9 ttydb
console ptyva ttydc
cpu_dma_latency ptyvb ttydd
dri ptyvc ttyde
dsp ptyvd ttydf
fb0 ptyve ttye0
full ptyvf ttye1
gpiochip0 ptyw0 ttye2
kmsg ptyw1 ttye3
log ptyw2 ttye4
mem ptyw3 ttye5
memory_bandwidth ptyw4 ttye6
mixer ptyw5 ttye7
mmcblk0 ptyw6 ttye8
mmcblk0p1 ptyw7 ttye9
mmcblk0p2 ptyw8 ttyea
network_latency ptyw9 ttyeb
network_throughput ptywa ttyec
null ptywb ttyed
ptmx ptywc ttyee
pts ptywd ttyef
ptya0 ptywe ttyp0
ptya1 ptywf ttyp1
ptya2 ptyx0 ttyp2
ptya3 ptyx1 ttyp3
ptya4 ptyx2 ttyp4
ptya5 ptyx3 ttyp5
ptya6 ptyx4 ttyp6
ptya7 ptyx5 ttyp7
ptya8 ptyx6 ttyp8
ptya9 ptyx7 ttyp9
ptyaa ptyx8 ttypa
ptyab ptyx9 ttypb
ptyac ptyxa ttypc
ptyad ptyxb ttypd
ptyae ptyxc ttype
ptyaf ptyxd ttypf
ptyb0 ptyxe ttyq0
ptyb1 ptyxf ttyq1
ptyb2 ptyy0 ttyq2
ptyb3 ptyy1 ttyq3
ptyb4 ptyy2 ttyq4
ptyb5 ptyy3 ttyq5
ptyb6 ptyy4 ttyq6
ptyb7 ptyy5 ttyq7
ptyb8 ptyy6 ttyq8
ptyb9 ptyy7 ttyq9
ptyba ptyy8 ttyqa
ptybb ptyy9 ttyqb
ptybc ptyya ttyqc
ptybd ptyyb ttyqd
ptybe ptyyc ttyqe
ptybf ptyyd ttyqf
ptyc0 ptyye ttyr0
ptyc1 ptyyf ttyr1
ptyc2 ptyz0 ttyr2
ptyc3 ptyz1 ttyr3
ptyc4 ptyz2 ttyr4
ptyc5 ptyz3 ttyr5
ptyc6 ptyz4 ttyr6
ptyc7 ptyz5 ttyr7
ptyc8 ptyz6 ttyr8
ptyc9 ptyz7 ttyr9
ptyca ptyz8 ttyra
ptycb ptyz9 ttyrb
ptycc ptyza ttyrc
ptycd ptyzb ttyrd
ptyce ptyzc ttyre
ptycf ptyzd ttyrf
ptyd0 ptyze ttys0
ptyd1 ptyzf ttys1
ptyd2 random ttys2
ptyd3 shm ttys3
ptyd4 snd ttys4
ptyd5 tty ttys5
ptyd6 tty0 ttys6
ptyd7 tty1 ttys7
ptyd8 tty10 ttys8
ptyd9 tty11 ttys9
ptyda tty12 ttysa
ptydb tty13 ttysb
ptydc tty14 ttysc
ptydd tty15 ttysd
ptyde tty16 ttyse
ptydf tty17 ttysf
ptye0 tty18 ttyt0
ptye1 tty19 ttyt1
ptye2 tty2 ttyt2
ptye3 tty20 ttyt3
ptye4 tty21 ttyt4
ptye5 tty22 ttyt5
ptye6 tty23 ttyt6
ptye7 tty24 ttyt7
ptye8 tty25 ttyt8
ptye9 tty26 ttyt9
ptyea tty27 ttyta
ptyeb tty28 ttytb
ptyec tty29 ttytc
ptyed tty3 ttytd
ptyee tty30 ttyte
ptyef tty31 ttytf
ptyp0 tty32 ttyu0
ptyp1 tty33 ttyu1
ptyp2 tty34 ttyu2
ptyp3 tty35 ttyu3
ptyp4 tty36 ttyu4
ptyp5 tty37 ttyu5
ptyp6 tty38 ttyu6
ptyp7 tty39 ttyu7
ptyp8 tty4 ttyu8
ptyp9 tty40 ttyu9
ptypa tty41 ttyua
ptypb tty42 ttyub
ptypc tty43 ttyuc
ptypd tty44 ttyud
ptype tty45 ttyue
ptypf tty46 ttyuf
ptyq0 tty47 ttyv0
ptyq1 tty48 ttyv1
ptyq2 tty49 ttyv2
ptyq3 tty5 ttyv3
ptyq4 tty50 ttyv4
ptyq5 tty51 ttyv5
ptyq6 tty52 ttyv6
ptyq7 tty53 ttyv7
ptyq8 tty54 ttyv8
ptyq9 tty55 ttyv9
ptyqa tty56 ttyva
ptyqb tty57 ttyvb
ptyqc tty58 ttyvc
ptyqd tty59 ttyvd
ptyqe tty6 ttyve
ptyqf tty60 ttyvf
ptyr0 tty61 ttyw0
ptyr1 tty62 ttyw1
ptyr2 tty63 ttyw2
ptyr3 tty7 ttyw3
ptyr4 tty8 ttyw4
ptyr5 tty9 ttyw5
ptyr6 ttyS0 ttyw6
ptyr7 ttyS1 ttyw7
ptyr8 ttyS2 ttyw8
ptyr9 ttyS3 ttyw9
ptyra ttyS4 ttywa
ptyrb ttyS5 ttywb
ptyrc ttyS6 ttywc
ptyrd ttyS7 ttywd
ptyre ttya0 ttywe
ptyrf ttya1 ttywf
ptys0 ttya2 ttyx0
ptys1 ttya3 ttyx1
ptys2 ttya4 ttyx2
ptys3 ttya5 ttyx3
ptys4 ttya6 ttyx4
ptys5 ttya7 ttyx5
ptys6 ttya8 ttyx6
ptys7 ttya9 ttyx7
ptys8 ttyaa ttyx8
ptys9 ttyab ttyx9
ptysa ttyac ttyxa
ptysb ttyad ttyxb
ptysc ttyae ttyxc
ptysd ttyaf ttyxd
ptyse ttyb0 ttyxe
ptysf ttyb1 ttyxf
ptyt0 ttyb2 ttyy0
ptyt1 ttyb3 ttyy1
ptyt2 ttyb4 ttyy2
ptyt3 ttyb5 ttyy3
ptyt4 ttyb6 ttyy4
ptyt5 ttyb7 ttyy5
ptyt6 ttyb8 ttyy6
ptyt7 ttyb9 ttyy7
ptyt8 ttyba ttyy8
ptyt9 ttybb ttyy9
ptyta ttybc ttyya
ptytb ttybd ttyyb
ptytc ttybe ttyyc
ptytd ttybf ttyyd
ptyte ttyc0 ttyye
ptytf ttyc1 ttyyf
ptyu0 ttyc2 ttyz0
ptyu1 ttyc3 ttyz1
ptyu2 ttyc4 ttyz2
ptyu3 ttyc5 ttyz3
ptyu4 ttyc6 ttyz4
ptyu5 ttyc7 ttyz5
ptyu6 ttyc8 ttyz6
ptyu7 ttyc9 ttyz7
ptyu8 ttyca ttyz8
ptyu9 ttycb ttyz9
ptyua ttycc ttyza
ptyub ttycd ttyzb
ptyuc ttyce ttyzc
ptyud ttycf ttyzd
ptyue ttyd0 ttyze
ptyuf ttyd1 ttyzf
ptyv0 ttyd2 urandom
ptyv1 ttyd3 vcs
ptyv2 ttyd4 vcs1
ptyv3 ttyd5 vcsa
ptyv4 ttyd6 vcsa1
ptyv5 ttyd7 vcsu
ptyv6 ttyd8 vcsu1
ptyv7 ttyd9 zero
挂载后的/dev
# ls /dev/
adsp ptyv8 ttyda
audio ptyv9 ttydb
console ptyva ttydc
cpu_dma_latency ptyvb ttydd
dri ptyvc ttyde
dsp ptyvd ttydf
fb0 ptyve ttye0
full ptyvf ttye1
gpiochip0 ptyw0 ttye2
kmsg ptyw1 ttye3
log ptyw2 ttye4
mem ptyw3 ttye5
memory_bandwidth ptyw4 ttye6
mixer ptyw5 ttye7
mmcblk0 ptyw6 ttye8
mmcblk0p1 ptyw7 ttye9
mmcblk0p2 ptyw8 ttyea
network_latency ptyw9 ttyeb
network_throughput ptywa ttyec
null ptywb ttyed
ptmx ptywc ttyee
pts ptywd ttyef
ptya0 ptywe ttyp0
ptya1 ptywf ttyp1
ptya2 ptyx0 ttyp2
ptya3 ptyx1 ttyp3
ptya4 ptyx2 ttyp4
ptya5 ptyx3 ttyp5
ptya6 ptyx4 ttyp6
ptya7 ptyx5 ttyp7
ptya8 ptyx6 ttyp8
ptya9 ptyx7 ttyp9
ptyaa ptyx8 ttypa
ptyab ptyx9 ttypb
ptyac ptyxa ttypc
ptyad ptyxb ttypd
ptyae ptyxc ttype
ptyaf ptyxd ttypf
ptyb0 ptyxe ttyq0
ptyb1 ptyxf ttyq1
ptyb2 ptyy0 ttyq2
ptyb3 ptyy1 ttyq3
ptyb4 ptyy2 ttyq4
ptyb5 ptyy3 ttyq5
ptyb6 ptyy4 ttyq6
ptyb7 ptyy5 ttyq7
ptyb8 ptyy6 ttyq8
ptyb9 ptyy7 ttyq9
ptyba ptyy8 ttyqa
ptybb ptyy9 ttyqb
ptybc ptyya ttyqc
ptybd ptyyb ttyqd
ptybe ptyyc ttyqe
ptybf ptyyd ttyqf
ptyc0 ptyye ttyr0
ptyc1 ptyyf ttyr1
ptyc2 ptyz0 ttyr2
ptyc3 ptyz1 ttyr3
ptyc4 ptyz2 ttyr4
ptyc5 ptyz3 ttyr5
ptyc6 ptyz4 ttyr6
ptyc7 ptyz5 ttyr7
ptyc8 ptyz6 ttyr8
ptyc9 ptyz7 ttyr9
ptyca ptyz8 ttyra
ptycb ptyz9 ttyrb
ptycc ptyza ttyrc
ptycd ptyzb ttyrd
ptyce ptyzc ttyre
ptycf ptyzd ttyrf
ptyd0 ptyze ttys0
ptyd1 ptyzf ttys1
ptyd2 random ttys2
ptyd3 shm ttys3
ptyd4 snd ttys4
ptyd5 tty ttys5
ptyd6 tty0 ttys6
ptyd7 tty1 ttys7
ptyd8 tty10 ttys8
ptyd9 tty11 ttys9
ptyda tty12 ttysa
ptydb tty13 ttysb
ptydc tty14 ttysc
ptydd tty15 ttysd
ptyde tty16 ttyse
ptydf tty17 ttysf
ptye0 tty18 ttyt0
ptye1 tty19 ttyt1
ptye2 tty2 ttyt2
ptye3 tty20 ttyt3
ptye4 tty21 ttyt4
ptye5 tty22 ttyt5
ptye6 tty23 ttyt6
ptye7 tty24 ttyt7
ptye8 tty25 ttyt8
ptye9 tty26 ttyt9
ptyea tty27 ttyta
ptyeb tty28 ttytb
ptyec tty29 ttytc
ptyed tty3 ttytd
ptyee tty30 ttyte
ptyef tty31 ttytf
ptyp0 tty32 ttyu0
ptyp1 tty33 ttyu1
ptyp2 tty34 ttyu2
ptyp3 tty35 ttyu3
ptyp4 tty36 ttyu4
ptyp5 tty37 ttyu5
ptyp6 tty38 ttyu6
ptyp7 tty39 ttyu7
ptyp8 tty4 ttyu8
ptyp9 tty40 ttyu9
ptypa tty41 ttyua
ptypb tty42 ttyub
ptypc tty43 ttyuc
ptypd tty44 ttyud
ptype tty45 ttyue
ptypf tty46 ttyuf
ptyq0 tty47 ttyv0
ptyq1 tty48 ttyv1
ptyq2 tty49 ttyv2
ptyq3 tty5 ttyv3
ptyq4 tty50 ttyv4
ptyq5 tty51 ttyv5
ptyq6 tty52 ttyv6
ptyq7 tty53 ttyv7
ptyq8 tty54 ttyv8
ptyq9 tty55 ttyv9
ptyqa tty56 ttyva
ptyqb tty57 ttyvb
ptyqc tty58 ttyvc
ptyqd tty59 ttyvd
ptyqe tty6 ttyve
ptyqf tty60 ttyvf
ptyr0 tty61 ttyw0
ptyr1 tty62 ttyw1
ptyr2 tty63 ttyw2
ptyr3 tty7 ttyw3
ptyr4 tty8 ttyw4
ptyr5 tty9 ttyw5
ptyr6 ttyS0 ttyw6
ptyr7 ttyS1 ttyw7
ptyr8 ttyS2 ttyw8
ptyr9 ttyS3 ttyw9
ptyra ttyS4 ttywa
ptyrb ttyS5 ttywb
ptyrc ttyS6 ttywc
ptyrd ttyS7 ttywd
ptyre ttya0 ttywe
ptyrf ttya1 ttywf
ptys0 ttya2 ttyx0
ptys1 ttya3 ttyx1
ptys2 ttya4 ttyx2
ptys3 ttya5 ttyx3
ptys4 ttya6 ttyx4
ptys5 ttya7 ttyx5
ptys6 ttya8 ttyx6
ptys7 ttya9 ttyx7
ptys8 ttyaa ttyx8
ptys9 ttyab ttyx9
ptysa ttyac ttyxa
ptysb ttyad ttyxb
ptysc ttyae ttyxc
ptysd ttyaf ttyxd
ptyse ttyb0 ttyxe
ptysf ttyb1 ttyxf
ptyt0 ttyb2 ttyy0
ptyt1 ttyb3 ttyy1
ptyt2 ttyb4 ttyy2
ptyt3 ttyb5 ttyy3
ptyt4 ttyb6 ttyy4
ptyt5 ttyb7 ttyy5
ptyt6 ttyb8 ttyy6
ptyt7 ttyb9 ttyy7
ptyt8 ttyba ttyy8
ptyt9 ttybb ttyy9
ptyta ttybc ttyya
ptytb ttybd ttyyb
ptytc ttybe ttyyc
ptytd ttybf ttyyd
ptyte ttyc0 ttyye
ptytf ttyc1 ttyyf
ptyu0 ttyc2 ttyz0
ptyu1 ttyc3 ttyz1
ptyu2 ttyc4 ttyz2
ptyu3 ttyc5 ttyz3
ptyu4 ttyc6 ttyz4
ptyu5 ttyc7 ttyz5
ptyu6 ttyc8 ttyz6
ptyu7 ttyc9 ttyz7
ptyu8 ttyca ttyz8
ptyu9 ttycb ttyz9
ptyua ttycc ttyza
ptyub ttycd ttyzb
ptyuc ttyce ttyzc
ptyud ttycf ttyzd
ptyue ttyd0 ttyze
ptyuf ttyd1 ttyzf
ptyv0 ttyd2 urandom
ptyv1 ttyd3 vcs
ptyv2 ttyd4 vcs1
ptyv3 ttyd5 vcsa
ptyv4 ttyd6 vcsa1
ptyv5 ttyd7 vcsu
ptyv6 ttyd8 vcsu1
ptyv7 ttyd9 zero
挂载完整打印信息如下:
# modprobe esp8089-spi.ko
[ 95.688812] esp8089_spi: loading out-of-tree module taints kernel.
[ 95.741441] esp8089_spi: EAGLE DRIVER VER bdf5087c3deb
[ 95.765422] esp8089_spi: poweron
[ 96.387139] esp8089_spi: esp_spi_dummy_probe enter
[ 96.410540] esp8089_spi: I will go dead
[ 96.432614] esp8089_spi: I am OK
[ 96.453823] esp8089_spi: register board OK
[ 96.475790] esp8089_spi: sem_timeout = 0
[ 96.712043] esp8089_spi: ESP8089 power up OK
[ 96.734478] esp8089_spi: esp_spi_probe ENTER
[ 96.756241] esp8089_spi: esp_setup_spi
[ 96.777099] esp8089_spi: sif_spi_protocol_init
[ 96.798455] esp8089_spi: /home/dika/DVPM_linux-5.2/spiwifi1/ESP8089-SPI-master/spi_sif_esp.c, 1559
[ 96.840698] esp8089_spi: fail_count = 0
[ 96.965062] rx:[0xff],[0xff],[0xff],[0xff],[0xff],[0xff],[0xff],[0xff],[0xff],[0xff]
[ 97.105917] esp8089_spi: /home/dika/DVPM_linux-5.2/spiwifi1/ESP8089-SPI-master/spi_sif_esp.c, 1559
[ 97.148312] esp8089_spi: fail_count = 1
[ 97.273686] rx:[0xff],[0x09],[0xff],[0xff],[0xff],[0xff],[0xff],[0xff],[0xff],[0xff]
[ 97.414738] esp8089_spi: /home/dika/DVPM_linux-5.2/spiwifi1/ESP8089-SPI-master/spi_sif_esp.c, 1559
[ 97.456957] esp8089_spi: fail_count = 2
[ 97.580939] rx:[0xff],[0xff],[0x01],[0xff],[0xff],[0xff],[0xff],[0xff],[0xff],[0xff]
[ 98.221376] esp8089_spi: /home/dika/DVPM_linux-5.2/spiwifi1/ESP8089-SPI-master/spi_sif_esp.c, 1578
[ 98.266542] rx:[0xff],[0xff],[0x01],[0x10],[0xff],[0xff],[0x00],[0xff],[0xff],[0xff]
[ 98.807767] esp8089_spi: /home/dika/DVPM_linux-5.2/spiwifi1/ESP8089-SPI-master/spi_sif_esp.c, 1591
[ 98.853626] rx:[0xff],[0xff],[0x00],[0x90],[0xff],[0xff],[0x00],[0xff],[0xff],[0xff]
[ 99.395096] esp8089_spi: /home/dika/DVPM_linux-5.2/spiwifi1/ESP8089-SPI-master/spi_sif_esp.c, 1603
[ 99.441481] rx:[0xff],[0x00],[0x02],[0xff],[0xff],[0xff],[0xff],[0xff],[0xff],[0xff]
[ 99.983821] esp8089_spi: /home/dika/DVPM_linux-5.2/spiwifi1/ESP8089-SPI-master/spi_sif_esp.c, 1617
[ 100.030828] rx:[0xff],[0x00],[0x03],[0xff],[0xff],[0xff],[0xff],[0xff],[0xff],[0xff]
[ 100.574038] esp8089_spi: /home/dika/DVPM_linux-5.2/spiwifi1/ESP8089-SPI-master/spi_sif_esp.c, 1630
[ 100.620951] rx:[0xff],[0x00],[0x02],[0xff],[0xff],[0xff],[0xff],[0xff],[0xff],[0xff]
[ 101.164762] esp8089_spi: /home/dika/DVPM_linux-5.2/spiwifi1/ESP8089-SPI-master/spi_sif_esp.c, 1643
[ 101.213307] rx:[0xff],[0x00],[0x03],[0xff],[0xff],[0xff],[0xff],[0xff],[0xff],[0xff]
[ 101.757707] esp8089_spi: /home/dika/DVPM_linux-5.2/spiwifi1/ESP8089-SPI-master/spi_sif_esp.c, 1655
[ 101.805890] rx:[0xff],[0x00],[0x00],[0xff],[0xff],[0xff],[0xff],[0xff],[0xff],[0xff]
[ 102.350613] esp8089_spi: /home/dika/DVPM_linux-5.2/spiwifi1/ESP8089-SPI-master/spi_sif_esp.c, 1655
[ 102.400344] rx:[0xff],[0x00],[0x25],[0xff],[0xff],[0xff],[0xff],[0xff],[0xff],[0xff]
[ 102.946778] esp8089_spi: /home/dika/DVPM_linux-5.2/spiwifi1/ESP8089-SPI-master/spi_sif_esp.c, 1655
[ 102.997877] rx:[0xff],[0x00],[0x10],[0xff],[0xff],[0xff],[0xff],[0xff],[0xff],[0xff]
[ 103.546238] esp8089_spi: /home/dika/DVPM_linux-5.2/spiwifi1/ESP8089-SPI-master/spi_sif_esp.c, 1655
[ 103.599613] rx:[0xff],[0x00],[0x12],[0xff],[0xff],[0xff],[0xff],[0xff],[0xff],[0xff]
[ 104.149105] esp8089_spi: /home/dika/DVPM_linux-5.2/spiwifi1/ESP8089-SPI-master/spi_sif_esp.c, 1655
[ 104.202882] rx:[0xff],[0x00],[0x00],[0xff],[0xff],[0xff],[0xff],[0xff],[0xff],[0xff]
[ 104.752619] esp8089_spi: /home/dika/DVPM_linux-5.2/spiwifi1/ESP8089-SPI-master/spi_sif_esp.c, 1655
[ 104.806487] rx:[0xff],[0x00],[0x06],[0xff],[0xff],[0xff],[0xff],[0xff],[0xff],[0xff]
[ 105.356591] esp8089_spi: /home/dika/DVPM_linux-5.2/spiwifi1/ESP8089-SPI-master/spi_sif_esp.c, 1655
[ 105.410714] rx:[0xff],[0x00],[0x00],[0xff],[0xff],[0xff],[0xff],[0xff],[0xff],[0xff]
[ 105.961113] esp8089_spi: /home/dika/DVPM_linux-5.2/spiwifi1/ESP8089-SPI-master/spi_sif_esp.c, 1655
[ 106.015706] rx:[0xff],[0x00],[0x00],[0xff],[0xff],[0xff],[0xff],[0xff],[0xff],[0xff]
[ 106.566018] esp8089_spi: /home/dika/DVPM_linux-5.2/spiwifi1/ESP8089-SPI-master/spi_sif_esp.c, 1668
[ 106.620083] rx:[0xff],[0x00],[0x00],[0xff],[0xff],[0xff],[0xff],[0xff],[0xff],[0xff]
[ 106.671116] esp8089_spi: /home/dika/DVPM_linux-5.2/spiwifi1/ESP8089-SPI-master/spi_sif_esp.c, 1681
[ 106.725178] rx:[0xff],[0x00],[0x02],[0xff],[0xff],[0xff],[0xff],[0xff],[0xff],[0xff]
[ 106.776159] esp8089_spi: /home/dika/DVPM_linux-5.2/spiwifi1/ESP8089-SPI-master/spi_sif_esp.c, 1694
[ 106.830105] rx:[0xff],[0x00],[0x01],[0xff],[0xff],[0xff],[0xff],[0xff],[0xff],[0xff]
[ 107.885182] esp8089_spi: esp_pub_init_all
[ 107.910962] esp8089_spi: downloadesp_download_fw
[ 107.948002] random: crng init done
[ 108.457730] esp8089_spi: sif_platform_irq_init enter
[ 108.682929] esp_host:bdf5087c3deb
[ 108.682929] esp_target: e826c2b3c9fd 57 18202
[ 108.682929]
[ 108.754269] esp_readwrite_file: file /system/lib/modules/test_results filp_open error
[ 108.807356] esp8089_spi: first normal exit
[ 108.832108] esp8089_spi: esp_spi_probe EXIT
[ 108.856864] esp8089_spi: sem_timeout = 0
[ 108.880921] esp8089_spi: esp_spi_remove
[ 109.022172] esp8089_spi: esp_spi_probe ENTER
[ 109.046057] esp8089_spi: esp_setup_spi
[ 109.069029] esp8089_spi: sif_spi_protocol_init
[ 109.092510] esp8089_spi: /home/dika/DVPM_linux-5.2/spiwifi1/ESP8089-SPI-master/spi_sif_esp.c, 1559
[ 109.138970] esp8089_spi: fail_count = 0
[ 109.265424] rx:[0xff],[0xff],[0xff],[0xff],[0xff],[0xff],[0xff],[0xff],[0xff],[0xff]
[ 109.410344] esp8089_spi: /home/dika/DVPM_linux-5.2/spiwifi1/ESP8089-SPI-master/spi_sif_esp.c, 1559
[ 109.456558] esp8089_spi: fail_count = 1
[ 109.582142] rx:[0xff],[0x09],[0xff],[0xff],[0xff],[0xff],[0xff],[0xff],[0xff],[0xff]
[ 109.726810] esp8089_spi: /home/dika/DVPM_linux-5.2/spiwifi1/ESP8089-SPI-master/spi_sif_esp.c, 1559
[ 109.772626] esp8089_spi: fail_count = 2
[ 109.897947] rx:[0xff],[0xff],[0x01],[0xff],[0xff],[0xff],[0xff],[0xff],[0xff],[0xff]
[ 110.541520] esp8089_spi: /home/dika/DVPM_linux-5.2/spiwifi1/ESP8089-SPI-master/spi_sif_esp.c, 1578
[ 110.589422] rx:[0xff],[0xff],[0x01],[0x10],[0xff],[0xff],[0x00],[0xff],[0xff],[0xff]
[ 111.133165] esp8089_spi: /home/dika/DVPM_linux-5.2/spiwifi1/ESP8089-SPI-master/spi_sif_esp.c, 1591
[ 111.180911] rx:[0xff],[0xff],[0x00],[0x90],[0xff],[0xff],[0x00],[0xff],[0xff],[0xff]
[ 111.724615] esp8089_spi: /home/dika/DVPM_linux-5.2/spiwifi1/ESP8089-SPI-master/spi_sif_esp.c, 1603
[ 111.772396] rx:[0xff],[0x00],[0x02],[0xff],[0xff],[0xff],[0xff],[0xff],[0xff],[0xff]
[ 112.316162] esp8089_spi: /home/dika/DVPM_linux-5.2/spiwifi1/ESP8089-SPI-master/spi_sif_esp.c, 1617
[ 112.363925] rx:[0xff],[0x00],[0x03],[0xff],[0xff],[0xff],[0xff],[0xff],[0xff],[0xff]
[ 112.907706] esp8089_spi: /home/dika/DVPM_linux-5.2/spiwifi1/ESP8089-SPI-master/spi_sif_esp.c, 1630
[ 112.955502] rx:[0xff],[0x00],[0x02],[0xff],[0xff],[0xff],[0xff],[0xff],[0xff],[0xff]
[ 113.499256] esp8089_spi: /home/dika/DVPM_linux-5.2/spiwifi1/ESP8089-SPI-master/spi_sif_esp.c, 1643
[ 113.546952] rx:[0xff],[0x00],[0x03],[0xff],[0xff],[0xff],[0xff],[0xff],[0xff],[0xff]
[ 114.091379] esp8089_spi: /home/dika/DVPM_linux-5.2/spiwifi1/ESP8089-SPI-master/spi_sif_esp.c, 1655
[ 114.140416] rx:[0xff],[0x00],[0x00],[0xff],[0xff],[0xff],[0xff],[0xff],[0xff],[0xff]
[ 114.685987] esp8089_spi: /home/dika/DVPM_linux-5.2/spiwifi1/ESP8089-SPI-master/spi_sif_esp.c, 1655
[ 114.735674] rx:[0xff],[0x00],[0x25],[0xff],[0xff],[0xff],[0xff],[0xff],[0xff],[0xff]
[ 115.282003] esp8089_spi: /home/dika/DVPM_linux-5.2/spiwifi1/ESP8089-SPI-master/spi_sif_esp.c, 1655
[ 115.333521] rx:[0xff],[0x00],[0x10],[0xff],[0xff],[0xff],[0xff],[0xff],[0xff],[0xff]
[ 115.881856] esp8089_spi: /home/dika/DVPM_linux-5.2/spiwifi1/ESP8089-SPI-master/spi_sif_esp.c, 1655
[ 115.934723] rx:[0xff],[0x00],[0x12],[0xff],[0xff],[0xff],[0xff],[0xff],[0xff],[0xff]
[ 116.484208] esp8089_spi: /home/dika/DVPM_linux-5.2/spiwifi1/ESP8089-SPI-master/spi_sif_esp.c, 1655
[ 116.537977] rx:[0xff],[0x00],[0x00],[0xff],[0xff],[0xff],[0xff],[0xff],[0xff],[0xff]
[ 117.087691] esp8089_spi: /home/dika/DVPM_linux-5.2/spiwifi1/ESP8089-SPI-master/spi_sif_esp.c, 1655
[ 117.141635] rx:[0xff],[0x00],[0x06],[0xff],[0xff],[0xff],[0xff],[0xff],[0xff],[0xff]
[ 117.691596] esp8089_spi: /home/dika/DVPM_linux-5.2/spiwifi1/ESP8089-SPI-master/spi_sif_esp.c, 1655
[ 117.745683] rx:[0xff],[0x00],[0x00],[0xff],[0xff],[0xff],[0xff],[0xff],[0xff],[0xff]
[ 118.296061] esp8089_spi: /home/dika/DVPM_linux-5.2/spiwifi1/ESP8089-SPI-master/spi_sif_esp.c, 1655
[ 118.350494] rx:[0xff],[0x00],[0x00],[0xff],[0xff],[0xff],[0xff],[0xff],[0xff],[0xff]
[ 118.900869] esp8089_spi: /home/dika/DVPM_linux-5.2/spiwifi1/ESP8089-SPI-master/spi_sif_esp.c, 1668
[ 118.955132] rx:[0xff],[0x00],[0x00],[0xff],[0xff],[0xff],[0xff],[0xff],[0xff],[0xff]
[ 119.006037] esp8089_spi: /home/dika/DVPM_linux-5.2/spiwifi1/ESP8089-SPI-master/spi_sif_esp.c, 1681
[ 119.060398] rx:[0xff],[0x00],[0x02],[0xff],[0xff],[0xff],[0xff],[0xff],[0xff],[0xff]
[ 119.111387] esp8089_spi: /home/dika/DVPM_linux-5.2/spiwifi1/ESP8089-SPI-master/spi_sif_esp.c, 1694
[ 119.165337] rx:[0xff],[0x00],[0x01],[0xff],[0xff],[0xff],[0xff],[0xff],[0xff],[0xff]
[ 120.219675] esp8089_spi: esp_pub_init_all
[ 120.245395] esp8089_spi: downloadesp_download_fw
[ 120.878445] esp8089_spi: sif_platform_irq_init enter
[ 120.935677] esp8089_spi: esp_spi_probe EXIT
[ 120.961321] esp8089_spi: esp_spi_init err 0
[ 120.992229] esp_host:bdf5087c3deb
[ 120.992229] esp_target: e826c2b3c9fd 57 18202
[ 120.992229]
什么鬼??
[ 21.298456] esp8089_spi: esp_pub_init_all
[ 21.324239] esp8089_spi: downloadesp_download_fw
[ 21.457072] random: crng init done
[ 21.871575] esp8089_spi: sif_platform_irq_init enter
[ 21.898407] esp8089_spi: sif sif_enable_irq failed
[ 32.481935] resetting event timeout
[ 32.506446] esp8089_spi: esp_init_all failed: -110
[ 32.532108] esp8089_spi: first error exit
[ 32.556646] esp8089_spi: esp_spi_probe EXIT
[ 32.581431] esp8089_spi: sem_timeout = 0
[ 32.605472] esp8089_spi: esp_spi_init err 0
目前卡住的位置,还没有达到把固件上传到wifi模块那一步
static int esp_spi_probe(struct spi_device *spi)
{
int err;
struct esp_pub *epub;
struct esp_spi_ctrl *sctrl;
printk("esp8089_spi: %s ENTER\n", __func__);
//esp_dbg(ESP_DBG_ERROR, "esp8089_spi: %s enter\n", __func__);
/* -------------------------------------------------------------------------- */
err = esp_setup_spi(spi);
if (err) {
esp_dbg(ESP_DBG_ERROR, "esp8089_spi: %s setup_spi error[%d]\n", __func__, err);
if(sif_sdio_state == ESP_SDIO_STATE_FIRST_INIT)
goto _err_spi;
else
goto _err_second_init;
}
//esp_dbg(ESP_DBG_ERROR, "esp8089_spi: %s init_protocol\n", __func__);
/* -------------------------------------------------------------------------- */
err = sif_spi_protocol_init(spi);//在这卡住了 @@@@@@@
if(err) {
if(sif_sdio_state == ESP_SDIO_STATE_FIRST_INIT)
goto _err_spi;
else
goto _err_second_init;
}
if(sif_sdio_state == ESP_SDIO_STATE_FIRST_INIT){
sctrl = kzalloc(sizeof(struct esp_spi_ctrl), GFP_KERNEL);
if (sctrl == NULL) {
err = -ENOMEM;
goto _err_spi;
}
/* temp buffer reserved for un-dma-able request */
sctrl->dma_buffer = kzalloc(ESP_DMA_IBUFSZ, GFP_KERNEL);
SPI 15MHz
# insmod esp8089-spi.ko
[ 14.900929] esp8089_spi: loading out-of-tree module taints kernel.
[ 14.952975] esp8089_spi: EAGLE DRIVER VER bdf5087c3deb
[ 14.977090] esp8089_spi: poweron
[ 15.598862] esp8089_spi: esp_spi_dummy_probe enter
[ 15.622305] esp8089_spi: I will go dead
[ 15.644433] esp8089_spi: I am OK
[ 15.665721] esp8089_spi: register board OK
[ 15.687822] esp8089_spi: sem_timeout = 0
[ 15.921987] esp8089_spi: ESP8089 power up OK
[ 15.944590] esp8089_spi: esp_spi_probe ENTER
[ 15.966546] esp8089_spi: esp_setup_spi
[ 15.987586] esp8089_spi: sif_spi_protocol_init
[ 16.009206] esp8089_spi: /home/dika/DVPM_linux-5.2/spiwifi1/ESP8089-SPI-master/spi_sif_esp.c, 1559
[ 16.051926] esp8089_spi: fail_count = 0
[ 16.176664] rx:[0x00],[0x00],[0x00],[0x00],[0x00],[0x00],[0x00],[0x00],[0x00],[0x00]
[ 16.317848] esp8089_spi: /home/dika/DVPM_linux-5.2/spiwifi1/ESP8089-SPI-master/spi_sif_esp.c, 1559
[ 16.360380] esp8089_spi: fail_count = 1
[ 16.484384] rx:[0x7e],[0x13],[0xff],[0xff],[0xff],[0xff],[0xff],[0xff],[0xff],[0xff]
[ 16.625686] esp8089_spi: /home/dika/DVPM_linux-5.2/spiwifi1/ESP8089-SPI-master/spi_sif_esp.c, 1559
[ 16.668282] esp8089_spi: fail_count = 2
[ 16.792084] rx:[0xff],[0xfe],[0x03],[0xff],[0xff],[0xff],[0xff],[0xff],[0xff],[0xff]
[ 16.933510] esp8089_spi: /home/dika/DVPM_linux-5.2/spiwifi1/ESP8089-SPI-master/spi_sif_esp.c, 1559
[ 16.976461] esp8089_spi: fail_count = 3
[ 17.100712] rx:[0xff],[0xfe],[0x03],[0xff],[0xff],[0xff],[0xff],[0xff],[0xff],[0xff]
[ 17.242400] esp8089_spi: /home/dika/DVPM_linux-5.2/spiwifi1/ESP8089-SPI-master/spi_sif_esp.c, 1559
[ 17.285400] esp8089_spi: fail_count = 4
[ 17.409749] rx:[0xff],[0xfe],[0x03],[0xff],[0xff],[0xff],[0xff],[0xff],[0xff],[0xff]
[ 17.551823] esp8089_spi: /home/dika/DVPM_linux-5.2/spiwifi1/ESP8089-SPI-master/spi_sif_esp.c, 1559
[ 17.595541] esp8089_spi: fail_count = 5
[ 17.719894] rx:[0xff],[0xfe],[0x03],[0xff],[0xff],[0xff],[0xff],[0xff],[0xff],[0xff]
[ 17.862428] esp8089_spi: /home/dika/DVPM_linux-5.2/spiwifi1/ESP8089-SPI-master/spi_sif_esp.c, 1559
[ 17.906287] esp8089_spi: fail_count = 6
[ 18.030713] rx:[0xff],[0xfe],[0x03],[0xff],[0xff],[0xff],[0xff],[0xff],[0xff],[0xff]
[ 18.173591] esp8089_spi: /home/dika/DVPM_linux-5.2/spiwifi1/ESP8089-SPI-master/spi_sif_esp.c, 1559
[ 18.218119] esp8089_spi: fail_count = 7
[ 18.343120] rx:[0xff],[0xfe],[0x03],[0xff],[0xff],[0xff],[0xff],[0xff],[0xff],[0xff]
[ 18.486304] esp8089_spi: /home/dika/DVPM_linux-5.2/spiwifi1/ESP8089-SPI-master/spi_sif_esp.c, 1559
[ 18.530786] esp8089_spi: fail_count = 8
[ 18.655660] rx:[0xff],[0xfe],[0x03],[0xff],[0xff],[0xff],[0xff],[0xff],[0xff],[0xff]
[ 18.799412] esp8089_spi: /home/dika/DVPM_linux-5.2/spiwifi1/ESP8089-SPI-master/spi_sif_esp.c, 1559
[ 18.845437] esp8089_spi: fail_count = 9
[ 18.971166] rx:[0xff],[0xfe],[0x03],[0xff],[0xff],[0xff],[0xff],[0xff],[0xff],[0xff]
[ 19.117060] esp8089_spi: /home/dika/DVPM_linux-5.2/spiwifi1/ESP8089-SPI-master/spi_sif_esp.c, 1559
[ 19.165190] esp8089_spi: fail_count = 10
[ 19.292546] rx:[0xff],[0xfe],[0x03],[0xff],[0xff],[0xff],[0xff],[0xff],[0xff],[0xff]
[ 19.439672] esp8089_spi: first error exit
[ 19.463473] esp8089_spi: esp_spi_probe EXIT
[ 19.487289] eagle: probe of spi0.0 failed with error -110
[ 19.512469] esp8089_spi: sem_timeout = 0
[ 19.535793] esp8089_spi: esp_spi_init err 0
SPI 1MHz
# insmod esp8089-spi.ko
[ 17.952847] esp8089_spi: loading out-of-tree module taints kernel.
[ 18.004636] esp8089_spi: EAGLE DRIVER VER bdf5087c3deb
[ 18.028754] esp8089_spi: poweron
[ 18.650540] esp8089_spi: esp_spi_dummy_probe enter
[ 18.674024] esp8089_spi: I will go dead
[ 18.696104] esp8089_spi: I am OK
[ 18.717387] esp8089_spi: register board OK
[ 18.739441] esp8089_spi: sem_timeout = 0
[ 18.971992] esp8089_spi: ESP8089 power up OK
[ 18.994566] esp8089_spi: esp_spi_probe ENTER
[ 19.016477] esp8089_spi: esp_setup_spi
[ 19.037504] esp8089_spi: sif_spi_protocol_init
[ 19.059051] esp8089_spi: /home/dika/DVPM_linux-5.2/spiwifi1/ESP8089-SPI-master/spi_sif_esp.c, 1559
[ 19.101610] esp8089_spi: fail_count = 0
[ 19.226331] rx:[0x00],[0x00],[0x00],[0x00],[0x00],[0x00],[0x00],[0x00],[0x00],[0x00]
[ 19.367306] esp8089_spi: /home/dika/DVPM_linux-5.2/spiwifi1/ESP8089-SPI-master/spi_sif_esp.c, 1559
[ 19.409756] esp8089_spi: fail_count = 1
[ 19.533739] rx:[0x7e],[0x13],[0xff],[0xff],[0xff],[0xff],[0xff],[0xff],[0xff],[0xff]
[ 19.674991] esp8089_spi: /home/dika/DVPM_linux-5.2/spiwifi1/ESP8089-SPI-master/spi_sif_esp.c, 1559
[ 19.717502] esp8089_spi: fail_count = 2
[ 19.841174] rx:[0xff],[0xfe],[0x03],[0xff],[0xff],[0xff],[0xff],[0xff],[0xff],[0xff]
[ 19.982489] esp8089_spi: /home/dika/DVPM_linux-5.2/spiwifi1/ESP8089-SPI-master/spi_sif_esp.c, 1559
[ 20.025333] esp8089_spi: fail_count = 3
[ 20.149896] rx:[0xff],[0xfe],[0x03],[0xff],[0xff],[0xff],[0xff],[0xff],[0xff],[0xff]
[ 20.291597] esp8089_spi: /home/dika/DVPM_linux-5.2/spiwifi1/ESP8089-SPI-master/spi_sif_esp.c, 1559
[ 20.334566] esp8089_spi: fail_count = 4
[ 20.458476] rx:[0xff],[0xfe],[0x03],[0xff],[0xff],[0xff],[0xff],[0xff],[0xff],[0xff]
[ 20.600450] esp8089_spi: /home/dika/DVPM_linux-5.2/spiwifi1/ESP8089-SPI-master/spi_sif_esp.c, 1559
[ 20.644036] esp8089_spi: fail_count = 5
[ 20.768435] rx:[0xff],[0xfe],[0x03],[0xff],[0xff],[0xff],[0xff],[0xff],[0xff],[0xff]
[ 20.910754] esp8089_spi: /home/dika/DVPM_linux-5.2/spiwifi1/ESP8089-SPI-master/spi_sif_esp.c, 1559
[ 20.954281] esp8089_spi: fail_count = 6
[ 21.078735] rx:[0xff],[0xfe],[0x03],[0xff],[0xff],[0xff],[0xff],[0xff],[0xff],[0xff]
[ 21.221554] esp8089_spi: /home/dika/DVPM_linux-5.2/spiwifi1/ESP8089-SPI-master/spi_sif_esp.c, 1559
[ 21.266070] esp8089_spi: fail_count = 7
[ 21.391336] rx:[0xff],[0xfe],[0x03],[0xff],[0xff],[0xff],[0xff],[0xff],[0xff],[0xff]
[ 21.534522] esp8089_spi: /home/dika/DVPM_linux-5.2/spiwifi1/ESP8089-SPI-master/spi_sif_esp.c, 1559
[ 21.579003] esp8089_spi: fail_count = 8
[ 21.704930] rx:[0xff],[0xfe],[0x03],[0xff],[0xff],[0xff],[0xff],[0xff],[0xff],[0xff]
[ 21.848840] esp8089_spi: /home/dika/DVPM_linux-5.2/spiwifi1/ESP8089-SPI-master/spi_sif_esp.c, 1559
[ 21.894883] esp8089_spi: fail_count = 9
[ 22.021035] rx:[0xff],[0xfe],[0x03],[0xff],[0xff],[0xff],[0xff],[0xff],[0xff],[0xff]
[ 22.166974] esp8089_spi: /home/dika/DVPM_linux-5.2/spiwifi1/ESP8089-SPI-master/spi_sif_esp.c, 1559
[ 22.215061] esp8089_spi: fail_count = 10
[ 22.342137] rx:[0xff],[0xfe],[0x03],[0xff],[0xff],[0xff],[0xff],[0xff],[0xff],[0xff]
[ 22.489415] esp8089_spi: first error exit
[ 22.513264] esp8089_spi: esp_spi_probe EXIT
[ 22.537086] eagle: probe of spi0.0 failed with error -110
[ 22.562279] esp8089_spi: sem_timeout = 0
[ 22.585622] esp8089_spi: esp_spi_init err 0
里面应该是树莓派的IO操作
spi_stub.c
#define MHz (1000000)
/* https://www.signal.com.tr/pdf/cat/8n-esp8266_spi_reference_en_v1.0.pdf */
#define SPI_FREQ (10000000)
//#define SPI_FREQ (20000000) // 1. 22.5Mhz 2. 45Mhz
//#define SPI_FREQ (30000000) // 1. 22.5Mhz 2. 45Mhz
//Below are for spi HZ 22.5M
#if (SPI_FREQ == 30000000)
#define CMD_RESP_SIZE (10) //(50) //Common respon wait time
#define DATA_RESP_SIZE_W (142+45) // (1024*13)// (1024*16) //(398+400) // (1024*10) //Only for Write bytes function, data write response. max:(361+109)
#define DATA_RESP_SIZE_R (231+75) // (340+102) //(231+75)//(340+102) //Only for Read bytes function, data write response max:(340+102)
#define BLOCK_W_DATA_RESP_SIZE_EACH (10) //For each data write resp size, in block write
#define BLOCK_W_DATA_RESP_SIZE_FINAL (152) // (142+52) //For final data write resp size, in block write ,max: 119
#define BLOCK_R_DATA_RESP_SIZE_1ST (265) // (231+75) //For each data read resp size, in block read ,max: 134
#define BLOCK_R_DATA_RESP_SIZE_EACH (10) // (20) //For each data read resp size, in block read
#elif(SPI_FREQ == 20000000)
#define CMD_RESP_SIZE (10) //Common respon wait time
#define DATA_RESP_SIZE_W (103+40) //Only for Write bytes function, data write response. max: 103
#define DATA_RESP_SIZE_R (118+40) //Only for Read bytes function, data write response max: 118
//w: oxFF : 218 clock. oxFE : 214 clock.
#define BLOCK_W_DATA_RESP_SIZE_EACH (20) //For each data write resp size, in block write
#define BLOCK_W_DATA_RESP_SIZE_FINAL (112+40) //For final data write resp size, in block write ,max :112
#define BLOCK_R_DATA_RESP_SIZE_1ST (123+40) //For each data read resp size, in block read ,max: 123
#define BLOCK_R_DATA_RESP_SIZE_EACH (20) //For each data read resp size, in block read
//0xE5 ~0xFF 30us totoal
#elif (SPI_FREQ == 10000000)
#define CMD_RESP_SIZE 10
#define DATA_RESP_SIZE_W 99
#define DATA_RESP_SIZE_R 10
#define BLOCK_W_DATA_RESP_SIZE_EACH 30
#define BLOCK_W_DATA_RESP_SIZE_FINAL 152
#define BLOCK_R_DATA_RESP_SIZE_1ST 61
#define BLOCK_R_DATA_RESP_SIZE_EACH 30
#else /* Per 1*MHz */
#define CMD_RESP_SIZE (0*(SPI_FREQ/1000000)+10)
#define DATA_RESP_SIZE_W (4.4*(SPI_FREQ/1000000)+55)
#define DATA_RESP_SIZE_R (14.8*(SPI_FREQ/1000000)-138)
#define BLOCK_W_DATA_RESP_SIZE_EACH (-1*(SPI_FREQ/1000000)+40)
#define BLOCK_W_DATA_RESP_SIZE_FINAL (0*(SPI_FREQ/1000000)+152)
#define BLOCK_R_DATA_RESP_SIZE_1ST (10.2*(SPI_FREQ/1000000)-41)
#define BLOCK_R_DATA_RESP_SIZE_EACH (-1*(SPI_FREQ/1000000)+40)
#endif
/*
x per 10*MHz
CMD_RESP_SIZE 0x+10
DATA_RESP_SIZE_W 44x+55
DATA_RESP_SIZE_R 148x-138
BLOCK_W_DATA_RESP_SIZE_EACH -10x+40
BLOCK_W_DATA_RESP_SIZE_FINAL 0x+152
BLOCK_R_DATA_RESP_SIZE_1ST 102x-41
BLOCK_R_DATA_RESP_SIZE_EACH -10x+40
*/
#include "esp_sif.h"
#include "linux/interrupt.h"
#include "linux/spi/spi.h"
#include <linux/init.h>
#include <linux/delay.h>
#include <linux/gpio.h>
#include <linux/module.h>
#include <linux/moduleparam.h>
/* *** *** Board info *** *** */
struct spi_device_id esp_spi_id[] = {
{"ESP8089_0", 0},
{"ESP8089_1", 1},
{"ESP8089_2", 2},
{},
};
MODULE_DEVICE_TABLE(spi, esp_spi_id);
static int esp_cs0_pin = 16;
module_param(esp_cs0_pin, int, 0);
MODULE_PARM_DESC(esp_cs0_pin, "SPI chip select zero");
#ifdef REGISTER_SPI_BOARD_INFO
#define MAX_SPEED_HZ (20*MHz)
static struct spi_master *master;
static struct spi_device *spi;
static struct spi_board_info esp_board_spi_devices[] = {
{
.modalias = "ESP8089_0",
.max_speed_hz = MAX_SPEED_HZ,
.bus_num = 0,
.chip_select = 0,
.mode = 0,
},
};
void sif_platform_register_board_info(void) {
//spi_register_board_info(esp_board_spi_devices, ARRAY_SIZE(esp_board_spi_devices));
}
struct spi_device* sif_platform_new_device(void) {
master = spi_busnum_to_master(esp_board_spi_devices[0].bus_num);
if(!master)
printk("esp8089_spi: FAILED to find master\n");
spi = spi_new_device( master, esp_board_spi_devices );
if(!spi)
printk("esp8089_spi: FAILED to create slave\n");
printk("esp8089_spi: I will go dead\n");
if(spi_setup(spi))
printk("esp8089_spi: FAILED to setup slave\n");
printk("esp8089_spi: I am OK\n");
return spi;
}
#endif
/* *** *** Interrupt *** *** */
static int esp_interrupt = 26;
module_param(esp_interrupt, int, 0);
MODULE_PARM_DESC(esp_interrupt, "Interrupt pin");
int sif_platform_irq_init(void) {
int ret;
printk(KERN_ERR "esp8089_spi: %s enter\n", __func__);
if ( (ret = gpio_request(esp_interrupt, "esp_interrupt")) != 0) {
printk(KERN_ERR "esp8089_spi: request gpio error\n");
return ret;
}
gpio_direction_input(esp_interrupt);
sif_platform_irq_clear();
sif_platform_irq_mask(1);
udelay(1);
return 0;
}
void sif_platform_irq_deinit(void) {
gpio_free(esp_interrupt);
}
int sif_platform_get_irq_no(void) {
return gpio_to_irq(esp_interrupt);
}
int sif_platform_is_irq_occur(void) {
return 1;
}
void sif_platform_irq_clear(void) {
}
void sif_platform_irq_mask(int mask) {
if (mask)
disable_irq_nosync(sif_platform_get_irq_no());
else
enable_irq(sif_platform_get_irq_no());
}
void sif_platform_target_speed(int high_speed) {
}
#ifdef ESP_ACK_INTERRUPT
void sif_platform_ack_interrupt(struct esp_pub *epub) {
sif_platform_irq_clear();
}
#endif
/* *** *** Platform power *** *** */
/*
HSPI:
GPIO12 HMISO
GPIO13 HMOSI
GPIO14 HSCLK
GPIO15 HCS
SPI:
GPIO6 SCLK
GPIO7 MISO
GPIO8 MOSI
GPIO11 CS
SDIO:
GPIO6 SDCLK
GPIO7 SDD0
GPIO8 SDD1
GPIO9 SDD2
GPIO10 SDD3
GPIO11 SDCMD
*/
static int esp_reset_gpio = 13;
module_param(esp_reset_gpio, int, 0);
MODULE_PARM_DESC(esp_reset_gpio, "ESP8089 CHIP_EN GPIO number");
void sif_platform_reset_target(void) {
gpio_request(esp_reset_gpio, "esp_reset_gpio");
gpio_direction_output(esp_reset_gpio, 0);
mdelay(200);
gpio_direction_output(esp_reset_gpio, 1);
mdelay(200);
gpio_free(esp_reset_gpio);
}
void sif_platform_target_poweroff(void) {
gpio_direction_output(esp_reset_gpio, 0);
}
void sif_platform_target_poweron(void) {
gpio_request(esp_reset_gpio, "esp_reset_gpio");
mdelay(200);
gpio_direction_output(esp_reset_gpio, 0);
mdelay(200);
gpio_direction_output(esp_reset_gpio, 1);
mdelay(200);
gpio_free(esp_reset_gpio);
}
//module_init(esp_spi_init);
late_initcall(esp_spi_init);
module_exit(esp_spi_exit);
里面是RK的IO操作
spi_stub.c
/*
* Copyright (c) 2013 Espressif System.
*
* sdio stub code for allwinner
*/
#include <asm/io.h>
#include <mach/irqs.h>
#include <mach/io.h>
#include <mach/iomux.h>
#include <mach/pmu.h>
#include <linux/gpio.h>
#include <asm/gpio.h>
#include <asm/mach/irq.h>
#include "linux/spi/spi.h"//#include "../drivers/spi/rk29_spim.h"
#include "esp_sif.h"
//#define SPI_FREQ (20000000) // 1. 22.5Mhz 2. 45Mhz
#define SPI_FREQ (30000000) // 1. 22.5Mhz 2. 45Mhz
//Below are for spi HZ 22.5M
#if (SPI_FREQ == 30000000)
#define CMD_RESP_SIZE (10) //(50) //Common respon wait time
#define DATA_RESP_SIZE_W (142+45) // (1024*13)// (1024*16) //(398+400) // (1024*10) //Only for Write bytes function, data write response. max:(361+109)
#define DATA_RESP_SIZE_R (231+75) // (340+102) //(231+75)//(340+102) //Only for Read bytes function, data write response max:(340+102)
#define BLOCK_W_DATA_RESP_SIZE_EACH (10) //For each data write resp size, in block write
#define BLOCK_W_DATA_RESP_SIZE_FINAL (152) // (142+52) //For final data write resp size, in block write ,max: 119
#define BLOCK_R_DATA_RESP_SIZE_1ST (265) // (231+75) //For each data read resp size, in block read ,max: 134
#define BLOCK_R_DATA_RESP_SIZE_EACH (10) // (20) //For each data read resp size, in block read
#elif(SPI_FREQ == 20000000)
#define CMD_RESP_SIZE (10) //Common respon wait time
#define DATA_RESP_SIZE_W (103+40) //Only for Write bytes function, data write response. max: 103
#define DATA_RESP_SIZE_R (118+40) //Only for Read bytes function, data write response max: 118
//w: oxFF : 218 clock. oxFE : 214 clock.
#define BLOCK_W_DATA_RESP_SIZE_EACH (20) //For each data write resp size, in block write
#define BLOCK_W_DATA_RESP_SIZE_FINAL (112+40) //For final data write resp size, in block write ,max :112
#define BLOCK_R_DATA_RESP_SIZE_1ST (123+40) //For each data read resp size, in block read ,max: 123
#define BLOCK_R_DATA_RESP_SIZE_EACH (20) //For each data read resp size, in block read
#endif
//0xE5 ~0xFF 30us totoal
//
struct spi_device_id esp_spi_id[] = {
{"esp_spi_0", 0},
{"esp_spi_1", 1},
{},
};
#ifdef REGISTER_SPI_BOARD_INFO
static struct spi_board_info esp_board_spi_devices[] = {
{
.modalias = "esp_spi_0",
.bus_num = 0, //0 or 1
.max_speed_hz = 18*1000*1000,
.chip_select = 0,
.mode = SPI_MODE_3,
},
};
void sif_platform_register_board_info(void) {
spi_register_board_info(esp_board_spi_devices, ARRAY_SIZE(esp_board_spi_devices));
}
#endif /*REGISTER_SPI_BOARD_INFO*/
#define RK30_GPIO0_BASE RK2928_GPIO0_BASE
#define GPIO_NO RK30_PIN0_PA0
#define GPIO_BASE_ADDR ((unsigned char __iomem *) RK30_GPIO0_BASE)
#define GPIO_INT_MASK_OFFSET GPIO_INTEN
#define GPIO_INT_STAT_OFFSET GPIO_PORTS_EOI
int sif_platform_get_irq_no(void)
{
return gpio_to_irq(GPIO_NO);
}
int sif_platform_is_irq_occur(void)
{
return 1;
}
void sif_platform_irq_clear(void)
{
}
void sif_platform_irq_mask(int mask)
{
if (mask)
disable_irq_nosync(sif_platform_get_irq_no());
else
enable_irq(sif_platform_get_irq_no());
}
int sif_platform_irq_init(void)
{
int ret;
printk(KERN_ERR "%s enter\n", __func__);
if ( (ret = gpio_request(GPIO_NO, "esp_spi_int")) != 0) {
printk(KERN_ERR "request gpio error\n");
return ret;
}
gpio_direction_input(GPIO_NO);
sif_platform_irq_clear();
sif_platform_irq_mask(1);
udelay(1);
return 0;
}
void sif_platform_irq_deinit(void)
{
gpio_free(GPIO_NO);
}
void sif_platform_reset_target(void)
{
gpio_direction_output(RK30_PIN1_PB3, GPIO_LOW);
mdelay(200);
gpio_direction_output(RK30_PIN1_PB3, GPIO_HIGH);
mdelay(200);
}
void sif_platform_target_poweroff(void)
{
gpio_direction_output(RK30_PIN1_PB3, GPIO_LOW);
}
void sif_platform_target_poweron(void)
{
mdelay(200);
gpio_direction_output(RK30_PIN1_PB3, GPIO_LOW);
mdelay(200);
gpio_direction_output(RK30_PIN1_PB3, GPIO_HIGH);
mdelay(200);
}
void sif_platform_target_speed(int high_speed)
{
}
#ifdef ESP_ACK_INTERRUPT
void sif_platform_ack_interrupt(struct esp_pub *epub)
{
sif_platform_irq_clear();
}
#endif //ESP_ACK_INTERRUPT
module_init(esp_spi_init);
module_exit(esp_spi_exit);
完整版打印日志如下
# modprobe esp8089-spi.ko
[ 14.160787] esp8089_spi: loading out-of-tree module taints kernel.
[ 14.212248] esp8089_spi: EAGLE DRIVER VER bdf5087c3deb
[ 14.836264] esp8089_spi: esp_spi_dummy_probe enter
[ 14.859719] esp8089_spi: I will go dead
[ 14.881817] esp8089_spi: I am OK
[ 14.903073] esp8089_spi: register board OK
[ 14.925106] esp8089_spi: sem_timeout = 0
[ 15.161968] esp8089_spi: ESP8089 power up OK
[ 15.184532] esp8089_spi: esp_spi_probe ENTER
[ 15.206471] esp8089_spi: esp_setup_spi
[ 15.227518] esp8089_spi: sif_spi_protocol_init
[ 15.249056] esp8089_spi: /home/dika/DVPM_linux-5.2/spiwifi/ESP8089-SPI-master/spi_sif_esp.c, 1559
[ 15.291547] esp8089_spi: fail_count = 0
[ 15.416100] rx:[0x00],[0x00],[0x00],[0x00],[0x00],[0x00],[0x00],[0x00],[0x00],[0x00]
[ 15.557168] esp8089_spi: /home/dika/DVPM_linux-5.2/spiwifi/ESP8089-SPI-master/spi_sif_esp.c, 1559
[ 15.599577] esp8089_spi: fail_count = 1
[ 15.723559] rx:[0x00],[0x00],[0x00],[0x00],[0x00],[0x00],[0x00],[0x00],[0x00],[0x00]
[ 15.864807] esp8089_spi: /home/dika/DVPM_linux-5.2/spiwifi/ESP8089-SPI-master/spi_sif_esp.c, 1559
[ 15.907158] esp8089_spi: fail_count = 2
[ 16.030840] rx:[0x00],[0x00],[0x00],[0x00],[0x00],[0x00],[0x00],[0x00],[0x00],[0x00]
[ 16.172182] esp8089_spi: /home/dika/DVPM_linux-5.2/spiwifi/ESP8089-SPI-master/spi_sif_esp.c, 1559
[ 16.214934] esp8089_spi: fail_count = 3
[ 16.339190] rx:[0x00],[0x00],[0x00],[0x00],[0x00],[0x00],[0x00],[0x00],[0x00],[0x00]
[ 16.480864] esp8089_spi: /home/dika/DVPM_linux-5.2/spiwifi/ESP8089-SPI-master/spi_sif_esp.c, 1559
[ 16.523665] esp8089_spi: fail_count = 4
[ 16.648389] rx:[0x00],[0x00],[0x00],[0x00],[0x00],[0x00],[0x00],[0x00],[0x00],[0x00]
[ 16.790452] esp8089_spi: /home/dika/DVPM_linux-5.2/spiwifi/ESP8089-SPI-master/spi_sif_esp.c, 1559
[ 16.833929] esp8089_spi: fail_count = 5
[ 16.958406] rx:[0x00],[0x00],[0x00],[0x00],[0x00],[0x00],[0x00],[0x00],[0x00],[0x00]
[ 17.100829] esp8089_spi: /home/dika/DVPM_linux-5.2/spiwifi/ESP8089-SPI-master/spi_sif_esp.c, 1559
[ 17.144925] esp8089_spi: fail_count = 6
[ 17.270024] rx:[0x00],[0x00],[0x00],[0x00],[0x00],[0x00],[0x00],[0x00],[0x00],[0x00]
[ 17.412897] esp8089_spi: /home/dika/DVPM_linux-5.2/spiwifi/ESP8089-SPI-master/spi_sif_esp.c, 1559
[ 17.457390] esp8089_spi: fail_count = 7
[ 17.582389] rx:[0x00],[0x00],[0x00],[0x00],[0x00],[0x00],[0x00],[0x00],[0x00],[0x00]
[ 17.725779] esp8089_spi: /home/dika/DVPM_linux-5.2/spiwifi/ESP8089-SPI-master/spi_sif_esp.c, 1559
[ 17.770330] esp8089_spi: fail_count = 8
[ 17.895073] rx:[0x00],[0x00],[0x00],[0x00],[0x00],[0x00],[0x00],[0x00],[0x00],[0x00]
[ 18.038762] esp8089_spi: /home/dika/DVPM_linux-5.2/spiwifi/ESP8089-SPI-master/spi_sif_esp.c, 1559
[ 18.084524] esp8089_spi: fail_count = 9
[ 18.210388] rx:[0x00],[0x00],[0x00],[0x00],[0x00],[0x00],[0x00],[0x00],[0x00],[0x00]
[ 18.356068] esp8089_spi: /home/dika/DVPM_linux-5.2/spiwifi/ESP8089-SPI-master/spi_sif_esp.c, 1559
[ 18.403822] esp8089_spi: fail_count = 10
[ 18.530763] rx:[0x00],[0x00],[0x00],[0x00],[0x00],[0x00],[0x00],[0x00],[0x00],[0x00]
[ 18.677695] esp8089_spi: first error exit
[ 18.701399] esp8089_spi: esp_spi_probe EXIT
[ 18.725104] eagle: probe of spi0.0 failed with error -110
[ 18.750141] esp8089_spi: sem_timeout = 0
[ 18.773383] esp8089_spi: esp_spi_init err 0
#
woc,,牛逼!!!
# cd /lib/modules/5.2.0-licheepi-nano/
# modprobe esp8089-spi.ko
[ 12.181054] esp8089_spi: loading out-of-tree module taints kernel.
[ 12.233128] esp8089_spi: EAGLE DRIVER VER bdf5087c3deb
[ 12.857475] esp8089_spi: esp_spi_dummy_probe enter
[ 12.881136] esp8089_spi: I will go dead
[ 12.903368] esp8089_spi: I am OK
[ 12.924720] esp8089_spi: register board OK
[ 12.946892] esp8089_spi: sem_timeout = 0
[ 13.182012] esp8089_spi: ESP8089 power up OK
[ 13.204773] esp8089_spi: esp_spi_probe ENTER
[ 13.226888] esp8089_spi: esp_setup_spi
[ 13.248167] esp8089_spi: sif_spi_protocol_init
[ 13.269955] esp8089_spi: /home/dika/DVPM_linux-5.2/spiwifi/ESP8089-SPI-master/spi_sif_esp.c, 1559
[ 13.313000] esp8089_spi: fail_count = 0
[ 13.437998] rx:[0x00],[0x00],[0x00],[0x00],[0x00],[0x00],[0x00],[0x00],[0x00],[0x00]
[ 13.579642] esp8089_spi: /home/dika/DVPM_linux-5.2/spiwifi/ESP8089-SPI-master/spi_sif_esp.c, 1559
[ 13.622443] esp8089_spi: fail_count = 1
[ 13.746389] rx:[0x00],[0x00],[0x00],[0x00],[0x00],[0x00],[0x00],[0x00],[0x00],[0x00]
[ 13.888106] esp8089_spi: /home/dika/DVPM_linux-5.2/spiwifi/ESP8089-SPI-master/spi_sif_esp.c, 1559
[ 13.931011] esp8089_spi: fail_count = 2
[ 14.055044] rx:[0x00],[0x00],[0x00],[0x00],[0x00],[0x00],[0x00],[0x00],[0x00],[0x00]
[ 14.196744] esp8089_spi: /home/dika/DVPM_linux-5.2/spiwifi/ESP8089-SPI-master/spi_sif_esp.c, 1559
[ 14.239826] esp8089_spi: fail_count = 3
[ 14.364670] rx:[0x00],[0x00],[0x00],[0x00],[0x00],[0x00],[0x00],[0x00],[0x00],[0x00]
[ 14.506752] esp8089_spi: /home/dika/DVPM_linux-5.2/spiwifi/ESP8089-SPI-master/spi_sif_esp.c, 1559
[ 14.550011] esp8089_spi: fail_count = 4
[ 14.675678] rx:[0x00],[0x00],[0x00],[0x00],[0x00],[0x00],[0x00],[0x00],[0x00],[0x00]
[ 14.817810] esp8089_spi: /home/dika/DVPM_linux-5.2/spiwifi/ESP8089-SPI-master/spi_sif_esp.c,
将bus_num改为0之后,就是如下
# modprobe esp8089-spi.ko
[ 11.554796] esp8089_spi: loading out-of-tree module taints kernel.
[ 11.606600] esp8089_spi: EAGLE DRIVER VER bdf5087c3deb
[ 12.230317] esp8089_spi: esp_spi_dummy_probe enter
[ 12.254156] sun6i-spi 1c05000.spi: chipselect 0 already in use
[ 12.296718] esp8089_spi: FAILED to create slave
[ 12.319904] esp8089_spi: I will go dead
[ 12.342262] Unable to handle kernel NULL pointer dereference at virtual addre ss 000001a8
[ 12.387280] pgd = (ptrval)
从串口信息来看,是这段代码出了问题,我们一个个分析
struct spi_device* sif_platform_new_device(void) {
master = spi_busnum_to_master(esp_board_spi_devices[0].bus_num);
if(!master)
printk("esp8089_spi: FAILED to find master\n");
spi = spi_new_device( master, esp_board_spi_devices );
if(!spi)
printk("esp8089_spi: FAILED to create slave\n");
printk("esp8089_spi: I will go dead\n");
if(spi_setup(spi))
printk("esp8089_spi: FAILED to setup slave\n");
printk("esp8089_spi: I am OK\n");
return spi;
}
首先看
master = spi_busnum_to_master(esp_board_spi_devices[0].bus_num);
其中,esp_board_spi_devices[]为前面定义的结构体
static struct spi_board_info esp_board_spi_devices[] = {
{
.modalias = "ESP8089_0",
.max_speed_hz = MAX_SPEED_HZ,
.bus_num = 1,
.chip_select = 0,
.mode = 0,
},
};
bus_num就是1
spi_busnum_to_master(1)研究一下
每个master都对应一个bus num。
注册spi slave设备,由dts解析得到,dts会指定spi slave 挂载在哪个bus num下,由bus num就可以得到对应的spi master 了
www.dika.ren
可以从我的网站里看我的魔方机器人,用nanopi
我把就上面的程序放到esp32上跑的1.7秒
esp8089-spi.ko
# cp esp8089-spi.ko /lib/modules/5.2.0-licheepi-nano/
esp8089-spi.ko modules.alias modules.dep modules.symbols
# cp esp8089-spi.ko /lib/modules/5.2.0-licheepi-nano/
# modprobe esp8089-spi.ko
[ 33.725660] esp8089_spi: loading out-of-tree module taints kernel.
[ 33.777373] esp8089_spi: EAGLE DRIVER VER bdf5087c3deb
[ 34.401079] esp8089_spi: FAILED to find master
[ 34.424137] esp8089_spi: FAILED to create slave
[ 34.446956] esp8089_spi: I will go dead ##这句是我自己加的,打印出来了。
[ 34.468930] Unable to handle kernel NULL pointer dereference at virtual addre ss 000001a8
[ 34.513349] pgd = (ptrval)
[ 34.534138] [000001a8] *pgd=83216831, *pte=00000000, *ppte=00000000
[ 34.576547] Internal error: Oops: 17 [#1] ARM
[ 34.598981] Modules linked in: esp8089_spi(O+)
[ 34.621376] CPU: 0 PID: 119 Comm: modprobe Tainted: G
struct spi_device* sif_platform_new_device(void) {
master = spi_busnum_to_master(esp_board_spi_devices[0].bus_num);
if(!master)
printk("esp8089_spi: FAILED to find master\n");
spi = spi_new_device( master, esp_board_spi_devices );
if(!spi)
printk("esp8089_spi: FAILED to create slave\n");
printk("esp8089_spi: I will go dead\n");
if(spi_setup(spi))
printk("esp8089_spi: FAILED to setup slave\n");
return spi;
}
做一下标记
# cd /lib/modules/5.2.0-licheepi-nano/
# ls
esp8089-spi.ko
# depmod
# ls
esp8089-spi.ko modules.alias modules.dep modules.symbols
# modprobe esp8089-spi.ko
[ 59.630001] esp8089_spi: loading out-of-tree module taints kernel.
[ 59.682075] esp8089_spi: EAGLE DRIVER VER bdf5087c3deb
[ 60.305428] esp8089_spi: FAILED to find master
[ 60.328536] esp8089_spi: FAILED to create slave
[ 60.351455] Unable to handle kernel NULL pointer dereference at virtual address 000001a8
[ 60.396146] pgd = (ptrval)
[ 60.417170] [000001a8] *pgd=83254831, *pte=00000000, *ppte=00000000
[ 60.460005] Internal error: Oops: 17 [#1] ARM
[ 60.482718] Modules linked in: esp8089_spi(O+)
[ 60.505401] CPU: 0 PID: 122 Comm: modprobe Tainted: G O 5.2.0-lic heepi-nano #7
[ 60.550047] Hardware name: Allwinner suniv Family
[ 60.572839] PC is at spi_setup+0x4/0x164
[ 60.594988] LR is at sif_platform_new_device+0x38/0x88 [esp8089_spi]
[ 60.636851] pc : [<c0423420>] lr : [<bf00023c>] psr: 60000013
[ 60.678439] sp : c3217d7c ip : 00000000 fp : bf00f490
[ 60.701620] r10: 00000003 r9 : bf03b9e0 r8 : 00000000
[ 60.724673] r7 : bf03bba4 r6 : 00000000 r5 : bf00f400 r4 : bf03bba0
[ 60.766000] r3 : 1ea5b1d7 r2 : 1ea5b1d7 r1 : 60000093 r0 : 00000000
[ 60.807214] Flags: nZCv IRQs on FIQs on Mode SVC_32 ISA ARM Segment none
[ 60.849221] Control: 0005317f Table: 83220000 DAC: 00000051
[ 60.889929] Process modprobe (pid: 122, stack limit = 0x(ptrval))
[ 60.931219] Stack: (0xc3217d7c to 0xc3218000)
[ 60.953276] 7d60: bf03bba0
[ 60.996208] 7d80: bf00f400 bf00023c bf03bba0 bf00f000 00000000 bf0410a0 00000000 c0a3bf00
[ 61.039109] 7da0: c0a03028 ffffe000 bf041000 00000000 bf03b9e0 00000024 c0a03028 c0102cc0
[ 61.082670] 7dc0: c0a03028 00000000 c0a76050 c0700c80 c08318f0 00000000 c3fdee00 c0a36640
[ 61.126169] 7de0: c3217df8 c3fdee04 c3fdee44 1ea5b1d7 bf03ba28 20000013 c3fdf020 00080000
[ 61.170070] 7e00: 00000001 0080007f bf03b9e0 1ea5b1d7 bf03b9e0 00000001 c32cc320 00000001
[ 61.213941] 7e20: c3bfcba4 00000024 c0a03028 c016f088 00000001 c016e1bc c3217f38 00000001
[ 61.257947] 7e40: c3bfcb80 c016e1c4 bf03b9ec 00007fff bf03b9e0 c016ba84 00000041 bf03ba28
[ 61.302507] 7e60: 000d05f0 bf03bad4 bf047844 bf03b9e0 c4a50708 bf03bb78 bf042000 c0701b8c
[ 61.347315] 7e80: 00000000 00000000 ffffe000 00000000 bf000000 00000000 00000000 00000000
[ 61.392105] 7ea0: 00000000 00000000 00000000 00000000 6e72656b 00006c65 00000000 00000000
[ 61.436708] 7ec0: 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
[ 61.481700] 7ee0: 00000000 00000000 00000000 1ea5b1d7 7fffffff c0a03028 00000000 00000003
[ 61.526818] 7f00: 000d05f0 c0101208 c3216000 00000000 000cfc80 c016e980 7fffffff 00000000
[ 61.572258] 7f20: 00000003 00000000 00000000 c4a0c000 00044758 00000000 c4a19bba c4a46660
[ 61.617726] 7f40: c4a0c000 00044758 c4a501e0 c4a50080 c4a4a55c 0003c000 0003de40 00006604
[ 61.663561] 7f60: 0003f098 00000000 00000000 00000000 000065f4 00000020 00000021 00000017
[ 61.709573] 7f80: 00000000 00000011 00000000 1ea5b1d7 000d05a8 000d05f0 000d05a8 000d05f0
[ 61.755883] 7fa0: 0000017b c0101000 000d05f0 000d05a8 00000003 000d05f0 00000000 000d0690
[ 61.802241] 7fc0: 000d05f0 000d05a8 000d05f0 0000017b 000d0690 000d0690 00000000 000cfc80
[ 61.848786] 7fe0: bec1db28 bec1db18 000263ec b6f008a0 60000010 00000003 00000000 00000000
[ 61.895790] [<c0423420>] (spi_setup) from [<00000000>] (0x0)
[ 61.940327] Code: ebff0d15 eafffff9 c080caa4 e92d4030 (e59031a8)
[ 61.985796] ---[ end trace b39325ed7e1d8da4 ]---
Segmentation fault
我将dtsi修改如下:
在pio分组下
spi0_pc_pins: spi0-pc-pins {
pins = "PC0","PC1","PC2","PC3";
function = "spi0";
};
在soc分组下(我是从4.15内核设备树中复制过来的)
spi0: spi@1c05000 {
compatible = "allwinner,suniv-spi",
"allwinner,sun8i-h3-spi";
reg = <0x01c05000 0x1000>;
interrupts = <10>;
clocks = <&ccu CLK_BUS_SPI0>, <&ccu CLK_BUS_SPI0>;
clock-names = "ahb", "mod";
resets = <&ccu RST_BUS_SPI0>;
status = "disabled";
#address-cells = <1>;
#size-cells = <0>;
};
我将dts修改如下
&spi0 {
pinctrl-names = "default";
pinctrl-0 = <&spi0_pc_pins>;
status = "okay";
};
然后我将编译出来的esp8089-spi.ko放到了板子的文件系统/opt中。
执行modprobe esp8089-spi.ko
# modprobe esp8089-spi.ko
modprobe: can't change directory to '/lib/modules': No such file or directory
我手动mkdir创建了/lib目录的modules文件夹
再次modprobe esp8089-spi.ko
# modprobe esp8089-spi.ko
modprobe: can't change directory to '5.2.0-licheepi-nano': No such file or directory
我手动mkdir创建了/lib/modules/目录的5.2.0-licheepi-nano文件夹
再次modprobe esp8089-spi.ko
# modprobe esp8089-spi.ko
modprobe: can't open 'modules.dep': No such file or directory
这个modules.dep是什么鬼???去查查
先参考这个帖子进行一些配置看看 https://whycan.cn/t_3754.html。
先把SPI搞定可以用再说接wifi
首先对
*** WARNING: This kernel lacks wireless extensions.
Wireless drivers will not work properly.
进行分析。
查看esp8089-spi的Makefile,发现这么一句话,
config_check:
@if [ -z "$(CONFIG_WIRELESS_EXT)$(CONFIG_NET_RADIO)" ]; then \
echo; echo; \
echo "*** WARNING: This kernel lacks wireless extensions."; \
echo "Wireless drivers will not work properly."; \
echo; echo; \
fi
那么我们就去搜一下。
在内核目录使用make ARCH=arm CROSS_COMPILE=arm-linux- menuconfig
然后按下/键,进行搜索CONFIG_WIRELESS_EXT,
找到
Symbol: WIRELESS_EXT [=n ]
│ Type : bool
│ Defined at net/wireless/Kconfig:2
│ Depends on: NET [=y] && WIRELESS [=y]
然后我就去kernel/net/wireless/Kconfig中找WIRELESS_EXT
config WIRELESS_EXT
bool
更改为
config WIRELESS_EXT
def_bool y
就OK了,再次编译
dika@dika-pc:~/DVPM_linux-5.2/spiwifi/ESP8089-SPI-master$ make ARCH=arm CROSS_COMPILE=arm-linux-
make -C /home/dika/DVPM_linux-5.2/linux-nano-5.2-tf M=/home/dika/DVPM_linux-5.2/spiwifi/ESP8089-SPI-master
make[1]: Entering directory '/home/dika/DVPM_linux-5.2/linux-nano-5.2-tf'
CC [M] /home/dika/DVPM_linux-5.2/spiwifi/ESP8089-SPI-master/esp_debug.o
CC [M] /home/dika/DVPM_linux-5.2/spiwifi/ESP8089-SPI-master/sdio_sif_esp.o
CC [M] /home/dika/DVPM_linux-5.2/spiwifi/ESP8089-SPI-master/spi_sif_esp.o
CC [M] /home/dika/DVPM_linux-5.2/spiwifi/ESP8089-SPI-master/esp_io.o
CC [M] /home/dika/DVPM_linux-5.2/spiwifi/ESP8089-SPI-master/esp_file.o
CC [M] /home/dika/DVPM_linux-5.2/spiwifi/ESP8089-SPI-master/esp_main.o
In file included from ./include/linux/mm_types.h:12:0,
from ./include/linux/mmzone.h:21,
from ./include/linux/gfp.h:6,
from ./include/linux/slab.h:15,
from ./include/linux/crypto.h:19,
from ./include/crypto/hash.h:11,
from ./include/linux/uio.h:10,
from ./include/linux/socket.h:8,
from ./include/linux/compat.h:15,
from ./include/linux/ethtool.h:17,
from ./include/linux/netdevice.h:37,
from /home/dika/DVPM_linux-5.2/spiwifi/ESP8089-SPI-master/esp_main.c:17:
/home/dika/DVPM_linux-5.2/spiwifi/ESP8089-SPI-master/esp_main.c: In function ‘esp_pub_init_all’:
./include/linux/completion.h:54:2: warning: ISO C90 forbids mixed declarations and code [-Wdeclaration-after-statement]
struct completion work = COMPLETION_INITIALIZER(work)
^
./include/linux/completion.h:74:43: note: in expansion of macro ‘DECLARE_COMPLETION’
# define DECLARE_COMPLETION_ONSTACK(work) DECLARE_COMPLETION(work)
^~~~~~~~~~~~~~~~~~
/home/dika/DVPM_linux-5.2/spiwifi/ESP8089-SPI-master/esp_main.c:81:2: note: in expansion of macro ‘DECLARE_COMPLETION_ONSTACK’
DECLARE_COMPLETION_ONSTACK(complete);
^~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from /home/dika/DVPM_linux-5.2/spiwifi/ESP8089-SPI-master/esp_main.c:221:0:
/home/dika/DVPM_linux-5.2/spiwifi/ESP8089-SPI-master/eagle_fw1.h: In function ‘esp_download_fw’:
/home/dika/DVPM_linux-5.2/spiwifi/ESP8089-SPI-master/eagle_fw1.h:8:1: warning: ISO C90 forbids mixed declarations and code [-Wdeclaration-after-statement]
static u8 eagle_fw1[] =
^~~~~~
CC [M] /home/dika/DVPM_linux-5.2/spiwifi/ESP8089-SPI-master/esp_sip.o
CC [M] /home/dika/DVPM_linux-5.2/spiwifi/ESP8089-SPI-master/esp_ext.o
CC [M] /home/dika/DVPM_linux-5.2/spiwifi/ESP8089-SPI-master/esp_ctrl.o
CC [M] /home/dika/DVPM_linux-5.2/spiwifi/ESP8089-SPI-master/esp_mac80211.o
CC [M] /home/dika/DVPM_linux-5.2/spiwifi/ESP8089-SPI-master/esp_utils.o
CC [M] /home/dika/DVPM_linux-5.2/spiwifi/ESP8089-SPI-master/esp_pm.o
CC [M] /home/dika/DVPM_linux-5.2/spiwifi/ESP8089-SPI-master/testmode.o
LD [M] /home/dika/DVPM_linux-5.2/spiwifi/ESP8089-SPI-master/esp8089-spi.o
Building modules, stage 2.
MODPOST 1 modules
CC /home/dika/DVPM_linux-5.2/spiwifi/ESP8089-SPI-master/esp8089-spi.mod.o
LD [M] /home/dika/DVPM_linux-5.2/spiwifi/ESP8089-SPI-master/esp8089-spi.ko
make[1]: Leaving directory '/home/dika/DVPM_linux-5.2/linux-nano-5.2-tf'
没有刚才的提示信息了
dika@dika-pc:~/DVPM_linux-5.2/spiwifi/ESP8089-SPI-master$ make ARCH=arm CROSS_COMPILE=arm-linux-
*** WARNING: This kernel lacks wireless extensions.
Wireless drivers will not work properly.
make -C /home/dika/DVPM_linux-5.2/linux-nano-5.2-tf M=/home/dika/DVPM_linux-5.2/spiwifi/ESP8089-SPI-master
make[1]: Entering directory '/home/dika/DVPM_linux-5.2/linux-nano-5.2-tf'
CC [M] /home/dika/DVPM_linux-5.2/spiwifi/ESP8089-SPI-master/esp_debug.o
CC [M] /home/dika/DVPM_linux-5.2/spiwifi/ESP8089-SPI-master/sdio_sif_esp.o
CC [M] /home/dika/DVPM_linux-5.2/spiwifi/ESP8089-SPI-master/spi_sif_esp.o
CC [M] /home/dika/DVPM_linux-5.2/spiwifi/ESP8089-SPI-master/esp_io.o
CC [M] /home/dika/DVPM_linux-5.2/spiwifi/ESP8089-SPI-master/esp_file.o
CC [M] /home/dika/DVPM_linux-5.2/spiwifi/ESP8089-SPI-master/esp_main.o
In file included from ./include/linux/mm_types.h:12:0,
from ./include/linux/mmzone.h:21,
from ./include/linux/gfp.h:6,
from ./include/linux/slab.h:15,
from ./include/linux/crypto.h:19,
from ./include/crypto/hash.h:11,
from ./include/linux/uio.h:10,
from ./include/linux/socket.h:8,
from ./include/linux/compat.h:15,
from ./include/linux/ethtool.h:17,
from ./include/linux/netdevice.h:37,
from /home/dika/DVPM_linux-5.2/spiwifi/ESP8089-SPI-master/esp_main.c:17:
/home/dika/DVPM_linux-5.2/spiwifi/ESP8089-SPI-master/esp_main.c: In function ‘esp_pub_init_all’:
./include/linux/completion.h:54:2: warning: ISO C90 forbids mixed declarations and code [-Wdeclaration-after-statement]
struct completion work = COMPLETION_INITIALIZER(work)
^
./include/linux/completion.h:74:43: note: in expansion of macro ‘DECLARE_COMPLETION’
# define DECLARE_COMPLETION_ONSTACK(work) DECLARE_COMPLETION(work)
^~~~~~~~~~~~~~~~~~
/home/dika/DVPM_linux-5.2/spiwifi/ESP8089-SPI-master/esp_main.c:81:2: note: in expansion of macro ‘DECLARE_COMPLETION_ONSTACK’
DECLARE_COMPLETION_ONSTACK(complete);
^~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from /home/dika/DVPM_linux-5.2/spiwifi/ESP8089-SPI-master/esp_main.c:221:0:
/home/dika/DVPM_linux-5.2/spiwifi/ESP8089-SPI-master/eagle_fw1.h: In function ‘esp_download_fw’:
/home/dika/DVPM_linux-5.2/spiwifi/ESP8089-SPI-master/eagle_fw1.h:8:1: warning: ISO C90 forbids mixed declarations and code [-Wdeclaration-after-statement]
static u8 eagle_fw1[] =
^~~~~~
CC [M] /home/dika/DVPM_linux-5.2/spiwifi/ESP8089-SPI-master/esp_sip.o
CC [M] /home/dika/DVPM_linux-5.2/spiwifi/ESP8089-SPI-master/esp_ext.o
CC [M] /home/dika/DVPM_linux-5.2/spiwifi/ESP8089-SPI-master/esp_ctrl.o
CC [M] /home/dika/DVPM_linux-5.2/spiwifi/ESP8089-SPI-master/esp_mac80211.o
CC [M] /home/dika/DVPM_linux-5.2/spiwifi/ESP8089-SPI-master/esp_utils.o
CC [M] /home/dika/DVPM_linux-5.2/spiwifi/ESP8089-SPI-master/esp_pm.o
CC [M] /home/dika/DVPM_linux-5.2/spiwifi/ESP8089-SPI-master/testmode.o
LD [M] /home/dika/DVPM_linux-5.2/spiwifi/ESP8089-SPI-master/esp8089-spi.o
Building modules, stage 2.
MODPOST 1 modules
CC /home/dika/DVPM_linux-5.2/spiwifi/ESP8089-SPI-master/esp8089-spi.mod.o
LD [M] /home/dika/DVPM_linux-5.2/spiwifi/ESP8089-SPI-master/esp8089-spi.ko
make[1]: Leaving directory '/home/dika/DVPM_linux-5.2/linux-nano-5.2-tf'
这是编译时的信息
$ grep ieee80211_rx_napi -r .
./net/mac80211/rx.c:void ieee80211_rx_napi(struct ieee80211_hw *hw, struct ieee80211_sta *pubsta,
./net/mac80211/rx.c:EXPORT_SYMBOL(ieee80211_rx_napi);
./include/net/mac80211.h: * ieee80211_rx_napi - receive frame from NAPI context要使能 网络驱动里面的 80211
多谢指点,今天试一下。
进度在此更新
从网上找了一份esp8089-spi的驱动,但是编译失败了。
源码位置在这。
https://github.com/notabucketofspam/ESP8089-SPI/blob/master/README.md
文中说,可以使用ESP8266或者ESP8089都是可以的。只不过ESP8266需要把SPI flash拆掉。
咱们先编译一下驱动吧。
我改了Makefile的KBUILD,指向F1C200S linux-5.2源码目录。
使用make ARCH=arm CROSS_COMPILE=arm-linux-命令进行编译,得来如下结果:
这是什么原因?
还有他居然说这个内核不支持无线?什么鬼
以下由 @哇酷小二 2020-05-09 添加:
------------------------------------------
不方便git clone的朋友本站下载: ESP8089-SPI_20200509.7z
屏终于亮了,
怕以后忘了,或者谁用这个屏,把参数放这!
屏的型号是D300N9307V0。
RGB接口只能是RGB565,需要在厂家给的初始化代码中增加,以更改为RGB565模式(请增加在最后的delay前面)
SPI_writecom(0x3A);
SPI_writedat(0x50);
uboot中的屏参数如下:
x:480,y:854,depth:16,pclk_khz:27000,le:43,ri:8,up:42,lo:4,hs:2,vs:10,sync:3,vmode:0
另再次记一下屏的参数名称对应
#define Hsync_Back_Porh 43 left_margin
#define Hsync_Front_Porh 8 right_margin
#define Hsync_Pulse_width 2 hsync_len
#define Vsync_Back_Porh 42 upper_margin
#define Vsync_Front_Porh 4 lower_margin
#define Vsync_Pulse_width 10 vsync_len
原来做的魔方机是用的友善之臂的nanopi M2,是三星S5P4418处理器。
还原速度在3~5秒左右。移步www.dika.ren观看还原效果。
ARM板子很贵嘛。
今天发现原来核心算法好像没有用多少内存,于是搞到单片机上试试,算法是用C++写的。我先改成C语言。
首先加到stm32的工程里编译成功,但是手边没有stm32,没办法试验。
手边有8266和esp32,
直接用arduino ide吧,也支持c++,这下就省事多了。
先用8266跑起来,
一会就挂了,后来我搜了搜,原来是软件看门狗复位了。需要用delay来喂狗,
在循环部分加了delay(10)。最后执行完是28秒,天哪呐。
然后我找到了如如何把软件看门狗关闭,就在80MHz运行 能在6秒多出结果。
在160MHz运行,能在3秒多出结果。
使用ESP32,能在1.7秒出结果。
算法里我写了一个固定的打乱的魔方序列,实际上任何魔方的状态都可以,估计2秒以内都能出30步以内的结果
第一行我会背,没错
@迪卡,USB用你那个驱动好像有问题,认不同芯片和Flash.用了zadig-2.3的驱动就可以了。
用driver文件下驱动也认出来了,是以下状态,但是用不了。
https://whycan.cn/files/members/2850/USB_Device(VID_1f3a_PID_efe8)1.png使用https://whycan.cn/files/members/2850/none_20200403-1055.png
https://whycan.cn/files/members/2850/USB_Device(VID_1f3a_PID_efe8)2.png
可以用就行啦,用zadig装也行。
我就是提取的zadig的驱动,可能不同电脑,签名啥的问题导致一些问题。
zadig也挺好,下次把这个加到软件包里
激光雷达可能满足lz的要求,只是提供思路,lz的精度要求太高估计价格都得是6位数,以下是我搜到的自动驾驶的例子
https://whycan.cn/files/members/1315/none_20200326-2050.png
https://item.taobao.com/item.htm?spm=a230r.1.14.22.560648b3JdxsV2&id=591094709862&ns=1&abbucket=18#detail
精度2cm.....
我们想达到2mm,这样才能连大卡车上的螺丝都能扫描到。
大家都知道热成像模块吧。
获得的每一个点都是温度。
我想要的面阵相机就是,每一个像素点都有深度信息,也就是距离相机的垂直距离。
我想用来对路过的大卡车进行扫描,把最外边的轮廓扫描出来,细节到这辆大卡车油箱盖有没有盖上,少不少螺丝。
现在市面上的深度相机有3种,
1.双目摄像头,+IR辅助,对于室外的环境有些垃圾
2.结构光,只适合室内静态
3.TOF相机,这个感觉应该会适合。
好像还有固体雷达。
我的摄像头与大客车的间距在1~2米,测量精度想要达到毫米级。
大佬们有推荐吗?
手上有一个小觅的双目摄像头,太垃圾了,很多轮廓都识别不出来,屎一样...可能人家只是用来辅助AGV用的。
DKTool
下一版
增加自动更新功能(用上我的服务器 www.dika.ren)
修复路径不能有空格的bug。
tf或spi flash固件制作功能。
迪卡做过了很多版PCB了吧, 老马失蹄
淘宝晶振买错了,买成了8M的,,
连上串口把波特率改为38400,就显示DDR初始化失败的信息。
BOOT0 is starting!
boot0 commit : 79d2fe0388f5367fe2f42cc3eb1db9113426c15d
boot0 version : 4.0
run key detect boot0
do_key_test
key pressed value=0x00000006
reg_val=0x00000000----------------------
initializing SDRAM Fail.