WhyCan Forum(哇酷开发者社区)

我们能随心所欲"有问题百度(谷歌)一下", 这得感谢为中文互联网持续输出优质内容的各位老铁们。 QQ: 516333132, 微信(wechat): whycan_cn (哇酷网/挖坑网/填坑网) service@whycan.cn

您尚未登录。

#1 2020-04-18 22:20:29

迪卡
会员
所在地: 河北
注册时间: 2018-11-02
累计积分: 757
个人网站

众人拾柴-F1C200S通过SPI使用ESP8089或ESP8266做无线网卡

从网上找了一份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-命令进行编译,得来如下结果:
syteco.png

这是什么原因?
还有他居然说这个内核不支持无线?什么鬼







以下由 @哇酷小二 2020-05-09 添加:
------------------------------------------
不方便git clone的朋友本站下载: ESP8089-SPI_20200509.7z

离线

#2 2020-04-18 22:34:22

kekemuyu
会员
注册时间: 2018-12-13
累计积分: 545

Re: 众人拾柴-F1C200S通过SPI使用ESP8089或ESP8266做无线网卡

最近也在研究linux驱动,发现驱动编写真不是人干的,涉及到的东西太多了,编译出错了,安装驱动出错了,根本就无从下手,想要彻底搞明白,还得从linux源码看起。

离线

#3 2020-04-18 22:49:07

黄粱梦
会员
注册时间: 2020-03-17
累计积分: 24

Re: 众人拾柴-F1C200S通过SPI使用ESP8089或ESP8266做无线网卡

$ 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

离线

#4 2020-04-19 06:18:13

迪卡
会员
所在地: 河北
注册时间: 2018-11-02
累计积分: 757
个人网站

Re: 众人拾柴-F1C200S通过SPI使用ESP8089或ESP8266做无线网卡

黄粱梦 说:

$ 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

多谢指点,今天试一下。
进度在此更新

离线

#5 2020-04-19 13:22:28

迪卡
会员
所在地: 河北
注册时间: 2018-11-02
累计积分: 757
个人网站

Re: 众人拾柴-F1C200S通过SPI使用ESP8089或ESP8266做无线网卡

多谢大佬,勾选很多80211的东西,编译内核之后,再次编译驱动成功出了.ko。
有时间试一下

离线

#6 2020-04-19 14:47:27

迪卡
会员
所在地: 河北
注册时间: 2018-11-02
累计积分: 757
个人网站

Re: 众人拾柴-F1C200S通过SPI使用ESP8089或ESP8266做无线网卡

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'

这是编译时的信息

离线

#7 2020-04-19 15:15:39

迪卡
会员
所在地: 河北
注册时间: 2018-11-02
累计积分: 757
个人网站

Re: 众人拾柴-F1C200S通过SPI使用ESP8089或ESP8266做无线网卡

首先对

*** 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'

没有刚才的提示信息了

离线

#8 2020-04-19 15:22:18

迪卡
会员
所在地: 河北
注册时间: 2018-11-02
累计积分: 757
个人网站

Re: 众人拾柴-F1C200S通过SPI使用ESP8089或ESP8266做无线网卡

几个warning信息不用管的,

error:ISO C90 forbids mixed declarations 云云

说的就是,禁止将声明和代码混合,就是说要先声明,再用,不用管的,
意思就是

int a ;
a = getnum();
int b ;
b = getnum();

这样不行,
你需要这样:

int a ;
int b ;
a = getnum();
b = getnum();

离线

#9 2020-04-19 19:20:13

迪卡
会员
所在地: 河北
注册时间: 2018-11-02
累计积分: 757
个人网站

Re: 众人拾柴-F1C200S通过SPI使用ESP8089或ESP8266做无线网卡

如果我想使用SPI接口接WIFI的话,是不是应该在设备树里说明呢?设备树里该如何去写?

离线

#10 2020-04-19 19:34:20

迪卡
会员
所在地: 河北
注册时间: 2018-11-02
累计积分: 757
个人网站

Re: 众人拾柴-F1C200S通过SPI使用ESP8089或ESP8266做无线网卡

先参考这个帖子进行一些配置看看 https://whycan.cn/t_3754.html。
先把SPI搞定可以用再说接wifi

离线

#11 2020-04-19 19:42:15

黄粱梦
会员
注册时间: 2020-03-17
累计积分: 24

Re: 众人拾柴-F1C200S通过SPI使用ESP8089或ESP8266做无线网卡

接到spi flash那组引脚,
dts写到 spi 节点下面就可以了.

离线

#12 2020-04-19 20:09:39

迪卡
会员
所在地: 河北
注册时间: 2018-11-02
累计积分: 757
个人网站

Re: 众人拾柴-F1C200S通过SPI使用ESP8089或ESP8266做无线网卡

我将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是什么鬼???去查查

离线

#13 2020-04-19 20:15:35

迪卡
会员
所在地: 河北
注册时间: 2018-11-02
累计积分: 757
个人网站

Re: 众人拾柴-F1C200S通过SPI使用ESP8089或ESP8266做无线网卡

从这个博客中看https://blog.csdn.net/qq_39101111/article/details/78773362
好像是缺东西,depmod,这个指令我的文件系统没有,那么我就再编译一遍buildroot,添加上这个指令。
同时要记得,手动将esp8089-spi.ko放到/lib/modules/5.2.0-licheepi-nano目录中。
我先去编译buildroot了,
这段时候可以去看个电视

离线

#14 2020-04-19 21:10:33

rongwinzip
会员
注册时间: 2020-03-14
累计积分: 35

Re: 众人拾柴-F1C200S通过SPI使用ESP8089或ESP8266做无线网卡

据说回复才有积分,我来支持大师

离线

#15 2020-04-19 21:13:34

迪卡
会员
所在地: 河北
注册时间: 2018-11-02
累计积分: 757
个人网站

Re: 众人拾柴-F1C200S通过SPI使用ESP8089或ESP8266做无线网卡

做一下标记

# 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

离线

#16 2020-04-19 22:42:05

rongwinzip
会员
注册时间: 2020-03-14
累计积分: 35

Re: 众人拾柴-F1C200S通过SPI使用ESP8089或ESP8266做无线网卡

[   60.305428] esp8089_spi: FAILED to find master
SPI 没通的感觉

离线

#17 2020-04-20 13:37:33

asdfwyg
会员
注册时间: 2020-04-10
累计积分: 21

Re: 众人拾柴-F1C200S通过SPI使用ESP8089或ESP8266做无线网卡

esp8266是串口的吧,速度肯定很慢,还使用usb或者sdio的好。

离线

#18 2020-04-20 21:22:41

迪卡
会员
所在地: 河北
注册时间: 2018-11-02
累计积分: 757
个人网站

Re: 众人拾柴-F1C200S通过SPI使用ESP8089或ESP8266做无线网卡

先把/dev/spixxx搞出来再说,应该是要研究一下设备树,对设备树不太懂

离线

#19 2020-04-20 21:32:30

xk100
会员
注册时间: 2018-12-13
累计积分: 40

Re: 众人拾柴-F1C200S通过SPI使用ESP8089或ESP8266做无线网卡

看的这眼花啊,感觉驱动这东西真的太深了。完全没法玩。

离线

#20 2020-04-20 21:34:33

飞翔工控
会员
注册时间: 2019-11-21
累计积分: 73

Re: 众人拾柴-F1C200S通过SPI使用ESP8089或ESP8266做无线网卡

迪卡 说:

先把/dev/spixxx搞出来再说,应该是要研究一下设备树,对设备树不太懂

驱动spi网卡, 不用搞出 /dev/spi0.0

除非你想应用层往 spi 设备写数据.

离线

#21 2020-04-20 21:41:15

arychen
会员
注册时间: 2019-04-06
累计积分: 124

Re: 众人拾柴-F1C200S通过SPI使用ESP8089或ESP8266做无线网卡

速度怎么样?   melis上好像大家用的不多,有没有人扩展到melis上的。

离线

#22 2020-04-20 22:25:08

迪卡
会员
所在地: 河北
注册时间: 2018-11-02
累计积分: 757
个人网站

Re: 众人拾柴-F1C200S通过SPI使用ESP8089或ESP8266做无线网卡

飞翔工控 说:

驱动spi网卡, 不用搞出 /dev/spi0.0

除非你想应用层往 spi 设备写数据.

多谢

离线

#23 2020-04-20 22:26:14

迪卡
会员
所在地: 河北
注册时间: 2018-11-02
累计积分: 757
个人网站

Re: 众人拾柴-F1C200S通过SPI使用ESP8089或ESP8266做无线网卡

我已经弄出来了/dev/spi0.0,
好像没啥用,
挂载模块还是一样的信息,因为我没有接WIFI模块。
今天我把WIFI模块弄好了,明天连上试试

离线

#24 2020-04-20 22:27:36

迪卡
会员
所在地: 河北
注册时间: 2018-11-02
累计积分: 757
个人网站

Re: 众人拾柴-F1C200S通过SPI使用ESP8089或ESP8266做无线网卡

-384ef6df1d899013.jpg50fac5bf889cabdd.jpg

离线

#25 2020-04-20 22:28:39

迪卡
会员
所在地: 河北
注册时间: 2018-11-02
累计积分: 757
个人网站

Re: 众人拾柴-F1C200S通过SPI使用ESP8089或ESP8266做无线网卡

asdfwyg 说:

esp8266是串口的吧,速度肯定很慢,还使用usb或者sdio的好。

不慢,能稳定1.2MB/S,很快的

离线

#26 2020-04-20 22:30:20

迪卡
会员
所在地: 河北
注册时间: 2018-11-02
累计积分: 757
个人网站

Re: 众人拾柴-F1C200S通过SPI使用ESP8089或ESP8266做无线网卡

arychen 说:

速度怎么样?   melis上好像大家用的不多,有没有人扩展到melis上的。

速度1MBytes/S以上,速度绝对可以

离线

#27 2020-04-20 22:37:41

kekemuyu
会员
注册时间: 2018-12-13
累计积分: 545

Re: 众人拾柴-F1C200S通过SPI使用ESP8089或ESP8266做无线网卡

迪卡 说:

从这个博客中看https://blog.csdn.net/qq_39101111/article/details/78773362
好像是缺东西,depmod,这个指令我的文件系统没有,那么我就再编译一遍buildroot,添加上这个指令。
同时要记得,手动将esp8089-spi.ko放到/lib/modules/5.2.0-licheepi-nano目录中。
我先去编译buildroot了,
这段时候可以去看个电视

depmod加进去就可以了吗?编译好的驱动可以分享吗?

离线

#28 2020-04-21 21:26:04

迪卡
会员
所在地: 河北
注册时间: 2018-11-02
累计积分: 757
个人网站

Re: 众人拾柴-F1C200S通过SPI使用ESP8089或ESP8266做无线网卡

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;
}

离线

#29 2020-04-21 21:26:49

迪卡
会员
所在地: 河北
注册时间: 2018-11-02
累计积分: 757
个人网站

Re: 众人拾柴-F1C200S通过SPI使用ESP8089或ESP8266做无线网卡

说明spi_new_device有问题,这个spi值不能setup

离线

#30 2020-04-21 21:28:27

迪卡
会员
所在地: 河北
注册时间: 2018-11-02
累计积分: 757
个人网站

Re: 众人拾柴-F1C200S通过SPI使用ESP8089或ESP8266做无线网卡

1) 首先申请设备驱动结构体。
        2) 调用spi_setup(spi)函数对设备信息初始化。
因为申请的设备驱动结构体有问题。
明天再说。

离线

#31 2020-04-21 22:51:39

迪卡
会员
所在地: 河北
注册时间: 2018-11-02
累计积分: 757
个人网站

Re: 众人拾柴-F1C200S通过SPI使用ESP8089或ESP8266做无线网卡

有人一起吗?
我感觉是不是github给的引脚定义是错的呀,
我搜了搜树莓派的引脚定义,有一个20是GND呀,怎么可能是spi的一个脚呢?
还有对826与主控连接的cs和miso mosi对不上,感觉github是瞎写的吧

离线

#32 2020-04-22 11:45:30

czllong1989
会员
注册时间: 2019-10-31
累计积分: 7

Re: 众人拾柴-F1C200S通过SPI使用ESP8089或ESP8266做无线网卡

这个用esp8266是真香 量大 便宜 1MB/s速度很快了 一般的应用都可以了

离线

#33 2020-04-23 08:04:10

迪卡
会员
所在地: 河北
注册时间: 2018-11-02
累计积分: 757
个人网站

Re: 众人拾柴-F1C200S通过SPI使用ESP8089或ESP8266做无线网卡

像大佬求助,是不是github上用的接口是错的,不是spi呀,我该从哪里找到网卡驱动正确spi接口定义

离线

#34 2020-04-23 19:02:20

迪卡
会员
所在地: 河北
注册时间: 2018-11-02
累计积分: 757
个人网站

Re: 众人拾柴-F1C200S通过SPI使用ESP8089或ESP8266做无线网卡

还是没有人,看来我这个项目太高端了...

离线

#35 2020-04-23 21:26:17

迪卡
会员
所在地: 河北
注册时间: 2018-11-02
累计积分: 757
个人网站

Re: 众人拾柴-F1C200S通过SPI使用ESP8089或ESP8266做无线网卡

从串口信息来看,是这段代码出了问题,我们一个个分析

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 了

离线

#36 2020-04-23 21:38:54

迪卡
会员
所在地: 河北
注册时间: 2018-11-02
累计积分: 757
个人网站

Re: 众人拾柴-F1C200S通过SPI使用ESP8089或ESP8266做无线网卡

将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)

离线

#37 2020-04-23 21:47:11

迪卡
会员
所在地: 河北
注册时间: 2018-11-02
累计积分: 757
个人网站

Re: 众人拾柴-F1C200S通过SPI使用ESP8089或ESP8266做无线网卡

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,  

离线

#38 2020-04-23 21:53:14

迪卡
会员
所在地: 河北
注册时间: 2018-11-02
累计积分: 757
个人网站

Re: 众人拾柴-F1C200S通过SPI使用ESP8089或ESP8266做无线网卡

今天就先到这。
记录一下我今天干了啥,
1,修改设备树,把SPI让出来,不能占用SPI,要okay的状态
2,驱动中的busnum改为0

离线

#39 2020-04-23 21:54:50

迪卡
会员
所在地: 河北
注册时间: 2018-11-02
累计积分: 757
个人网站

Re: 众人拾柴-F1C200S通过SPI使用ESP8089或ESP8266做无线网卡

完整版打印日志如下

# 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
#

离线

#40 2020-04-23 21:55:36

迪卡
会员
所在地: 河北
注册时间: 2018-11-02
累计积分: 757
个人网站

Re: 众人拾柴-F1C200S通过SPI使用ESP8089或ESP8266做无线网卡

下一步就是,改gpio,
驱动需要控制GPIO来复位ESP8266

离线

#41 2020-04-23 22:11:02

xyyangkun
会员
注册时间: 2018-03-14
累计积分: 10

Re: 众人拾柴-F1C200S通过SPI使用ESP8089或ESP8266做无线网卡

