espressif / esp-hosted

Hosted Solution (Linux/MCU) with ESP32 (Wi-Fi + BT + BLE)
Other
703 stars 166 forks source link

[ESP32 FG mode, stm32mp131 host, sdio mode] serial interface failed to work #485

Closed renliangli closed 1 month ago

renliangli commented 1 month ago

Checklist

How often does this bug occurs?

always

Expected behavior

AP, STA, and Bluetooth can work normally

Actual behavior (suspected bug)

After the driver is loaded, the AP, STA, and Bluetooth cannot work properly

Error logs or terminal output

root@myd-yf13x:/# insmod esp32_sdio.ko
[  116.717188] esp32_sdio: loading out-of-tree module taints kernel.
[  116.725149] esp_probe: ESP network device detected
root@myd-yf13x:/#
root@myd-yf13x:/# ifconfig -a
eth0      Link encap:Ethernet  HWaddr B6:54:9E:46:DF:6F
          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)
          Interrupt:46 Base address:0x4000

ethap0    Link encap:Ethernet  HWaddr 00:00:00:00:00:00
          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)

ethsta0   Link encap:Ethernet  HWaddr 00:00:00:00:00:00
          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)

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:98 errors:0 dropped:0 overruns:0 frame:0
          TX packets:98 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:8661 (8.4 KiB)  TX bytes:8661 (8.4 KiB)

usb0      Link encap:Ethernet  HWaddr 2E:8D:9C:3B:50:B0
          inet addr:192.168.7.1  Bcast:192.168.7.255  Mask:255.255.255.0
          inet6 addr: fe80::2c8d:9cff:fe3b:50b0/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:262 errors:0 dropped:0 overruns:0 frame:0
          TX packets:51 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:21100 (20.6 KiB)  TX bytes:9116 (8.9 KiB)

root@myd-yf13x:/#
root@myd-yf13x:/#
root@myd-yf13x:/# ./test.out
sudo ./test.out
[
 set_sta_mac_addr               ||
 get_sta_mac_addr               ||
 set_softap_mac_addr            ||
 get_softap_mac_addr            ||
 get_ap_scan_list               ||
 sta_connect                    ||
 get_sta_config                 ||
 sta_disconnect                 ||
 set_wifi_mode                  ||
 get_wifi_mode                  ||
 reset_softap_vendor_ie         ||
 set_softap_vendor_ie           ||
 softap_start                   ||
 get_softap_config              ||
 softap_connected_sta_list      ||
 softap_stop                    ||
 set_wifi_powersave_mode        ||
 get_wifi_powersave_mode        ||
 set_wifi_max_tx_power          ||
 get_wifi_curr_tx_power         ||
 ota <ESP 'network_adapter.bin' path>
]