F1C100S的spi操作与树莓派相同吗? 这个移植的关键是把spi通信搞通吧

离线

#42 2020-04-23 22:18:48

迪卡
会员
所在地: 河北
注册时间: 2018-11-02
累计积分: 757
个人网站

Re: 众人拾柴-F1C200S通过SPI使用ESP8089或ESP8266做无线网卡

xyyangkun 说:

F1C100S的spi操作与树莓派相同吗? 这个移植的关键是把spi通信搞通吧

现在有/dev/spi0.0节点呢,spi应该可以用了。
现在不知道esp8266与板子连接的spi是哪几个脚。
因为github上那个人用的不是8266的spi脚

离线

#43 2020-04-24 08:58:22

jambogo
会员
注册时间: 2020-03-27
累计积分: 7

Re: 众人拾柴-F1C200S通过SPI使用ESP8089或ESP8266做无线网卡

mark 一下,多一种接口方案增加接口灵活性。

离线

#44 2020-04-25 08:49:09

迪卡
会员
所在地: 河北
注册时间: 2018-11-02
累计积分: 757
个人网站

Re: 众人拾柴-F1C200S通过SPI使用ESP8089或ESP8266做无线网卡

离线

#45 2020-04-25 11:24:10

xyyangkun
会员
注册时间: 2018-03-14
累计积分: 10

Re: 众人拾柴-F1C200S通过SPI使用ESP8089或ESP8266做无线网卡

迪卡 说:

现在有/dev/spi0.0节点呢,spi应该可以用了。
现在不知道esp8266与板子连接的spi是哪几个脚。
因为github上那个人用的不是8266的spi脚

这个是不是需要通过spi把8266的固件传过去后,8266才可以正常工作?我看这个代码里好像没有8266的固件。
这一步考虑没?

离线

#46 2020-04-25 11:30:53

迪卡
会员
所在地: 河北
注册时间: 2018-11-02
累计积分: 757
个人网站

Re: 众人拾柴-F1C200S通过SPI使用ESP8089或ESP8266做无线网卡

xyyangkun 说:

这个是不是需要通过spi把8266的固件传过去后,8266才可以正常工作?我看这个代码里好像没有8266的固件。
这一步考虑没?

代码里有固件的,就是那3个.h文件

离线

#47 2020-04-25 22:06:56

迪卡
会员
所在地: 河北
注册时间: 2018-11-02
累计积分: 757
个人网站

Re: 众人拾柴-F1C200S通过SPI使用ESP8089或ESP8266做无线网卡

里面是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);
 

离线

#48 2020-04-25 22:07:32

迪卡
会员
所在地: 河北
注册时间: 2018-11-02
累计积分: 757
个人网站

Re: 众人拾柴-F1C200S通过SPI使用ESP8089或ESP8266做无线网卡

里面应该是树莓派的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);

离线

#49 2020-04-25 22:18:55

迪卡
会员
所在地: 河北
注册时间: 2018-11-02
累计积分: 757
个人网站

Re: 众人拾柴-F1C200S通过SPI使用ESP8089或ESP8266做无线网卡

那么,需要调的有2项,
1.找个IO用做esp_reset_gpio,然后参照驱动自己写.c操作IO,使用万用表测量IO状态,看是否能动。
2.连接spi的4个io到arduino 的adc脚,实时读取信号状态,打印到串口绘图器。挂载驱动模块,看是否有信号。

离线

#50 2020-04-25 22:19:37

迪卡
会员
所在地: 河北
注册时间: 2018-11-02
累计积分: 757
个人网站

Re: 众人拾柴-F1C200S通过SPI使用ESP8089或ESP8266做无线网卡

有大佬做起了吗?
坑我已经挖好了。

离线

#51 2020-04-26 11:22:57

迪卡
会员
所在地: 河北
注册时间: 2018-11-02
累计积分: 757
个人网站

Re: 众人拾柴-F1C200S通过SPI使用ESP8089或ESP8266做无线网卡

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

离线

#52 2020-04-26 11:24:34

迪卡
会员
所在地: 河北
注册时间: 2018-11-02
累计积分: 757
个人网站

Re: 众人拾柴-F1C200S通过SPI使用ESP8089或ESP8266做无线网卡

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

离线

#53 2020-04-26 11:35:12

迪卡
会员
所在地: 河北
注册时间: 2018-11-02
累计积分: 757
个人网站

Re: 众人拾柴-F1C200S通过SPI使用ESP8089或ESP8266做无线网卡

目前卡住的位置,还没有达到把固件上传到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);

离线

#54 2020-04-26 11:40:32

迪卡
会员
所在地: 河北
注册时间: 2018-11-02
累计积分: 757
个人网站

Re: 众人拾柴-F1C200S通过SPI使用ESP8089或ESP8266做无线网卡

离线

#55 2020-04-26 11:42:03

迪卡
会员
所在地: 河北
注册时间: 2018-11-02
累计积分: 757
个人网站

Re: 众人拾柴-F1C200S通过SPI使用ESP8089或ESP8266做无线网卡

离线

#56 2020-04-26 16:08:38

迪卡
会员
所在地: 河北
注册时间: 2018-11-02
累计积分: 757
个人网站

Re: 众人拾柴-F1C200S通过SPI使用ESP8089或ESP8266做无线网卡

什么鬼??

[   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

离线

#57 2020-04-26 16:09:29

迪卡
会员
所在地: 河北
注册时间: 2018-11-02
累计积分: 757
个人网站

Re: 众人拾柴-F1C200S通过SPI使用ESP8089或ESP8266做无线网卡

看起来固件是下进去了,但是中断脚设置不行,还得研究一下中断脚

离线

#58 2020-04-26 16:23:29

迪卡
会员
所在地: 河北
注册时间: 2018-11-02
累计积分: 757
个人网站

Re: 众人拾柴-F1C200S通过SPI使用ESP8089或ESP8266做无线网卡

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]

离线

#59 2020-04-26 16:30:34

迪卡
会员
所在地: 河北
注册时间: 2018-11-02
累计积分: 757
个人网站

Re: 众人拾柴-F1C200S通过SPI使用ESP8089或ESP8266做无线网卡

请问,这是跑起来了吗?

# 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)

#

离线

#60 2020-04-26 16:36:48

迪卡
会员
所在地: 河北
注册时间: 2018-11-02
累计积分: 757
个人网站

Re: 众人拾柴-F1C200S通过SPI使用ESP8089或ESP8266做无线网卡

先简单总结一下把,
1.要改为SPI模式
2.spi的模式要选对
3.需要2个IO
4.需要配置中断脚
5.

离线

#61 2020-04-26 16:46:52

hameyou
会员
注册时间: 2018-04-15
累计积分: 87

Re: 众人拾柴-F1C200S通过SPI使用ESP8089或ESP8266做无线网卡

楼主真有耐心,不错赞一个

离线

#62 2020-04-26 17:04:18

迪卡
会员
所在地: 河北
注册时间: 2018-11-02
累计积分: 757
个人网站

Re: 众人拾柴-F1C200S通过SPI使用ESP8089或ESP8266做无线网卡

大佬告诉我配置wifi用iw,,装一个

离线

#63 2020-04-26 17:25:04

迪卡
会员
所在地: 河北
注册时间: 2018-11-02
累计积分: 757
个人网站

Re: 众人拾柴-F1C200S通过SPI使用ESP8089或ESP8266做无线网卡

能搜到WIFI了

离线

#64 2020-04-26 20:19:45

XZHDJH
会员
注册时间: 2020-01-18
累计积分: 29

Re: 众人拾柴-F1C200S通过SPI使用ESP8089或ESP8266做无线网卡

拾柴来了

离线

#65 2020-04-26 21:15:00

迪卡
会员
所在地: 河北
注册时间: 2018-11-02
累计积分: 757
个人网站

Re: 众人拾柴-F1C200S通过SPI使用ESP8089或ESP8266做无线网卡

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

连上了我手机的热点

离线

#66 2020-04-26 21:26:35

迪卡
会员
所在地: 河北
注册时间: 2018-11-02
累计积分: 757
个人网站

Re: 众人拾柴-F1C200S通过SPI使用ESP8089或ESP8266做无线网卡

同一局域网可以互相ping,但是没有dns东西,没放访问外网

离线

#67 2020-04-26 22:10:02

迪卡
会员
所在地: 河北
注册时间: 2018-11-02
累计积分: 757
个人网站

Re: 众人拾柴-F1C200S通过SPI使用ESP8089或ESP8266做无线网卡

buildroot制作出来的最小rootfs真是啥都缺.....

离线

#68 2020-04-26 22:21:36

迪卡
会员
所在地: 河北
注册时间: 2018-11-02
累计积分: 757
个人网站

Re: 众人拾柴-F1C200S通过SPI使用ESP8089或ESP8266做无线网卡

# while [ 1 ]; do
> data;wget ftp://192.168.43.1:3721/Downloads/DKTool_0229.rar -O /dev/null ;data
;
> done;

离线

#69 2020-04-26 22:27:25

迪卡
会员
所在地: 河北
注册时间: 2018-11-02
累计积分: 757
个人网站

Re: 众人拾柴-F1C200S通过SPI使用ESP8089或ESP8266做无线网卡

QQ截图20200426222516.png
使用wget 下载手机ftp的DKTool文件
手机显示的速度大约在350KB/S,
我使用SPI的速度是1MHZ

离线

#70 2020-04-27 00:19:29

hzqlz
会员
注册时间: 2018-03-23
累计积分: 87

Re: 众人拾柴-F1C200S通过SPI使用ESP8089或ESP8266做无线网卡

厉害厉害,持续关注,我一直用ESP8266做开发,还没有大佬这钻研精神

离线

#71 2020-04-27 07:48:31

迪卡
会员
所在地: 河北
注册时间: 2018-11-02
累计积分: 757
个人网站

Re: 众人拾柴-F1C200S通过SPI使用ESP8089或ESP8266做无线网卡

#cd /lib/modules/5.2.0-licheepi-nano/
#modprobe esp8089-spi.ko
#ifconfig wlan0 up
#iw wlan0 connect huawei3
#ifconfig wlan0 192.168.43.45
# while [ 1 ]; do
> data;wget ftp://192.168.43.1:3721/Downloads/DKTool_0229.rar -O /dev/null ;data;
> done;

离线

#72 2020-04-27 07:50:19

迪卡
会员
所在地: 河北
注册时间: 2018-11-02
累计积分: 757
个人网站

Re: 众人拾柴-F1C200S通过SPI使用ESP8089或ESP8266做无线网卡

原来昨天测试350KB/s的SPI速度是10MHz,
今天测试了一下30MHz,在800KB/S左右

离线

#73 2020-04-27 07:59:03

迪卡
会员
所在地: 河北
注册时间: 2018-11-02
累计积分: 757
个人网站

Re: 众人拾柴-F1C200S通过SPI使用ESP8089或ESP8266做无线网卡

50MHz的SPI 初始化失败,
不能超30MHz,

最近编辑记录 迪卡 (2020-04-27 08:02:38)

离线

#74 2020-04-27 08:28:23

迪卡
会员
所在地: 河北
注册时间: 2018-11-02
累计积分: 757
个人网站

Re: 众人拾柴-F1C200S通过SPI使用ESP8089或ESP8266做无线网卡

QQ截图20200427082723.png
使用30MHz SPI
小测,
中间断了一次是因为手机APP退到了后台

离线

#75 2020-04-27 08:30:16

迪卡
会员
所在地: 河北
注册时间: 2018-11-02
累计积分: 757
个人网站

Re: 众人拾柴-F1C200S通过SPI使用ESP8089或ESP8266做无线网卡

QQ图片20200427082951.jpg

离线

#76 2020-04-27 08:39:11

我思故我在
会员
注册时间: 2019-09-03
累计积分: 206

Re: 众人拾柴-F1C200S通过SPI使用ESP8089或ESP8266做无线网卡

迪卡再把微信配网搞定, 配合F1C100s, 做些不在乎功耗的物联网产品竞争力还是蛮强的。

离线

#77 2020-04-27 11:51:39

路人甲
会员
注册时间: 2017-09-07
累计积分: 159

Re: 众人拾柴-F1C200S通过SPI使用ESP8089或ESP8266做无线网卡

这个驱动稳定性如何?我记得前面的帖子里面的驱动三下五除二就挂了,基本没有找到稳定的。

离线

#78 2020-04-27 12:35:35

迪卡
会员
所在地: 河北
注册时间: 2018-11-02
累计积分: 757
个人网站

Re: 众人拾柴-F1C200S通过SPI使用ESP8089或ESP8266做无线网卡

路人甲 说:

这个驱动稳定性如何?我记得前面的帖子里面的驱动三下五除二就挂了,基本没有找到稳定的。

晚上我挂一着试试,目前来说,ftp下载文件还是挺稳定的,下了几十轮都没事。

离线

#79 2020-04-27 12:38:26

迪卡
会员
所在地: 河北
注册时间: 2018-11-02
累计积分: 757
个人网站

Re: 众人拾柴-F1C200S通过SPI使用ESP8089或ESP8266做无线网卡

创建一个方便用的文件系统,免得缺什么都要去重新buildroot,太麻烦了。
就用debian吧,
debian分很多版本
9 stretch
8 jessie
7 wheezy
6 squeeze
5 lenny
4 etch

sudo apt-get install debootstrap
debootstrap --foreign --verbose --arch=armel  jessie rootfs http://ftp2.cn.debian.org/debian

离线

#80 2020-04-27 12:43:42

迪卡
会员
所在地: 河北
注册时间: 2018-11-02
累计积分: 757
个人网站

Re: 众人拾柴-F1C200S通过SPI使用ESP8089或ESP8266做无线网卡

离线

#81 2020-04-27 21:56:51

迪卡
会员
所在地: 河北
注册时间: 2018-11-02
累计积分: 757
个人网站

Re: 众人拾柴-F1C200S通过SPI使用ESP8089或ESP8266做无线网卡

离线

#82 2020-04-27 22:07:47

迪卡
会员
所在地: 河北
注册时间: 2018-11-02
累计积分: 757
个人网站

Re: 众人拾柴-F1C200S通过SPI使用ESP8089或ESP8266做无线网卡

QQ截图20200427220710.png

不会玩,连密码都不会改,太难了

离线

#83 2020-04-27 23:00:26

迪卡
会员
所在地: 河北
注册时间: 2018-11-02
累计积分: 757
个人网站

Re: 众人拾柴-F1C200S通过SPI使用ESP8089或ESP8266做无线网卡

26ceccd9c504f699.png


安装晕哥给的帖子的教程,debian跑起来了。
但是我的文件系统中的udhcp有问题,所以还不能访问外网,明天研究一下,可以访问外网的话就可以apt了

离线

#84 2020-04-27 23:10:15

jiangming1399
会员
注册时间: 2018-06-14
累计积分: 112

Re: 众人拾柴-F1C200S通过SPI使用ESP8089或ESP8266做无线网卡

root密码必须在设定rootfs的时候弄,不然空密码很可能进不去;现在已经有Debian10Buster了,为啥不用最新的呢

离线

#85 2020-04-27 23:50:55

ifree64
会员
注册时间: 2019-06-27
累计积分: 62

Re: 众人拾柴-F1C200S通过SPI使用ESP8089或ESP8266做无线网卡

支持一下大佬!不能支持wpa密码的WiFi吗?

离线

#86 2020-04-28 08:41:57

迪卡
会员
所在地: 河北
注册时间: 2018-11-02
累计积分: 757
个人网站

Re: 众人拾柴-F1C200S通过SPI使用ESP8089或ESP8266做无线网卡

QQ截图20200428084113.png
dhcp搞好了,可以上网APT了

离线

#87 2020-04-30 22:34:10

迪卡
会员
所在地: 河北
注册时间: 2018-11-02
累计积分: 757
个人网站

Re: 众人拾柴-F1C200S通过SPI使用ESP8089或ESP8266做无线网卡

离线

#88 2020-04-30 22:43:42

哇酷小二
管理员
注册时间: 2020-04-22
累计积分: 1,672

Re: 众人拾柴-F1C200S通过SPI使用ESP8089或ESP8266做无线网卡

迪神牛叉

离线

#89 2020-05-01 19:47:03

xyyangkun
会员
注册时间: 2018-03-14
累计积分: 10

Re: 众人拾柴-F1C200S通过SPI使用ESP8089或ESP8266做无线网卡

1. 可以用iperf测试这个网卡的收发数据的性能。
2. esp8266的 GPIO15/MTDO  必需是拉高的状态吗?

离线

#90 2020-05-03 17:24:37

xyyangkun
会员
注册时间: 2018-03-14
累计积分: 10

Re: 众人拾柴-F1C200S通过SPI使用ESP8089或ESP8266做无线网卡

请问,想用这个spi接8266,一定要把flash焊掉吗?我这边用的nodemcu, 拆壳比较费劲!!

离线

#91 2020-05-03 18:47:48

迪卡
会员
所在地: 河北
注册时间: 2018-11-02
累计积分: 757
个人网站

Re: 众人拾柴-F1C200S通过SPI使用ESP8089或ESP8266做无线网卡

xyyangkun 说:

1. 可以用iperf测试这个网卡的收发数据的性能。
2. esp8266的 GPIO15/MTDO  必需是拉高的状态吗?

我用了iperf,基本上10Mbps,拉不拉高可以试试

离线

#92 2020-05-03 19:26:57

迪卡
会员
所在地: 河北
注册时间: 2018-11-02
累计积分: 757
个人网站

Re: 众人拾柴-F1C200S通过SPI使用ESP8089或ESP8266做无线网卡

xyyangkun 说:

请问,想用这个spi接8266,一定要把flash焊掉吗?我这边用的nodemcu, 拆壳比较费劲!!

我也是nodemcu,拆下来的模块,拆掉了壳

离线

#93 2020-05-07 04:56:43

ma6254
会员
注册时间: 2019-11-03
累计积分: 34

Re: 众人拾柴-F1C200S通过SPI使用ESP8089或ESP8266做无线网卡

迪神NB
我尝试在openwrt跑跑看,不知道能不能长期用,还有就是8266在这种工作模式下的休眠和唤醒会不会有问题

离线

#94 2020-05-07 07:34:45

迪卡
会员
所在地: 河北
注册时间: 2018-11-02
累计积分: 757
个人网站

Re: 众人拾柴-F1C200S通过SPI使用ESP8089或ESP8266做无线网卡

ma6254 说:

迪神NB
我尝试在openwrt跑跑看,不知道能不能长期用,还有就是8266在这种工作模式下的休眠和唤醒会不会有问题

休眠??老子不让他休眠

离线

#95 2020-05-08 09:43:21

ma6254
会员
注册时间: 2019-11-03
累计积分: 34

Re: 众人拾柴-F1C200S通过SPI使用ESP8089或ESP8266做无线网卡

迪神,我搞到这里了,接下去怎么搞,要搞中断口或者EN口吗?

root@OpenWrt:~# insmod esp8089-spi.ko
[   19.267713] esp8089_spi: loading out-of-tree module taints kernel.
[   19.276448] esp8089_spi: EAGLE DRIVER VER bdf5087c3deb
[   19.882064] esp8089_spi: esp_spi_dummy_probe enter
[   19.886991] esp8089_spi: register board OK
[   19.891086] esp8089_spi: sem_timeout = 0
[   20.105470] esp8089_spi: ESP8089 power up OK
[   20.110065] esp8089_spi: esp_spi_probe ENTER
[   20.114338] esp8089_spi: esp_setup_spi
[   20.118173] esp8089_spi: sif_spi_protocol_init
[   20.122617] esp8089_spi: /home/mjc/test/ESP8089-SPI/spi_sif_esp.c, 1559
[   20.129245] esp8089_spi: fail_count = 0
[   20.234938] rx:[0x00],[0x00],[0x00],[0x00],[0x00],[0x00],[0x00],[0x00],[0x00],[0x00]
[   20.342720] esp8089_spi: /home/mjc/test/ESP8089-SPI/spi_sif_esp.c, 1559
[   20.349337] esp8089_spi: fail_count = 1
[   20.454818] rx:[0x00],[0x00],[0x00],[0x00],[0x00],[0x00],[0x00],[0x00],[0x00],[0x00]
[   20.562585] esp8089_spi: /home/mjc/test/ESP8089-SPI/spi_sif_esp.c, 1559
[   20.569200] esp8089_spi: fail_count = 2
[   20.674696] rx:[0x00],[0x00],[0x00],[0x00],[0x00],[0x00],[0x00],[0x00],[0x00],[0x00]
[   20.782472] esp8089_spi: /home/mjc/test/ESP8089-SPI/spi_sif_esp.c, 1559
[   20.789088] esp8089_spi: fail_count = 3
[   20.894560] rx:[0x00],[0x00],[0x00],[0x00],[0x00],[0x00],[0x00],[0x00],[0x00],[0x00]
[   21.002336] esp8089_spi: /home/mjc/test/ESP8089-SPI/spi_sif_esp.c, 1559
[   21.008951] esp8089_spi: fail_count = 4
[   21.114433] rx:[0x00],[0x00],[0x00],[0x00],[0x00],[0x00],[0x00],[0x00],[0x00],[0x00]
[   21.222210] esp8089_spi: /home/mjc/test/ESP8089-SPI/spi_sif_esp.c, 1559
[   21.228827] esp8089_spi: fail_count = 5
[   21.334298] rx:[0x00],[0x00],[0x00],[0x00],[0x00],[0x00],[0x00],[0x00],[0x00],[0x00]
[   21.442086] esp8089_spi: /home/mjc/test/ESP8089-SPI/spi_sif_esp.c, 1559
[   21.448703] esp8089_spi: fail_count = 6
[   21.556023] rx:[0x00],[0x00],[0x00],[0x00],[0x00],[0x00],[0x00],[0x00],[0x00],[0x00]
[   21.663783] esp8089_spi: /home/mjc/test/ESP8089-SPI/spi_sif_esp.c, 1559
[   21.670398] esp8089_spi: fail_count = 7
[   21.775866] rx:[0x00],[0x00],[0x00],[0x00],[0x00],[0x00],[0x00],[0x00],[0x00],[0x00]
[   21.883617] esp8089_spi: /home/mjc/test/ESP8089-SPI/spi_sif_esp.c, 1559
[   21.890231] esp8089_spi: fail_count = 8
[   21.995690] rx:[0x00],[0x00],[0x00],[0x00],[0x00],[0x00],[0x00],[0x00],[0x00],[0x00]
[   22.103444] esp8089_spi: /home/mjc/test/ESP8089-SPI/spi_sif_esp.c, 1559
[   22.110060] esp8089_spi: fail_count = 9
[   22.215553] rx:[0x00],[0x00],[0x00],[0x00],[0x00],[0x00],[0x00],[0x00],[0x00],[0x00]
[   22.323312] esp8089_spi: /home/mjc/test/ESP8089-SPI/spi_sif_esp.c, 1559
[   22.329926] esp8089_spi: fail_count = 10
[   22.437331] rx:[0x00],[0x00],[0x00],[0x00],[0x00],[0x00],[0x00],[0x00],[0x00],[0x00]
[   22.545097] esp8089_spi: first error exit
[   22.549127] esp8089_spi: esp_spi_probe EXIT
[   22.553342] eagle: probe of spi0.0 failed with error -110
[   22.558887] esp8089_spi: sem_timeout = 0
[   22.562811] esp8089_spi: esp_spi_init err 0
root@OpenWrt:~#

离线

#96 2020-05-08 09:58:53

ma6254
会员
注册时间: 2019-11-03
累计积分: 34

Re: 众人拾柴-F1C200S通过SPI使用ESP8089或ESP8266做无线网卡

我看到加载驱动的时候可以指定参数,比如说中断口
我的板子是荔枝zero,想用PB5作为中断口,但是他对应的参数是int型的

/* *** *** Interrupt *** *** */

static int esp_interrupt = 26;
module_param(esp_interrupt, int, 0);
MODULE_PARM_DESC(esp_interrupt, "Interrupt pin");
root@OpenWrt:~# insmod esp8089-spi.ko esp_interrupt=PB5
[   25.373115] esp8089_spi: loading out-of-tree module taints kernel.
[   25.381419] esp8089_spi: `PB5' invalid for parameter `esp_interrupt'

离线

#97 2020-05-08 10:00:12

ma6254
会员
注册时间: 2019-11-03
累计积分: 34

Re: 众人拾柴-F1C200S通过SPI使用ESP8089或ESP8266做无线网卡

_20200508095940.jpg

离线

#98 2020-05-08 11:54:06

迪卡
会员
所在地: 河北
注册时间: 2018-11-02
累计积分: 757
个人网站

Re: 众人拾柴-F1C200S通过SPI使用ESP8089或ESP8266做无线网卡

那你算一下PB5是多少呀
A是0
B是32
32+5

离线

#99 2020-05-08 15:40:29

mysteryli
会员
注册时间: 2020-03-05
累计积分: 138
个人网站

Re: 众人拾柴-F1C200S通过SPI使用ESP8089或ESP8266做无线网卡

牛逼

离线

#100 2020-05-08 16:51:32

ma6254
会员
注册时间: 2019-11-03
累计积分: 34

Re: 众人拾柴-F1C200S通过SPI使用ESP8089或ESP8266做无线网卡

迪卡 说:

那你算一下PB5是多少呀
A是0
B是32
32+5

感谢迪大大的回复,原来还可以这样算的,我基础知识太差了

之前直接接排针容易掉,找了个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

_20200508164806.png
_20200508164625.jpg
_20200508164620.jpg
_20200508164634.jpg

最近编辑记录 ma6254 (2020-05-08 16:54:02)

离线

#101 2020-05-09 08:28:33

春风吹又生
会员
注册时间: 2020-02-25
累计积分: 43

Re: 众人拾柴-F1C200S通过SPI使用ESP8089或ESP8266做无线网卡

请教迪卡大佬, 为什么ESP8089 和 ESP8266 都可以通过SPI接主控芯片?
他们是不是同一个DIE?有什么区别呢?

离线

#102 2020-05-09 11:06:51

我思故我在
会员
注册时间: 2019-09-03
累计积分: 206

Re: 众人拾柴-F1C200S通过SPI使用ESP8089或ESP8266做无线网卡

楼主大佬有没有 dts 参考一下呢?

离线

#103 2020-05-09 11:58:23

路人甲
会员
注册时间: 2017-09-07
累计积分: 159

Re: 众人拾柴-F1C200S通过SPI使用ESP8089或ESP8266做无线网卡

我思故我在 说:

楼主大佬有没有 dts 参考一下呢?

感觉不需要,

按readme, 应该这样执行命令或许就可以了:

modprobe esp8089-spi esp_reset_gpio=13 esp_cs0_pin=16 esp_interrupt=26

离线

#104 2020-05-09 16:33:32

ma6254
会员
注册时间: 2019-11-03
累计积分: 34

Re: 众人拾柴-F1C200S通过SPI使用ESP8089或ESP8266做无线网卡

有进展,起码有数据了,改了spi设备树的interrupts,感觉哪里还没配置好,板子是荔枝zero