For example,
sudo ./test.out set_sta_mac_addr
root@myd-yf13x:/# mknod /dev/esps0 c 221 0
root@myd-yf13x:/# chmod 666 /dev/esps0
root@myd-yf13x:/#
root@myd-yf13x:/# ./test.out softap_start
serial interface open failed, Is the driver loaded?
Failed to serial_init
init hosted control lib failed
Err Exit
root@myd-yf13x:/#
root@myd-yf13x:/#
root@myd-yf13x:/# dmesg
[    0.000000] Booting Linux on physical CPU 0x0
[    0.000000] Linux version 5.15.67-g9cec825a70d7-dirty (renliang@ubuntu) (arm-ostl-linux-gnueabi-gcc (GCC) 11.3.0, GNU ld (GNU Binutils) 2.38.20220708) #24 PREEMPT Thu Sep 12 09:59:12 +08 2024
[    0.000000] CPU: ARMv7 Processor [410fc075] revision 5 (ARMv7), cr=10c5387d
[    0.000000] CPU: div instructions available: patching division code
[    0.000000] CPU: PIPT / VIPT nonaliasing data cache, VIPT aliasing instruction cache
[    0.000000] OF: fdt: Machine model: STMicroelectronics custom STM32CubeMX board - openstlinux-5.15-yocto-kirkstone-mp1-v22.11.23
[    0.000000] Memory policy: Data cache writeback
[    0.000000] cma: Reserved 64 MiB at 0xc1800000
[    0.000000] Zone ranges:
[    0.000000]   Normal   [mem 0x00000000c0000000-0x00000000c7afffff]
[    0.000000]   HighMem  [mem 0x00000000c7b00000-0x00000000c7ffffff]
[    0.000000] Movable zone start for each node
[    0.000000] Early memory node ranges
[    0.000000]   node   0: [mem 0x00000000c0000000-0x00000000c7afffff]
[    0.000000]   node   0: [mem 0x00000000c7b00000-0x00000000c7ffffff]
[    0.000000] Initmem setup node 0 [mem 0x00000000c0000000-0x00000000c7ffffff]
[    0.000000] psci: probing for conduit method from DT.
[    0.000000] psci: PSCIv1.0 detected in firmware.
[    0.000000] psci: Using standard PSCI v0.2 function IDs
[    0.000000] psci: MIGRATE_INFO_TYPE not supported.
[    0.000000] psci: SMC Calling Convention v1.1
[    0.000000] CPU: All CPU(s) started in SVC mode.
[    0.000000] pcpu-alloc: s0 r0 d32768 u32768 alloc=1*32768
[    0.000000] pcpu-alloc: [0] 0
[    0.000000] Built 1 zonelists, mobility grouping on.  Total pages: 32491
[    0.000000] Kernel command line: ubi.mtd=UBI rootfstype=ubifs root=ubi0:rootfs rootwait rw   console=ttySTM0,115200
[    0.000000] Dentry cache hash table entries: 16384 (order: 4, 65536 bytes, linear)
[    0.000000] Inode-cache hash table entries: 8192 (order: 3, 32768 bytes, linear)
[    0.000000] mem auto-init: stack:off, heap alloc:off, heap free:off
[    0.000000] Memory: 40040K/131072K available (12288K kernel code, 1134K rwdata, 3016K rodata, 1024K init, 195K bss, 25496K reserved, 65536K cma-reserved, 0K highmem)
[    0.000000] SLUB: HWalign=64, Order=0-3, MinObjects=0, CPUs=1, Nodes=1
[    0.000000] trace event string verifier disabled
[    0.000000] rcu: Preemptible hierarchical RCU implementation.
[    0.000000] rcu:     RCU event tracing is enabled.
[    0.000000]  Trampoline variant of Tasks RCU enabled.
[    0.000000]  Tracing variant of Tasks RCU enabled.
[    0.000000] rcu: RCU calculated value of scheduler-enlistment delay is 10 jiffies.
[    0.000000] NR_IRQS: 16, nr_irqs: 16, preallocated irqs: 16
[    0.000000] arch_timer: cp15 timer(s) running at 24.00MHz (virt).
[    0.000000] clocksource: arch_sys_counter: mask: 0xffffffffffffff max_cycles: 0x588fe9dc0, max_idle_ns: 440795202592 ns
[    0.000001] sched_clock: 56 bits at 24MHz, resolution 41ns, wraps every 4398046511097ns
[    0.000029] Switching to timer-based delay loop, resolution 41ns
[    0.001003] Console: colour dummy device 80x30
[    0.001086] Calibrating delay loop (skipped), value calculated using timer frequency.. 48.00 BogoMIPS (lpj=240000)
[    0.001118] pid_max: default: 32768 minimum: 301
[    0.001395] Mount-cache hash table entries: 1024 (order: 0, 4096 bytes, linear)
[    0.001437] Mountpoint-cache hash table entries: 1024 (order: 0, 4096 bytes, linear)
[    0.002731] CPU: Testing write buffer coherency: ok
[    0.004724] Setting up static identity map for 0xc0100000 - 0xc0100060
[    0.004998] rcu: Hierarchical SRCU implementation.
[    0.006962] devtmpfs: initialized
[    0.021355] VFP support v0.3: implementor 41 architecture 2 part 30 variant 7 rev 5
[    0.021717] clocksource: jiffies: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 19112604462750000 ns
[    0.021764] futex hash table entries: 256 (order: -1, 3072 bytes, linear)
[    0.025222] pinctrl core: initialized pinctrl subsystem
[    0.027842] NET: Registered PF_NETLINK/PF_ROUTE protocol family
[    0.030784] DMA: preallocated 256 KiB pool for atomic coherent allocations
[    0.032307] thermal_sys: Registered thermal governor 'step_wise'
[    0.032714] cpuidle: using governor menu
[    0.033039] hw-breakpoint: found 5 (+1 reserved) breakpoint and 4 watchpoint registers.
[    0.033070] hw-breakpoint: maximum watchpoint size is 8 bytes.
[    0.033490] Serial: AMBA PL011 UART driver
[    0.036750] stm32-pm-domain pm_domain: domain core-ret-power-domain registered
[    0.036808] stm32-pm-domain pm_domain: subdomain core-power-domain registered
[    0.036830] stm32-pm-domain pm_domain: domains probed
[    0.052394] /soc/interrupt-controller@5000d000: bank0
[    0.052455] /soc/interrupt-controller@5000d000: bank1
[    0.052484] /soc/interrupt-controller@5000d000: bank2
[    0.077215] Kprobes globally optimized
[    0.091545] SCSI subsystem initialized
[    0.092008] libata version 3.00 loaded.
[    0.092484] usbcore: registered new interface driver usbfs
[    0.092578] usbcore: registered new interface driver hub
[    0.092664] usbcore: registered new device driver usb
[    0.093170] pps_core: LinuxPPS API ver. 1 registered
[    0.093195] pps_core: Software ver. 5.3.6 - Copyright 2005-2007 Rodolfo Giometti <giometti@linux.it>
[    0.093237] PTP clock support registered
[    0.093312] EDAC MC: Ver: 3.0.0
[    0.096239] Bluetooth: Core ver 2.22
[    0.096362] NET: Registered PF_BLUETOOTH protocol family
[    0.096384] Bluetooth: HCI device and connection manager initialized
[    0.096412] Bluetooth: HCI socket layer initialized
[    0.096431] Bluetooth: L2CAP socket layer initialized
[    0.096471] Bluetooth: SCO socket layer initialized
[    0.097515] clocksource: Switched to clocksource arch_sys_counter
[    0.177303] NET: Registered PF_INET protocol family
[    0.177744] IP idents hash table entries: 2048 (order: 2, 16384 bytes, linear)
[    0.179018] tcp_listen_portaddr_hash hash table entries: 512 (order: 0, 4096 bytes, linear)
[    0.179089] Table-perturb hash table entries: 65536 (order: 6, 262144 bytes, linear)
[    0.179123] TCP established hash table entries: 1024 (order: 0, 4096 bytes, linear)
[    0.179157] TCP bind hash table entries: 1024 (order: 0, 4096 bytes, linear)
[    0.179190] TCP: Hash tables configured (established 1024 bind 1024)
[    0.179345] UDP hash table entries: 256 (order: 0, 4096 bytes, linear)
[    0.179397] UDP-Lite hash table entries: 256 (order: 0, 4096 bytes, linear)
[    0.179774] NET: Registered PF_UNIX/PF_LOCAL protocol family
[    0.188405] hw perfevents: enabled with armv7_cortex_a7 PMU driver, 5 counters available
[    0.190187] Initialise system trusted keyrings
[    0.191081] workingset: timestamp_bits=14 max_order=15 bucket_order=1
[    0.211069] ntfs: driver 2.1.32 [Flags: R/O].
[    0.211759] fuse: init (API version 7.34)
[    0.378278] NET: Registered PF_ALG protocol family
[    0.378328] Key type asymmetric registered
[    0.378343] Asymmetric key parser 'x509' registered
[    0.378556] bounce: pool size: 64 pages
[    0.378669] Block layer SCSI generic (bsg) driver version 0.4 loaded (major 247)
[    0.378694] io scheduler mq-deadline registered
[    0.378709] io scheduler kyber registered
[    0.386910] STM32 USART driver initialized
[    0.406233] brd: module loaded
[    0.416631] loop: module loaded
[    0.423042] PPP generic driver version 2.4.2
[    0.423395] PPP BSD Compression module registered
[    0.423422] PPP Deflate Compression module registered
[    0.423450] PPP MPPE Compression module registered
[    0.423464] NET: Registered PF_PPPOX protocol family
[    0.423509] pegasus: Pegasus/Pegasus II USB Ethernet driver
[    0.423643] usbcore: registered new interface driver pegasus
[    0.423736] usbcore: registered new interface driver asix
[    0.423799] usbcore: registered new interface driver ax88179_178a
[    0.423859] usbcore: registered new interface driver cdc_ether
[    0.423935] usbcore: registered new interface driver smsc75xx
[    0.424010] usbcore: registered new interface driver smsc95xx
[    0.424084] usbcore: registered new interface driver net1080
[    0.424147] usbcore: registered new interface driver cdc_subset
[    0.424206] usbcore: registered new interface driver zaurus
[    0.424354] usbcore: registered new interface driver cdc_ncm
[    0.424419] usbcore: registered new interface driver qmi_wwan
[    0.425472] ehci_hcd: USB 2.0 'Enhanced' Host Controller (EHCI) Driver
[    0.425540] ehci-platform: EHCI generic platform driver
[    0.425770] ohci_hcd: USB 1.1 'Open' Host Controller (OHCI) Driver
[    0.425815] ohci-platform: OHCI generic platform driver
[    0.426449] usbcore: registered new interface driver cdc_acm
[    0.426476] cdc_acm: USB Abstract Control Model driver for USB modems and ISDN adapters
[    0.426544] usbcore: registered new interface driver cdc_wdm
[    0.426633] usbcore: registered new interface driver usb-storage
[    0.426802] usbcore: registered new interface driver option
[    0.426863] usbserial: USB Serial support registered for GSM modem (1-port)
[    0.428786] udc-core: couldn't find an available UDC - added [g_ether] to list of pending drivers
[    0.432001] device-mapper: ioctl: 4.45.0-ioctl (2021-03-22) initialised: dm-devel@redhat.com
[    0.432050] Bluetooth: HCI UART driver ver 2.3
[    0.432068] Bluetooth: HCI UART protocol H4 registered
[    0.432083] Bluetooth: HCI UART protocol BCSP registered
[    0.432723] stm32-cpufreq stm32-cpufreq: OPP-v2 not supported
[    0.433623] sdhci: Secure Digital Host Controller Interface driver
[    0.433652] sdhci: Copyright(c) Pierre Ossman
[    0.433664] Synopsys Designware Multimedia Card Interface Driver
[    0.434047] sdhci-pltfm: SDHCI platform and OF driver helper
[    0.434963] ledtrig-cpu: registered to indicate activity on CPUs
[    0.435522] usbcore: registered new interface driver usbhid
[    0.435551] usbhid: USB HID core driver
[    0.438560] optee: probing for conduit method.
[    0.438615] optee: revision 3.16 (f44b6e4c)
[    0.439570] optee: Asynchronous notifications enabled
[    0.439621] optee: dynamic shared memory is enabled
[    0.442109] optee: initialized driver
[    0.444641] NET: Registered PF_INET6 protocol family
[    0.446072] random: crng init done
[    0.450994] Segment Routing with IPv6
[    0.451116] In-situ OAM (IOAM) with IPv6
[    0.451399] NET: Registered PF_PACKET protocol family
[    0.451847] Bluetooth: RFCOMM TTY layer initialized
[    0.451904] Bluetooth: RFCOMM socket layer initialized
[    0.451958] Bluetooth: RFCOMM ver 1.11
[    0.451993] Bluetooth: BNEP (Ethernet Emulation) ver 1.3
[    0.452008] Bluetooth: BNEP filters: protocol multicast
[    0.452030] Bluetooth: BNEP socket layer initialized
[    0.452044] Bluetooth: HIDP (Human Interface Emulation) ver 1.2
[    0.452064] Bluetooth: HIDP socket layer initialized
[    0.452570] Key type dns_resolver registered
[    0.452708] ThumbEE CPU extension supported.
[    0.452742] Registering SWP/SWPB emulation handler
[    0.453229] registered taskstats version 1
[    0.453273] Loading compiled-in X.509 certificates
[    0.458515] arm-scmi firmware:scmi: SCMI Notifications - Core Enabled.
[    0.458768] arm-scmi firmware:scmi: SCMI Protocol v2.0 'ST:' Firmware version 0x0
[    0.468460] thermal thermal_zone0: binding zone cpu-thermal with cdev cpufreq-cpu0 failed:-22
[    0.477090] scmi-regulator scmi_dev.4: Regulator reg11 registered for domain [0]
[    0.478013] scmi-regulator scmi_dev.4: Regulator reg18 registered for domain [1]
[    0.478554] scmi-regulator scmi_dev.4: Regulator usb33 registered for domain [2]
[    0.482039] stm32_rtc 5c004000.rtc: registered as rtc0
[    0.482111] stm32_rtc 5c004000.rtc: setting system clock to 2000-01-01T01:11:10 UTC (946689070)
[    0.482484] stm32_rtc 5c004000.rtc: Date/Time must be initialized
[    0.482518] stm32_rtc 5c004000.rtc: registered rev:3.3
[    0.496910] stm32mp135-pinctrl soc:pinctrl@50002000: GPIOA bank added
[    0.498090] stm32mp135-pinctrl soc:pinctrl@50002000: GPIOB bank added
[    0.499054] stm32mp135-pinctrl soc:pinctrl@50002000: GPIOC bank added
[    0.499988] stm32mp135-pinctrl soc:pinctrl@50002000: GPIOD bank added
[    0.500922] stm32mp135-pinctrl soc:pinctrl@50002000: GPIOE bank added
[    0.501899] stm32mp135-pinctrl soc:pinctrl@50002000: GPIOF bank added
[    0.502870] stm32mp135-pinctrl soc:pinctrl@50002000: GPIOG bank added
[    0.503849] stm32mp135-pinctrl soc:pinctrl@50002000: GPIOH bank added
[    0.504856] stm32mp135-pinctrl soc:pinctrl@50002000: GPIOI bank added
[    0.504929] stm32mp135-pinctrl soc:pinctrl@50002000: Pinctrl STM32 initialized
[    0.509056] stm32-mdma 58000000.dma-controller: STM32 MDMA driver registered
[    0.512726] stm32-usbphyc 5a006000.usbphyc: registered rev:1.0
[    0.515730] stm32-dma 48000000.dma-controller: STM32 DMA driver registered
[    0.518303] stm32-dma 48001000.dma-controller: STM32 DMA driver registered
[    0.519577] stm32-usart 40010000.serial: interrupt mode for rx (no dma)
[    0.519619] stm32-usart 40010000.serial: interrupt mode for tx (no dma)
[    0.519659] 40010000.serial: ttySTM0 at MMIO 0x40010000 (irq = 52, base_baud = 4000000) is a stm32-usart
[    1.673718] printk: console [ttySTM0] enabled
[    1.680003] stm32-usart 40011000.serial: interrupt mode for rx (no dma)
[    1.685200] stm32-usart 40011000.serial: interrupt mode for tx (no dma)
[    1.691862] 40011000.serial: ttySTM2 at MMIO 0x40011000 (irq = 53, base_baud = 4000000) is a stm32-usart
[    1.703297] stm32-usart 40018000.serial: interrupt mode for rx (no dma)
[    1.708633] stm32-usart 40018000.serial: interrupt mode for tx (no dma)
[    1.715135] 40018000.serial: ttySTM3 at MMIO 0x40018000 (irq = 54, base_baud = 4000000) is a stm32-usart
[    1.726479] stm32-usart 4c000000.serial: interrupt mode for rx (no dma)
[    1.731798] stm32-usart 4c000000.serial: interrupt mode for tx (no dma)
[    1.738336] 4c000000.serial: ttySTM1 at MMIO 0x4c000000 (irq = 55, base_baud = 4000000) is a stm32-usart
[    1.754589] spi-nand spi0.0: GigaDevice SPI NAND was found.
[    1.758957] spi-nand spi0.0: 128 MiB, block size: 128 KiB, page size: 2048, OOB size: 128
[    1.767139] 7 fixed-partitions partitions found on MTD device spi0.0
[    1.773313] Creating 7 MTD partitions on "spi0.0":
[    1.778091] 0x000000000000-0x000000080000 : "fsbl1"
[    1.785399] 0x000000080000-0x000000100000 : "fsbl2"
[    1.791535] 0x000000100000-0x000000180000 : "metadata1"
[    1.798102] 0x000000180000-0x000000200000 : "metadata2"
[    1.804413] 0x000000200000-0x000000400000 : "fip-a1"
[    1.811380] 0x000000400000-0x000000600000 : "fip-a2"
[    1.818321] 0x000000600000-0x000008000000 : "UBI"
[    1.880901] stm32-dwmac 5800a000.eth1: IRQ eth_lpi not found
[    1.885414] stm32-dwmac 5800a000.eth1: PTP uses main clock
[    1.891796] stm32-dwmac 5800a000.eth1: User ID: 0x12, Synopsys ID: 0x42
[    1.897204] stm32-dwmac 5800a000.eth1:       DWMAC4/5
[    1.901864] stm32-dwmac 5800a000.eth1: DMA HW capability register supported
[    1.908822] stm32-dwmac 5800a000.eth1: RX Checksum Offload Engine supported
[    1.915700] stm32-dwmac 5800a000.eth1: TX Checksum insertion supported
[    1.922195] stm32-dwmac 5800a000.eth1: Wake-Up On Lan supported
[    1.928244] stm32-dwmac 5800a000.eth1: TSO supported
[    1.933012] stm32-dwmac 5800a000.eth1: Enable RX Mitigation via HW Watchdog Timer
[    1.940552] stm32-dwmac 5800a000.eth1: device MAC address fe:72:21:05:53:af
[    1.947438] stm32-dwmac 5800a000.eth1: Enabled L3L4 Flow TC (entries=2)
[    1.954039] stm32-dwmac 5800a000.eth1: Enabled RFS Flow TC (entries=8)
[    1.960570] stm32-dwmac 5800a000.eth1: TSO feature enabled
[    1.965937] stm32-dwmac 5800a000.eth1: Using 32 bits DMA width
[    1.987169] dwc2 49000000.usb-otg: supply vusb_d not found, using dummy regulator
[    1.993757] dwc2 49000000.usb-otg: supply vusb_a not found, using dummy regulator
[    2.127846] dwc2 49000000.usb-otg: EPs: 9, dedicated fifos, 952 entries in SPRAM
[    2.134740] dwc2 49000000.usb-otg: DWC OTG Controller
[    2.139020] dwc2 49000000.usb-otg: new USB bus registered, assigned bus number 1
[    2.146261] dwc2 49000000.usb-otg: irq 56, io mem 0x49000000
[    2.153190] hub 1-0:1.0: USB hub found
[    2.155629] hub 1-0:1.0: 1 port detected
[    2.160845] using random self ethernet address
[    2.163920] using random host ethernet address
[    2.169533] usb0: HOST MAC 52:42:ed:cc:2f:5e
[    2.172609] usb0: MAC 4e:3f:2f:7c:60:8c
[    2.176565] using random self ethernet address
[    2.181135] using random host ethernet address
[    2.185418] g_ether gadget: Ethernet Gadget, version: Memorial Day 2008
[    2.191893] g_ether gadget: g_ether ready
[    2.195856] dwc2 49000000.usb-otg: bound driver g_ether
[    2.205058] ehci-platform 5800d000.usbh-ehci: EHCI Host Controller
[    2.210065] ehci-platform 5800d000.usbh-ehci: new USB bus registered, assigned bus number 2
[    2.218696] ehci-platform 5800d000.usbh-ehci: irq 48, io mem 0x5800d000
[    2.247544] ehci-platform 5800d000.usbh-ehci: USB 2.0 started, EHCI 1.00
[    2.254243] hub 2-0:1.0: USB hub found
[    2.256673] hub 2-0:1.0: 2 ports detected
[    2.281817] stm32f7-i2c 40012000.i2c: STM32F7 I2C-0 bus adapter
[    2.307981] stm32f7-i2c 40013000.i2c: STM32F7 I2C-1 bus adapter
[    2.314099] stm_thermal 50028000.thermal: stm_thermal_probe: Driver initialized successfully
[    2.321197] dwc2 49000000.usb-otg: new device is high-speed
[    2.331266] mmci-pl18x 58007000.mmc: mmc0: PL180 manf 53 rev2 at 0x58007000 irq 45,0 (pio)
[    2.353874] dwc2 49000000.usb-otg: new address 12
[    2.374912] spi@0 enforce active low on chipselect handle
[    2.380284] spi_stm32 4c002000.spi: driver initialized (master mode)
[    2.387266] spi@0 enforce active low on chipselect handle
[    2.392052] spi_master spi2: cannot find modalias for /soc/spi@4c003000/spi@0
[    2.398486] spi_master spi2: Failed to create SPI device for /soc/spi@4c003000/spi@0
[    2.406152] spi_stm32 4c003000.spi: driver initialized (master mode)
[    2.413732] mmc0: queuing unknown CIS tuple 0x01 [d9 01 ff] (3 bytes)
[    2.422262] ubi0: attaching mtd6
[    2.430871] mmc0: queuing unknown CIS tuple 0x1a [01 01 00 02 07] (5 bytes)
[    2.440319] mmc0: queuing unknown CIS tuple 0x1b [c1 41 30 30 ff ff ff ff] (8 bytes)
[    2.458755] mmc0: new SDIO card at address 0001
[    2.576910] dwc2 49000000.usb-otg: new device is high-speed
[    2.613773] dwc2 49000000.usb-otg: new address 13
[    2.818942] ubi0: scanning is finished
[    2.829256] ubi0: attached mtd6 (name "UBI", size 122 MiB)
[    2.833350] ubi0: PEB size: 131072 bytes (128 KiB), LEB size: 126976 bytes
[    2.840344] ubi0: min./max. I/O unit sizes: 2048/2048, sub-page size 2048
[    2.846928] ubi0: VID header offset: 2048 (aligned 2048), data offset: 4096
[    2.853930] ubi0: good PEBs: 976, bad PEBs: 0, corrupted PEBs: 0
[    2.859941] ubi0: user volume: 4, internal volumes: 1, max. volumes count: 128
[    2.867123] ubi0: max/mean erase counter: 2/0, WL threshold: 4096, image sequence number: 88350912
[    2.876037] ubi0: available PEBs: 0, total reserved PEBs: 976, PEBs reserved for bad PEB handling: 20
[    2.885284] ubi0: background thread "ubi_bgt0d" started, PID 101
[    2.892079] input: gpio-keys as /devices/platform/gpio-keys/input/input0
[    2.899539] cfg80211: Loading compiled-in X.509 certificates for regulatory database
[    2.910689] cfg80211: Loaded X.509 cert 'sforshee: 00b28ddf47aef9cea7'
[    2.916002] platform regulatory.0: Direct firmware load for regulatory.db failed with error -2
[    2.925571] cfg80211: failed to load regulatory.db
[    2.931683] UBIFS (ubi0:3): Mounting in unauthenticated mode
[    2.936261] UBIFS (ubi0:3): background thread "ubifs_bgt0_3" started, PID 107
[    2.994049] UBIFS (ubi0:3): UBIFS: mounted UBI device 0, volume 3, name "rootfs"
[    3.000117] UBIFS (ubi0:3): LEB size: 126976 bytes (124 KiB), min./max. I/O unit sizes: 2048 bytes/2048 bytes
[    3.009963] UBIFS (ubi0:3): FS size: 101834752 bytes (97 MiB, 802 LEBs), max 2048 LEBs, journal size 9023488 bytes (8 MiB, 72 LEBs)
[    3.021774] UBIFS (ubi0:3): reserved for root: 0 bytes (0 KiB)
[    3.027572] UBIFS (ubi0:3): media format: w4/r0 (latest is w5/r0), UUID 0914D225-A103-4884-A7AB-6E3075ED5B20, small LPT model
[    3.040385] VFS: Mounted root (ubifs filesystem) on device 0:16.
[    3.045722] devtmpfs: mounted
[    3.050073] Freeing unused kernel image (initmem) memory: 1024K
[    3.054931] Run /sbin/init as init process
[    3.058727]   with arguments:
[    3.058741]     /sbin/init
[    3.058750]   with environment:
[    3.058758]     HOME=/
[    3.058766]     TERM=linux
[    3.336063] systemd[1]: System time before build time, advancing clock.
[    3.440408] systemd[1]: systemd 250.5+ running in system mode (+PAM -AUDIT -SELINUX -APPARMOR +IMA -SMACK -SECCOMP -GCRYPT -GNUTLS -OPENSSL -ACL +BLKID -CURL -ELFUTILS -FIDO2 -IDN2 -IDN +IPTC +KMOD -LIBCRYPTSETUP +LIBFDISK -PCRE2 -PWQUALITY -P11KIT -QRENCODE -BZIP2 -LZ4 -XZ -ZLIB +ZSTD -BPF_FRAMEWORK -XKBCOMMON +UTMP +SYSVINIT default-hierarchy=hybrid)
[    3.472515] systemd[1]: Detected architecture arm.
[    3.572335] systemd[1]: Hostname set to <myd-yf13x>.
[    7.009695] systemd[1]: /lib/systemd/system/mount-partitions.service:9: Standard output type syslog is obsolete, automatically updating to journal. Please update your unit file, and consider removing the setting altogether.
[    7.063548] systemd[1]: Queued start job for default target Multi-User System.
[    7.143012] systemd[1]: Created slice Slice /system/getty.
[    7.182957] systemd[1]: Created slice Slice /system/modprobe.
[    7.222266] systemd[1]: Created slice Slice /system/serial-getty.
[    7.261601] systemd[1]: Created slice User and Session Slice.
[    7.299902] systemd[1]: Started Dispatch Password Requests to Console Directory Watch.
[    7.338479] systemd[1]: Started Forward Password Requests to Wall Directory Watch.
[    7.378451] systemd[1]: Reached target Path Units.
[    7.418048] systemd[1]: Reached target Remote File Systems.
[    7.458052] systemd[1]: Reached target Slice Units.
[    7.488059] systemd[1]: Reached target Swaps.
[    7.559233] systemd[1]: Listening on RPCbind Server Activation Socket.
[    7.598123] systemd[1]: Reached target RPC Port Mapper.
[    7.640262] systemd[1]: Listening on Syslog Socket.
[    7.693590] systemd[1]: Listening on Process Core Dump Socket.
[    7.728672] systemd[1]: Listening on initctl Compatibility Named Pipe.
[    7.776177] systemd[1]: Journal Audit Socket was skipped because of a failed condition check (ConditionSecurity=audit).
[    7.788111] systemd[1]: Listening on Journal Socket (/dev/log).
[    7.829463] systemd[1]: Listening on Journal Socket.
[    7.870548] systemd[1]: Listening on Network Service Netlink Socket.
[    7.911595] systemd[1]: Listening on udev Control Socket.
[    7.949005] systemd[1]: Listening on udev Kernel Socket.
[    7.989907] systemd[1]: Listening on User Database Manager Socket.
[    8.029370] systemd[1]: Huge Pages File System was skipped because of a failed condition check (ConditionPathExists=/sys/kernel/mm/hugepages).
[    8.052706] systemd[1]: Mounting POSIX Message Queue File System...
[    8.095666] systemd[1]: Mounting Kernel Debug File System...
[    8.155337] systemd[1]: Mounting Kernel Trace File System...
[    8.206516] systemd[1]: Mounting Temporary Directory /tmp...
[    8.248951] systemd[1]: Create List of Static Device Nodes was skipped because of a failed condition check (ConditionFileNotEmpty=/lib/modules/5.15.67-g9cec825a70d7-dirty/modules.devname).
[    8.276837] systemd[1]: Starting Load Kernel Module configfs...
[    8.326196] systemd[1]: Starting Load Kernel Module drm...
[    8.355035] systemd[1]: Starting Load Kernel Module fuse...
[    8.406073] systemd[1]: Starting Mount partitions...
[    8.471323] systemd[1]: Starting RPC Bind...
[    8.490473] systemd[1]: File System Check on Root Device was skipped because of a failed condition check (ConditionPathIsReadWrite=!/).
[    8.544922] systemd[1]: Starting Journal Service...
[    8.587949] systemd[1]: Load Kernel Modules was skipped because all trigger condition checks failed.
[    8.640085] systemd[1]: Starting Generate network units from Kernel command line...
[    8.715974] systemd[1]: Starting Remount Root and Kernel File Systems...
[    8.786487] systemd[1]: Starting Apply Kernel Variables...
[    8.866522] systemd[1]: Starting Coldplug All udev Devices...
[    9.086960] systemd[1]: Mounted POSIX Message Queue File System.
[    9.150017] systemd[1]: Started RPC Bind.
[    9.163926] systemd[1]: Mounted Kernel Debug File System.
[    9.176996] UBIFS (ubi0:2): Mounting in unauthenticated mode
[    9.184865] UBIFS (ubi0:2): background thread "ubifs_bgt0_2" started, PID 585
[    9.209126] systemd[1]: Mounted Kernel Trace File System.
[    9.249052] systemd[1]: Mounted Temporary Directory /tmp.
[    9.290827] systemd[1]: modprobe@configfs.service: Deactivated successfully.
[    9.306977] UBIFS (ubi0:2): UBIFS: mounted UBI device 0, volume 2, name "boot"
[    9.328039] systemd[1]: Finished Load Kernel Module configfs.
[    9.338063] UBIFS (ubi0:2): LEB size: 126976 bytes (124 KiB), min./max. I/O unit sizes: 2048 bytes/2048 bytes
[    9.367723] UBIFS (ubi0:2): FS size: 15491072 bytes (14 MiB, 122 LEBs), max 1024 LEBs, journal size 9023488 bytes (8 MiB, 72 LEBs)
[    9.407302] UBIFS (ubi0:2): reserved for root: 0 bytes (0 KiB)
[    9.418004] UBIFS (ubi0:2): media format: w4/r0 (latest is w5/r0), UUID 039E39EF-10A1-4A79-9B69-76648C6067E0, small LPT model
[    9.451167] systemd[1]: modprobe@drm.service: Deactivated successfully.
[    9.488421] systemd[1]: Finished Load Kernel Module drm.
[    9.570665] systemd[1]: modprobe@fuse.service: Deactivated successfully.
[    9.599101] systemd[1]: Finished Load Kernel Module fuse.
[    9.648511] systemd[1]: Finished Mount partitions.
[    9.698621] systemd[1]: Finished Generate network units from Kernel command line.
[    9.743407] systemd[1]: Finished Remount Root and Kernel File Systems.
[    9.799110] systemd[1]: Started Journal Service.
[   10.125278] systemd-journald[557]: Received client request to flush runtime journal.
[   14.170199] mtdblock: MTD device 'fsbl2' is NAND, please consider using UBI block devices instead.
[   14.182592] mtdblock: MTD device 'fsbl1' is NAND, please consider using UBI block devices instead.
[   14.233122] mtdblock: MTD device 'metadata1' is NAND, please consider using UBI block devices instead.
[   14.389813] mtdblock: MTD device 'metadata2' is NAND, please consider using UBI block devices instead.
[   14.600516] mtdblock: MTD device 'fip-a1' is NAND, please consider using UBI block devices instead.
[   14.623483] mtdblock: MTD device 'fip-a2' is NAND, please consider using UBI block devices instead.
[   14.922368] mtdblock: MTD device 'UBI' is NAND, please consider using UBI block devices instead.
[   15.853291] using random self ethernet address
[   15.856375] using random host ethernet address
[   16.851938] udc-core: couldn't find an available UDC or it's busy
[   22.545146] stm32-dwmac 5800a000.eth1 eth0: PHY [stmmac-0:03] driver [TI DP83825I] (irq=POLL)
[   22.578794] stm32-dwmac 5800a000.eth1 eth0: Register MEM_TYPE_PAGE_POOL RxQ-0
[   22.607776] dwmac4: Master AXI performs any burst length
[   22.611678] stm32-dwmac 5800a000.eth1 eth0: No Safety Features support found
[   22.648070] stm32-dwmac 5800a000.eth1 eth0: IEEE 1588-2008 Advanced Timestamp supported
[   22.685974] stm32-dwmac 5800a000.eth1 eth0: registered PTP clock
[   22.728179] stm32-dwmac 5800a000.eth1 eth0: configuring for phy/rmii link mode
[   33.127571] vddadc: disabling
[  116.717188] esp32_sdio: loading out-of-tree module taints kernel.
[  116.725149] esp_probe: ESP network device detected