root@OpenWrt:~# uname -a
Linux OpenWrt 4.14.14-licheepi-zero+ #3 SMP Fri May 8 21:46:55 CST 2020 armv7l GNU/Linux
root@OpenWrt:~# insmod esp8089-spi.ko esp_reset_gpio=33 esp_interrupt=32
[   41.873059] esp8089_spi: loading out-of-tree module taints kernel.
[   41.881785] esp8089_spi: EAGLE DRIVER VER bdf5087c3deb
[   42.487522] esp8089_spi: esp_spi_dummy_probe enter
[   42.492375] esp8089_spi: register board OK
[   42.496540] esp8089_spi: sem_timeout = 0
[   42.714973] esp8089_spi: ESP8089 power up OK
[   42.719538] esp8089_spi: esp_spi_probe ENTER
[   42.723810] esp8089_spi: esp_setup_spi
[   42.727645] esp8089_spi: sif_spi_protocol_init
[   42.732088] esp8089_spi: /home/mjc/test/ESP8089-SPI/spi_sif_esp.c, 1559
[   42.738716] esp8089_spi: fail_count = 0
[   42.844994] spi_master spi0: spi0.0: timeout transferring 6 bytes@100000Hz for 110(100)ms
[   42.853177] eagle spi0.0: SPI transfer failed: -110
[   42.858111] spi_master spi0: failed to transfer one message from queue
[   42.864634] esp8089_spi: sif_spi_write_raw_proto: failed, error: -110
[   43.074977] spi_master spi0: spi0.0: timeout transferring 10 bytes@100000Hz for 110(100)ms
[   43.083239] eagle spi0.0: SPI transfer failed: -110
[   43.088162] spi_master spi0: failed to transfer one message from queue
[   43.094685] esp8089_spi: spierr sif_spi_write_async_read_proto: failed, error: -110
[   43.102355] rx:[0x00],[0xbf],[0xc0],[0xab],[0x03],[0xbf],[0x0b],[0x00],[0x00],[0x00]
[   43.210101] esp8089_spi: /home/mjc/test/ESP8089-SPI/spi_sif_esp.c, 1559
[   43.216712] esp8089_spi: fail_count = 1
[   43.324968] spi_master spi0: spi0.0: timeout transferring 6 bytes@100000Hz for 110(100)ms
[   43.333144] eagle spi0.0: SPI transfer failed: -110
[   43.338055] spi_master spi0: failed to transfer one message from queue
[   43.344575] esp8089_spi: sif_spi_write_raw_proto: failed, error: -110
[   43.554974] spi_master spi0: spi0.0: timeout transferring 10 bytes@100000Hz for 110(100)ms
[   43.563239] eagle spi0.0: SPI transfer failed: -110
[   43.568164] spi_master spi0: failed to transfer one message from queue
[   43.574684] esp8089_spi: spierr sif_spi_write_async_read_proto: failed, error: -110
[   43.582350] rx:[0x00],[0xbf],[0xc0],[0xab],[0x03],[0xbf],[0x0b],[0x00],[0x00],[0x00]
[   43.690095] esp8089_spi: /home/mjc/test/ESP8089-SPI/spi_sif_esp.c, 1559
[   43.696708] esp8089_spi: fail_count = 2
[   43.804981] spi_master spi0: spi0.0: timeout transferring 6 bytes@100000Hz for 110(100)ms
[   43.813171] eagle spi0.0: SPI transfer failed: -110
[   43.818106] spi_master spi0: failed to transfer one message from queue
[   43.824630] esp8089_spi: sif_spi_write_raw_proto: failed, error: -110
[   44.034994] spi_master spi0: spi0.0: timeout transferring 10 bytes@100000Hz for 110(100)ms
[   44.043258] eagle spi0.0: SPI transfer failed: -110
[   44.048179] spi_master spi0: failed to transfer one message from queue
[   44.054698] esp8089_spi: spierr sif_spi_write_async_read_proto: failed, error: -110
[   44.062377] rx:[0x00],[0xbf],[0xc0],[0xab],[0x03],[0xbf],[0x0b],[0x00],[0x00],[0x00]
[   44.170128] esp8089_spi: /home/mjc/test/ESP8089-SPI/spi_sif_esp.c, 1559
[   44.176743] esp8089_spi: fail_count = 3
[   44.284972] spi_master spi0: spi0.0: timeout transferring 6 bytes@100000Hz for 110(100)ms
[   44.293146] eagle spi0.0: SPI transfer failed: -110
[   44.298061] spi_master spi0: failed to transfer one message from queue
[   44.304580] esp8089_spi: sif_spi_write_raw_proto: failed, error: -110
[   44.514977] spi_master spi0: spi0.0: timeout transferring 10 bytes@100000Hz for 110(100)ms
[   44.523239] eagle spi0.0: SPI transfer failed: -110
[   44.528157] spi_master spi0: failed to transfer one message from queue
[   44.534676] esp8089_spi: spierr sif_spi_write_async_read_proto: failed, error: -110
[   44.542341] rx:[0x00],[0xbf],[0xc0],[0xab],[0x03],[0xbf],[0x0b],[0x00],[0x00],[0x00]
[   44.650086] esp8089_spi: /home/mjc/test/ESP8089-SPI/spi_sif_esp.c, 1559
[   44.656700] esp8089_spi: fail_count = 4
[   44.764974] spi_master spi0: spi0.0: timeout transferring 6 bytes@100000Hz for 110(100)ms
[   44.773151] eagle spi0.0: SPI transfer failed: -110
[   44.778069] spi_master spi0: failed to transfer one message from queue
[   44.784589] esp8089_spi: sif_spi_write_raw_proto: failed, error: -110
[   44.994972] spi_master spi0: spi0.0: timeout transferring 10 bytes@100000Hz for 110(100)ms
[   45.003235] eagle spi0.0: SPI transfer failed: -110
[   45.008152] spi_master spi0: failed to transfer one message from queue
[   45.014673] esp8089_spi: spierr sif_spi_write_async_read_proto: failed, error: -110
[   45.022336] rx:[0x00],[0xbf],[0xc0],[0xab],[0x03],[0xbf],[0x0b],[0x00],[0x00],[0x00]
[   45.130081] esp8089_spi: /home/mjc/test/ESP8089-SPI/spi_sif_esp.c, 1559
[   45.136698] esp8089_spi: fail_count = 5
[   45.244965] spi_master spi0: spi0.0: timeout transferring 6 bytes@100000Hz for 110(100)ms
[   45.253140] eagle spi0.0: SPI transfer failed: -110
[   45.258051] spi_master spi0: failed to transfer one message from queue
[   45.264570] esp8089_spi: sif_spi_write_raw_proto: failed, error: -110
[   45.475002] spi_master spi0: spi0.0: timeout transferring 10 bytes@100000Hz for 110(100)ms
[   45.483259] eagle spi0.0: SPI transfer failed: -110
[   45.488171] spi_master spi0: failed to transfer one message from queue
[   45.494691] esp8089_spi: spierr sif_spi_write_async_read_proto: failed, error: -110
[   45.502358] rx:[0x00],[0xbf],[0xc0],[0xab],[0x03],[0xbf],[0x0b],[0x00],[0x00],[0x00]
[   45.610110] esp8089_spi: /home/mjc/test/ESP8089-SPI/spi_sif_esp.c, 1559
[   45.616722] esp8089_spi: fail_count = 6
[   45.724980] spi_master spi0: spi0.0: timeout transferring 6 bytes@100000Hz for 110(100)ms
[   45.733156] eagle spi0.0: SPI transfer failed: -110
[   45.738080] spi_master spi0: failed to transfer one message from queue
[   45.744601] esp8089_spi: sif_spi_write_raw_proto: failed, error: -110
[   45.955006] spi_master spi0: spi0.0: timeout transferring 10 bytes@100000Hz for 110(100)ms
[   45.963266] eagle spi0.0: SPI transfer failed: -110
[   45.968179] spi_master spi0: failed to transfer one message from queue
[   45.974699] esp8089_spi: spierr sif_spi_write_async_read_proto: failed, error: -110
[   45.982365] rx:[0x00],[0xbf],[0xc0],[0xab],[0x03],[0xbf],[0x0b],[0x00],[0x00],[0x00]
[   46.090110] esp8089_spi: /home/mjc/test/ESP8089-SPI/spi_sif_esp.c, 1559
[   46.096726] esp8089_spi: fail_count = 7
[   46.205025] spi_master spi0: spi0.0: timeout transferring 6 bytes@100000Hz for 110(100)ms
[   46.213210] eagle spi0.0: SPI transfer failed: -110
[   46.218159] spi_master spi0: failed to transfer one message from queue
[   46.224681] esp8089_spi: sif_spi_write_raw_proto: failed, error: -110
[   46.434985] spi_master spi0: spi0.0: timeout transferring 10 bytes@100000Hz for 110(100)ms
[   46.443251] eagle spi0.0: SPI transfer failed: -110
[   46.448179] spi_master spi0: failed to transfer one message from queue
[   46.454700] esp8089_spi: spierr sif_spi_write_async_read_proto: failed, error: -110
[   46.462369] rx:[0x00],[0xbf],[0xc0],[0xab],[0x03],[0xbf],[0x0b],[0x00],[0x00],[0x00]
[   46.570113] esp8089_spi: /home/mjc/test/ESP8089-SPI/spi_sif_esp.c, 1559
[   46.576726] esp8089_spi: fail_count = 8
[   46.684971] spi_master spi0: spi0.0: timeout transferring 6 bytes@100000Hz for 110(100)ms
[   46.693149] eagle spi0.0: SPI transfer failed: -110
[   46.698069] spi_master spi0: failed to transfer one message from queue
[   46.704590] esp8089_spi: sif_spi_write_raw_proto: failed, error: -110
[   46.914970] spi_master spi0: spi0.0: timeout transferring 10 bytes@100000Hz for 110(100)ms
[   46.923236] eagle spi0.0: SPI transfer failed: -110
[   46.928156] spi_master spi0: failed to transfer one message from queue
[   46.934677] esp8089_spi: spierr sif_spi_write_async_read_proto: failed, error: -110
[   46.942346] rx:[0x00],[0xbf],[0xc0],[0xab],[0x03],[0xbf],[0x0b],[0x00],[0x00],[0x00]
[   47.050092] esp8089_spi: /home/mjc/test/ESP8089-SPI/spi_sif_esp.c, 1559
[   47.056706] esp8089_spi: fail_count = 9
[   47.164964] spi_master spi0: spi0.0: timeout transferring 6 bytes@100000Hz for 110(100)ms
[   47.173139] eagle spi0.0: SPI transfer failed: -110
[   47.178049] spi_master spi0: failed to transfer one message from queue
[   47.184567] esp8089_spi: sif_spi_write_raw_proto: failed, error: -110
[   47.394978] spi_master spi0: spi0.0: timeout transferring 10 bytes@100000Hz for 110(100)ms
[   47.403233] eagle spi0.0: SPI transfer failed: -110
[   47.408148] spi_master spi0: failed to transfer one message from queue
[   47.414669] esp8089_spi: spierr sif_spi_write_async_read_proto: failed, error: -110
[   47.422336] rx:[0x00],[0xbf],[0xc0],[0xab],[0x03],[0xbf],[0x0b],[0x00],[0x00],[0x00]
[   47.530080] esp8089_spi: /home/mjc/test/ESP8089-SPI/spi_sif_esp.c, 1559
[   47.536693] esp8089_spi: fail_count = 10
[   47.644974] spi_master spi0: spi0.0: timeout transferring 6 bytes@100000Hz for 110(100)ms
[   47.653147] eagle spi0.0: SPI transfer failed: -110
[   47.658057] spi_master spi0: failed to transfer one message from queue
[   47.664578] esp8089_spi: sif_spi_write_raw_proto: failed, error: -110
[   47.874976] spi_master spi0: spi0.0: timeout transferring 10 bytes@100000Hz for 110(100)ms
[   47.883240] eagle spi0.0: SPI transfer failed: -110
[   47.888155] spi_master spi0: failed to transfer one message from queue
[   47.894675] esp8089_spi: spierr sif_spi_write_async_read_proto: failed, error: -110
[   47.902341] rx:[0x00],[0xbf],[0xc0],[0xab],[0x03],[0xbf],[0x0b],[0x00],[0x00],[0x00]
[   48.010096] esp8089_spi: first error exit
[   48.014102] esp8089_spi: esp_spi_probe EXIT
[   48.018330] eagle: probe of spi0.0 failed with error -110
[   48.023868] esp8089_spi: sem_timeout = 0
[   48.027830] esp8089_spi: esp_spi_init err 0
root@OpenWrt:~# 
		spi0: spi@1c68000 {
			compatible = "allwinner,sun8i-h3-spi";
			reg = <0x01c68000 0x1000>;
			interrupts = <GIC_SPI 32 IRQ_TYPE_LEVEL_HIGH>;
			clocks = <&ccu CLK_BUS_SPI0>, <&ccu CLK_SPI0>;
			clock-names = "ahb", "mod";
			resets = <&ccu RST_BUS_SPI0>;
			pinctrl-names = "default";
			pinctrl-0 = <&spi0_pins>;
			status = "disabled";
			#address-cells = <1>;
			#size-cells = <0>;
		};

最近编辑记录 ma6254 (2020-05-09 16:38:00)

离线

#105 2020-05-09 17:46:54

ma6254
会员
注册时间: 2019-11-03
累计积分: 34

Re: 众人拾柴-F1C200S通过SPI使用ESP8089或ESP8266做无线网卡

逻辑分析仪抓了下
_20200509174446.png_20200509174501.png_20200509174517.png

离线

#106 2020-05-09 18:52:29

lhc200
会员
注册时间: 2020-05-09
累计积分: 8

Re: 众人拾柴-F1C200S通过SPI使用ESP8089或ESP8266做无线网卡

哥们,哪里的板子?
我也想弄一个;
淘宝买的,给个链接


自己做的,能否共享pcb;谢谢

离线

#107 2020-05-09 22:17:17

迪卡
会员
所在地: 河北
注册时间: 2018-11-02
累计积分: 757
个人网站

Re: 众人拾柴-F1C200S通过SPI使用ESP8089或ESP8266做无线网卡

ma6254 说:

感谢迪大大的回复,原来还可以这样算的,我基础知识太差了

之前直接接排针容易掉,找了个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

板子不错,这样焊比较整洁

离线

#108 2020-05-09 22:18:01

迪卡
会员
所在地: 河北
注册时间: 2018-11-02
累计积分: 757
个人网站

Re: 众人拾柴-F1C200S通过SPI使用ESP8089或ESP8266做无线网卡

春风吹又生 说:

请教迪卡大佬, 为什么ESP8089 和 ESP8266 都可以通过SPI接主控芯片?
他们是不是同一个DIE?有什么区别呢?

应该是同一个die,但是也是有区别的

离线

#109 2020-05-09 22:18:51

迪卡
会员
所在地: 河北
注册时间: 2018-11-02
累计积分: 757
个人网站

Re: 众人拾柴-F1C200S通过SPI使用ESP8089或ESP8266做无线网卡

我思故我在 说:

楼主大佬有没有 dts 参考一下呢?

dts没有啥 就配置好spi,指定好引脚就行

离线

#110 2020-05-09 22:21:49

迪卡
会员
所在地: 河北
注册时间: 2018-11-02
累计积分: 757
个人网站

Re: 众人拾柴-F1C200S通过SPI使用ESP8089或ESP8266做无线网卡

没看懂你是抓的哪几部分,分析一下呗,en,interrupt,cs,clk,miso,mosi

离线

#111 2020-05-09 22:23:24

迪卡
会员
所在地: 河北
注册时间: 2018-11-02
累计积分: 757
个人网站

Re: 众人拾柴-F1C200S通过SPI使用ESP8089或ESP8266做无线网卡

lhc200 说:

哥们,哪里的板子?
我也想弄一个;
淘宝买的,给个链接


自己做的,能否共享pcb;谢谢

都是这种无意义的回复是不能加分的,而且也对自己没什么帮助,一味索取不行的。

离线

#112 2020-05-10 09:21:57

xyyangkun
会员
注册时间: 2018-03-14
累计积分: 10

Re: 众人拾柴-F1C200S通过SPI使用ESP8089或ESP8266做无线网卡

[   26.600400] Adding 905212k swap on /var/swap.  Priority:-2 extents:4 across:1167356k SSFS
[   66.371975] esp8089_spi: loading out-of-tree module taints kernel.
[   66.396631] esp8089_spi: EAGLE DRIVER VER bdf5087c3deb
[   67.015290] esp8089_spi: esp_spi_dummy_probe enter
[   67.015484] esp8089_spi: register board OK
[   67.015497] esp8089_spi: sem_timeout = 0
[   67.226446] esp8089_spi: ESP8089 power up OK
[   67.226881] esp8089_spi: esp_spi_probe ENTER
[   67.226892] esp8089_spi: esp_setup_spi
[   67.226920] esp8089_spi: sif_spi_protocol_init
[   67.226933] esp8089_spi: /data/raspberry/8266/ESP8089-SPI/spi_sif_esp.c, 1559
[   67.226940] esp8089_spi: fail_count = 0
[   67.352574] rx:[0x00],[0x00],[0x00],[0x00],[0x00],[0x00],[0x00],[0x00],[0x00],[0x00]
[   67.453473] esp8089_spi: /data/raspberry/8266/ESP8089-SPI/spi_sif_esp.c, 1559
[   67.453485] esp8089_spi: fail_count = 1
[   67.561299] rx:[0x3f],[0x09],[0xff],[0xff],[0xff],[0xff],[0xff],[0xff],[0xff],[0xff]
[   67.662171] esp8089_spi: /data/raspberry/8266/ESP8089-SPI/spi_sif_esp.c, 1559
[   67.662184] esp8089_spi: fail_count = 2
[   67.770685] rx:[0xff],[0xff],[0x01],[0xff],[0xff],[0xff],[0xff],[0xff],[0xff],[0xff]
[   68.375609] esp8089_spi: /data/raspberry/8266/ESP8089-SPI/spi_sif_esp.c, 1578
[   68.380606] rx:[0xff],[0xff],[0x01],[0x10],[0xff],[0xff],[0x00],[0xff],[0xff],[0xff]
[   68.884734] esp8089_spi: /data/raspberry/8266/ESP8089-SPI/spi_sif_esp.c, 1591
[   68.888699] rx:[0xff],[0xff],[0x00],[0x90],[0xff],[0xff],[0x00],[0xff],[0xff],[0xff]
[   69.392803] esp8089_spi: /data/raspberry/8266/ESP8089-SPI/spi_sif_esp.c, 1603
[   69.397658] rx:[0xff],[0x00],[0x02],[0xff],[0xff],[0xff],[0xff],[0xff],[0xff],[0xff]
[   69.901795] esp8089_spi: /data/raspberry/8266/ESP8089-SPI/spi_sif_esp.c, 1617
[   69.907142] rx:[0xff],[0x00],[0x03],[0xff],[0xff],[0xff],[0xff],[0xff],[0xff],[0xff]
[   70.411257] esp8089_spi: /data/raspberry/8266/ESP8089-SPI/spi_sif_esp.c, 1630
[   70.415723] rx:[0xff],[0x00],[0x02],[0xff],[0xff],[0xff],[0xff],[0xff],[0xff],[0xff]
[   70.919875] esp8089_spi: /data/raspberry/8266/ESP8089-SPI/spi_sif_esp.c, 1643
[   70.931100] rx:[0xff],[0x00],[0x03],[0xff],[0xff],[0xff],[0xff],[0xff],[0xff],[0xff]
[   71.435197] esp8089_spi: /data/raspberry/8266/ESP8089-SPI/spi_sif_esp.c, 1655
[   71.439793] rx:[0xff],[0x00],[0x00],[0xff],[0xff],[0xff],[0xff],[0xff],[0xff],[0xff]
[   71.943983] esp8089_spi: /data/raspberry/8266/ESP8089-SPI/spi_sif_esp.c, 1655
[   71.950147] rx:[0xff],[0x00],[0x25],[0xff],[0xff],[0xff],[0xff],[0xff],[0xff],[0xff]
[   72.454206] esp8089_spi: /data/raspberry/8266/ESP8089-SPI/spi_sif_esp.c, 1655
[   72.458791] rx:[0xff],[0x00],[0x10],[0xff],[0xff],[0xff],[0xff],[0xff],[0xff],[0xff]
[   72.963012] esp8089_spi: /data/raspberry/8266/ESP8089-SPI/spi_sif_esp.c, 1655
[   72.968017] rx:[0xff],[0x00],[0x12],[0xff],[0xff],[0xff],[0xff],[0xff],[0xff],[0xff]
[   73.472106] esp8089_spi: /data/raspberry/8266/ESP8089-SPI/spi_sif_esp.c, 1655
[   73.476040] rx:[0xff],[0x00],[0x00],[0xff],[0xff],[0xff],[0xff],[0xff],[0xff],[0xff]
[   73.980207] esp8089_spi: /data/raspberry/8266/ESP8089-SPI/spi_sif_esp.c, 1655
[   73.984614] rx:[0xff],[0x00],[0x06],[0xff],[0xff],[0xff],[0xff],[0xff],[0xff],[0xff]
[   74.488777] esp8089_spi: /data/raspberry/8266/ESP8089-SPI/spi_sif_esp.c, 1655
[   74.493607] rx:[0xff],[0x00],[0x00],[0xff],[0xff],[0xff],[0xff],[0xff],[0xff],[0xff]
[   74.997712] esp8089_spi: /data/raspberry/8266/ESP8089-SPI/spi_sif_esp.c, 1655
[   75.002035] rx:[0xff],[0x00],[0x00],[0xff],[0xff],[0xff],[0xff],[0xff],[0xff],[0xff]
[   75.506140] esp8089_spi: /data/raspberry/8266/ESP8089-SPI/spi_sif_esp.c, 1668
[   75.509766] rx:[0xff],[0x00],[0x00],[0xff],[0xff],[0xff],[0xff],[0xff],[0xff],[0xff]
[   75.509787] esp8089_spi: /data/raspberry/8266/ESP8089-SPI/spi_sif_esp.c, 1681
[   75.509929] rx:[0xff],[0x00],[0x02],[0xff],[0xff],[0xff],[0xff],[0xff],[0xff],[0xff]
[   75.509941] esp8089_spi: /data/raspberry/8266/ESP8089-SPI/spi_sif_esp.c, 1694
[   75.510079] rx:[0xff],[0x00],[0x01],[0xff],[0xff],[0xff],[0xff],[0xff],[0xff],[0xff]
[   76.530982] esp8089_spi: esp_pub_init_all
[   76.531125] esp8089_spi: esp_download_fw
[   77.025219] esp8089_spi: sif_platform_irq_init enter
[   77.244191] esp_host:bdf5087c3deb
               esp_target: e826c2b3c9fd 57 18202

[   77.244321] esp_readwrite_file: file /system/lib/modules/test_results filp_open error
[   77.245832] esp8089_spi: first normal exit
[   77.245848] esp8089_spi: esp_spi_probe EXIT
[   77.246132] esp8089_spi: sem_timeout = 0
[   77.246206] esp8089_spi: esp_spi_remove
[   77.376590] esp8089_spi: esp_spi_probe ENTER
[   77.376606] esp8089_spi: esp_setup_spi
[   77.376614] esp8089_spi: sif_spi_protocol_init
[   77.376628] esp8089_spi: /data/raspberry/8266/ESP8089-SPI/spi_sif_esp.c, 1559
[   77.376634] esp8089_spi: fail_count = 0
[   77.485191] rx:[0x00],[0x00],[0x00],[0x00],[0x00],[0x00],[0x00],[0x00],[0x00],[0x00]
[   77.586224] esp8089_spi: /data/raspberry/8266/ESP8089-SPI/spi_sif_esp.c, 1559
[   77.586238] esp8089_spi: fail_count = 1
[   77.693635] rx:[0x3f],[0x09],[0xff],[0xff],[0xff],[0xff],[0xff],[0xff],[0xff],[0xff]
[   77.794564] esp8089_spi: /data/raspberry/8266/ESP8089-SPI/spi_sif_esp.c, 1559
[   77.794577] esp8089_spi: fail_count = 2
[   77.901298] rx:[0xff],[0xff],[0x01],[0xff],[0xff],[0xff],[0xff],[0xff],[0xff],[0xff]
[   78.506161] esp8089_spi: /data/raspberry/8266/ESP8089-SPI/spi_sif_esp.c, 1578
[   78.510096] rx:[0xff],[0xff],[0x01],[0x10],[0xff],[0xff],[0x00],[0xff],[0xff],[0xff]
[   79.014201] esp8089_spi: /data/raspberry/8266/ESP8089-SPI/spi_sif_esp.c, 1591
[   79.019392] rx:[0xff],[0xff],[0x00],[0x90],[0xff],[0xff],[0x00],[0xff],[0xff],[0xff]
[   79.523503] esp8089_spi: /data/raspberry/8266/ESP8089-SPI/spi_sif_esp.c, 1603
[   79.528183] rx:[0xff],[0x00],[0x02],[0xff],[0xff],[0xff],[0xff],[0xff],[0xff],[0xff]
[   80.032309] esp8089_spi: /data/raspberry/8266/ESP8089-SPI/spi_sif_esp.c, 1617
[   80.036776] rx:[0xff],[0x00],[0x03],[0xff],[0xff],[0xff],[0xff],[0xff],[0xff],[0xff]
[   80.540880] esp8089_spi: /data/raspberry/8266/ESP8089-SPI/spi_sif_esp.c, 1630
[   80.545516] rx:[0xff],[0x00],[0x02],[0xff],[0xff],[0xff],[0xff],[0xff],[0xff],[0xff]
[   81.049727] esp8089_spi: /data/raspberry/8266/ESP8089-SPI/spi_sif_esp.c, 1643
[   81.061853] rx:[0xff],[0x00],[0x03],[0xff],[0xff],[0xff],[0xff],[0xff],[0xff],[0xff]
[   81.565989] esp8089_spi: /data/raspberry/8266/ESP8089-SPI/spi_sif_esp.c, 1655
[   81.570411] rx:[0xff],[0x00],[0x00],[0xff],[0xff],[0xff],[0xff],[0xff],[0xff],[0xff]
[   82.074605] esp8089_spi: /data/raspberry/8266/ESP8089-SPI/spi_sif_esp.c, 1655
[   82.079556] rx:[0xff],[0x00],[0x25],[0xff],[0xff],[0xff],[0xff],[0xff],[0xff],[0xff]
[   82.583775] esp8089_spi: /data/raspberry/8266/ESP8089-SPI/spi_sif_esp.c, 1655
[   82.589059] rx:[0xff],[0x00],[0x10],[0xff],[0xff],[0xff],[0xff],[0xff],[0xff],[0xff]
[   83.093204] esp8089_spi: /data/raspberry/8266/ESP8089-SPI/spi_sif_esp.c, 1655
[   83.145532] rx:[0xff],[0x00],[0x12],[0xff],[0xff],[0xff],[0xff],[0xff],[0xff],[0xff]
[   83.649765] esp8089_spi: /data/raspberry/8266/ESP8089-SPI/spi_sif_esp.c, 1655
[   83.654466] rx:[0xff],[0x00],[0x00],[0xff],[0xff],[0xff],[0xff],[0xff],[0xff],[0xff]
[   84.158628] esp8089_spi: /data/raspberry/8266/ESP8089-SPI/spi_sif_esp.c, 1655
[   84.163003] rx:[0xff],[0x00],[0x06],[0xff],[0xff],[0xff],[0xff],[0xff],[0xff],[0xff]
[   84.667139] esp8089_spi: /data/raspberry/8266/ESP8089-SPI/spi_sif_esp.c, 1655
[   84.671465] rx:[0xff],[0x00],[0x00],[0xff],[0xff],[0xff],[0xff],[0xff],[0xff],[0xff]
[   85.175548] esp8089_spi: /data/raspberry/8266/ESP8089-SPI/spi_sif_esp.c, 1655
[   85.180071] rx:[0xff],[0x00],[0x00],[0xff],[0xff],[0xff],[0xff],[0xff],[0xff],[0xff]
[   85.684170] esp8089_spi: /data/raspberry/8266/ESP8089-SPI/spi_sif_esp.c, 1668
[   85.689675] rx:[0xff],[0x00],[0x00],[0xff],[0xff],[0xff],[0xff],[0xff],[0xff],[0xff]
[   85.689695] esp8089_spi: /data/raspberry/8266/ESP8089-SPI/spi_sif_esp.c, 1681
[   85.689837] rx:[0xff],[0x00],[0x02],[0xff],[0xff],[0xff],[0xff],[0xff],[0xff],[0xff]
[   85.689851] esp8089_spi: /data/raspberry/8266/ESP8089-SPI/spi_sif_esp.c, 1694
[   85.689987] rx:[0xff],[0x00],[0x01],[0xff],[0xff],[0xff],[0xff],[0xff],[0xff],[0xff]
[   86.710515] esp8089_spi: esp_pub_init_all
[   86.710532] esp8089_spi: esp_download_fw
[   87.314819] esp8089_spi: sif_platform_irq_init enter
[   87.363840] esp_host:bdf5087c3deb
               esp_target: e826c2b3c9fd 57 18202

[   87.588031] esp8089_spi: esp_spi_probe EXIT
[   87.588344] esp8089_spi: esp_spi_init err 0
[   88.913171] esp_op_add_interface STA
[   88.915054] IPv6: ADDRCONF(NETDEV_UP): wlan0: link is not ready
[   90.110801] wlan0: authenticate with 20:dc:e6:fd:c9:77
[   90.111152] wlan0: send auth to 20:dc:e6:fd:c9:77 (try 1/3)
[   90.122334] wlan0: authenticated
[   90.126579] wlan0: associate with 20:dc:e6:fd:c9:77 (try 1/3)
[   90.137107] wlan0: RX AssocResp from 20:dc:e6:fd:c9:77 (capab=0x431 status=0 aid=2)
[   90.137311] wlan0: associated
[   90.571333] IPv6: ADDRCONF(NETDEV_CHANGE): wlan0: link becomes ready

成功把8266当成wifi网卡,之前的出现以下错误是en脚没有使能。直接接到3.3V后,可以下载固件,并正常加载ko.

[   72.081984] rx:[0x00],[0x00],[0x00],[0x00],[0x00],[0x00],[0x00],[0x00],[0x00],[0x00]
[   72.182922] esp8089_spi: first error exit
[   72.182938] esp8089_spi: esp_spi_probe EXIT
[   72.187142] eagle: probe of spi0.0 failed with error -110
[   72.187353] esp8089_spi: sem_timeout = 0
[   72.187367] esp8089_spi: esp_spi_init err 0
[  177.692206] esp8089_spi: esp_spi_exit

离线

#113 2020-05-11 10:45:17

ma6254
会员
注册时间: 2019-11-03
累计积分: 34

Re: 众人拾柴-F1C200S通过SPI使用ESP8089或ESP8266做无线网卡

可喜可贺,我也调通了
生成了一个大的空文件来测试速度

PC:

sudo dd if=/dev/zero of=./zero.bin bs=1G seek=100 count=0
python3 -m http.server

板子里:

root@OpenWrt:~# curl -o /dev/null  "http://192.168.43.234:8000/a.zip"
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
 26  286M   26 76.5M    0     0   972k      0  0:05:01  0:01:20  0:03:41  967k^C
root@OpenWrt:~# curl -o /dev/null  "http://192.168.43.234:8000/zero.bin"
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
  0 10.0G    0 7451k    0     0   964k      0  3:01:06  0:00:07  3:00:59  978k^C

离线

#114 2020-05-11 14:13:22

xiezonglin
会员
注册时间: 2020-03-07
累计积分: 5

Re: 众人拾柴-F1C200S通过SPI使用ESP8089或ESP8266做无线网卡

你后来都很顺利吗?我一直都有一个问题,就是开启中断后就提示超时,看了一下代码应该是等待中断超时,可是我明明设置了中断,而且我这时如果把中断脚接到地就可以成功下一步,而且后面还可以搜到AP(或者我CS脚拉到地也可以)