Steps to reproduce the behavior

  1. insmod esp32_sdio.ko
  2. mknod /dev/esps0 c 221 0
  3. chmod 666 /dev/esps0
  4. ./test.out softap_start

Project release version

release/fg-v0.0.5

System architecture

other (details in Additional context)

Operating system

Linux

Operating system version

Linux version 5.15.67

Shell

sh

Additional context

No response

mantriyogesh commented 1 month ago
  1. Please try with the latest master at both esp and host.

  2. root@myd-yf13x:/# mknod /dev/esps0 c 221 0
    root@myd-yf13x:/# chmod 666 /dev/esps0

    is not more required or supported.

  3. There are module parameters mentioned, unless you use reset pin, it would not work.

  4. I suspect that you have not followed the porting guide correctly. Check it step by step and retry. https://github.com/espressif/esp-hosted/blob/master/esp_hosted_fg/docs/Linux_based_host/porting_guide.md

  5. there are no esp side logs attached.

mantriyogesh commented 1 month ago

Please use latest master code on both esp and host - same git commit.

renliangli commented 1 month ago

esp side log:

configsip: 0, SPIWP:0xee clk_drv:0x00,q_drv:0x00,d_drv:0x00,cs0_drv:0x00,hd_drv:0x00,wp_drv:0x00 mode:DIO, clock div:2 load:0x3fff0030,len:7012 load:0x40078000,len:15384 load:0x40080400,len:3816 entry 0x40080648 I (269) boot: ESP-IDF v5.0-beta1-742-g7bd5af7f1e 2nd stage bootloader I (269) boot: compile time 09:25:50 I (270) boot: chip revision: V301 I (274) boot_comm: chip revision: 3, min. bootloader chip revision: 0 I (281) boot.esp32: SPI Speed : 40MHz I (286) boot.esp32: SPI Mode : DIO I (290) boot.esp32: SPI Flash Size : 4MB I (295) boot: Enabling RNG early entropy source... I (300) boot: Partition Table: I (304) boot: ## Label Usage Type ST Offset Length I (311) boot: 0 nvs WiFi data 01 02 00009000 00004000 I (319) boot: 1 otadata OTA data 01 00 0000d000 00002000 I (326) boot: 2 phy_init RF data 01 01 0000f000 00001000 I (334) boot: 3 factory factory app 00 00 00010000 00100000 I (341) boot: 4 ota_0 OTA app 00 10 00110000 00100000 I (349) boot: 5 ota_1 OTA app 00 11 00210000 00100000 I (357) boot: End of partition table I (361) boot: Defaulting to factory image I (366) boot_comm: chip revision: 3, min. application chip revision: 0 I (373) esp_image: segment 0: paddr=00010020 vaddr=3f400020 size=28444h (164932) map I (441) esp_image: segment 1: paddr=0003846c vaddr=3ffbdb60 size=05874h ( 22644) load I (450) esp_image: segment 2: paddr=0003dce8 vaddr=40080000 size=02330h ( 9008) load I (454) esp_image: segment 3: paddr=00040020 vaddr=400d0020 size=9c740h (640832) map I (689) esp_image: segment 4: paddr=000dc768 vaddr=40082330 size=1bbech (113644) load I (736) esp_image: segment 5: paddr=000f835c vaddr=50000000 size=00010h ( 16) load I (751) boot: Loaded app from partition at offset 0x10000 I (751) boot: Disabling RNG early entropy source... I (763) cpu_start: Pro cpu up. I (763) cpu_start: Starting app cpu, entry point is 0x400813dc I (0) cpu_start: App cpu up. I (779) cpu_start: Pro cpu start user code I (779) cpu_start: cpu freq: 240000000 Hz I (779) cpu_start: Application information: I (784) cpu_start: Project name: network_adapter I (790) cpu_start: App version: e0bb23b I (795) cpu_start: Compile time: Oct 21 2022 09:25:38 I (801) cpu_start: ELF file SHA256: e190dae174510bac... I (807) cpu_start: ESP-IDF: v5.0-beta1-742-g7bd5af7f1e I (814) heap_init: Initializing. RAM available for dynamic allocation: I (821) heap_init: At 3FFAFF10 len 000000F0 (0 KiB): DRAM I (827) heap_init: At 3FFB6388 len 00001C78 (7 KiB): DRAM I (833) heap_init: At 3FFB9A20 len 00004108 (16 KiB): DRAM I (839) heap_init: At 3FFCCA38 len 000135C8 (77 KiB): DRAM I (845) heap_init: At 3FFE0440 len 00003AE0 (14 KiB): D/IRAM I (851) heap_init: At 3FFE4350 len 0001BCB0 (111 KiB): D/IRAM I (858) heap_init: At 4009DF1C len 000020E4 (8 KiB): IRAM I (865) spi_flash: detected chip: generic I (869) spi_flash: flash io: dio W (873) spi_flash: Detected size(8192k) larger than the size in the binary image header(4096k). Using the size in the binary image header. I (887) cpu_start: Starting scheduler on PRO CPU. I (0) cpu_start: Starting scheduler on APP CPU. I (901) NETWORK_ADAPTER: I (907) NETWORK_ADAPTER: ESP-Hosted-FG Firmware version :: 0.0.5 I (915) NETWORK_ADAPTER: Transport used :: SDIO only I (923) NETWORK_ADAPTER: I (931) NETWORK_ADAPTER: Supported features are: I (935) NETWORK_ADAPTER: - WLAN over SDIO I (939) ESP_BT: - BT/BLE I (941) ESP_BT: - HCI Over SDIO I (943) ESP_BT: - BT/BLE dual mode I (947) NETWORK_ADAPTER: capabilities: 0x1d I (959) BTDM_INIT: BT controller compile version [8020d24] I (961) system_api: Base MAC address is not set I (961) system_api: read default base MAC address from EFUSE I (967) phy_init: phy_version 4670,719f9f6,Feb 18 2021,17:07:07 I (1293) NETWORK_ADAPTER: ESP Bluetooth MAC addr: e4:65:b8:50:34:76 I (1293) SDIO_SLAVE: Using SDIO interface I (29791) NETWORK_ADAPTER: Start Data Path

mantriyogesh commented 1 month ago

As I see, 'Start Data Path' is there, host and slave seems to be configured fine with sdio - only the connection is there.

but from

[  116.717188] esp32_sdio: loading out-of-tree module taints kernel.
[  116.725149] esp_probe: ESP network device detected

it is evident that the hardwares are not correctly connected.

It is ESP32 as SDIO slave. So it may need eFuse burning. It also needs external pull-ups.

Next things:

  1. Check porting guide for expected hardware requirements. efuse & ext pull-ups are mandatory.
  2. There are extremely strict requirements for jumper cables, if you are connecting with jumper cables. Share photo of setup in this regard. if you use PCB, there should be no problems, if you adhere (1) in your hardware.
renliangli commented 1 month ago

Please use latest master code on both esp and host - same git commit.

The latest master branch code is ok, the problem has been resolved, thank you.