[ 59.382190] esp8089_spi: sif_platform_irq_init enter
[   69.602131] resetting event timeout
[   69.605657] esp8089_spi: esp_init_all failed: -110
[   69.610435] esp8089_spi: first error exit
[   69.614611] esp8089_spi: esp_spi_probe EXIT
[   69.619080] esp8089_spi: sem_timeout = 0
[   69.623112] esp8089_spi: esp_spi_init err 0
xyyangkun 说:
[   26.600400] Adding 905212k swap on /var/swap.  Priority:-2 extents:4 across:1167356k SSFS
[   66.371975] esp8089_spi: loading out-of-tree module taints kernel.
[   66.396631] esp8089_spi: EAGLE DRIVER VER bdf5087c3deb
[   67.015290] esp8089_spi: esp_spi_dummy_probe enter
[   67.015484] esp8089_spi: register board OK
[   67.015497] esp8089_spi: sem_timeout = 0
[   67.226446] esp8089_spi: ESP8089 power up OK
[   67.226881] esp8089_spi: esp_spi_probe ENTER
[   67.226892] esp8089_spi: esp_setup_spi
[   67.226920] esp8089_spi: sif_spi_protocol_init
[   67.226933] esp8089_spi: /data/raspberry/8266/ESP8089-SPI/spi_sif_esp.c, 1559
[   67.226940] esp8089_spi: fail_count = 0
[   67.352574] rx:[0x00],[0x00],[0x00],[0x00],[0x00],[0x00],[0x00],[0x00],[0x00],[0x00]
[   67.453473] esp8089_spi: /data/raspberry/8266/ESP8089-SPI/spi_sif_esp.c, 1559
[   67.453485] esp8089_spi: fail_count = 1
[   67.561299] rx:[0x3f],[0x09],[0xff],[0xff],[0xff],[0xff],[0xff],[0xff],[0xff],[0xff]
[   67.662171] esp8089_spi: /data/raspberry/8266/ESP8089-SPI/spi_sif_esp.c, 1559
[   67.662184] esp8089_spi: fail_count = 2
[   67.770685] rx:[0xff],[0xff],[0x01],[0xff],[0xff],[0xff],[0xff],[0xff],[0xff],[0xff]
[   68.375609] esp8089_spi: /data/raspberry/8266/ESP8089-SPI/spi_sif_esp.c, 1578
[   68.380606] rx:[0xff],[0xff],[0x01],[0x10],[0xff],[0xff],[0x00],[0xff],[0xff],[0xff]
[   68.884734] esp8089_spi: /data/raspberry/8266/ESP8089-SPI/spi_sif_esp.c, 1591
[   68.888699] rx:[0xff],[0xff],[0x00],[0x90],[0xff],[0xff],[0x00],[0xff],[0xff],[0xff]
[   69.392803] esp8089_spi: /data/raspberry/8266/ESP8089-SPI/spi_sif_esp.c, 1603
[   69.397658] rx:[0xff],[0x00],[0x02],[0xff],[0xff],[0xff],[0xff],[0xff],[0xff],[0xff]
[   69.901795] esp8089_spi: /data/raspberry/8266/ESP8089-SPI/spi_sif_esp.c, 1617
[   69.907142] rx:[0xff],[0x00],[0x03],[0xff],[0xff],[0xff],[0xff],[0xff],[0xff],[0xff]
[   70.411257] esp8089_spi: /data/raspberry/8266/ESP8089-SPI/spi_sif_esp.c, 1630
[   70.415723] rx:[0xff],[0x00],[0x02],[0xff],[0xff],[0xff],[0xff],[0xff],[0xff],[0xff]
[   70.919875] esp8089_spi: /data/raspberry/8266/ESP8089-SPI/spi_sif_esp.c, 1643
[   70.931100] rx:[0xff],[0x00],[0x03],[0xff],[0xff],[0xff],[0xff],[0xff],[0xff],[0xff]
[   71.435197] esp8089_spi: /data/raspberry/8266/ESP8089-SPI/spi_sif_esp.c, 1655
[   71.439793] rx:[0xff],[0x00],[0x00],[0xff],[0xff],[0xff],[0xff],[0xff],[0xff],[0xff]
[   71.943983] esp8089_spi: /data/raspberry/8266/ESP8089-SPI/spi_sif_esp.c, 1655
[   71.950147] rx:[0xff],[0x00],[0x25],[0xff],[0xff],[0xff],[0xff],[0xff],[0xff],[0xff]
[   72.454206] esp8089_spi: /data/raspberry/8266/ESP8089-SPI/spi_sif_esp.c, 1655
[   72.458791] rx:[0xff],[0x00],[0x10],[0xff],[0xff],[0xff],[0xff],[0xff],[0xff],[0xff]
[   72.963012] esp8089_spi: /data/raspberry/8266/ESP8089-SPI/spi_sif_esp.c, 1655
[   72.968017] rx:[0xff],[0x00],[0x12],[0xff],[0xff],[0xff],[0xff],[0xff],[0xff],[0xff]
[   73.472106] esp8089_spi: /data/raspberry/8266/ESP8089-SPI/spi_sif_esp.c, 1655
[   73.476040] rx:[0xff],[0x00],[0x00],[0xff],[0xff],[0xff],[0xff],[0xff],[0xff],[0xff]
[   73.980207] esp8089_spi: /data/raspberry/8266/ESP8089-SPI/spi_sif_esp.c, 1655
[   73.984614] rx:[0xff],[0x00],[0x06],[0xff],[0xff],[0xff],[0xff],[0xff],[0xff],[0xff]
[   74.488777] esp8089_spi: /data/raspberry/8266/ESP8089-SPI/spi_sif_esp.c, 1655
[   74.493607] rx:[0xff],[0x00],[0x00],[0xff],[0xff],[0xff],[0xff],[0xff],[0xff],[0xff]
[   74.997712] esp8089_spi: /data/raspberry/8266/ESP8089-SPI/spi_sif_esp.c, 1655
[   75.002035] rx:[0xff],[0x00],[0x00],[0xff],[0xff],[0xff],[0xff],[0xff],[0xff],[0xff]
[   75.506140] esp8089_spi: /data/raspberry/8266/ESP8089-SPI/spi_sif_esp.c, 1668
[   75.509766] rx:[0xff],[0x00],[0x00],[0xff],[0xff],[0xff],[0xff],[0xff],[0xff],[0xff]
[   75.509787] esp8089_spi: /data/raspberry/8266/ESP8089-SPI/spi_sif_esp.c, 1681
[   75.509929] rx:[0xff],[0x00],[0x02],[0xff],[0xff],[0xff],[0xff],[0xff],[0xff],[0xff]
[   75.509941] esp8089_spi: /data/raspberry/8266/ESP8089-SPI/spi_sif_esp.c, 1694
[   75.510079] rx:[0xff],[0x00],[0x01],[0xff],[0xff],[0xff],[0xff],[0xff],[0xff],[0xff]
[   76.530982] esp8089_spi: esp_pub_init_all
[   76.531125] esp8089_spi: esp_download_fw
[   77.025219] esp8089_spi: sif_platform_irq_init enter
[   77.244191] esp_host:bdf5087c3deb
               esp_target: e826c2b3c9fd 57 18202

[   77.244321] esp_readwrite_file: file /system/lib/modules/test_results filp_open error
[   77.245832] esp8089_spi: first normal exit
[   77.245848] esp8089_spi: esp_spi_probe EXIT
[   77.246132] esp8089_spi: sem_timeout = 0
[   77.246206] esp8089_spi: esp_spi_remove
[   77.376590] esp8089_spi: esp_spi_probe ENTER
[   77.376606] esp8089_spi: esp_setup_spi
[   77.376614] esp8089_spi: sif_spi_protocol_init
[   77.376628] esp8089_spi: /data/raspberry/8266/ESP8089-SPI/spi_sif_esp.c, 1559
[   77.376634] esp8089_spi: fail_count = 0
[   77.485191] rx:[0x00],[0x00],[0x00],[0x00],[0x00],[0x00],[0x00],[0x00],[0x00],[0x00]
[   77.586224] esp8089_spi: /data/raspberry/8266/ESP8089-SPI/spi_sif_esp.c, 1559
[   77.586238] esp8089_spi: fail_count = 1
[   77.693635] rx:[0x3f],[0x09],[0xff],[0xff],[0xff],[0xff],[0xff],[0xff],[0xff],[0xff]
[   77.794564] esp8089_spi: /data/raspberry/8266/ESP8089-SPI/spi_sif_esp.c, 1559
[   77.794577] esp8089_spi: fail_count = 2
[   77.901298] rx:[0xff],[0xff],[0x01],[0xff],[0xff],[0xff],[0xff],[0xff],[0xff],[0xff]
[   78.506161] esp8089_spi: /data/raspberry/8266/ESP8089-SPI/spi_sif_esp.c, 1578
[   78.510096] rx:[0xff],[0xff],[0x01],[0x10],[0xff],[0xff],[0x00],[0xff],[0xff],[0xff]
[   79.014201] esp8089_spi: /data/raspberry/8266/ESP8089-SPI/spi_sif_esp.c, 1591
[   79.019392] rx:[0xff],[0xff],[0x00],[0x90],[0xff],[0xff],[0x00],[0xff],[0xff],[0xff]
[   79.523503] esp8089_spi: /data/raspberry/8266/ESP8089-SPI/spi_sif_esp.c, 1603
[   79.528183] rx:[0xff],[0x00],[0x02],[0xff],[0xff],[0xff],[0xff],[0xff],[0xff],[0xff]
[   80.032309] esp8089_spi: /data/raspberry/8266/ESP8089-SPI/spi_sif_esp.c, 1617
[   80.036776] rx:[0xff],[0x00],[0x03],[0xff],[0xff],[0xff],[0xff],[0xff],[0xff],[0xff]
[   80.540880] esp8089_spi: /data/raspberry/8266/ESP8089-SPI/spi_sif_esp.c, 1630
[   80.545516] rx:[0xff],[0x00],[0x02],[0xff],[0xff],[0xff],[0xff],[0xff],[0xff],[0xff]
[   81.049727] esp8089_spi: /data/raspberry/8266/ESP8089-SPI/spi_sif_esp.c, 1643
[   81.061853] rx:[0xff],[0x00],[0x03],[0xff],[0xff],[0xff],[0xff],[0xff],[0xff],[0xff]
[   81.565989] esp8089_spi: /data/raspberry/8266/ESP8089-SPI/spi_sif_esp.c, 1655
[   81.570411] rx:[0xff],[0x00],[0x00],[0xff],[0xff],[0xff],[0xff],[0xff],[0xff],[0xff]
[   82.074605] esp8089_spi: /data/raspberry/8266/ESP8089-SPI/spi_sif_esp.c, 1655
[   82.079556] rx:[0xff],[0x00],[0x25],[0xff],[0xff],[0xff],[0xff],[0xff],[0xff],[0xff]
[   82.583775] esp8089_spi: /data/raspberry/8266/ESP8089-SPI/spi_sif_esp.c, 1655
[   82.589059] rx:[0xff],[0x00],[0x10],[0xff],[0xff],[0xff],[0xff],[0xff],[0xff],[0xff]
[   83.093204] esp8089_spi: /data/raspberry/8266/ESP8089-SPI/spi_sif_esp.c, 1655
[   83.145532] rx:[0xff],[0x00],[0x12],[0xff],[0xff],[0xff],[0xff],[0xff],[0xff],[0xff]
[   83.649765] esp8089_spi: /data/raspberry/8266/ESP8089-SPI/spi_sif_esp.c, 1655
[   83.654466] rx:[0xff],[0x00],[0x00],[0xff],[0xff],[0xff],[0xff],[0xff],[0xff],[0xff]
[   84.158628] esp8089_spi: /data/raspberry/8266/ESP8089-SPI/spi_sif_esp.c, 1655
[   84.163003] rx:[0xff],[0x00],[0x06],[0xff],[0xff],[0xff],[0xff],[0xff],[0xff],[0xff]
[   84.667139] esp8089_spi: /data/raspberry/8266/ESP8089-SPI/spi_sif_esp.c, 1655
[   84.671465] rx:[0xff],[0x00],[0x00],[0xff],[0xff],[0xff],[0xff],[0xff],[0xff],[0xff]
[   85.175548] esp8089_spi: /data/raspberry/8266/ESP8089-SPI/spi_sif_esp.c, 1655
[   85.180071] rx:[0xff],[0x00],[0x00],[0xff],[0xff],[0xff],[0xff],[0xff],[0xff],[0xff]
[   85.684170] esp8089_spi: /data/raspberry/8266/ESP8089-SPI/spi_sif_esp.c, 1668
[   85.689675] rx:[0xff],[0x00],[0x00],[0xff],[0xff],[0xff],[0xff],[0xff],[0xff],[0xff]
[   85.689695] esp8089_spi: /data/raspberry/8266/ESP8089-SPI/spi_sif_esp.c, 1681
[   85.689837] rx:[0xff],[0x00],[0x02],[0xff],[0xff],[0xff],[0xff],[0xff],[0xff],[0xff]
[   85.689851] esp8089_spi: /data/raspberry/8266/ESP8089-SPI/spi_sif_esp.c, 1694
[   85.689987] rx:[0xff],[0x00],[0x01],[0xff],[0xff],[0xff],[0xff],[0xff],[0xff],[0xff]
[   86.710515] esp8089_spi: esp_pub_init_all
[   86.710532] esp8089_spi: esp_download_fw
[   87.314819] esp8089_spi: sif_platform_irq_init enter
[   87.363840] esp_host:bdf5087c3deb
               esp_target: e826c2b3c9fd 57 18202

[   87.588031] esp8089_spi: esp_spi_probe EXIT
[   87.588344] esp8089_spi: esp_spi_init err 0
[   88.913171] esp_op_add_interface STA
[   88.915054] IPv6: ADDRCONF(NETDEV_UP): wlan0: link is not ready
[   90.110801] wlan0: authenticate with 20:dc:e6:fd:c9:77
[   90.111152] wlan0: send auth to 20:dc:e6:fd:c9:77 (try 1/3)
[   90.122334] wlan0: authenticated
[   90.126579] wlan0: associate with 20:dc:e6:fd:c9:77 (try 1/3)
[   90.137107] wlan0: RX AssocResp from 20:dc:e6:fd:c9:77 (capab=0x431 status=0 aid=2)
[   90.137311] wlan0: associated
[   90.571333] IPv6: ADDRCONF(NETDEV_CHANGE): wlan0: link becomes ready

成功把8266当成wifi网卡,之前的出现以下错误是en脚没有使能。直接接到3.3V后,可以下载固件,并正常加载ko.

[   72.081984] rx:[0x00],[0x00],[0x00],[0x00],[0x00],[0x00],[0x00],[0x00],[0x00],[0x00]
[   72.182922] esp8089_spi: first error exit
[   72.182938] esp8089_spi: esp_spi_probe EXIT
[   72.187142] eagle: probe of spi0.0 failed with error -110
[   72.187353] esp8089_spi: sem_timeout = 0
[   72.187367] esp8089_spi: esp_spi_init err 0
[  177.692206] esp8089_spi: esp_spi_exit

离线

#115 2020-05-12 08:19:12

迪卡
会员
所在地: 河北
注册时间: 2018-11-02
累计积分: 757
个人网站

Re: 众人拾柴-F1C200S通过SPI使用ESP8089或ESP8266做无线网卡

我试了一下,去掉中断不可以呢。
把这部分屏蔽不行呢。在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;

离线

#116 2020-05-12 08:20:30

迪卡
会员
所在地: 河北
注册时间: 2018-11-02
累计积分: 757
个人网站

Re: 众人拾柴-F1C200S通过SPI使用ESP8089或ESP8266做无线网卡

没有注释的

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]

离线

#117 2020-05-12 08:21:01

迪卡
会员
所在地: 河北
注册时间: 2018-11-02
累计积分: 757
个人网站

Re: 众人拾柴-F1C200S通过SPI使用ESP8089或ESP8266做无线网卡

注释的

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:~#

离线

#118 2020-05-12 08:21:33

迪卡
会员
所在地: 河北
注册时间: 2018-11-02
累计积分: 757
个人网站

Re: 众人拾柴-F1C200S通过SPI使用ESP8089或ESP8266做无线网卡

另外可以不接CS,但需要将CS接到GND

离线

#119 2020-05-13 00:54:23

huxiao45
会员
注册时间: 2019-11-04
累计积分: 8

Re: 众人拾柴-F1C200S通过SPI使用ESP8089或ESP8266做无线网卡

迪神牛X,特来膜拜下,改后的文件发一份上来?

离线

#120 2020-05-24 22:58:59

逸俊晨晖
会员
注册时间: 2018-08-29
累计积分: 75

Re: 众人拾柴-F1C200S通过SPI使用ESP8089或ESP8266做无线网卡

我用spi1接8266-12f 数据线时钟线都有数据了 可是出现了以下错误 不知道什么原因 插个眼

...
esp8089_spi: /home/dika/DVPM_linux-5.2/spiwifi1/ESP8089-SPI-master/spi_sif_esp.c, 1681
rx:[0xff],[0x00],[0x02],[0xff],[0xff],[0xff],[0xff],[0xff],[0xff],[0xff]
esp8089_spi: /home/dika/DVPM_linux-5.2/spiwifi1/ESP8089-SPI-master/spi_sif_esp.c, 1694
rx:[0xff],[0x00],[0x01],[0xff],[0xff],[0xff],[0xff],[0xff],[0xff],[0xff]
esp8089_spi: spierr byte read cmd resp 0x00 no recv
esp8089_spi: spierr byte read cmd resp 0x00 no recv
...
esp8089_spi: spierr byte read cmd resp 0x00 no recv

离线

#121 2020-06-05 14:29:08

molin2050
会员
注册时间: 2020-01-06
累计积分: 18

Re: 众人拾柴-F1C200S通过SPI使用ESP8089或ESP8266做无线网卡

每次启动都要下载一次固件吗?可不可以跳过这部分

离线

#122 2020-06-05 14:46:06

哇酷小二
管理员
注册时间: 2020-04-22
累计积分: 1,672

Re: 众人拾柴-F1C200S通过SPI使用ESP8089或ESP8266做无线网卡

molin2050 说:

每次启动都要下载一次固件吗?可不可以跳过这部分

可以, 通过 sunxi-fel 下载到 dram 跑:

https://whycan.cn/t_2449.html

离线

#123 2020-06-05 15:00:25

guangozhiosu
会员
注册时间: 2020-06-03
累计积分: 5

Re: 众人拾柴-F1C200S通过SPI使用ESP8089或ESP8266做无线网卡

这个下载了没反应是怎么回事

离线

#124 2020-06-10 09:49:59

秦皇岛岛主
会员
注册时间: 2020-05-22
累计积分: 28

Re: 众人拾柴-F1C200S通过SPI使用ESP8089或ESP8266做无线网卡

此文必须标记

离线

#125 2020-06-10 14:59:44

xiaodianlu210
会员
注册时间: 2020-06-09
累计积分: 6

Re: 众人拾柴-F1C200S通过SPI使用ESP8089或ESP8266做无线网卡

不错,正要调试ESP8089

离线

#126 2020-06-12 07:18:39

迪卡
会员
所在地: 河北
注册时间: 2018-11-02
累计积分: 757
个人网站

Re: 众人拾柴-F1C200S通过SPI使用ESP8089或ESP8266做无线网卡

QQ图片20.png

离线

#127 2020-06-19 02:56:38

DoZh
会员
注册时间: 2019-12-20
累计积分: 9

Re: 众人拾柴-F1C200S通过SPI使用ESP8089或ESP8266做无线网卡

卡在挺靠前的位置了

root@pop-os:/lib/modules/5.2.0-licheepi-nano+# ls
esp8089-spi.ko     modules.builtin      modules.dep.bin  modules.softdep
modules.alias      modules.builtin.bin  modules.devname  modules.symbols
modules.alias.bin  modules.dep          modules.order    modules.symbols.bin
root@pop-os:/lib/modules/5.2.0-licheepi-nano+# modprobe esp8089-spi.ko
modprobe: FATAL: Module esp8089-spi.ko not found in directory /lib/modules/5.2.0-licheepi-nano+

这。。。什么鬼?我已经把.ko拷过去了啊?

各位大佬有没有什么思路?

========
解决了

root@pop-os:/lib/modules/5.2.0-licheepi-nano+# modprobe esp8089-spi

原来要这样。。。

最近编辑记录 DoZh (2020-06-19 03:01:01)

离线

#128 2020-07-01 09:12:43

gzhssl
会员
注册时间: 2019-11-22
累计积分: 7

Re: 众人拾柴-F1C200S通过SPI使用ESP8089或ESP8266做无线网卡

我也出现了这个错误提示,多次重启之后加载ESP8089模块会报EXT4 xxxxx的错误,因为我的rootfs分区是EXT4的,于是改为EXT3之后就OK了,顺利出现WLAN0~~~,不知道你这个跟我一样不

逸俊晨晖 说:

我用spi1接8266-12f 数据线时钟线都有数据了 可是出现了以下错误 不知道什么原因 插个眼

...
esp8089_spi: /home/dika/DVPM_linux-5.2/spiwifi1/ESP8089-SPI-master/spi_sif_esp.c, 1681
rx:[0xff],[0x00],[0x02],[0xff],[0xff],[0xff],[0xff],[0xff],[0xff],[0xff]
esp8089_spi: /home/dika/DVPM_linux-5.2/spiwifi1/ESP8089-SPI-master/spi_sif_esp.c, 1694
rx:[0xff],[0x00],[0x01],[0xff],[0xff],[0xff],[0xff],[0xff],[0xff],[0xff]
esp8089_spi: spierr byte read cmd resp 0x00 no recv
esp8089_spi: spierr byte read cmd resp 0x00 no recv
...
esp8089_spi: spierr byte read cmd resp 0x00 no recv

离线

#129 2020-07-01 12:17:42

迪卡
会员
所在地: 河北
注册时间: 2018-11-02
累计积分: 757
个人网站

Re: 众人拾柴-F1C200S通过SPI使用ESP8089或ESP8266做无线网卡

调试成功的来报个名

离线

#130 2020-07-01 17:49:39

hikaru0
会员
注册时间: 2020-07-01
累计积分: 0

Re: 众人拾柴-F1C200S通过SPI使用ESP8089或ESP8266做无线网卡

感谢分享,先mark了,闲了调试看看。。。。。

离线

#131 2020-07-26 22:14:42

wlcccccc
会员
注册时间: 2019-12-06
累计积分: 40

Re: 众人拾柴-F1C200S通过SPI使用ESP8089或ESP8266做无线网卡

有没有 esp8089 的原理图?

离线

#132 2020-07-28 22:49:34

DoZh
会员
注册时间: 2019-12-20
累计积分: 9

Re: 众人拾柴-F1C200S通过SPI使用ESP8089或ESP8266做无线网卡

没辙了,怎么调试ESP8089/8266都没反应.

有没有哪位大佬能够指点一二?

用的是f1c100s的PA0-PA3做SPI1,ESP8089和8266都试过,换了几块板子了,感觉芯片都没有响应。。。

终端输出:

root@pop-os:~# insmod /lib/modules/5.2.0-licheepi-nano+/esp8089-spi.ko esp_reset_gpio=130 esp_cs0_pin=0 esp_interrupt=131
[  100.487205] esp8089_spi: loading out-of-tree module taints kernel.
[  100.502255] esp8089_spi: EAGLE DRIVER VER bdf5087c3deb
[  101.107979] esp8089_spi: esp_spi_dummy_probe enter
[  101.113372] esp8089_spi: register board OK
[  101.117707] esp8089_spi: sem_timeout = 0
[  101.339049] esp8089_spi: ESP8089 power up OK
[  101.344184] esp8089_spi: esp_spi_probe ENTER
[  101.348713] esp8089_spi: esp_setup_spi
[  101.352844] esp8089_spi: sif_spi_protocol_init
[  101.357535] esp8089_spi: /home/dozh/embedded_linux/f1c200s/ESP8089-SPI/spi_sif_esp.c, 1559
[  101.366256] esp8089_spi: fail_count = 0
[  101.484912] rx:[0x00],[0x00],[0x00],[0x00],[0x00],[0x00],[0x00],[0x00],[0x00],[0x00]
[  101.593085] esp8089_spi: /home/dozh/embedded_linux/f1c200s/ESP8089-SPI/spi_sif_esp.c, 1559
[  101.601821] esp8089_spi: fail_count = 1
[  101.711623] rx:[0x00],[0x00],[0x00],[0x00],[0x00],[0x00],[0x00],[0x00],[0x00],[0x00]
[  101.819797] esp8089_spi: /home/dozh/embedded_linux/f1c200s/ESP8089-SPI/spi_sif_esp.c, 1559
[  101.828460] esp8089_spi: fail_count = 2
[  101.938086] rx:[0x00],[0x00],[0x00],[0x00],[0x00],[0x00],[0x00],[0x00],[0x00],[0x00]
[  102.046329] esp8089_spi: /home/dozh/embedded_linux/f1c200s/ESP8089-SPI/spi_sif_esp.c, 1559
[  102.055057] esp8089_spi: fail_count = 3
[  102.170503] rx:[0x00],[0x00],[0x00],[0x00],[0x00],[0x00],[0x00],[0x00],[0x00],[0x00]
[  102.290458] esp8089_spi: /home/dozh/embedded_linux/f1c200s/ESP8089-SPI/spi_sif_esp.c, 1559
[  102.311082] esp8089_spi: fail_count = 4
[  102.427085] rx:[0x00],[0x00],[0x00],[0x00],[0x00],[0x00],[0x00],[0x00],[0x00],[0x00]
[  102.546976] esp8089_spi: /home/dozh/embedded_linux/f1c200s/ESP8089-SPI/spi_sif_esp.c, 1559
[  102.567478] esp8089_spi: fail_count = 5
[  102.683231] rx:[0x00],[0x00],[0x00],[0x00],[0x00],[0x00],[0x00],[0x00],[0x00],[0x00]
[  102.803629] esp8089_spi: /home/dozh/embedded_linux/f1c200s/ESP8089-SPI/spi_sif_esp.c, 1559
[  102.825123] esp8089_spi: fail_count = 6
[  102.941701] rx:[0x00],[0x00],[0x00],[0x00],[0x00],[0x00],[0x00],[0x00],[0x00],[0x00]
[  103.063014] esp8089_spi: /home/dozh/embedded_linux/f1c200s/ESP8089-SPI/spi_sif_esp.c, 1559
[  103.084966] esp8089_spi: fail_count = 7
[  103.201628] rx:[0x00],[0x00],[0x00],[0x00],[0x00],[0x00],[0x00],[0x00],[0x00],[0x00]
[  103.322898] esp8089_spi: /home/dozh/embedded_linux/f1c200s/ESP8089-SPI/spi_sif_esp.c, 1559
[  103.344858] esp8089_spi: fail_count = 8
[  103.461802] rx:[0x00],[0x00],[0x00],[0x00],[0x00],[0x00],[0x00],[0x00],[0x00],[0x00]
[  103.583043] esp8089_spi: /home/dozh/embedded_linux/f1c200s/ESP8089-SPI/spi_sif_esp.c, 1559
[  103.604976] esp8089_spi: fail_count = 9
[  103.721343] rx:[0x00],[0x00],[0x00],[0x00],[0x00],[0x00],[0x00],[0x00],[0x00],[0x00]
[  103.842613] esp8089_spi: /home/dozh/embedded_linux/f1c200s/ESP8089-SPI/spi_sif_esp.c, 1559
[  103.864570] esp8089_spi: fail_count = 10
[  103.981306] rx:[0x00],[0x00],[0x00],[0x00],[0x00],[0x00],[0x00],[0x00],[0x00],[0x00]
[  104.102631] esp8089_spi: first error exit
[  104.113547] esp8089_spi: esp_spi_probe EXIT
[  104.124558] eagle: probe of spi1.0 failed with error -110
[  104.137024] esp8089_spi: sem_timeout = 0
[  104.147740] esp8089_spi: esp_spi_init err 0
root@pop-os:~#

原理图:
Snipaste_2020-07-28_22-35-28.png


逻辑分析仪吐出来的时序图:
Snipaste_2020-07-28_22-42-07.png
Snipaste_2020-07-28_22-48-52.png

ESP8266串口0输出的启动信息:

 ets Jan  8 2013,rst cause:1, boot mode:(6,2)


 ets Jan  8 2013,rst cause:1, boot mode:(6,6)

waiting for host

 ets Jan  8 2013,rst cause:1, boot mode:(6,6)

waiting for host

离线

#133 2020-07-29 13:43:55

xiezonglin
会员
注册时间: 2020-03-07
累计积分: 5

Re: 众人拾柴-F1C200S通过SPI使用ESP8089或ESP8266做无线网卡

DoZh 说:

没辙了,怎么调试ESP8089/8266都没反应.

有没有哪位大佬能够指点一二?

用的是f1c100s的PA0-PA3做SPI1,ESP8089和8266都试过,换了几块板子了,感觉芯片都没有响应。。。

终端输出:

root@pop-os:~# insmod /lib/modules/5.2.0-licheepi-nano+/esp8089-spi.ko esp_reset_gpio=130 esp_cs0_pin=0 esp_interrupt=131
[  100.487205] esp8089_spi: loading out-of-tree module taints kernel.
[  100.502255] esp8089_spi: EAGLE DRIVER VER bdf5087c3deb
[  101.107979] esp8089_spi: esp_spi_dummy_probe enter
[  101.113372] esp8089_spi: register board OK
[  101.117707] esp8089_spi: sem_timeout = 0
[  101.339049] esp8089_spi: ESP8089 power up OK
[  101.344184] esp8089_spi: esp_spi_probe ENTER
[  101.348713] esp8089_spi: esp_setup_spi
[  101.352844] esp8089_spi: sif_spi_protocol_init
[  101.357535] esp8089_spi: /home/dozh/embedded_linux/f1c200s/ESP8089-SPI/spi_sif_esp.c, 1559
[  101.366256] esp8089_spi: fail_count = 0
[  101.484912] rx:[0x00],[0x00],[0x00],[0x00],[0x00],[0x00],[0x00],[0x00],[0x00],[0x00]
[  101.593085] esp8089_spi: /home/dozh/embedded_linux/f1c200s/ESP8089-SPI/spi_sif_esp.c, 1559
[  101.601821] esp8089_spi: fail_count = 1
[  101.711623] rx:[0x00],[0x00],[0x00],[0x00],[0x00],[0x00],[0x00],[0x00],[0x00],[0x00]
[  101.819797] esp8089_spi: /home/dozh/embedded_linux/f1c200s/ESP8089-SPI/spi_sif_esp.c, 1559
[  101.828460] esp8089_spi: fail_count = 2
[  101.938086] rx:[0x00],[0x00],[0x00],[0x00],[0x00],[0x00],[0x00],[0x00],[0x00],[0x00]
[  102.046329] esp8089_spi: /home/dozh/embedded_linux/f1c200s/ESP8089-SPI/spi_sif_esp.c, 1559
[  102.055057] esp8089_spi: fail_count = 3
[  102.170503] rx:[0x00],[0x00],[0x00],[0x00],[0x00],[0x00],[0x00],[0x00],[0x00],[0x00]
[  102.290458] esp8089_spi: /home/dozh/embedded_linux/f1c200s/ESP8089-SPI/spi_sif_esp.c, 1559
[  102.311082] esp8089_spi: fail_count = 4
[  102.427085] rx:[0x00],[0x00],[0x00],[0x00],[0x00],[0x00],[0x00],[0x00],[0x00],[0x00]
[  102.546976] esp8089_spi: /home/dozh/embedded_linux/f1c200s/ESP8089-SPI/spi_sif_esp.c, 1559
[  102.567478] esp8089_spi: fail_count = 5
[  102.683231] rx:[0x00],[0x00],[0x00],[0x00],[0x00],[0x00],[0x00],[0x00],[0x00],[0x00]
[  102.803629] esp8089_spi: /home/dozh/embedded_linux/f1c200s/ESP8089-SPI/spi_sif_esp.c, 1559
[  102.825123] esp8089_spi: fail_count = 6
[  102.941701] rx:[0x00],[0x00],[0x00],[0x00],[0x00],[0x00],[0x00],[0x00],[0x00],[0x00]
[  103.063014] esp8089_spi: /home/dozh/embedded_linux/f1c200s/ESP8089-SPI/spi_sif_esp.c, 1559
[  103.084966] esp8089_spi: fail_count = 7
[  103.201628] rx:[0x00],[0x00],[0x00],[0x00],[0x00],[0x00],[0x00],[0x00],[0x00],[0x00]
[  103.322898] esp8089_spi: /home/dozh/embedded_linux/f1c200s/ESP8089-SPI/spi_sif_esp.c, 1559
[  103.344858] esp8089_spi: fail_count = 8
[  103.461802] rx:[0x00],[0x00],[0x00],[0x00],[0x00],[0x00],[0x00],[0x00],[0x00],[0x00]
[  103.583043] esp8089_spi: /home/dozh/embedded_linux/f1c200s/ESP8089-SPI/spi_sif_esp.c, 1559
[  103.604976] esp8089_spi: fail_count = 9
[  103.721343] rx:[0x00],[0x00],[0x00],[0x00],[0x00],[0x00],[0x00],[0x00],[0x00],[0x00]
[  103.842613] esp8089_spi: /home/dozh/embedded_linux/f1c200s/ESP8089-SPI/spi_sif_esp.c, 1559
[  103.864570] esp8089_spi: fail_count = 10
[  103.981306] rx:[0x00],[0x00],[0x00],[0x00],[0x00],[0x00],[0x00],[0x00],[0x00],[0x00]
[  104.102631] esp8089_spi: first error exit
[  104.113547] esp8089_spi: esp_spi_probe EXIT
[  104.124558] eagle: probe of spi1.0 failed with error -110
[  104.137024] esp8089_spi: sem_timeout = 0
[  104.147740] esp8089_spi: esp_spi_init err 0
root@pop-os:~#

原理图:
https://whycan.cn/files/members/2701/Snipaste_2020-07-28_22-35-28.png


逻辑分析仪吐出来的时序图:
https://whycan.cn/files/members/2701/Snipaste_2020-07-28_22-42-07.png
https://whycan.cn/files/members/2701/Snipaste_2020-07-28_22-48-52.png

ESP8266串口0输出的启动信息:

 ets Jan  8 2013,rst cause:1, boot mode:(6,2)


 ets Jan  8 2013,rst cause:1, boot mode:(6,6)

waiting for host

 ets Jan  8 2013,rst cause:1, boot mode:(6,6)

waiting for host

感觉还是芯片工作不正常或者没焊接好,CHIP_EN脚看看是不是高电平

离线

#134 2020-08-11 18:49:48

lignin
会员
注册时间: 2020-03-21
累计积分: 32

Re: 众人拾柴-F1C200S通过SPI使用ESP8089或ESP8266做无线网卡

我的几乎都是这样,可能几十次之中会有一个能够接受到数据的

root@lign-G3-3579:~# insmod esp8089-spi.ko esp_reset_gpio=100 esp_interrupt=101
[   40.118584] esp8089_spi: loading out-of-tree module taints kernel.
[   40.141832] esp8089_spi: EAGLE DRIVER VER bdf5087c3deb
[   40.747336] esp8089_spi: esp_spi_dummy_probe enter
[   40.752689] esp8089_spi: register board OK
[   40.757011] esp8089_spi: sem_timeout = 0
[   40.978375] esp8089_spi: ESP8089 power up OK
[   40.983429] esp8089_spi: esp_spi_probe ENTER
[   40.987947] esp8089_spi: esp_setup_spi
[   41.029403] esp8089_spi: sif_spi_protocol_init
[   41.034135] esp8089_spi: /home/lign/work/lichee/linux_sd/ESP8089-SPI/spi_sif_esp.c, 1559
[   41.042747] esp8089_spi: fail_count = 0
[   41.179144] rx:[0xff],[0xff],[0xff],[0xff],[0xff],[0xff],[0xff],[0xff],[0xff],[0xff]
[   41.287232] esp8089_spi: /home/lign/work/lichee/linux_sd/ESP8089-SPI/spi_sif_esp.c, 1559
[   41.295755] esp8089_spi: fail_count = 1
[   41.408015] rx:[0xff],[0xff],[0xff],[0xff],[0xff],[0xff],[0xff],[0xff],[0xff],[0xff]
[   41.516195] esp8089_spi: /home/lign/work/lichee/linux_sd/ESP8089-SPI/spi_sif_esp.c, 1559
[   41.524725] esp8089_spi: fail_count = 2
[   41.636543] rx:[0xff],[0xff],[0xff],[0xff],[0xff],[0xff],[0xff],[0xff],[0xff],[0xff]
[   41.744690] esp8089_spi: /home/lign/work/lichee/linux_sd/ESP8089-SPI/spi_sif_esp.c, 1559
[   41.753208] esp8089_spi: fail_count = 3
[   41.866619] rx:[0xff],[0xff],[0xff],[0xff],[0xff],[0xff],[0xff],[0xff],[0xff],[0xff]
[   41.974690] esp8089_spi: /home/lign/work/lichee/linux_sd/ESP8089-SPI/spi_sif_esp.c, 1559
[   41.994558] esp8089_spi: fail_count = 4
[   42.115036] rx:[0xff],[0xff],[0xff],[0xff],[0xff],[0xff],[0xff],[0xff],[0xff],[0xff]
[   42.234544] esp8089_spi: /home/lign/work/lichee/linux_sd/ESP8089-SPI/spi_sif_esp.c, 1559
[   42.254508] esp8089_spi: fail_count = 5
[   42.383613] rx:[0xff],[0xff],[0xff],[0xff],[0xff],[0xff],[0xff],[0xff],[0xff],[0xff]
[   42.503734] esp8089_spi: /home/lign/work/lichee/linux_sd/ESP8089-SPI/spi_sif_esp.c, 1559
[   42.524648] esp8089_spi: fail_count = 6
[   42.649902] rx:[0xff],[0xff],[0xff],[0xff],[0xff],[0xff],[0xff],[0xff],[0xff],[0xff]
[   42.770822] esp8089_spi: /home/lign/work/lichee/linux_sd/ESP8089-SPI/spi_sif_esp.c, 1559
[   42.792176] esp8089_spi: fail_count = 7
[   42.913071] rx:[0xff],[0xff],[0xff],[0xff],[0xff],[0xff],[0xff],[0xff],[0xff],[0xff]
[   43.033852] esp8089_spi: /home/lign/work/lichee/linux_sd/ESP8089-SPI/spi_sif_esp.c, 1559
[   43.055174] esp8089_spi: fail_count = 8
[   43.173997] rx:[0xff],[0xff],[0xff],[0xff],[0xff],[0xff],[0xff],[0xff],[0xff],[0xff]
[   43.294812] esp8089_spi: /home/lign/work/lichee/linux_sd/ESP8089-SPI/spi_sif_esp.c, 1559
[   43.316164] esp8089_spi: fail_count = 9
[   43.513360] rx:[0xff],[0xff],[0xff],[0xff],[0xff],[0xff],[0xff],[0xff],[0xff],[0xff]
[   43.634279] esp8089_spi: /home/lign/work/lichee/linux_sd/ESP8089-SPI/spi_sif_esp.c, 1559
[   43.655658] esp8089_spi: fail_count = 10
[   43.775698] rx:[0xff],[0xff],[0xff],[0xff],[0xff],[0xff],[0xff],[0xff],[0xff],[0xff]
[   43.896530] esp8089_spi: first error exit
[   43.907218] esp8089_spi: esp_spi_probe EXIT
[   43.918009] eagle: probe of spi1.0 failed with error -110
[   43.930260] esp8089_spi: sem_timeout = 0
[   43.940746] esp8089_spi: esp_spi_init err 0

离线

#135 2020-08-11 19:28:21

lignin
会员
注册时间: 2020-03-21
累计积分: 32

Re: 众人拾柴-F1C200S通过SPI使用ESP8089或ESP8266做无线网卡

我也是,你的问题解决了吗

DoZh 说:

没辙了,怎么调试ESP8089/8266都没反应.

有没有哪位大佬能够指点一二?

用的是f1c100s的PA0-PA3做SPI1,ESP8089和8266都试过,换了几块板子了,感觉芯片都没有响应。。。

终端输出:

root@pop-os:~# insmod /lib/modules/5.2.0-licheepi-nano+/esp8089-spi.ko esp_reset_gpio=130 esp_cs0_pin=0 esp_interrupt=131
[  100.487205] esp8089_spi: loading out-of-tree module taints kernel.
[  100.502255] esp8089_spi: EAGLE DRIVER VER bdf5087c3deb
[  101.107979] esp8089_spi: esp_spi_dummy_probe enter
[  101.113372] esp8089_spi: register board OK
[  101.117707] esp8089_spi: sem_timeout = 0
[  101.339049] esp8089_spi: ESP8089 power up OK
[  101.344184] esp8089_spi: esp_spi_probe ENTER
[  101.348713] esp8089_spi: esp_setup_spi
[  101.352844] esp8089_spi: sif_spi_protocol_init
[  101.357535] esp8089_spi: /home/dozh/embedded_linux/f1c200s/ESP8089-SPI/spi_sif_esp.c, 1559
[  101.366256] esp8089_spi: fail_count = 0
[  101.484912] rx:[0x00],[0x00],[0x00],[0x00],[0x00],[0x00],[0x00],[0x00],[0x00],[0x00]
[  101.593085] esp8089_spi: /home/dozh/embedded_linux/f1c200s/ESP8089-SPI/spi_sif_esp.c, 1559
[  101.601821] esp8089_spi: fail_count = 1
[  101.711623] rx:[0x00],[0x00],[0x00],[0x00],[0x00],[0x00],[0x00],[0x00],[0x00],[0x00]
[  101.819797] esp8089_spi: /home/dozh/embedded_linux/f1c200s/ESP8089-SPI/spi_sif_esp.c, 1559
[  101.828460] esp8089_spi: fail_count = 2
[  101.938086] rx:[0x00],[0x00],[0x00],[0x00],[0x00],[0x00],[0x00],[0x00],[0x00],[0x00]
[  102.046329] esp8089_spi: /home/dozh/embedded_linux/f1c200s/ESP8089-SPI/spi_sif_esp.c, 1559
[  102.055057] esp8089_spi: fail_count = 3
[  102.170503] rx:[0x00],[0x00],[0x00],[0x00],[0x00],[0x00],[0x00],[0x00],[0x00],[0x00]
[  102.290458] esp8089_spi: /home/dozh/embedded_linux/f1c200s/ESP8089-SPI/spi_sif_esp.c, 1559
[  102.311082] esp8089_spi: fail_count = 4
[  102.427085] rx:[0x00],[0x00],[0x00],[0x00],[0x00],[0x00],[0x00],[0x00],[0x00],[0x00]
[  102.546976] esp8089_spi: /home/dozh/embedded_linux/f1c200s/ESP8089-SPI/spi_sif_esp.c, 1559
[  102.567478] esp8089_spi: fail_count = 5
[  102.683231] rx:[0x00],[0x00],[0x00],[0x00],[0x00],[0x00],[0x00],[0x00],[0x00],[0x00]
[  102.803629] esp8089_spi: /home/dozh/embedded_linux/f1c200s/ESP8089-SPI/spi_sif_esp.c, 1559
[  102.825123] esp8089_spi: fail_count = 6
[  102.941701] rx:[0x00],[0x00],[0x00],[0x00],[0x00],[0x00],[0x00],[0x00],[0x00],[0x00]
[  103.063014] esp8089_spi: /home/dozh/embedded_linux/f1c200s/ESP8089-SPI/spi_sif_esp.c, 1559
[  103.084966] esp8089_spi: fail_count = 7
[  103.201628] rx:[0x00],[0x00],[0x00],[0x00],[0x00],[0x00],[0x00],[0x00],[0x00],[0x00]
[  103.322898] esp8089_spi: /home/dozh/embedded_linux/f1c200s/ESP8089-SPI/spi_sif_esp.c, 1559
[  103.344858] esp8089_spi: fail_count = 8
[  103.461802] rx:[0x00],[0x00],[0x00],[0x00],[0x00],[0x00],[0x00],[0x00],[0x00],[0x00]
[  103.583043] esp8089_spi: /home/dozh/embedded_linux/f1c200s/ESP8089-SPI/spi_sif_esp.c, 1559
[  103.604976] esp8089_spi: fail_count = 9
[  103.721343] rx:[0x00],[0x00],[0x00],[0x00],[0x00],[0x00],[0x00],[0x00],[0x00],[0x00]
[  103.842613] esp8089_spi: /home/dozh/embedded_linux/f1c200s/ESP8089-SPI/spi_sif_esp.c, 1559
[  103.864570] esp8089_spi: fail_count = 10
[  103.981306] rx:[0x00],[0x00],[0x00],[0x00],[0x00],[0x00],[0x00],[0x00],[0x00],[0x00]
[  104.102631] esp8089_spi: first error exit
[  104.113547] esp8089_spi: esp_spi_probe EXIT
[  104.124558] eagle: probe of spi1.0 failed with error -110
[  104.137024] esp8089_spi: sem_timeout = 0
[  104.147740] esp8089_spi: esp_spi_init err 0
root@pop-os:~#

原理图:
https://whycan.cn/files/members/2701/Snipaste_2020-07-28_22-35-28.png


逻辑分析仪吐出来的时序图:
https://whycan.cn/files/members/2701/Snipaste_2020-07-28_22-42-07.png
https://whycan.cn/files/members/2701/Snipaste_2020-07-28_22-48-52.png

ESP8266串口0输出的启动信息:

 ets Jan  8 2013,rst cause:1, boot mode:(6,2)


 ets Jan  8 2013,rst cause:1, boot mode:(6,6)

waiting for host

 ets Jan  8 2013,rst cause:1, boot mode:(6,6)

waiting for host

离线

页脚

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