Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Kernel5.4.3, ESP32 WRoom 32UE ,use esp-hosted-release-v0.3 sdio wifi #212

Open
shihui2014 opened this issue Mar 11, 2023 · 62 comments
Open

Comments

@shihui2014
Copy link

insmod esp32_sdio.ko,can not run esp_probe function
i have update dtsi
&usdhc2 {
#address-cells = <1>;
#size-cells = <0>;
pinctrl-names = "default";
max-frequency = <50000000>;
pinctrl-0 = <&pinctrl_usdhc2_alt &pinctrl_wifi>;// &pinctrl_wifi
bus-width = <4>;
// no-1-8-v; /* force 3.3V VIO */
non-removable;
pm-ignore-notify;
cap-power-off-card;
// /delete-property/ wakeup-source;
status = "okay";
esp32: esp32@1 {
reg = <1>;
compatible = "esp32_sdio";
gpios = <&gpio3 4 GPIO_ACTIVE_LOW>;
};
};
pinctrl_wifi: wifigrp {
fsl,pins = <
MX6UL_PAD_LCD_RESET__GPIO3_IO04 0x1b0b0

    >;
};

pinctrl_usdhc2_alt: usdhc2grp_alt {
fsl,pins = <
MX6UL_PAD_LCD_DATA18__USDHC2_CMD 0x17051
MX6UL_PAD_LCD_DATA19__USDHC2_CLK 0x17051
MX6UL_PAD_LCD_DATA20__USDHC2_DATA0 0x17051
MX6UL_PAD_LCD_DATA21__USDHC2_DATA1 0x17051
MX6UL_PAD_LCD_DATA22__USDHC2_DATA2 0x17051
MX6UL_PAD_LCD_DATA23__USDHC2_DATA3 0x17051
>;
};
and menuconfig MMC/SD/SDIO card support (MMC [=y])

insmod esp32_sio.ko can restart esp32 ,because i have config static int resetpin = 68;
the esp32 log is
I (647) system_api: Base MAC address is not set, read default base MAC address from BLK0 of EFUSE
I (757) phy: phy_version: 4390, 6b3c1f2, Sep 10 2020, 15:09:07, 0, 0
I (1227) SDIO_SLAVE: Using SDIO interface
I (1247) wifi:wifi driver task: 3ffde798, prio:23, stack:6656, core=0
I (1247) system_api: Base MAC address is not set, read default base MAC address from BLK0 of EFUSE
I (1247) system_api: Base MAC address is not set, read default base MAC address from BLK0 of EFUSE
I (1257) wifi:wifi firmware version: 6e1f9e4
I (1257) wifi:config NVS flash: disabled
I (1267) wifi:config nano formating: disabled
I (1267) wifi:Init data frame dynamic rx buffer num: 32
I (1277) wifi:Init management frame dynamic rx buffer num: 32
I (1277) wifi:Init management short buffer num: 32
I (1287) wifi:Init dynamic tx buffer num: 32
I (1287) wifi:Init static rx buffer size: 1600
I (1287) wifi:Init static rx buffer num: 10
I (1297) wifi:Init dynamic rx buffer num: 32
I (1307) wifi:mode : null
I (1307) NETWORK_ADAPTER: Initial set up done
kernel log
dmesg |grep usdh
[2.313463] mmcl: SDHCI ontroller on 2194000.usdhc [2194000.usdhc] using ADMA
and /sys/bus/sdio/devices nothing

@shihui2014 shihui2014 changed the title Kernel5.4.3, ESP32 WRoom 32UE ,use esp-hosted-release-v0.3 wifi Kernel5.4.3, ESP32 WRoom 32UE ,use esp-hosted-release-v0.3 sdio wifi Mar 11, 2023
@mantriyogesh
Copy link
Collaborator

Hello @shihui2014 ,

Thank you for using ESP-HOSTED.

As I see you are using 0.3, I recommend using latest release, 0.0.5.

Can you please confirm the source code git commit you are using for 0.3, at ESP side and Host side?
Host and ESP side code is expected to be on same commit.
If in case you are using released ESP binaries, 'source code.zip' from assets on same page is expected to be used for host side kernel module building.

@shihui2014
Copy link
Author

shihui2014 commented Mar 11, 2023

i have use same verion, esp_hosted_firmware_esp32_sdio_uart_v0.3 and esp-hosted-release-v0.3,
the pin cmd and all the data(dat0-dat3) mast 10K pullups?

@shihui2014
Copy link
Author

Can you tell me kernel ,esp32 sdio work time sequence?

@mantriyogesh
Copy link
Collaborator

Okay.
In your case, pull ups are required (mandatory) for sdio. See the [details)[https://docs.espressif.com/projects/esp-idf/en/v4.1/api-reference/peripherals/sd_pullup_requirements.html).

Can you help to provide logs at host (/var/log/kern.log or dmesg or /var/log/messages) and commands run at host and their output.

Kernel 5.4.3 should be okay.
Can you please elaborate 'sdio work time sequence'?

Some milestones:

  1. Most imp: porting guide. please check both, https://github.com/espressif/esp-hosted/blob/master/esp_hosted_fg/docs/Linux_based_host/porting_guide.md
    And
    https://github.com/espressif/esp-hosted/blob/master/esp_hosted_ng/docs/porting_guide.md
  2. Getting sdio configured on your platform using say device tree
  3. Add external pull ups
  4. Connect esp to host using sdio lines
  5. Burn esp with sdio binaries
  6. While bootup of host, you should get CIS info printed (esp identified as sdio) with matching sdio instance as configured (in device tree)
  7. Resetpin should be verified working
  8. Load the kernel driver
  9. Get the bootup / init event from ESP

CIS and bootup logs can be referred from https://github.com/espressif/esp-hosted/blob/master/esp_hosted_fg/docs/Linux_based_host/SDIO_setup.md#3-checking-the-setup-for-sdio

Getting platform configured is prerequisite for esp hosted kernel driver to work.
we can help you in the process, but it largely remains outsides the scope of esp_hosted.

If you are no position to add pull ups, you can use alternative transport, spi, where pull ups are not required.

@shihui2014
Copy link
Author

thanks for your reply,Below is the kernel5.4.3 log
and we have add external pull ups
Loading Environment from NAND... *** Warning - bad CRC, using default environment

Display: MYIR-LCD-7-800x480 (800x480)
Video: 800x480x16
In: serial
Out: serial
Err: serial
Net:
Warning: ethernet@02188000 (eth0) using random MAC address - 66:63:3a:14:e0:9f
eth0: ethernet@02188000 [PRIME]
Fastboot: Normal
Normal Boot
Hit any key to stop autoboot: 0

NAND read: device 0 offset 0x600000, size 0xa00000
10485760 bytes read: OK

NAND read: device 0 offset 0x1000000, size 0x100000
1048576 bytes read: OK
Kernel image @ 0x80800000 [ 0x000000 - 0x83ee60 ]

Flattened Device Tree blob at 83000000

Booting using the fdt blob at 0x83000000
Using Device Tree in place at 83000000, end 8300bca9
Modify /soc/aips-bus@2200000/epdc@228c000:status disabled
ft_system_setup for mx6

Starting kernel ...

[ 0.000000] Booting Linux on physical CPU 0x0
[ 0.000000] Linux version 5.4.3-g9c2490a-dirty (wt@ubuntu) (gcc version 9.2.0 (GCC)) #1 SMP PREEMPT Thu Jun 9 18:15:48 PDT 2022
[ 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: Freescale i.MX6 ULL 14x14 MYiR Board
[ 0.000000] Memory policy: Data cache writealloc
[ 0.000000] cma: Reserved 32 MiB at 0x8e000000
[ 0.000000] percpu: Embedded 15 pages/cpu s32076 r8192 d21172 u61440
[ 0.000000] Built 1 zonelists, mobility grouping on. Total pages: 65024
[ 0.000000] Kernel command line: console=ttymxc0,115200 ubi.mtd=4 root=ubi0:rootfs rootfstype=ubifs mtdparts=gpmi-nand:5m(boot),1m(env),10m(kernel),1m(dtb),-(rootfs)
[ 0.000000] Dentry cache hash table entries: 32768 (order: 5, 131072 bytes, linear)
[ 0.000000] Inode-cache hash table entries: 16384 (order: 4, 65536 bytes, linear)
[ 0.000000] mem auto-init: stack:off, heap alloc:off, heap free:off
[ 0.000000] Memory: 208284K/262144K available (11264K kernel code, 727K rwdata, 4060K rodata, 1024K init, 430K bss, 21092K reserved, 32768K cma-reserved, 0K highmem)
[ 0.000000] SLUB: HWalign=64, Order=0-3, MinObjects=0, CPUs=1, Nodes=1
[ 0.000000] rcu: Preemptible hierarchical RCU implementation.
[ 0.000000] rcu: RCU restricting CPUs from NR_CPUS=4 to nr_cpu_ids=1.
[ 0.000000] Tasks RCU enabled.
[ 0.000000] rcu: RCU calculated value of scheduler-enlistment delay is 10 jiffies.
[ 0.000000] rcu: Adjusting geometry for rcu_fanout_leaf=16, nr_cpu_ids=1
[ 0.000000] NR_IRQS: 16, nr_irqs: 16, preallocated irqs: 16
[ 0.000000] random: get_random_bytes called from start_kernel+0x2c8/0x468 with crng_init=0
[ 0.000000] Switching to timer-based delay loop, resolution 41ns
[ 0.000016] sched_clock: 32 bits at 24MHz, resolution 41ns, wraps every 89478484971ns
[ 0.000055] clocksource: mxc_timer1: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 79635851949 ns
[ 0.003077] Console: colour dummy device 80x30
[ 0.003148] Calibrating delay loop (skipped), value calculated using timer frequency.. 48.00 BogoMIPS (lpj=240000)
[ 0.003184] pid_max: default: 32768 minimum: 301
[ 0.003483] Mount-cache hash table entries: 1024 (order: 0, 4096 bytes, linear)
[ 0.003520] Mountpoint-cache hash table entries: 1024 (order: 0, 4096 bytes, linear)
[ 0.005051] CPU: Testing write buffer coherency: ok
[ 0.005734] CPU0: update cpu_capacity 1024
[ 0.005765] CPU0: thread -1, cpu 0, socket 0, mpidr 80000000
[ 0.060581] Setting up static identity map for 0x80100000 - 0x80100060
[ 0.080553] rcu: Hierarchical SRCU implementation.
[ 0.120722] smp: Bringing up secondary CPUs ...
[ 0.120758] smp: Brought up 1 node, 1 CPU
[ 0.120780] SMP: Total of 1 processors activated (48.00 BogoMIPS).
[ 0.120796] CPU: All CPU(s) started in SVC mode.
[ 0.121631] devtmpfs: initialized
[ 0.133343] Duplicate name in timing0, renamed to "-porch#1"
[ 0.133552] Duplicate name in timing1, renamed to "-porch#1"
[ 0.137260] VFP support v0.3: implementor 41 architecture 2 part 30 variant 7 rev 5
[ 0.138200] clocksource: jiffies: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 19112604462750000 ns
[ 0.138254] futex hash table entries: 256 (order: 2, 16384 bytes, linear)
[ 0.141136] pinctrl core: initialized pinctrl subsystem
[ 0.143451] NET: Registered protocol family 16
[ 0.166678] DMA: preallocated 256 KiB pool for atomic coherent allocations
[ 0.169281] cpuidle: using governor menu
[ 0.186693] vdd3p0: supplied by regulator-dummy
[ 0.188066] cpu: supplied by regulator-dummy
[ 0.189367] vddsoc: supplied by regulator-dummy
[ 0.213865] No ATAGs?
[ 0.214001] hw-breakpoint: found 5 (+1 reserved) breakpoint and 4 watchpoint registers.
[ 0.214039] hw-breakpoint: maximum watchpoint size is 8 bytes.
[ 0.218389] imx6ul-pinctrl 20e0000.iomuxc: no groups defined in /soc/aips-bus@2000000/iomuxc@20e0000/gpmi-nand-1
[ 0.218432] imx6ul-pinctrl 20e0000.iomuxc: initialized IMX pinctrl driver
[ 0.219680] imx6ul-pinctrl 2290000.iomuxc-snvs: initialized IMX pinctrl driver
[ 0.222693] imx mu driver is registered.
[ 0.223745] imx rpmsg driver is registered.
[ 0.326201] regulator@2 GPIO handle specifies active low - ignored
[ 0.329098] vgaarb: loaded
[ 0.330948] SCSI subsystem initialized
[ 0.333267] usbcore: registered new interface driver usbfs
[ 0.333393] usbcore: registered new interface driver hub
[ 0.333610] usbcore: registered new device driver usb
[ 0.337272] i2c i2c-1: IMX I2C adapter registered
[ 0.338087] imx-i2c 21a8000.i2c: can't get pinctrl, bus recovery not supported
[ 0.338822] i2c i2c-2: IMX I2C adapter registered
[ 0.339753] mc: Linux media interface: v0.10
[ 0.339871] videodev: Linux video capture interface: v2.00
[ 0.340008] pps_core: LinuxPPS API ver. 1 registered
[ 0.340026] pps_core: Software ver. 5.3.6 - Copyright 2005-2007 Rodolfo Giometti [email protected]
[ 0.340081] PTP clock support registered
[ 0.343265] MIPI CSI2 driver module loaded
[ 0.343400] Advanced Linux Sound Architecture Driver Initialized.
[ 0.345208] Bluetooth: Core ver 2.22
[ 0.345356] NET: Registered protocol family 31
[ 0.345378] Bluetooth: HCI device and connection manager initialized
[ 0.345417] Bluetooth: HCI socket layer initialized
[ 0.345443] Bluetooth: L2CAP socket layer initialized
[ 0.345496] Bluetooth: SCO socket layer initialized
[ 0.346737] clocksource: Switched to clocksource mxc_timer1
[ 0.347060] VFS: Disk quotas dquot_6.6.0
[ 0.347219] VFS: Dquot-cache hash table entries: 1024 (order 0, 4096 bytes)
[ 0.370272] thermal_sys: Registered thermal governor 'step_wise'
[ 0.370915] NET: Registered protocol family 2
[ 0.372242] tcp_listen_portaddr_hash hash table entries: 512 (order: 0, 6144 bytes, linear)
[ 0.372316] TCP established hash table entries: 2048 (order: 1, 8192 bytes, linear)
[ 0.372389] TCP bind hash table entries: 2048 (order: 2, 16384 bytes, linear)
[ 0.372479] TCP: Hash tables configured (established 2048 bind 2048)
[ 0.372693] UDP hash table entries: 256 (order: 1, 8192 bytes, linear)
[ 0.372760] UDP-Lite hash table entries: 256 (order: 1, 8192 bytes, linear)
[ 0.373137] NET: Registered protocol family 1
[ 0.404656] RPC: Registered named UNIX socket transport module.
[ 0.404691] RPC: Registered udp transport module.
[ 0.404709] RPC: Registered tcp transport module.
[ 0.404727] RPC: Registered tcp NFSv4.1 backchannel transport module.
[ 0.416106] PCI: CLS 0 bytes, default 64
[ 0.417881] hw perfevents: enabled with armv7_cortex_a7 PMU driver, 5 counters available
[ 0.421475] Bus freq driver module loaded
[ 0.424207] Initialise system trusted keyrings
[ 0.424761] workingset: timestamp_bits=30 max_order=16 bucket_order=0
[ 0.449871] NFS: Registering the id_resolver key type
[ 0.449946] Key type id_resolver registered
[ 0.449966] Key type id_legacy registered
[ 0.450069] jffs2: version 2.2. (NAND) © 2001-2006 Red Hat, Inc.
[ 0.451203] fuse: init (API version 7.31)
[ 0.541147] Key type asymmetric registered
[ 0.541180] Asymmetric key parser 'x509' registered
[ 0.541253] io scheduler mq-deadline registered
[ 0.541274] io scheduler kyber registered
[ 0.550044] pwm-backlight backlight-display: backlight-display supply power not found, using dummy regulator
[ 0.550244] of_pwm_get(): can't parse "pwms" property
[ 0.550281] pwm-backlight backlight-display: unable to request PWM
[ 0.550498] pwm-backlight: probe of backlight-display failed with error -2
[ 0.554440] mxsfb 21c8000.lcdif: 21c8000.lcdif supply lcd not found, using dummy regulator
[ 0.554655] mxsfb 21c8000.lcdif: failed to find display phandle
[ 0.554689] mxsfb 21c8000.lcdif: Failed to initialize fbinfo: -2
[ 0.554989] mxsfb: probe of 21c8000.lcdif failed with error -2
[ 0.564598] imx-sdma 20ec000.sdma: Direct firmware load for imx/sdma/sdma-imx6q.bin failed with error -2
[ 0.564639] imx-sdma 20ec000.sdma: Falling back to sysfs fallback for: imx/sdma/sdma-imx6q.bin
[ 0.569771] mxs-dma 1804000.dma-apbh: initialized
[ 0.577620] 2020000.serial: ttymxc0 at MMIO 0x2020000 (irq = 22, base_baud = 5000000) is a IMX
[ 1.334569] printk: console [ttymxc0] enabled
[ 1.341289] 21e8000.serial: ttymxc1 at MMIO 0x21e8000 (irq = 65, base_baud = 5000000) is a IMX
[ 1.351827] 21f0000.serial: ttymxc3 at MMIO 0x21f0000 (irq = 66, base_baud = 5000000) is a IMX
[ 1.396097] imx_rngc 2284000.rng: Freescale RNGC registered.
[ 1.402604] imx sema4 driver is registered.
[ 1.443325] brd: module loaded
[ 1.467216] loop: module loaded
[ 1.473107] imx ahci driver is registered.
[ 1.480642] imx6ul-pinctrl 20e0000.iomuxc: invalid function iomuxc in map table
[ 1.490188] nand: device found, Manufacturer ID: 0x2c, Chip ID: 0xda
[ 1.496589] nand: Micron MT29F2G08ABAEAWP
[ 1.500707] nand: 256 MiB, SLC, erase size: 128 KiB, page size: 2048, OOB size: 64
[ 1.509526] Bad block table found at page 131008, version 0x01
[ 1.515706] Bad block table found at page 130944, version 0x01
[ 1.522070] 5 cmdlinepart partitions found on MTD device gpmi-nand
[ 1.528345] Creating 5 MTD partitions on "gpmi-nand":
[ 1.533444] 0x000000000000-0x000000500000 : "boot"
[ 1.548704] 0x000000500000-0x000000600000 : "env"
[ 1.568658] 0x000000600000-0x000001000000 : "kernel"
[ 1.588669] 0x000001000000-0x000001100000 : "dtb"
[ 1.608642] 0x000001100000-0x000010000000 : "rootfs"
[ 1.628666] gpmi-nand 1806000.gpmi-nand: driver registered.
[ 1.640626] libphy: Fixed MDIO Bus: probed
[ 1.646046] CAN device driver interface
[ 1.719094] pps pps0: new PPS source ptp0
[ 1.723678] fec 20b4000.ethernet: Invalid MAC address: 00:00:00:00:00:00
[ 1.730558] fec 20b4000.ethernet: Using random MAC address: ba:c6:f8:0e:cf:15
[ 1.738608] libphy: fec_enet_mii_bus: probed
[ 1.747670] fec 20b4000.ethernet eth0: registered PHC device 0
[ 1.819019] pps pps1: new PPS source ptp1
[ 1.825620] fec 2188000.ethernet eth1: registered PHC device 1
[ 1.832390] e1000e: Intel(R) PRO/1000 Network Driver - 3.2.6-k
[ 1.838341] e1000e: Copyright(c) 1999 - 2015 Intel Corporation.
[ 1.845415] PPP generic driver version 2.4.2
[ 1.850309] PPP BSD Compression module registered
[ 1.855059] PPP Deflate Compression module registered
[ 1.860237] PPP MPPE Compression module registered
[ 1.865064] NET: Registered protocol family 24
[ 1.869809] usbcore: registered new interface driver r8152
[ 1.875464] usbcore: registered new interface driver lan78xx
[ 1.881476] usbcore: registered new interface driver asix
[ 1.887104] usbcore: registered new interface driver ax88179_178a
[ 1.893321] usbcore: registered new interface driver cdc_ether
[ 1.899374] usbcore: registered new interface driver smsc95xx
[ 1.905244] usbcore: registered new interface driver net1080
[ 1.911075] usbcore: registered new interface driver cdc_subset
[ 1.917165] usbcore: registered new interface driver zaurus
[ 1.922864] usbcore: registered new interface driver MOSCHIP usb-ethernet driver
[ 1.930496] usbcore: registered new interface driver cdc_ncm
[ 1.936300] usbcore: registered new interface driver qmi_wwan_q
[ 1.942398] usbcore: registered new interface driver qmi_wwan
[ 1.948322] ehci_hcd: USB 2.0 'Enhanced' Host Controller (EHCI) Driver
[ 1.954884] ehci-pci: EHCI PCI platform driver
[ 1.959511] ehci-mxc: Freescale On-Chip EHCI Host driver
[ 1.965743] usbcore: registered new interface driver cdc_wdm
[ 1.971684] usbcore: registered new interface driver usb-storage
[ 1.978010] usbcore: registered new interface driver usbserial_generic
[ 1.984642] usbserial: USB Serial support registered for generic
[ 1.990834] usbcore: registered new interface driver option
[ 1.996515] usbserial: USB Serial support registered for GSM modem (1-port)
[ 2.008190] imx_usb 2184000.usb: No over current polarity defined
[ 2.014467] imx_usb 2184000.usb: 2184000.usb supply vbus not found, using dummy regulator
[ 2.217420] random: fast init done
[ 2.649860] mxs_phy 20c9000.usbphy: Data pin can't make good contact.
[ 2.669275] imx_usb 2184200.usb: 2184200.usb supply vbus not found, using dummy regulator
[ 2.682225] ci_hdrc ci_hdrc.1: EHCI Host Controller
[ 2.687322] ci_hdrc ci_hdrc.1: new USB bus registered, assigned bus number 1
[ 2.716844] ci_hdrc ci_hdrc.1: USB 2.0 started, EHCI 1.00
[ 2.722746] usb usb1: New USB device found, idVendor=1d6b, idProduct=0002, bcdDevice= 5.04
[ 2.731189] usb usb1: New USB device strings: Mfr=3, Product=2, SerialNumber=1
[ 2.738503] usb usb1: Product: EHCI Host Controller
[ 2.743420] usb usb1: Manufacturer: Linux 5.4.3-g9c2490a-dirty ehci_hcd
[ 2.750106] usb usb1: SerialNumber: ci_hdrc.1
[ 2.755967] hub 1-0:1.0: USB hub found
[ 2.760032] hub 1-0:1.0: 1 port detected
[ 2.780315] input: 20cc000.snvs:snvs-powerkey as /devices/soc0/soc/2000000.aips-bus/20cc000.snvs/20cc000.snvs:snvs-powerkey/input/input0
[ 2.801100] edt_ft5x06 1-0038: touchscreen probe failed
[ 2.807593] imx6ul-pinctrl 20e0000.iomuxc: pin MX6UL_PAD_GPIO1_IO02 already requested by 20e0000.iomuxc; cannot claim for 2040000.tsc
[ 2.819827] imx6ul-pinctrl 20e0000.iomuxc: pin-25 (2040000.tsc) status -22
[ 2.826808] imx6ul-pinctrl 20e0000.iomuxc: could not request pin 25 (MX6UL_PAD_GPIO1_IO02) from group tscgrp on device 20e0000.iomuxc
[ 2.838974] imx6ul-tsc 2040000.tsc: Error applying setting, reverse things back
[ 2.846346] imx6ul-tsc: probe of 2040000.tsc failed with error -22
[ 2.859207] snvs_rtc 20cc000.snvs:snvs-rtc-lp: registered as rtc0
[ 2.865703] i2c /dev entries driver
[ 2.872296] ov2659 1-0030: link-frequencies property not found or too many
[ 2.879347] ov2659 1-0030: platform data not specified
[ 2.884597] ov2659: probe of 1-0030 failed with error -22
[ 2.892885] pxp-v4l2 pxp_v4l2: initialized
[ 2.902634] imx2-wdt 20bc000.wdog: timeout 60 sec (nowayout=0)
[ 2.910207] Bluetooth: HCI UART driver ver 2.3
[ 2.914705] Bluetooth: HCI UART protocol H4 registered
[ 2.919970] Bluetooth: HCI UART protocol BCSP registered
[ 2.925403] Bluetooth: HCI UART protocol LL registered
[ 2.930715] Bluetooth: HCI UART protocol Three-wire (H5) registered
[ 2.937133] Bluetooth: HCI UART protocol Marvell registered
[ 2.942884] usbcore: registered new interface driver btusb
[ 2.950613] sdhci: Secure Digital Host Controller Interface driver
[ 2.956948] sdhci: Copyright(c) Pierre Ossman
[ 2.961336] sdhci-pltfm: SDHCI platform and OF driver helper
[ 3.012457] mmc1: SDHCI controller on 2194000.usdhc [2194000.usdhc] using ADMA
[ 3.024816] caam-snvs 20cc000.caam-snvs: can't get snvs clock
[ 3.030990] caam-snvs 20cc000.caam-snvs: violation handlers armed - init state
[ 3.047321] usbcore: registered new interface driver usbhid
[ 3.053076] usbhid: USB HID core driver
[ 3.070096] wm8904 1-001a: 1-001a supply DCVDD not found, using dummy regulator
[ 3.078087] wm8904 1-001a: 1-001a supply DBVDD not found, using dummy regulator
[ 3.085884] wm8904 1-001a: 1-001a supply AVDD not found, using dummy regulator
[ 3.093793] wm8904 1-001a: 1-001a supply CPVDD not found, using dummy regulator
[ 3.101511] wm8904 1-001a: 1-001a supply MICVDD not found, using dummy regulator
[ 3.109908] wm8904 1-001a: Failed to read ID register: -6
[ 3.123664] fsl-sai 202c000.sai: failed to get mclk0 clock: -2
[ 3.135167] imx-wm8904 sound: cpu dai phandle missing or invalid
[ 3.141660] imx-wm8904: probe of sound failed with error -22
[ 3.147872] NET: Registered protocol family 26
[ 3.154271] NET: Registered protocol family 10
[ 3.171641] Segment Routing with IPv6
[ 3.175834] sit: IPv6, IPv4 and MPLS over IPv4 tunneling driver
[ 3.184065] NET: Registered protocol family 17
[ 3.188943] can: controller area network core (rev 20170425 abi 9)
[ 3.195525] NET: Registered protocol family 29
[ 3.200294] can: raw protocol (rev 20170425)
[ 3.204777] can: broadcast manager protocol (rev 20170425 t)
[ 3.210714] can: netlink gateway (rev 20190810) max_hops=1
[ 3.217067] Bluetooth: RFCOMM TTY layer initialized
[ 3.222523] Bluetooth: RFCOMM socket layer initialized
[ 3.228126] Bluetooth: RFCOMM ver 1.11
[ 3.232034] Bluetooth: BNEP (Ethernet Emulation) ver 1.3
[ 3.237477] Bluetooth: BNEP filters: protocol multicast
[ 3.242760] Bluetooth: BNEP socket layer initialized
[ 3.248042] Bluetooth: HIDP (Human Interface Emulation) ver 1.2
[ 3.254012] Bluetooth: HIDP socket layer initialized
[ 3.259313] Key type dns_resolver registered
[ 3.290233] Registering SWP/SWPB emulation handler
[ 3.295954] Loading compiled-in X.509 certificates
[ 3.346283] imx_thermal tempmon: Industrial CPU temperature grade - max:105C critical:100C passive:95C
[ 3.357172] ubi0: default fastmap pool size: 95
[ 3.361743] ubi0: default fastmap WL pool size: 47
[ 3.366552] ubi0: attaching mtd4
[ 4.510717] ubi0: scanning is finished
[ 4.529890] ubi0: attached mtd4 (name "rootfs", size 239 MiB)
[ 4.535694] ubi0: PEB size: 131072 bytes (128 KiB), LEB size: 126976 bytes
[ 4.543075] ubi0: min./max. I/O unit sizes: 2048/2048, sub-page size 2048
[ 4.550177] ubi0: VID header offset: 2048 (aligned 2048), data offset: 4096
[ 4.557206] ubi0: good PEBs: 1908, bad PEBs: 4, corrupted PEBs: 0
[ 4.563322] ubi0: user volume: 1, internal volumes: 1, max. volumes count: 128
[ 4.570648] ubi0: max/mean erase counter: 2/1, WL threshold: 4096, image sequence number: 4048816808
[ 4.579839] ubi0: available PEBs: 0, total reserved PEBs: 1908, PEBs reserved for bad PEB handling: 36
[ 4.589222] ubi0: background thread "ubi_bgt0d" started, PID 118
[ 4.595935] gpio-keys gpio-keys: Button without keycode
[ 4.601345] gpio-keys: probe of gpio-keys failed with error -22
[ 4.607499] snvs_rtc 20cc000.snvs:snvs-rtc-lp: setting system clock to 1970-01-01T00:12:24 UTC (744)
[ 4.617278] cfg80211: Loading compiled-in X.509 certificates for regulatory database
[ 4.630818] cfg80211: Loaded X.509 cert 'sforshee: 00b28ddf47aef9cea7'
[ 4.637869] platform regulatory.0: Direct firmware load for regulatory.db failed with error -2
[ 4.646517] platform regulatory.0: Falling back to sysfs fallback for: regulatory.db
[ 4.654758] ALSA device list:
[ 4.658017] No soundcards found.
[ 4.663094] UBIFS (ubi0:0): Mounting in unauthenticated mode
[ 4.753007] UBIFS (ubi0:0): UBIFS: mounted UBI device 0, volume 0, name "rootfs", R/O mode
[ 4.761530] UBIFS (ubi0:0): LEB size: 126976 bytes (124 KiB), min./max. I/O unit sizes: 2048 bytes/2048 bytes
[ 4.771538] UBIFS (ubi0:0): FS size: 235413504 bytes (224 MiB, 1854 LEBs), journal size 11808768 bytes (11 MiB, 93 LEBs)
[ 4.782809] UBIFS (ubi0:0): reserved for root: 4952683 bytes (4836 KiB)
[ 4.789726] UBIFS (ubi0:0): media format: w5/r0 (latest is w5/r0), UUID 3590AA13-E4FE-44EC-B840-F12B012BF79D, small LPT model
[ 4.803440] VFS: Mounted root (ubifs filesystem) readonly on device 0:14.
[ 4.811519] devtmpfs: mounted
[ 4.817246] Freeing unused kernel memory: 1024K
[ 4.822275] Run /sbin/init as init process
[ 5.214666] systemd[1]: System time before build time, advancing clock.
[ 5.320730] systemd[1]: systemd 243+ running in system mode. (-PAM -AUDIT -SELINUX +IMA -APPARMOR +SMACK +SYSVINIT +UTMP -LIBCRYPTSETUP -GCRYPT -GNUTLS +ACL +XZ -LZ4 -SECCOMP +BLKID -ELFUTILS +KMOD -IDN2 -IDN -PCRE2 default-hierarchy=hybrid)
[ 5.345051] systemd[1]: Detected architecture arm.

Welcome to NXP i.MX Release Distro 5.4-zeus (zeus)!

[ 5.403358] systemd[1]: Set hostname to .
[ 5.981714] random: crng init done
[ 6.480907] systemd[1]: /lib/systemd/system/dbus.socket:5: ListenStream= references a path below legacy directory /var/run/, updating /var/run/dbus/system_bus_socket → /run/dbus/system_bus_socket; please update the unit file accordingly.
[ 6.581509] systemd[1]: /lib/systemd/system/rpcbind.socket:5: ListenStream= references a path below legacy directory /var/run/, updating /var/run/rpcbind.sock → /run/rpcbind.sock; please update the unit file accordingly.
[ 6.902490] systemd[1]: system-getty.slice: unit configures an IP firewall, but the local system does not support BPF/cgroup firewalling.
[ 6.915187] systemd[1]: (This warning is only shown for the first unit using IP firewalling.)
[ 6.927205] systemd[1]: Created slice system-getty.slice.
[ OK ] Created slice system-getty.slice.
[ 6.969838] systemd[1]: Created slice system-serial\x2dgetty.slice.
[ OK ] Created slice system-serial\x2dgetty.slice.
[ 7.010390] systemd[1]: Created slice User and Session Slice.
[ OK ] Created slice User and Session Slice.
[ OK ] Started Dispatch Password …ts to Console Directory Watch.
[ OK ] Started Forward Password R…uests to Wall Directory Watch.
[ OK ] Reached target Paths.
[ OK ] Reached target Remote File Systems.
[ OK ] Reached target Slices.
[ OK ] Reached target Swap.
[ OK ] Listening on Syslog Socket.
[ OK ] Listening on initctl Compatibility Named Pipe.
[ OK ] Listening on Journal Socket (/dev/log).
[ OK ] Listening on Journal Socket.
[ OK ] Listening on Network Service Netlink Socket.
[ OK ] Listening on udev Control Socket.
[ OK ] Listening on udev Kernel Socket.
Mounting Kernel Debug File System...
Mounting Temporary Directory (/tmp)...
Starting File System Check on Root Device...
Starting Journal Service...
Mounting FUSE Control File System...
Mounting Kernel Configuration File System...
Starting Apply Kernel Variables...
Starting udev Coldplug all Devices...
Starting Setup Virtual Console...
[ OK ] Mounted Kernel Debug File System.
[ OK ] Mounted Temporary Directory (/tmp).
[ OK ] Started File System Check on Root Device.
[ OK ] Mounted FUSE Control File System.
[ OK ] Mounted Kernel Configuration File System.
[ OK ] Started Apply Kernel Variables.
[ OK ] Started Setup Virtual Console.
Starting Remount Root and Kernel File Systems...
[ 8.290277] UBIFS (ubi0:0): background thread "ubifs_bgt0_0" started, PID 150
[ OK ] Started Remount Root and Kernel File Systems.
Starting Create Static Device Nodes in /dev...
[ OK ] Started Journal Service.
Starting Flush Journal to Persistent Storage...
[ OK ] Started Create Static Device Nodes in /dev.
[ 8.688323] systemd-journald[139]: Received client request to flush runtime journal.
[ OK ] Reached target Local File Systems (Pre).
Mounting /var/volatile...
Starting udev Kernel Device Manager...
[ OK ] Started Flush Journal to Persistent Storage.
[ OK ] Mounted /var/volatile.
Starting Load/Save Random Seed...
[ OK ] Reached target Local File Systems.
Starting Create Volatile Files and Directories...
[ OK ] Started Load/Save Random Seed.
[ OK ] Started Create Volatile Files and Directories.
[ OK ] Started udev Kernel Device Manager.
Starting Network Service...
Starting Network Time Synchronization...
Starting Update UTMP about System Boot/Shutdown...
[ OK ] Started Update UTMP about System Boot/Shutdown.
[ OK ] Started Network Service.
Starting Network Name Resolution...
[ OK ] Started Network Time Synchronization.
[ OK ] Reached target System Time Set.
[ OK ] Reached target System Time Synchronized.
[ 12.194638] pxp-v4l2 pxp_v4l2: failed to call pxp_set_fbinfo
[ OK ] Started udev Coldplug all Devices.
[ OK ] Reached target System Initialization.
[ OK ] Started Daily Cleanup of Temporary Directories.
[ OK ] Reached target Timers.
[ OK ] Listening on Avahi mDNS/DNS-SD Stack Activation Socket.
[ OK ] Listening on D-Bus System Message Bus Socket.
[ OK ] Listening on dropbear.socket.
[ OK ] Listening on RPCbind Server Activation Socket.
[ OK ] Reached target Sockets.
[ OK ] Reached target Basic System.
[ OK ] Started Kernel Logging Service.
[ OK ] Started System Logging Service.
[ OK ] Started D-Bus System Message Bus.
[ OK ] Started User Space Epdc Firmware Loading.
Starting Network Time Service (one-shot ntpdate mode)...
Starting Telephony service...
Starting Start Psplash Boot Screen...
[ OK ] Started User Space Regulatory Firmware Loading.
Starting RPC Bind Service...
[ OK ] Started User Space SDMA Firmware Loading.
[ 14.757244] SMSC LAN8710/LAN8720 20b4000.ethernet-1:01: attached PHY driver [SMSC LAN8710/LAN8720] (mii_bus:phy_addr=20b4000.ethernet-1:01, irq=POLL)
Starting Login Service...
[ OK ] Started TEE Supplicant.
[ OK ] Started Network Name Resolution.
[ OK ] Started Network Time Service (one-shot ntpdate mode).
[ OK ] Started Start Psplash Boot Screen.
[ 15.810646] imx-sdma 20ec000.sdma: loaded firmware 3.5
[ OK ] Started RPC Bind Service.
[ 16.397217] SMSC LAN8710/LAN8720 20b4000.ethernet-1:00: attached PHY driver [SMSC LAN8710/LAN8720] (mii_bus:phy_addr=20b4000.ethernet-1:00, irq=POLL)
[ 18.727517] fec 2188000.ethernet eth1: Link is Up - 100Mbps/Full - flow control rx/tx
[ 18.735428] IPv6: ADDRCONF(NETDEV_CHANGE): eth1: link becomes ready
[ OK ] Started Telephony service.
[ OK ] Started Login Service.
[ OK ] Reached target Network.
[ OK ] Reached target Host and Network Name Lookups.
Starting Avahi mDNS/DNS-SD Stack...
[ OK ] Started NFS status monitor for NFSv2/3 locking..
[ OK ] Started Updates psplash to basic.
[ OK ] Started Update psplash to network.
Starting Terminate Psplash Boot Screen...
Starting /etc/rc.local Compatibility...
[FAILED] Failed to start Terminate Psplash Boot Screen.
See 'systemctl status psplash-quit.service' for details.
[ OK ] Started /etc/rc.local Compatibility.
[ OK ] Started Avahi mDNS/DNS-SD Stack.
[ OK ] Started Getty on tty1.
[ OK ] Started Serial Getty on ttymxc0.
[ OK ] Reached target Login Prompts.
Starting start process control system for UNIX...
[FAILED] Failed to start start process control system for UNIX.
See 'systemctl status startservice.service' for details.
[ OK ] Reached target Multi-User System.
Starting Update UTMP about System Runlevel Changes...
[ OK ] Started Update UTMP about System Runlevel Changes.

NXP i.MX Release Distro 5.4-zeus myd-y6ull14x14 ttymxc0

myd-y6ull14x14 login: root (automatic login)

root@myd-y6ull14x14:#
root@myd-y6ull14x14:
# ls
app myd-y6ull-gpmi-weim.dtb rtu_lk.log tool web_lk.log
esp32_sdio.ko myir_start_service.sh ssh_lk.log update_success
root@myd-y6ull14x14:# insmod esp32_sdio.ko
[ 34.949496] drivers/net/wireless/esp32/main.c:648 esp32 222 hello esp_init.
[ 34.956500] drivers/net/wireless/esp32/main.c:595ESP32: Resetpin of Host is 68
[ 34.974523] drivers/net/wireless/esp32/main.c:608ESP32: Triggering ESP reset.
[ 35.004043] drivers/net/wireless/esp32/esp_sdio.c:791 esp32 esp_init_interface_layer:
[ 35.021292] drivers/net/wireless/esp32/esp_sdio.c:802 esp32 sdio_register_driver ret:0
[ 35.029675] drivers/net/wireless/esp32/main.c:662 esp32 esp_init_interface_layer ret:0.
root@myd-y6ull14x14:
# [ 35.046930] ltemodule-pwr: disabling
[ 35.050730] wifi-pwr: disabling
[ 35.053891] can-3v3: disabling

root@myd-y6ull14x14:~# dmesg | grep usdhc
[ 3.012457] mmc1: SDHCI controller on 2194000.usdhc [2194000.usdhc] using ADMA

Below is the esp side log
I (580) cpu_start: Starting scheduler on PRO CPU.
I (586) NETWORK_ADAPTER: *********************************************************************
I (586) NETWORK_ADAPTER: ESP-Hosted Firmware version :: 0.3
I (596) NETWORK_ADAPTER: Transport used :: SDIO
I (606) NETWORK_ADAPTER: *********************************************************************
I (616) NETWORK_ADAPTER: Supported features are:
I (626) NETWORK_ADAPTER: - WLAN over SDIO
I (626) NETWORK_ADAPTER: - BT/BLE
I (636) NETWORK_ADAPTER: - HCI Over UART
I (636) NETWORK_ADAPTER: - BT/BLE dual mode
I (646) BTDM_INIT: BT controller compile version [4bc0a8e]
I (646) system_api: Base MAC address is not set, read default base MAC address from BLK0 of EFUSE
I (756) phy: phy_version: 4390, 6b3c1f2, Sep 10 2020, 15:09:07, 0, 0
I (1226) SDIO_SLAVE: Using SDIO interface
I (1236) wifi:wifi driver task: 3ffde798, prio:23, stack:6656, core=0
I (1236) system_api: Base MAC address is not set, read default base MAC address from BLK0 of EFUSE
I (1236) system_api: Base MAC address is not set, read default base MAC address from BLK0 of EFUSE
I (1246) wifi:wifi firmware version: 6e1f9e4
I (1246) wifi:config NVS flash: disabled
I (1256) wifi:config nano formating: disabled
I (1256) wifi:Init data frame dynamic rx buffer num: 32
I (1266) wifi:Init management frame dynamic rx buffer num: 32
I (1266) wifi:Init management short buffer num: 32
I (1276) wifi:Init dynamic tx buffer num: 32
I (1276) wifi:Init static rx buffer size: 1600
I (1276) wifi:Init static rx buffer num: 10
I (1286) wifi:Init dynamic rx buffer num: 32
I (1296) wifi:mode : null
I (1296) NETWORK_ADAPTER: Initial set up done

@shihui2014
Copy link
Author

图片

@mantriyogesh
Copy link
Collaborator

So from your log, I still suspect if the SDIO is detected or not.
I would suggest to verify your device tree.

If the connections are correct and ESP is flashed with SDIO firmware, Host should detect the ESP SDIO first.

I am attaching working reference NXP imx 8mm (imx8mm-lpddr4-evk) dts for your reference.
We are not expert of device tree, but we believe below files may point you in better direction.

imx8mm-evk.dts
u64@ubuntu:~/imx8_dev_board/imx-yocto-bsp/build/tmp/work/x86_64-nativesdk-pokysdk-linux/nativesdk-linux-libc-headers/5.16-r0/linux-5.16/arch/arm64/boot/dts/freescale$ cat imx8mm-evk.dts
// SPDX-License-Identifier: (GPL-2.0+ OR MIT)
/*
* Copyright 2019-2020 NXP
*/

/dts-v1/;

#include <dt-bindings/usb/pd.h>
#include "imx8mm-evk.dtsi"

/ {
   model = "FSL i.MX8MM EVK board";
   compatible = "fsl,imx8mm-evk", "fsl,imx8mm";

   aliases {
   	spi0 = &flexspi;
   };
};

&ddrc {
   operating-points-v2 = <&ddrc_opp_table>;

   ddrc_opp_table: opp-table {
   	compatible = "operating-points-v2";

   	opp-25M {
   		opp-hz = /bits/ 64 <25000000>;
   	};

   	opp-100M {
   		opp-hz = /bits/ 64 <100000000>;
   	};

   	opp-750M {
   		opp-hz = /bits/ 64 <750000000>;
   	};
   };
};

&flexspi {
   pinctrl-names = "default";
   pinctrl-0 = <&pinctrl_flexspi>;
   status = "okay";

   flash@0 {
   	reg = <0>;
   	#address-cells = <1>;
   	#size-cells = <1>;
   	compatible = "jedec,spi-nor";
   	spi-max-frequency = <80000000>;
   	spi-tx-bus-width = <1>;
   	spi-rx-bus-width = <4>;
   };
};

&usdhc3 {
   assigned-clocks = <&clk IMX8MM_CLK_USDHC3_ROOT>;
   assigned-clock-rates = <400000000>;
   pinctrl-names = "default", "state_100mhz", "state_200mhz";
   pinctrl-0 = <&pinctrl_usdhc3>;
   pinctrl-1 = <&pinctrl_usdhc3_100mhz>;
   pinctrl-2 = <&pinctrl_usdhc3_200mhz>;
   bus-width = <8>;
   non-removable;
   status = "okay";
};

&iomuxc {
   pinctrl_flexspi: flexspigrp {
   	fsl,pins = <
   		MX8MM_IOMUXC_NAND_ALE_QSPI_A_SCLK               0x1c2
   		MX8MM_IOMUXC_NAND_CE0_B_QSPI_A_SS0_B            0x82
   		MX8MM_IOMUXC_NAND_DATA00_QSPI_A_DATA0           0x82
   		MX8MM_IOMUXC_NAND_DATA01_QSPI_A_DATA1           0x82
   		MX8MM_IOMUXC_NAND_DATA02_QSPI_A_DATA2           0x82
   		MX8MM_IOMUXC_NAND_DATA03_QSPI_A_DATA3           0x82
   	>;
   };

   pinctrl_usdhc3: usdhc3grp {
   	fsl,pins = <
   		MX8MM_IOMUXC_NAND_WE_B_USDHC3_CLK               0x190
   		MX8MM_IOMUXC_NAND_WP_B_USDHC3_CMD               0x1d0
   		MX8MM_IOMUXC_NAND_DATA04_USDHC3_DATA0           0x1d0
   		MX8MM_IOMUXC_NAND_DATA05_USDHC3_DATA1           0x1d0
   		MX8MM_IOMUXC_NAND_DATA06_USDHC3_DATA2           0x1d0
   		MX8MM_IOMUXC_NAND_DATA06_USDHC3_DATA2           0x1d0
   		MX8MM_IOMUXC_NAND_DATA07_USDHC3_DATA3           0x1d0
   		MX8MM_IOMUXC_NAND_RE_B_USDHC3_DATA4             0x1d0
   		MX8MM_IOMUXC_NAND_CE2_B_USDHC3_DATA5            0x1d0
   		MX8MM_IOMUXC_NAND_CE3_B_USDHC3_DATA6            0x1d0
   		MX8MM_IOMUXC_NAND_CLE_USDHC3_DATA7              0x1d0
   		MX8MM_IOMUXC_NAND_CE1_B_USDHC3_STROBE           0x190
   	>;
   };

   pinctrl_usdhc3_100mhz: usdhc3-100mhzgrp {
   	fsl,pins = <
   		MX8MM_IOMUXC_NAND_WE_B_USDHC3_CLK               0x194
   		MX8MM_IOMUXC_NAND_WP_B_USDHC3_CMD               0x1d4
   		MX8MM_IOMUXC_NAND_DATA04_USDHC3_DATA0           0x1d4
   		MX8MM_IOMUXC_NAND_DATA05_USDHC3_DATA1           0x1d4
   		MX8MM_IOMUXC_NAND_DATA06_USDHC3_DATA2           0x1d4
   		MX8MM_IOMUXC_NAND_DATA07_USDHC3_DATA3           0x1d4
   		MX8MM_IOMUXC_NAND_RE_B_USDHC3_DATA4             0x1d4
   		MX8MM_IOMUXC_NAND_CE2_B_USDHC3_DATA5            0x1d4
   		MX8MM_IOMUXC_NAND_CE3_B_USDHC3_DATA6            0x1d4
   		MX8MM_IOMUXC_NAND_CLE_USDHC3_DATA7              0x1d4
   		MX8MM_IOMUXC_NAND_CE1_B_USDHC3_STROBE           0x194
   	>;
   };

   pinctrl_usdhc3_200mhz: usdhc3-200mhzgrp {
   	fsl,pins = <
   		MX8MM_IOMUXC_NAND_WE_B_USDHC3_CLK               0x196
   		MX8MM_IOMUXC_NAND_WP_B_USDHC3_CMD               0x1d6
   		MX8MM_IOMUXC_NAND_DATA04_USDHC3_DATA0           0x1d6
   		MX8MM_IOMUXC_NAND_DATA05_USDHC3_DATA1           0x1d6
   		MX8MM_IOMUXC_NAND_DATA06_USDHC3_DATA2           0x1d6
   		MX8MM_IOMUXC_NAND_DATA07_USDHC3_DATA3           0x1d6
   		MX8MM_IOMUXC_NAND_RE_B_USDHC3_DATA4             0x1d6
   		MX8MM_IOMUXC_NAND_CE2_B_USDHC3_DATA5            0x1d6
   		MX8MM_IOMUXC_NAND_CE3_B_USDHC3_DATA6            0x1d6
   		MX8MM_IOMUXC_NAND_CLE_USDHC3_DATA7              0x1d6
   		MX8MM_IOMUXC_NAND_CE1_B_USDHC3_STROBE           0x196
   	>;
   };
};
imx8mm-evk.dtsi
u64@ubuntu:~/imx8_dev_board/imx-yocto-bsp/build/tmp/work/x86_64-nativesdk-pokysdk-linux/nativesdk-linux-libc-headers/5.16-r0/linux-5.16/arch/arm64/boot/dts/freescale$ cat imx8mm-evk.dtsi
// SPDX-License-Identifier: (GPL-2.0+ OR MIT)
/*
 * Copyright 2020 NXP
 */

/dts-v1/;

#include <dt-bindings/usb/pd.h>
#include "imx8mm.dtsi"

/ {
	chosen {
		stdout-path = &uart2;
	};

	memory@40000000 {
		device_type = "memory";
		reg = <0x0 0x40000000 0 0x80000000>;
	};

	leds {
		compatible = "gpio-leds";
		pinctrl-names = "default";
		pinctrl-0 = <&pinctrl_gpio_led>;

		status {
			label = "status";
			gpios = <&gpio3 16 GPIO_ACTIVE_HIGH>;
			default-state = "on";
		};
	};

	reg_usdhc2_vmmc: regulator-usdhc2 {
		compatible = "regulator-fixed";
		pinctrl-names = "default";
		pinctrl-0 = <&pinctrl_reg_usdhc2_vmmc>;
		regulator-name = "VSD_3V3";
		regulator-min-microvolt = <3300000>;
		regulator-max-microvolt = <3300000>;
		gpio = <&gpio2 19 GPIO_ACTIVE_HIGH>;
		enable-active-high;
	};

	ir-receiver {
		compatible = "gpio-ir-receiver";
		gpios = <&gpio1 13 GPIO_ACTIVE_LOW>;
		pinctrl-names = "default";
		pinctrl-0 = <&pinctrl_ir>;
		linux,autosuspend-period = <125>;
	};

	wm8524: audio-codec {
		#sound-dai-cells = <0>;
		compatible = "wlf,wm8524";
		pinctrl-names = "default";
		pinctrl-0 = <&pinctrl_gpio_wlf>;
		wlf,mute-gpios = <&gpio5 21 GPIO_ACTIVE_LOW>;
	};

	sound-wm8524 {
		compatible = "simple-audio-card";
		simple-audio-card,name = "wm8524-audio";
		simple-audio-card,format = "i2s";
		simple-audio-card,frame-master = <&cpudai>;
		simple-audio-card,bitclock-master = <&cpudai>;
		simple-audio-card,widgets =
			"Line", "Left Line Out Jack",
			"Line", "Right Line Out Jack";
		simple-audio-card,routing =
			"Left Line Out Jack", "LINEVOUTL",
			"Right Line Out Jack", "LINEVOUTR";

		cpudai: simple-audio-card,cpu {
			sound-dai = <&sai3>;
			dai-tdm-slot-num = <2>;
			dai-tdm-slot-width = <32>;
		};

		simple-audio-card,codec {
			sound-dai = <&wm8524>;
			clocks = <&clk IMX8MM_CLK_SAI3_ROOT>;
		};
	};
};

&A53_0 {
	cpu-supply = <&buck2_reg>;
};

&A53_1 {
	cpu-supply = <&buck2_reg>;
};

&A53_2 {
	cpu-supply = <&buck2_reg>;
};

&A53_3 {
	cpu-supply = <&buck2_reg>;
};

&fec1 {
	pinctrl-names = "default";
	pinctrl-0 = <&pinctrl_fec1>;
	phy-mode = "rgmii-id";
	phy-handle = <&ethphy0>;
	fsl,magic-packet;
	status = "okay";

	mdio {
		#address-cells = <1>;
		#size-cells = <0>;

		ethphy0: ethernet-phy@0 {
			compatible = "ethernet-phy-ieee802.3-c22";
			reg = <0>;
			reset-gpios = <&gpio4 22 GPIO_ACTIVE_LOW>;
			reset-assert-us = <10000>;
		};
	};
};

&i2c1 {
	clock-frequency = <400000>;
	pinctrl-names = "default";
	pinctrl-0 = <&pinctrl_i2c1>;
	status = "okay";

	pmic@4b {
		compatible = "rohm,bd71847";
		reg = <0x4b>;
		pinctrl-names = "default";
		pinctrl-0 = <&pinctrl_pmic>;
		interrupt-parent = <&gpio1>;
		interrupts = <3 IRQ_TYPE_LEVEL_LOW>;
		rohm,reset-snvs-powered;

		#clock-cells = <0>;
		clocks = <&osc_32k 0>;
		clock-output-names = "clk-32k-out";

		regulators {
			buck1_reg: BUCK1 {
				regulator-name = "buck1";
				regulator-min-microvolt = <700000>;
				regulator-max-microvolt = <1300000>;
				regulator-boot-on;
				regulator-always-on;
				regulator-ramp-delay = <1250>;
			};

			buck2_reg: BUCK2 {
				regulator-name = "buck2";
				regulator-min-microvolt = <700000>;
				regulator-max-microvolt = <1300000>;
				regulator-boot-on;
				regulator-always-on;
				regulator-ramp-delay = <1250>;
				rohm,dvs-run-voltage = <1000000>;
				rohm,dvs-idle-voltage = <900000>;
			};

			buck3_reg: BUCK3 {
				// BUCK5 in datasheet
				regulator-name = "buck3";
				regulator-min-microvolt = <700000>;
				regulator-max-microvolt = <1350000>;
				regulator-boot-on;
				regulator-always-on;
			};

			buck4_reg: BUCK4 {
				// BUCK6 in datasheet
				regulator-name = "buck4";
				regulator-min-microvolt = <3000000>;
				regulator-max-microvolt = <3300000>;
				regulator-boot-on;
				regulator-always-on;
			};

			buck5_reg: BUCK5 {
				// BUCK7 in datasheet
				regulator-name = "buck5";
				regulator-min-microvolt = <1605000>;
				regulator-max-microvolt = <1995000>;
				regulator-boot-on;
				regulator-always-on;
			};

			buck6_reg: BUCK6 {
				// BUCK8 in datasheet
				regulator-name = "buck6";
				regulator-min-microvolt = <800000>;
				regulator-max-microvolt = <1400000>;
				regulator-boot-on;
				regulator-always-on;
			};

			ldo1_reg: LDO1 {
				regulator-name = "ldo1";
				regulator-min-microvolt = <1600000>;
				regulator-max-microvolt = <3300000>;
				regulator-boot-on;
				regulator-always-on;
			};

			ldo2_reg: LDO2 {
				regulator-name = "ldo2";
				regulator-min-microvolt = <800000>;
				regulator-max-microvolt = <900000>;
				regulator-boot-on;
				regulator-always-on;
			};

			ldo3_reg: LDO3 {
				regulator-name = "ldo3";
				regulator-min-microvolt = <1800000>;
				regulator-max-microvolt = <3300000>;
				regulator-boot-on;
				regulator-always-on;
			};

			ldo4_reg: LDO4 {
				regulator-name = "ldo4";
				regulator-min-microvolt = <900000>;
				regulator-max-microvolt = <1800000>;
				regulator-boot-on;
				regulator-always-on;
			};

			ldo6_reg: LDO6 {
				regulator-name = "ldo6";
				regulator-min-microvolt = <900000>;
				regulator-max-microvolt = <1800000>;
				regulator-boot-on;
				regulator-always-on;
			};
		};
	};
};

&i2c2 {
	clock-frequency = <400000>;
	pinctrl-names = "default";
	pinctrl-0 = <&pinctrl_i2c2>;
	status = "okay";

	ptn5110: tcpc@50 {
		compatible = "nxp,ptn5110";
		pinctrl-names = "default";
		pinctrl-0 = <&pinctrl_typec1>;
		reg = <0x50>;
		interrupt-parent = <&gpio2>;
		interrupts = <11 8>;
		status = "okay";

		port {
			typec1_dr_sw: endpoint {
				remote-endpoint = <&usb1_drd_sw>;
			};
		};

		typec1_con: connector {
			compatible = "usb-c-connector";
			label = "USB-C";
			power-role = "dual";
			data-role = "dual";
			try-power-role = "sink";
			source-pdos = <PDO_FIXED(5000, 3000, PDO_FIXED_USB_COMM)>;
			sink-pdos = <PDO_FIXED(5000, 3000, PDO_FIXED_USB_COMM)
				     PDO_VAR(5000, 20000, 3000)>;
			op-sink-microwatt = <15000000>;
			self-powered;
		};
	};
};

&i2c3 {
	clock-frequency = <400000>;
	pinctrl-names = "default";
	pinctrl-0 = <&pinctrl_i2c3>;
	status = "okay";

	pca6416: gpio@20 {
		compatible = "ti,tca6416";
		reg = <0x20>;
		gpio-controller;
		#gpio-cells = <2>;
	};
};

&sai3 {
	pinctrl-names = "default";
	pinctrl-0 = <&pinctrl_sai3>;
	assigned-clocks = <&clk IMX8MM_CLK_SAI3>;
	assigned-clock-parents = <&clk IMX8MM_AUDIO_PLL1_OUT>;
	assigned-clock-rates = <24576000>;
	status = "okay";
};

&snvs_pwrkey {
	status = "okay";
};

&uart2 { /* console */
	pinctrl-names = "default";
	pinctrl-0 = <&pinctrl_uart2>;
	status = "okay";
};

&usbotg1 {
	dr_mode = "otg";
	hnp-disable;
	srp-disable;
	adp-disable;
	usb-role-switch;
	disable-over-current;
	samsung,picophy-pre-emp-curr-control = <3>;
	samsung,picophy-dc-vol-level-adjust = <7>;
	status = "okay";

	port {
		usb1_drd_sw: endpoint {
			remote-endpoint = <&typec1_dr_sw>;
		};
	};
};

&usdhc2 {
	assigned-clocks = <&clk IMX8MM_CLK_USDHC2>;
	assigned-clock-rates = <200000000>;
	pinctrl-names = "default", "state_100mhz", "state_200mhz";
	pinctrl-0 = <&pinctrl_usdhc2>, <&pinctrl_usdhc2_gpio>;
	pinctrl-1 = <&pinctrl_usdhc2_100mhz>, <&pinctrl_usdhc2_gpio>;
	pinctrl-2 = <&pinctrl_usdhc2_200mhz>, <&pinctrl_usdhc2_gpio>;
	cd-gpios = <&gpio1 15 GPIO_ACTIVE_LOW>;
	bus-width = <4>;
	vmmc-supply = <&reg_usdhc2_vmmc>;
	status = "okay";
};

&wdog1 {
	pinctrl-names = "default";
	pinctrl-0 = <&pinctrl_wdog>;
	fsl,ext-reset-output;
	status = "okay";
};

&iomuxc {
	pinctrl_fec1: fec1grp {
		fsl,pins = <
			MX8MM_IOMUXC_ENET_MDC_ENET1_MDC			0x3
			MX8MM_IOMUXC_ENET_MDIO_ENET1_MDIO		0x3
			MX8MM_IOMUXC_ENET_TD3_ENET1_RGMII_TD3		0x1f
			MX8MM_IOMUXC_ENET_TD2_ENET1_RGMII_TD2		0x1f
			MX8MM_IOMUXC_ENET_TD1_ENET1_RGMII_TD1		0x1f
			MX8MM_IOMUXC_ENET_TD0_ENET1_RGMII_TD0		0x1f
			MX8MM_IOMUXC_ENET_RD3_ENET1_RGMII_RD3		0x91
			MX8MM_IOMUXC_ENET_RD2_ENET1_RGMII_RD2		0x91
			MX8MM_IOMUXC_ENET_RD1_ENET1_RGMII_RD1		0x91
			MX8MM_IOMUXC_ENET_RD0_ENET1_RGMII_RD0		0x91
			MX8MM_IOMUXC_ENET_TXC_ENET1_RGMII_TXC		0x1f
			MX8MM_IOMUXC_ENET_RXC_ENET1_RGMII_RXC		0x91
			MX8MM_IOMUXC_ENET_RX_CTL_ENET1_RGMII_RX_CTL	0x91
			MX8MM_IOMUXC_ENET_TX_CTL_ENET1_RGMII_TX_CTL	0x1f
			MX8MM_IOMUXC_SAI2_RXC_GPIO4_IO22		0x19
		>;
	};

	pinctrl_gpio_led: gpioledgrp {
		fsl,pins = <
			MX8MM_IOMUXC_NAND_READY_B_GPIO3_IO16	0x19
		>;
	};

	pinctrl_ir: irgrp {
		fsl,pins = <
			MX8MM_IOMUXC_GPIO1_IO13_GPIO1_IO13              0x4f
		>;
	};

	pinctrl_gpio_wlf: gpiowlfgrp {
		fsl,pins = <
			MX8MM_IOMUXC_I2C4_SDA_GPIO5_IO21	0xd6
		>;
	};

	pinctrl_i2c1: i2c1grp {
		fsl,pins = <
			MX8MM_IOMUXC_I2C1_SCL_I2C1_SCL			0x400001c3
			MX8MM_IOMUXC_I2C1_SDA_I2C1_SDA			0x400001c3
		>;
	};

	pinctrl_i2c2: i2c2grp {
		fsl,pins = <
			MX8MM_IOMUXC_I2C2_SCL_I2C2_SCL			0x400001c3
			MX8MM_IOMUXC_I2C2_SDA_I2C2_SDA			0x400001c3
		>;
	};

	pinctrl_i2c3: i2c3grp {
		fsl,pins = <
			MX8MM_IOMUXC_I2C3_SCL_I2C3_SCL			0x400001c3
			MX8MM_IOMUXC_I2C3_SDA_I2C3_SDA			0x400001c3
		>;
	};

	pinctrl_pmic: pmicirqgrp {
		fsl,pins = <
			MX8MM_IOMUXC_GPIO1_IO03_GPIO1_IO3		0x141
		>;
	};

	pinctrl_reg_usdhc2_vmmc: regusdhc2vmmcgrp {
		fsl,pins = <
			MX8MM_IOMUXC_SD2_RESET_B_GPIO2_IO19	0x41
		>;
	};

	pinctrl_sai3: sai3grp {
		fsl,pins = <
			MX8MM_IOMUXC_SAI3_TXFS_SAI3_TX_SYNC     0xd6
			MX8MM_IOMUXC_SAI3_TXC_SAI3_TX_BCLK      0xd6
			MX8MM_IOMUXC_SAI3_MCLK_SAI3_MCLK        0xd6
			MX8MM_IOMUXC_SAI3_TXD_SAI3_TX_DATA0     0xd6
		>;
	};

	pinctrl_typec1: typec1grp {
		fsl,pins = <
			MX8MM_IOMUXC_SD1_STROBE_GPIO2_IO11	0x159
		>;
	};

	pinctrl_uart2: uart2grp {
		fsl,pins = <
			MX8MM_IOMUXC_UART2_RXD_UART2_DCE_RX	0x140
			MX8MM_IOMUXC_UART2_TXD_UART2_DCE_TX	0x140
		>;
	};

	pinctrl_usdhc2_gpio: usdhc2grpgpiogrp {
		fsl,pins = <
			MX8MM_IOMUXC_GPIO1_IO15_GPIO1_IO15	0x1c4
		>;
	};

	pinctrl_usdhc2: usdhc2grp {
		fsl,pins = <
			MX8MM_IOMUXC_SD2_CLK_USDHC2_CLK		0x190
			MX8MM_IOMUXC_SD2_CMD_USDHC2_CMD		0x1d0
			MX8MM_IOMUXC_SD2_DATA0_USDHC2_DATA0	0x1d0
			MX8MM_IOMUXC_SD2_DATA1_USDHC2_DATA1	0x1d0
			MX8MM_IOMUXC_SD2_DATA2_USDHC2_DATA2	0x1d0
			MX8MM_IOMUXC_SD2_DATA3_USDHC2_DATA3	0x1d0
			MX8MM_IOMUXC_GPIO1_IO04_USDHC2_VSELECT	0x1d0
		>;
	};

	pinctrl_usdhc2_100mhz: usdhc2-100mhzgrp {
		fsl,pins = <
			MX8MM_IOMUXC_SD2_CLK_USDHC2_CLK		0x194
			MX8MM_IOMUXC_SD2_CMD_USDHC2_CMD		0x1d4
			MX8MM_IOMUXC_SD2_DATA0_USDHC2_DATA0	0x1d4
			MX8MM_IOMUXC_SD2_DATA1_USDHC2_DATA1	0x1d4
			MX8MM_IOMUXC_SD2_DATA2_USDHC2_DATA2	0x1d4
			MX8MM_IOMUXC_SD2_DATA3_USDHC2_DATA3	0x1d4
			MX8MM_IOMUXC_GPIO1_IO04_USDHC2_VSELECT	0x1d0
		>;
	};

	pinctrl_usdhc2_200mhz: usdhc2-200mhzgrp {
		fsl,pins = <
			MX8MM_IOMUXC_SD2_CLK_USDHC2_CLK		0x196
			MX8MM_IOMUXC_SD2_CMD_USDHC2_CMD		0x1d6
			MX8MM_IOMUXC_SD2_DATA0_USDHC2_DATA0	0x1d6
			MX8MM_IOMUXC_SD2_DATA1_USDHC2_DATA1	0x1d6
			MX8MM_IOMUXC_SD2_DATA2_USDHC2_DATA2	0x1d6
			MX8MM_IOMUXC_SD2_DATA3_USDHC2_DATA3	0x1d6
			MX8MM_IOMUXC_GPIO1_IO04_USDHC2_VSELECT	0x1d0
		>;
	};

	pinctrl_wdog: wdoggrp {
		fsl,pins = <
			MX8MM_IOMUXC_GPIO1_IO02_WDOG1_WDOG_B	0x166
		>;
	};
};
u64@ubuntu:~/imx8_dev_board/imx-yocto-bsp/build/tmp/work/x86_64-nativesdk-pokysdk-linux/nativesdk-linux-libc-headers/5.16-r0/linux-5.16/arch/arm64/boot/dts/freescale$

@mantriyogesh
Copy link
Collaborator

mantriyogesh commented Mar 13, 2023

To add further,
After doing:

  1. ESP <== SDIO ==> Host connections made
  2. Device tree mmc instance enabled (with correct/default pinctrl)
  3. ESP flashed with SDIO binary

Your expected host side log (without even loading ESP32 host kernel module):

/var/log/kern.log or /var/log/messages or dmesg would contain:

[   77.649578] mmc1: queuing unknown CIS tuple 0x01 (3 bytes)
[   77.657019] mmc1: queuing unknown CIS tuple 0x1a (5 bytes)
[   77.660243] mmc1: queuing unknown CIS tuple 0x1b (8 bytes)
[   77.662448] mmc1: queuing unknown CIS tuple 0x80 (1 bytes)
[   77.662545] mmc1: queuing unknown CIS tuple 0x81 (1 bytes)
[   77.662643] mmc1: queuing unknown CIS tuple 0x82 (1 bytes)
[   77.664445] mmc1: queuing unknown CIS tuple 0x80 (1 bytes)
[   77.664541] mmc1: queuing unknown CIS tuple 0x81 (1 bytes)
[   77.664637] mmc1: queuing unknown CIS tuple 0x82 (1 bytes)
[   77.664832] mmc1: new SDIO card at address 0001

Once you have detected the SDIO, then, you would want to port rpi_init.sh script as per your host (porting guide mentions this). This should be simple enough.
then you can load the esp32_sdio.ko driver with 'resetpin' configured using ported rpi_init.sh.

Once the kernel module loaded, you can see ESP has reset (using resetpin). Host will show log similar to:

[   77.665287] esp_probe: ESP network device detected
[   77.877892] Features supported are:
[   77.877901] 	 * WLAN
[   77.877906] 	 * BT/BLE
[   77.877911] 	   - HCI over SDIO
[   77.877916] 	   - BT/BLE dual mode
[   78.096179] esp_sdio: probe of mmc1:0001:2 failed with error -22

mmc instance will vary.

@mantriyogesh
Copy link
Collaborator

Hello @shihui2014

Were you manage to get CIS & first event like above?

@shihui2014
Copy link
Author

hello @mantriyogesh
I haven't got this infomation。

1 similar comment
@shihui2014
Copy link
Author

hello @mantriyogesh
I haven't got this infomation。

@mantriyogesh
Copy link
Collaborator

I think you can cross check your Linux SoC MMC config (Device Tree). We cannot assess your Device Tree to be correct or not (It varies from SoC to SoC)

If that is correct, ESP is connected correctly with expected pull-ups & ESP flashed with correct(matching) firmware, then you can expect the CIS prints.

You can also verify if (1) CIS is originated from ESP or not by shut the power to ESP -> No CIS for mmcX. (2) Power ESP -> CIS for mmcX printed in host log.

Make sure you reboot host to check CIS prints in both above tests (If device tree is not correctly configured/supported to poll the SD MMC hardware detection)

host log could be one from /var/log/messages or /var/log/kern/log or dmesg command.

@shihui2014
Copy link
Author

okey,
I'm going to use ESP-Hosted-FG-release 0.0.5,

@mantriyogesh
Copy link
Collaborator

Okay, that will be easy to integrate actually.
You can embed your expected calls right from application.

But even in that case, the underlying sdio hardware still needs to be configured (#212 (comment) is still applicable)

@shihui2014
Copy link
Author

hi,I have obtained the following information from dmesg!
[ 142.959567] mmc1: queuing unknown CIS tuple 0x01 (3 bytes)
[ 142.979684] mmc1: queuing unknown CIS tuple 0x1a (5 bytes)
[ 142.990920] mmc1: queuing unknown CIS tuple 0x1b (8 bytes)
[ 142.999253] drivers/net/wireless/esp32/esp_sdio.c:736 Enter
[ 143.004870] drivers/net/wireless/esp32/esp_sdio.c:737 Class=0
[ 143.014081] drivers/net/wireless/esp32/esp_sdio.c:738 sdio vendor ID: 0x6666
[ 143.023016] drivers/net/wireless/esp32/esp_sdio.c:739 sdio device ID: 0x2222
[ 143.031704] drivers/net/wireless/esp32/esp_sdio.c:740 Function#: 1
[ 143.039495] esp_probe: ESP network device detected
[ 143.045161]
[ 143.045161] Received INIT event from ESP32 peripheral
[ 143.045174] EVENT: 0
[ 143.059163] ESP peripheral capabilities: 0x1b
[ 143.063550] Features supported are:
[ 143.096948] drivers/net/wireless/esp32/esp_sdio.c:736 Enter
[ 143.126903] * WLAN
[ 143.129122] * BT/BLE
[ 143.131488] - HCI over UART
[ 143.134634] - BT/BLE dual mode
[ 143.143276] drivers/net/wireless/esp32/esp_sdio.c:737 Class=2
[ 143.169340] drivers/net/wireless/esp32/esp_sdio.c:738 sdio vendor ID: 0x6666
[ 143.176421] drivers/net/wireless/esp32/esp_sdio.c:739 sdio device ID: 0x3333
[ 143.196884] EVENT: 3
[ 143.223037] drivers/net/wireless/esp32/esp_sdio.c:740 Function#: 2
[ 143.242039] esp_sdio: probe of mmc1:0001:2 failed with error -22
[ 143.271008] drivers/net/wireless/esp32/esp_sdio.c:805 esp32 sdio_register_driver ret:0
root@myd-y6ull14x14:~# [ 144.395119] process_rx_packet, Dropping unsupported serial frame

@shihui2014
Copy link
Author

hi,@mantriyogesh ,thank you for your support,
When see this information,"esp_sdio: probe of mmc1:0001:2 failed with error -22 ",
What should I do next?

@mantriyogesh
Copy link
Collaborator

esp_sdio: probe of mmc1:0001:2 failed with error -22
can be ignored. we don't use function 2 so returns.

What is concerning,
process_rx_packet, Dropping unsupported serial frame

@mantriyogesh
Copy link
Collaborator

mantriyogesh commented Mar 15, 2023

What is output of

$ git log --oneline | head -2 

at ESP (if building from source) and Host side?
It should be d30942e

Can you use current master at both sides, ESP and host side?

sdio_slave_config_t config = {
.sending_mode = SDIO_SLAVE_SEND_STREAM,
.send_queue_size = SDIO_SLAVE_QUEUE_SIZE,
.recv_buffer_size = BUFFER_SIZE,
.event_cb = event_cb,
/* Note: For small devkits there may be no pullups on the board.
This enables the internal pullups to help evaluate the driver
quickly. However the internal pullups are not sufficient and not
reliable, please make sure external pullups are connected to the
bus in your real design.
*/
//.flags = SDIO_SLAVE_FLAG_INTERNAL_PULLUP,
.flags = SDIO_SLAVE_FLAG_DEFAULT_SPEED,
/* Note: Sometimes the SDIO card is detected but gets problem in
* Read/Write or handling ISR because of SDIO timing issues.
* In these cases, Please tune timing below using value from
* https://github.com/espressif/esp-idf/blob/release/v5.0/components/hal/include/hal/sdio_slave_types.h#L26-L38
* */
/* .timing = SDIO_SLAVE_TIMING_NSEND_PSAMPLE,*/
};

You can tune timing there.

@mantriyogesh
Copy link
Collaborator

Are you able to check ahead if you are able connect to AP (using demo app)?
Capture logs at both, ESP and Host.

  • ESP
    • idf.py monitor OR minicom log
  • Host:
    • dmesg OR /var/log/messages OR /var/log/kern.log
    • Commands run and their output

@shihui2014
Copy link
Author

I visit the website" https://github.com/espressif/esp-hosted/releases " and download ESP-Hosted-FG-release_0.0.5.tgz ,esp-hosted-release-fg-v0.0.5.zip

@mantriyogesh
Copy link
Collaborator

yes perfect.
Can you try this and get logs at both sides?

@shihui2014
Copy link
Author

yes,
esp32's log
I (69918) wifi:wifi driver task: 3ffdb308, prio:23, stack:6656, core=1
I (69918) wifi:wifi firmware version: 03528e0
I (69920) wifi:wifi certification version: v7.0
I (69920) wifi:config NVS flash: disabled
I (69924) wifi:config nano formating: disabled
I (69926) wifi:Init data frame dynamic rx buffer num: 32
I (69930) wifi:Init management frame dynamic rx buffer num: 32
I (69936) wifi:Init management short buffer num: 32
I (69938) wifi:Init dynamic tx buffer num: 64
I (69942) wifi:Init static I (69944) NETWORK_ADAPTER: Start Data Path
rx buffer size: 1600
I (69950) wifi:Init static rx buffer num: 16
I (69952) wifi:Init dynamic rx buffer num: 32
I (69956) wifi_init: rx ba win: 6
I (69958) wifi_init: tcpip mbox: 32
I (69962) wifi_init: udp mbox: 6
I (69966) wifi_init: tcp mbox: 6
I (69968) wifi_init: tcp tx win: 5744
I (69972) wifi_init: tcp rx win: 5744
I (69976) wifi_init: tcp mss: 1440
I (69978) wifi_init: WiFi IRAM OP enabled
I (69982) wifi_init: WiFi RX IRAM OP enabled
I (69988) wifi:mode : null
I (69990) NETWORK_ADAPTER: Initial set up done
I (70992) slave_ctrl: event ESPInit
kernel'e log
Hit any key to stop autoboot: 0

NAND read: device 0 offset 0x600000, size 0xa00000
10485760 bytes read: OK

NAND read: device 0 offset 0x1000000, size 0x100000
1048576 bytes read: OK
Kernel image @ 0x80800000 [ 0x000000 - 0x83f710 ]

Flattened Device Tree blob at 83000000

Booting using the fdt blob at 0x83000000
Using Device Tree in place at 83000000, end 8300bcd4
Modify /soc/aips-bus@2200000/epdc@228c000:status disabled
ft_system_setup for mx6

Starting kernel ...

[ 0.000000] Booting Linux on physical CPU 0x0
[ 0.000000] Linux version 5.4.3-gc724a73-dirty (root@ubuntu) (gcc version 9.2.0 (GCC)) #2 SMP PREEMPT Wed Mar 15 17:12:38 +08 2023
[ 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: Freescale i.MX6 ULL 14x14 MYiR Board
[ 0.000000] Memory policy: Data cache writealloc
[ 0.000000] Reserved memory: created CMA memory pool at 0x88000000, size 128 MiB
[ 0.000000] OF: reserved mem: initialized node linux,cma, compatible id shared-dma-pool
[ 0.000000] percpu: Embedded 15 pages/cpu s32076 r8192 d21172 u61440
[ 0.000000] Built 1 zonelists, mobility grouping on. Total pages: 65024
[ 0.000000] Kernel command line: console=ttymxc0,115200 ubi.mtd=4 root=ubi0:rootfs rootfstype=ubifs mtdparts=gpmi-nand:5m(boot),1m(env),10m(kernel),1m(dtb),-(rootfs)
[ 0.000000] Dentry cache hash table entries: 32768 (order: 5, 131072 bytes, linear)
[ 0.000000] Inode-cache hash table entries: 16384 (order: 4, 65536 bytes, linear)
[ 0.000000] mem auto-init: stack:off, heap alloc:off, heap free:off
[ 0.000000] Memory: 109784K/262144K available (11264K kernel code, 728K rwdata, 4060K rodata, 1024K init, 430K bss, 21288K reserved, 131072K cma-reserved, 0K highmem)
[ 0.000000] SLUB: HWalign=64, Order=0-3, MinObjects=0, CPUs=1, Nodes=1
[ 0.000000] rcu: Preemptible hierarchical RCU implementation.
[ 0.000000] rcu: RCU restricting CPUs from NR_CPUS=4 to nr_cpu_ids=1.
[ 0.000000] Tasks RCU enabled.
[ 0.000000] rcu: RCU calculated value of scheduler-enlistment delay is 10 jiffies.
[ 0.000000] rcu: Adjusting geometry for rcu_fanout_leaf=16, nr_cpu_ids=1
[ 0.000000] NR_IRQS: 16, nr_irqs: 16, preallocated irqs: 16
[ 0.000000] random: get_random_bytes called from start_kernel+0x2c8/0x468 with crng_init=0
[ 0.000000] Switching to timer-based delay loop, resolution 41ns
[ 0.000015] sched_clock: 32 bits at 24MHz, resolution 41ns, wraps every 89478484971ns
[ 0.000055] clocksource: mxc_timer1: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 79635851949 ns
[ 0.003081] Console: colour dummy device 80x30
[ 0.003150] Calibrating delay loop (skipped), value calculated using timer frequency.. 48.00 BogoMIPS (lpj=240000)
[ 0.003182] pid_max: default: 32768 minimum: 301
[ 0.003483] Mount-cache hash table entries: 1024 (order: 0, 4096 bytes, linear)
[ 0.003516] Mountpoint-cache hash table entries: 1024 (order: 0, 4096 bytes, linear)
[ 0.005079] CPU: Testing write buffer coherency: ok
[ 0.005801] CPU0: update cpu_capacity 1024
[ 0.005832] CPU0: thread -1, cpu 0, socket 0, mpidr 80000000
[ 0.060577] Setting up static identity map for 0x80100000 - 0x80100060
[ 0.080551] rcu: Hierarchical SRCU implementation.
[ 0.120719] smp: Bringing up secondary CPUs ...
[ 0.120753] smp: Brought up 1 node, 1 CPU
[ 0.120775] SMP: Total of 1 processors activated (48.00 BogoMIPS).
[ 0.120792] CPU: All CPU(s) started in SVC mode.
[ 0.121641] devtmpfs: initialized
[ 0.137049] VFP support v0.3: implementor 41 architecture 2 part 30 variant 7 rev 5
[ 0.137997] clocksource: jiffies: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 19112604462750000 ns
[ 0.138047] futex hash table entries: 256 (order: 2, 16384 bytes, linear)
[ 0.147991] pinctrl core: initialized pinctrl subsystem
[ 0.150382] NET: Registered protocol family 16
[ 0.176971] DMA: preallocated 256 KiB pool for atomic coherent allocations
[ 0.179551] cpuidle: using governor menu
[ 0.196856] vdd3p0: supplied by regulator-dummy
[ 0.198257] cpu: supplied by regulator-dummy
[ 0.199647] vddsoc: supplied by regulator-dummy
[ 0.224127] No ATAGs?
[ 0.224260] hw-breakpoint: found 5 (+1 reserved) breakpoint and 4 watchpoint registers.
[ 0.224298] hw-breakpoint: maximum watchpoint size is 8 bytes.
[ 0.228698] imx6ul-pinctrl 20e0000.iomuxc: no groups defined in /soc/aips-bus@2000000/iomuxc@20e0000/gpmi-nand-1
[ 0.228741] imx6ul-pinctrl 20e0000.iomuxc: initialized IMX pinctrl driver
[ 0.230063] imx6ul-pinctrl 2290000.iomuxc-snvs: initialized IMX pinctrl driver
[ 0.233132] imx mu driver is registered.
[ 0.234186] imx rpmsg driver is registered.
[ 0.336207] regulator@2 GPIO handle specifies active low - ignored
[ 0.339199] vgaarb: loaded
[ 0.341128] SCSI subsystem initialized
[ 0.343364] usbcore: registered new interface driver usbfs
[ 0.343496] usbcore: registered new interface driver hub
[ 0.343705] usbcore: registered new device driver usb
[ 0.347359] i2c i2c-1: IMX I2C adapter registered
[ 0.348144] imx-i2c 21a8000.i2c: can't get pinctrl, bus recovery not supported
[ 0.348897] i2c i2c-2: IMX I2C adapter registered
[ 0.349797] mc: Linux media interface: v0.10
[ 0.349910] videodev: Linux video capture interface: v2.00
[ 0.350048] pps_core: LinuxPPS API ver. 1 registered
[ 0.350066] pps_core: Software ver. 5.3.6 - Copyright 2005-2007 Rodolfo Giometti [email protected]
[ 0.350118] PTP clock support registered
[ 0.353291] MIPI CSI2 driver module loaded
[ 0.353425] Advanced Linux Sound Architecture Driver Initialized.
[ 0.355198] Bluetooth: Core ver 2.22
[ 0.355333] NET: Registered protocol family 31
[ 0.355353] Bluetooth: HCI device and connection manager initialized
[ 0.355389] Bluetooth: HCI socket layer initialized
[ 0.355416] Bluetooth: L2CAP socket layer initialized
[ 0.355472] Bluetooth: SCO socket layer initialized
[ 0.356726] clocksource: Switched to clocksource mxc_timer1
[ 0.357074] VFS: Disk quotas dquot_6.6.0
[ 0.357229] VFS: Dquot-cache hash table entries: 1024 (order 0, 4096 bytes)
[ 0.380195] thermal_sys: Registered thermal governor 'step_wise'
[ 0.380849] NET: Registered protocol family 2
[ 0.382150] tcp_listen_portaddr_hash hash table entries: 512 (order: 0, 6144 bytes, linear)
[ 0.382225] TCP established hash table entries: 2048 (order: 1, 8192 bytes, linear)
[ 0.382294] TCP bind hash table entries: 2048 (order: 2, 16384 bytes, linear)
[ 0.382383] TCP: Hash tables configured (established 2048 bind 2048)
[ 0.382581] UDP hash table entries: 256 (order: 1, 8192 bytes, linear)
[ 0.382645] UDP-Lite hash table entries: 256 (order: 1, 8192 bytes, linear)
[ 0.383028] NET: Registered protocol family 1
[ 0.414572] RPC: Registered named UNIX socket transport module.
[ 0.414608] RPC: Registered udp transport module.
[ 0.414624] RPC: Registered tcp transport module.
[ 0.414638] RPC: Registered tcp NFSv4.1 backchannel transport module.
[ 0.426047] PCI: CLS 0 bytes, default 64
[ 0.427880] hw perfevents: enabled with armv7_cortex_a7 PMU driver, 5 counters available
[ 0.431482] Bus freq driver module loaded
[ 0.434300] Initialise system trusted keyrings
[ 0.434856] workingset: timestamp_bits=30 max_order=16 bucket_order=0
[ 0.459691] NFS: Registering the id_resolver key type
[ 0.459762] Key type id_resolver registered
[ 0.459780] Key type id_legacy registered
[ 0.459880] jffs2: version 2.2. (NAND) © 2001-2006 Red Hat, Inc.
[ 0.461024] fuse: init (API version 7.31)
[ 0.552612] Key type asymmetric registered
[ 0.552643] Asymmetric key parser 'x509' registered
[ 0.552717] io scheduler mq-deadline registered
[ 0.552738] io scheduler kyber registered
[ 0.561471] pwm-backlight backlight-display: backlight-display supply power not found, using dummy regulator
[ 0.567317] mxsfb 21c8000.lcdif: 21c8000.lcdif supply lcd not found, using dummy regulator
[ 0.685612] Console: switching to colour frame buffer device 100x30
[ 0.780968] mxsfb 21c8000.lcdif: initialized
[ 0.791527] imx-sdma 20ec000.sdma: Direct firmware load for imx/sdma/sdma-imx6q.bin failed with error -2
[ 0.791567] imx-sdma 20ec000.sdma: Falling back to sysfs fallback for: imx/sdma/sdma-imx6q.bin
[ 0.796007] mxs-dma 1804000.dma-apbh: initialized
[ 0.803695] 2020000.serial: ttymxc0 at MMIO 0x2020000 (irq = 22, base_baud = 5000000) is a IMX
[ 1.535214] printk: console [ttymxc0] enabled
[ 1.541853] 21e8000.serial: ttymxc1 at MMIO 0x21e8000 (irq = 65, base_baud = 5000000) is a IMX
[ 1.552472] 21f0000.serial: ttymxc3 at MMIO 0x21f0000 (irq = 66, base_baud = 5000000) is a IMX
[ 1.596592] imx_rngc 2284000.rng: Freescale RNGC registered.
[ 1.603250] imx sema4 driver is registered.
[ 1.644313] brd: module loaded
[ 1.670176] loop: module loaded
[ 1.676314] imx ahci driver is registered.
[ 1.683634] imx6ul-pinctrl 20e0000.iomuxc: invalid function iomuxc in map table
[ 1.693140] nand: device found, Manufacturer ID: 0x2c, Chip ID: 0xda
[ 1.699612] nand: Micron MT29F2G08ABAEAWP
[ 1.703658] nand: 256 MiB, SLC, erase size: 128 KiB, page size: 2048, OOB size: 64
[ 1.712479] Bad block table found at page 131008, version 0x01
[ 1.718715] Bad block table found at page 130944, version 0x01
[ 1.725014] 5 cmdlinepart partitions found on MTD device gpmi-nand
[ 1.731381] Creating 5 MTD partitions on "gpmi-nand":
[ 1.736476] 0x000000000000-0x000000500000 : "boot"
[ 1.748975] 0x000000500000-0x000000600000 : "env"
[ 1.768750] 0x000000600000-0x000001000000 : "kernel"
[ 1.788692] 0x000001000000-0x000001100000 : "dtb"
[ 1.808711] 0x000001100000-0x000010000000 : "rootfs"
[ 1.828987] gpmi-nand 1806000.gpmi-nand: driver registered.
[ 1.840597] libphy: Fixed MDIO Bus: probed
[ 1.846864] CAN device driver interface
[ 1.919441] pps pps0: new PPS source ptp0
[ 1.925380] fec 20b4000.ethernet: Invalid MAC address: 00:00:00:00:00:00
[ 1.932269] fec 20b4000.ethernet: Using random MAC address: 16:da:4b:52:4a:a4
[ 1.940593] libphy: fec_enet_mii_bus: probed
[ 1.948938] fec 20b4000.ethernet eth0: registered PHC device 0
[ 2.028930] pps pps1: new PPS source ptp1
[ 2.036991] fec 2188000.ethernet eth1: registered PHC device 1
[ 2.043624] e1000e: Intel(R) PRO/1000 Network Driver - 3.2.6-k
[ 2.049579] e1000e: Copyright(c) 1999 - 2015 Intel Corporation.
[ 2.056638] PPP generic driver version 2.4.2
[ 2.061541] PPP BSD Compression module registered
[ 2.066288] PPP Deflate Compression module registered
[ 2.071462] PPP MPPE Compression module registered
[ 2.076288] NET: Registered protocol family 24
[ 2.081127] usbcore: registered new interface driver r8152
[ 2.086927] usbcore: registered new interface driver lan78xx
[ 2.092738] usbcore: registered new interface driver asix
[ 2.098329] usbcore: registered new interface driver ax88179_178a
[ 2.104532] usbcore: registered new interface driver cdc_ether
[ 2.110593] usbcore: registered new interface driver smsc95xx
[ 2.116458] usbcore: registered new interface driver net1080
[ 2.122304] usbcore: registered new interface driver cdc_subset
[ 2.128392] usbcore: registered new interface driver zaurus
[ 2.134072] usbcore: registered new interface driver MOSCHIP usb-ethernet driver
[ 2.141675] usbcore: registered new interface driver cdc_ncm
[ 2.147659] usbcore: registered new interface driver qmi_wwan_q
[ 2.153705] usbcore: registered new interface driver qmi_wwan
[ 2.159549] ehci_hcd: USB 2.0 'Enhanced' Host Controller (EHCI) Driver
[ 2.166102] ehci-pci: EHCI PCI platform driver
[ 2.170814] ehci-mxc: Freescale On-Chip EHCI Host driver
[ 2.177101] usbcore: registered new interface driver cdc_wdm
[ 2.182927] usbcore: registered new interface driver usb-storage
[ 2.189294] usbcore: registered new interface driver usbserial_generic
[ 2.195931] usbserial: USB Serial support registered for generic
[ 2.202129] usbcore: registered new interface driver option
[ 2.207851] usbserial: USB Serial support registered for GSM modem (1-port)
[ 2.219231] imx_usb 2184000.usb: No over current polarity defined
[ 2.225530] imx_usb 2184000.usb: 2184000.usb supply vbus not found, using dummy regulator
[ 2.284115] random: fast init done
[ 2.861348] mxs_phy 20c9000.usbphy: Data pin can't make good contact.
[ 2.881163] imx_usb 2184200.usb: 2184200.usb supply vbus not found, using dummy regulator
[ 2.894429] ci_hdrc ci_hdrc.1: EHCI Host Controller
[ 2.899499] ci_hdrc ci_hdrc.1: new USB bus registered, assigned bus number 1
[ 2.936853] ci_hdrc ci_hdrc.1: USB 2.0 started, EHCI 1.00
[ 2.942758] usb usb1: New USB device found, idVendor=1d6b, idProduct=0002, bcdDevice= 5.04
[ 2.951147] usb usb1: New USB device strings: Mfr=3, Product=2, SerialNumber=1
[ 2.958442] usb usb1: Product: EHCI Host Controller
[ 2.963349] usb usb1: Manufacturer: Linux 5.4.3-gc724a73-dirty ehci_hcd
[ 2.970095] usb usb1: SerialNumber: ci_hdrc.1
[ 2.976123] hub 1-0:1.0: USB hub found
[ 2.980210] hub 1-0:1.0: 1 port detected
[ 3.000442] input: 20cc000.snvs:snvs-powerkey as /devices/soc0/soc/2000000.aips-bus/20cc000.snvs/20cc000.snvs:snvs-powerkey/input/input0
[ 3.021157] edt_ft5x06 1-0038: touchscreen probe failed
[ 3.027638] imx6ul-pinctrl 20e0000.iomuxc: pin MX6UL_PAD_GPIO1_IO02 already requested by 20e0000.iomuxc; cannot claim for 2040000.tsc
[ 3.039868] imx6ul-pinctrl 20e0000.iomuxc: pin-25 (2040000.tsc) status -22
[ 3.046906] imx6ul-pinctrl 20e0000.iomuxc: could not request pin 25 (MX6UL_PAD_GPIO1_IO02) from group tscgrp on device 20e0000.iomuxc
[ 3.059073] imx6ul-tsc 2040000.tsc: Error applying setting, reverse things back
[ 3.066445] imx6ul-tsc: probe of 2040000.tsc failed with error -22
[ 3.079028] snvs_rtc 20cc000.snvs:snvs-rtc-lp: registered as rtc0
[ 3.085521] i2c /dev entries driver
[ 3.092623] link-frequencies 0 value 70000000
[ 3.217146] ov2659 1-0030: Sensor soft reset failed
[ 3.224841] pxp-v4l2 pxp_v4l2: initialized
[ 3.234568] imx2-wdt 20bc000.wdog: timeout 60 sec (nowayout=0)
[ 3.242244] Bluetooth: HCI UART driver ver 2.3
[ 3.246930] Bluetooth: HCI UART protocol H4 registered
[ 3.252105] Bluetooth: HCI UART protocol BCSP registered
[ 3.257643] Bluetooth: HCI UART protocol LL registered
[ 3.262879] Bluetooth: HCI UART protocol Three-wire (H5) registered
[ 3.269296] Bluetooth: HCI UART protocol Marvell registered
[ 3.275036] usbcore: registered new interface driver btusb
[ 3.282691] sdhci: Secure Digital Host Controller Interface driver
[ 3.289020] sdhci: Copyright(c) Pierre Ossman
[ 3.293405] sdhci-pltfm: SDHCI platform and OF driver helper
[ 3.345472] mmc1: SDHCI controller on 2194000.usdhc [2194000.usdhc] using ADMA
[ 3.357897] caam-snvs 20cc000.caam-snvs: can't get snvs clock
[ 3.363982] caam-snvs 20cc000.caam-snvs: violation handlers armed - init state
[ 3.378429] usbcore: registered new interface driver usbhid
[ 3.384055] usbhid: USB HID core driver
[ 3.394062] mmc1: queuing unknown CIS tuple 0x01 (3 bytes)
[ 3.409909] wm8904 1-001a: 1-001a supply DCVDD not found, using dummy regulator
[ 3.417862] wm8904 1-001a: 1-001a supply DBVDD not found, using dummy regulator
[ 3.425472] wm8904 1-001a: 1-001a supply AVDD not found, using dummy regulator
[ 3.433158] wm8904 1-001a: 1-001a supply CPVDD not found, using dummy regulator
[ 3.440868] wm8904 1-001a: 1-001a supply MICVDD not found, using dummy regulator
[ 3.449426] wm8904 1-001a: Failed to read ID register: -6
[ 3.456597] mmc1: queuing unknown CIS tuple 0x1a (5 bytes)
[ 3.467108] fsl-sai 202c000.sai: failed to get mclk0 clock: -2
[ 3.477017] mmc1: queuing unknown CIS tuple 0x1b (8 bytes)
[ 3.485031] imx-wm8904 sound: failed to find codec platform device
[ 3.494576] mmc1: queuing unknown CIS tuple 0x80 (1 bytes)
[ 3.500223] imx-wm8904: probe of sound failed with error -22
[ 3.506327] mmc1: queuing unknown CIS tuple 0x81 (1 bytes)
[ 3.512108] NET: Registered protocol family 26
[ 3.517231] mmc1: queuing unknown CIS tuple 0x82 (1 bytes)
[ 3.524074] NET: Registered protocol family 10
[ 3.531610] mmc1: queuing unknown CIS tuple 0x80 (1 bytes)
[ 3.539169] mmc1: queuing unknown CIS tuple 0x81 (1 bytes)
[ 3.544899] mmc1: queuing unknown CIS tuple 0x82 (1 bytes)
[ 3.551694] Segment Routing with IPv6
[ 3.555564] sit: IPv6, IPv4 and MPLS over IPv4 tunneling driver
[ 3.562211] mmc1: new SDIO card at address 0001
[ 3.568385] NET: Registered protocol family 17
[ 3.572903] can: controller area network core (rev 20170425 abi 9)
[ 3.580406] NET: Registered protocol family 29
[ 3.585035] can: raw protocol (rev 20170425)
[ 3.589415] can: broadcast manager protocol (rev 20170425 t)
[ 3.595124] can: netlink gateway (rev 20190810) max_hops=1
[ 3.601305] Bluetooth: RFCOMM TTY layer initialized
[ 3.606254] Bluetooth: RFCOMM socket layer initialized
[ 3.611684] Bluetooth: RFCOMM ver 1.11
[ 3.615496] Bluetooth: BNEP (Ethernet Emulation) ver 1.3
[ 3.621014] Bluetooth: BNEP filters: protocol multicast
[ 3.626292] Bluetooth: BNEP socket layer initialized
[ 3.631336] Bluetooth: HIDP (Human Interface Emulation) ver 1.2
[ 3.637333] Bluetooth: HIDP socket layer initialized
[ 3.642485] Key type dns_resolver registered
[ 3.680157] Registering SWP/SWPB emulation handler
[ 3.686116] Loading compiled-in X.509 certificates
[ 3.734136] imx_thermal tempmon: Industrial CPU temperature grade - max:115C critical:110C passive:105C
[ 3.744860] ubi0: default fastmap pool size: 95
[ 3.749553] ubi0: default fastmap WL pool size: 47
[ 3.754366] ubi0: attaching mtd4
[ 4.898346] ubi0: scanning is finished
[ 4.925044] ubi0: attached mtd4 (name "rootfs", size 239 MiB)
[ 4.930951] ubi0: PEB size: 131072 bytes (128 KiB), LEB size: 126976 bytes
[ 4.937888] ubi0: min./max. I/O unit sizes: 2048/2048, sub-page size 2048
[ 4.944695] ubi0: VID header offset: 2048 (aligned 2048), data offset: 4096
[ 4.951773] ubi0: good PEBs: 1908, bad PEBs: 4, corrupted PEBs: 0
[ 4.957923] ubi0: user volume: 1, internal volumes: 1, max. volumes count: 128
[ 4.965165] ubi0: max/mean erase counter: 2/1, WL threshold: 4096, image sequence number: 2410973462
[ 4.974385] ubi0: available PEBs: 0, total reserved PEBs: 1908, PEBs reserved for bad PEB handling: 36
[ 4.983778] ubi0: background thread "ubi_bgt0d" started, PID 118
[ 4.991047] input: gpio-keys as /devices/soc0/gpio-keys/input/input2
[ 4.998686] snvs_rtc 20cc000.snvs:snvs-rtc-lp: setting system clock to 1970-01-01T00:00:01 UTC (1)
[ 5.008229] cfg80211: Loading compiled-in X.509 certificates for regulatory database
[ 5.021845] cfg80211: Loaded X.509 cert 'sforshee: 00b28ddf47aef9cea7'
[ 5.028870] platform regulatory.0: Direct firmware load for regulatory.db failed with error -2
[ 5.037952] ALSA device list:
[ 5.040949] No soundcards found.
[ 5.045466] platform regulatory.0: Falling back to sysfs fallback for: regulatory.db
[ 5.053855] UBIFS (ubi0:0): Mounting in unauthenticated mode
[ 5.096633] UBIFS (ubi0:0): recovery needed
[ 5.203699] UBIFS (ubi0:0): recovery deferred
[ 5.208456] UBIFS (ubi0:0): UBIFS: mounted UBI device 0, volume 0, name "rootfs", R/O mode
[ 5.216821] UBIFS (ubi0:0): LEB size: 126976 bytes (124 KiB), min./max. I/O unit sizes: 2048 bytes/2048 bytes
[ 5.226805] UBIFS (ubi0:0): FS size: 235413504 bytes (224 MiB, 1854 LEBs), journal size 11808768 bytes (11 MiB, 93 LEBs)
[ 5.238060] UBIFS (ubi0:0): reserved for root: 4952683 bytes (4836 KiB)
[ 5.244898] UBIFS (ubi0:0): media format: w5/r0 (latest is w5/r0), UUID 700A3DC8-7317-40CD-8DB3-9C433550637C, small LPT model
[ 5.257339] VFS: Mounted root (ubifs filesystem) readonly on device 0:14.
[ 5.264966] devtmpfs: mounted
[ 5.270733] Freeing unused kernel memory: 1024K
[ 5.275755] Run /sbin/init as init process
[ 5.660813] systemd[1]: System time before build time, advancing clock.
[ 5.765396] systemd[1]: systemd 243+ running in system mode. (-PAM -AUDIT -SELINUX +IMA -APPARMOR +SMACK +SYSVINIT +UTMP -LIBCRYPTSETUP -GCRYPT -GNUTLS +ACL +XZ -LZ4 -SECCOMP +BLKID -ELFUTILS +KMOD -IDN2 -IDN -PCRE2 default-hierarchy=hybrid)
[ 5.789936] systemd[1]: Detected architecture arm.

Welcome to NXP i.MX Release Distro 5.4-zeus (zeus)!

[ 5.854673] systemd[1]: Set hostname to .
[ 6.238851] random: crng init done
[ 6.907890] systemd[1]: /lib/systemd/system/dbus.socket:5: ListenStream= references a path below legacy directory /var/run/, updating /var/run/dbus/system_bus_socket → /run/dbus/system_bus_socket; please update the unit file accordingly.
[ 7.006935] systemd[1]: /lib/systemd/system/rpcbind.socket:5: ListenStream= references a path below legacy directory /var/run/, updating /var/run/rpcbind.sock → /run/rpcbind.sock; please update the unit file accordingly.
[ 7.332650] systemd[1]: system-getty.slice: unit configures an IP firewall, but the local system does not support BPF/cgroup firewalling.
[ 7.345322] systemd[1]: (This warning is only shown for the first unit using IP firewalling.)
[ 7.356661] systemd[1]: Created slice system-getty.slice.
[ OK ] Created slice system-getty.slice.
[ 7.400266] systemd[1]: Created slice system-serial\x2dgetty.slice.
[ OK ] Created slice system-serial\x2dgetty.slice.
[ 7.438683] systemd[1]: Created slice User and Session Slice.
[ OK ] Created slice User and Session Slice.
[ OK ] Started Dispatch Password …ts to Console Directory Watch.
[ OK ] Started Forward Password R…uests to Wall Directory Watch.
[ OK ] Reached target Paths.
[ OK ] Reached target Remote File Systems.
[ OK ] Reached target Slices.
[ OK ] Reached target Swap.
[ OK ] Listening on Syslog Socket.
[ OK ] Listening on initctl Compatibility Named Pipe.
[ OK ] Listening on Journal Socket (/dev/log).
[ OK ] Listening on Journal Socket.
[ OK ] Listening on Network Service Netlink Socket.
[ OK ] Listening on udev Control Socket.
[ OK ] Listening on udev Kernel Socket.
Mounting Kernel Debug File System...
Mounting Temporary Directory (/tmp)...
Starting File System Check on Root Device...
Starting Journal Service...
Mounting FUSE Control File System...
Mounting Kernel Configuration File System...
Starting Apply Kernel Variables...
Starting udev Coldplug all Devices...
Starting Setup Virtual Console...
[ OK ] Mounted Kernel Debug File System.
[ OK ] Mounted Temporary Directory (/tmp).
[ OK ] Started File System Check on Root Device.
[ OK ] Mounted FUSE Control File System.
[ OK ] Mounted Kernel Configuration File System.
[ OK ] Started Apply Kernel Variables.
[ OK ] Started Setup Virtual Console.
Starting Remount Root and Kernel File Systems...
[ 8.732440] UBIFS (ubi0:0): completing deferred recovery
[ 8.827769] UBIFS (ubi0:0): background thread "ubifs_bgt0_0" started, PID 150
[ 8.843865] UBIFS (ubi0:0): deferred recovery completed
[ OK ] Started Journal Service.
[ OK ] Started Remount Root and Kernel File Systems.
Starting Flush Journal to Persistent Storage...
Starting Create Static Device Nodes in /dev...
[ 9.067159] systemd-journald[139]: Received client request to flush runtime journal.
[ OK ] Started Flush Journal to Persistent Storage.
[ OK ] Started Create Static Device Nodes in /dev.
[ OK ] Reached target Local File Systems (Pre).
Mounting /var/volatile...
Starting udev Kernel Device Manager...
[ OK ] Mounted /var/volatile.
Starting Load/Save Random Seed...
[ OK ] Reached target Local File Systems.
Starting Create Volatile Files and Directories...
[ OK ] Started Load/Save Random Seed.
[ OK ] Started Create Volatile Files and Directories.
Starting Network Time Synchronization...
Starting Update UTMP about System Boot/Shutdown...
[ OK ] Started udev Kernel Device Manager.
Starting Network Service...
[ OK ] Started Update UTMP about System Boot/Shutdown.
[ OK ] Started Network Service.
Starting Network Name Resolution...
[ OK ] Started Network Time Synchronization.
[ OK ] Reached target System Time Set.
[ OK ] Reached target System Time Synchronized.
[ OK ] Started udev Coldplug all Devices.
[ OK ] Reached target System Initialization.
[ OK ] Started Daily Cleanup of Temporary Directories.
[ OK ] Reached target Timers.
[ OK ] Listening on Avahi mDNS/DNS-SD Stack Activation Socket.
[ OK ] Listening on D-Bus System Message Bus Socket.
[ OK ] Listening on dropbear.socket.
[ OK ] Listening on RPCbind Server Activation Socket.
[ OK ] Reached target Sockets.
[ OK ] Reached target Basic System.
[ OK ] Started Kernel Logging Service.
[ OK ] Started System Logging Service.
[ OK ] Started D-Bus System Message Bus.
[ OK ] Started User Space Epdc Firmware Loading.
Starting Network Time Service (one-shot ntpdate mode)...
Starting Telephony service...
Starting Start Psplash Boot Screen...
[ OK ] Started User Space Regulatory Firmware Loading.
Starting RPC Bind Service...
[ OK ] Started User Space SDMA Firmware Loading.
Starting Login Service...
[ OK ] Started TEE Supplicant.
[ OK ] Started Network Name Resolution.
[ OK ] Started Network Time Service (one-shot ntpdate mode).
[ OK ] Started Start Psplash Boot Screen.
[ 15.282749] imx-sdma 20ec000.sdma: loaded firmware 3.5
[ OK ] Started RPC Bind Service.
[ 15.802164] Generic PHY 20b4000.ethernet-1:01: attached PHY driver [Generic PHY] (mii_bus:phy_addr=20b4000.ethernet-1:01, irq=POLL)
[ 17.167334] Generic PHY 20b4000.ethernet-1:00: attached PHY driver [Generic PHY] (mii_bus:phy_addr=20b4000.ethernet-1:00, irq=POLL)
[ OK ] Started Telephony service.
[ 19.367434] fec 2188000.ethernet eth1: Link is Up - 100Mbps/Full - flow control rx/tx
[ 19.375344] IPv6: ADDRCONF(NETDEV_CHANGE): eth1: link becomes ready
[ OK ] Started Login Service.
[ OK ] Created slice system-systemd\x2dbacklight.slice.
[ OK ] Reached target Network.
[ OK ] Reached target Host and Network Name Lookups.
Starting Avahi mDNS/DNS-SD Stack...
[ OK ] Started NFS status monitor for NFSv2/3 locking..
[ OK ] Started Updates psplash to basic.
[ OK ] Started Update psplash to network.
Starting Terminate Psplash Boot Screen...
Starting /etc/rc.local Compatibility...
Starting Load/Save Screen …backlight:backlight-display...
[ OK ] Started Terminate Psplash Boot Screen.
[ OK ] Started /etc/rc.local Compatibility.
[ OK ] Started Load/Save Screen B…f backlight:backlight-display.
[ OK ] Started Avahi mDNS/DNS-SD Stack.
[ OK ] Started Getty on tty1.
[ OK ] Started Serial Getty on ttymxc0.
[ OK ] Reached target Login Prompts.
Starting start process control system for UNIX...
[ OK ] Started start process control system for UNIX.
[ OK ] Reached target Multi-User System.
Starting Update UTMP about System Runlevel Changes...
[ OK ] Started Update UTMP about System Runlevel Changes.

NXP i.MX Release Distro 5.4-zeus myd-y6ull14x14 ttymxc0

myd-y6ull14x14 login: [ 35.046928] can-3v3: disabling

myd-y6ull14x14 login: root
root@myd-y6ull14x14:# ls
esp32_sdio.ko
root@myd-y6ull14x14:
# insmod esp32_sdio.ko
[ 76.372806] mmc1: queuing unknown CIS tuple 0x01 (3 bytes)
[ 76.394998] mmc1: queuing unknown CIS tuple 0x1a (5 bytes)
[ 76.404555] mmc1: queuing unknown CIS tuple 0x1b (8 bytes)
[ 76.415528] drivers/net/wireless/esp32/esp_sdio.c:736 Enter
[ 76.432062] drivers/net/wireless/esp32/esp_sdio.c:737 Class=0
[ 76.440496] drivers/net/wireless/esp32/esp_sdio.c:738 sdio vendor ID: 0x6666
[ 76.449256] drivers/net/wireless/esp32/esp_sdio.c:739 sdio device ID: 0x2222
[ 76.456333] drivers/net/wireless/esp32/esp_sdio.c:740 Function#: 1
[ 76.465053] esp_probe: ESP network device detected
[ 76.472193]
[ 76.472193] Received INIT event from ESP32 peripheral
[ 76.472210] EVENT: 0
[ 76.484663] ESP peripheral capabilities: 0x1b
[ 76.517068] drivers/net/wireless/esp32/esp_sdio.c:736 Enter
[ 76.522680] drivers/net/wireless/esp32/esp_sdio.c:737 Class=2
[ 76.538922] Features supported are:
[ 76.542447] * WLAN
[ 76.544639] * BT/BLE
[ 76.576919] - HCI over UART
[ 76.580094] - BT/BLE dual mode
[ 76.583504] EVENT: 3
[ 76.589477] drivers/net/wireless/esp32/esp_sdio.c:738 sdio vendor ID: 0x6666
[ 76.596557] drivers/net/wireless/esp32/esp_sdio.c:739 sdio device ID: 0x3333
[ 76.644527] drivers/net/wireless/esp32/esp_sdio.c:740 Function#: 2
[ 76.664339] esp_sdio: probe of mmc1:0001:2 failed with error -22
[ 76.698803] drivers/net/wireless/esp32/esp_sdio.c:805 esp32 sdio_register_driver ret:0
root@myd-y6ull14x14:~# [ 77.820534] process_rx_packet, Dropping unsupported serial frame

@shihui2014
Copy link
Author

hi @mantriyogesh you say “connect to AP (using demo app)?”
the demo app is?

@shihui2014
Copy link
Author

connect to ap use by “esp-hosted-release-fg-v0.0.5\esp_hosted_fg\host\linux\host_control\ c_support ”?
may i use “c_support” only?Because my board has no python environment。

@mantriyogesh
Copy link
Collaborator

I don't see your ESP full log.
Can you please help to get ESP log from flashing till end?
I suspect you are still using old release.

@mantriyogesh
Copy link
Collaborator

Yes you can use C demo app from esp_hosted_fg\host\linux\host_control\c_support.

@shihui2014
Copy link
Author

An error occurred while compiling c_support
fatal error: protobuf-c/protobuf-c.h: No such file or directory
file protobuf-c/protobuf-c/protobuf-c.c is not exist。

and esp log is :
ets Jul 29 2019 12:21:46

rst:0x1 (POWERON_RESET),boot:0x2b (HSPI_FLASH_BOOT)
invalid header: 0xffffffff
invalid header: 0xffffffff
invalid header: 0xffffffff
invalid header: 0xffffffff
invalid header: 0xffffffff
invalid header: 0xffffffff
invalid header: 0xffffffff
invalid header: 0xffffffff
ets Jul 29 2019 12:21:46

rst:0x10 (RTCWDT_RTC_RESET),boot:0x3b (SPI_FAST_FLASH_BOOT)
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 (28) boot: ESP-IDF v5.0-beta1-742-g7bd5af7f1e 2nd stage bootloader
I (28) boot: compile time 09:35:03
I (28) boot: chip revision: V300
I (32) boot_comm: chip revision: 3, min. bootloader chip revision: 0
I (39) boot.esp32: SPI Speed : 40MHz
I (44) boot.esp32: SPI Mode : DIO
I (49) boot.esp32: SPI Flash Size : 4MB
I (53) boot: Enabling RNG early entropy source...
I (59) boot: Partition Table:
I (62) boot: ## Label Usage Type ST Offset Length
I (69) boot: 0 nvs WiFi data 01 02 00009000 00004000
I (77) boot: 1 otadata OTA data 01 00 0000d000 00002000
I (84) boot: 2 phy_init RF data 01 01 0000f000 00001000
I (92) boot: 3 factory factory app 00 00 00010000 00100000
I (99) boot: 4 ota_0 OTA app 00 10 00110000 00100000
I (107) boot: 5 ota_1 OTA app 00 11 00210000 00100000
I (114) boot: End of partition table
I (119) boot: Defaulting to factory image
I (123) boot_comm: chip revision: 3, min. application chip revision: 0
I (130) esp_image: segment 0: paddr=00010020 vaddr=3f400020 size=288ach (166060) map
I (199) esp_image: segment 1: paddr=000388d4 vaddr=3ffbdb60 size=05864h ( 22628) load
I (208) esp_image: segment 2: paddr=0003e140 vaddr=40080000 size=01ed8h ( 7896) load
I (212) esp_image: segment 3: paddr=00040020 vaddr=400d0020 size=9d014h (643092) map
I (448) esp_image: segment 4: paddr=000dd03c vaddr=40081ed8 size=1c044h (114756) load
I (495) esp_image: segment 5: paddr=000f9088 vaddr=50000000 size=00010h ( 16) load
I (511) boot: Loaded app from partition at offset 0x10000
I (511) boot: Disabling RNG early entropy source...
I (522) cpu_start: Pro cpu up.
I (523) cpu_start: Starting app cpu, entry point is 0x400813dc
I (0) cpu_start: App cpu up.
I (539) cpu_start: Pro cpu start user code
I (539) cpu_start: cpu freq: 240000000 Hz
I (539) cpu_start: Application information:
I (544) cpu_start: Project name: network_adapter
I (549) cpu_start: App version: e0bb23b
I (554) cpu_start: Compile time: Oct 21 2022 09:34:49
I (560) cpu_start: ELF file SHA256: 985ab6d0449645a0...
I (566) cpu_start: ESP-IDF: v5.0-beta1-742-g7bd5af7f1e
I (573) heap_init: Initializing. RAM available for dynamic allocation:
I (580) heap_init: At 3FFAFF10 len 000000F0 (0 KiB): DRAM
I (586) heap_init: At 3FFB6388 len 00001C78 (7 KiB): DRAM
I (592) heap_init: At 3FFB9A20 len 00004108 (16 KiB): DRAM
I (598) heap_init: At 3FFCCA28 len 000135D8 (77 KiB): DRAM
I (605) heap_init: At 3FFE0440 len 00003AE0 (14 KiB): D/IRAM
I (611) heap_init: At 3FFE4350 len 0001BCB0 (111 KiB): D/IRAM
I (617) heap_init: At 4009DF1C len 000020E4 (8 KiB): IRAM
I (625) spi_flash: detected chip: gd
I (628) spi_flash: flash io: dio
W (632) spi_flash: Detected size(8192k) larger than the size in the binary image header(4096k). Using the size in the binary image header.
I (646) cpu_start: Starting scheduler on PRO CPU.
I (0) cpu_start: Starting scheduler on APP CPU.
I (660) NETWORK_ADAPTER: *********************************************************************
I (666) NETWORK_ADAPTER: ESP-Hosted-FG Firmware version :: 0.0.5
I (674) NETWORK_ADAPTER: Transport used :: SDIO + UART
I (682) NETWORK_ADAPTER: *********************************************************************
I (690) NETWORK_ADAPTER: Supported features are:
I (694) NETWORK_ADAPTER: - WLAN over SDIO
I (698) ESP_BT: - BT/BLE
I (700) ESP_BT: - HCI Over UART
I (702) ESP_BT: - BT/BLE dual mode
I (706) NETWORK_ADAPTER: capabilities: 0x1b
I (718) BTDM_INIT: BT controller compile version [8020d24]
I (720) system_api: Base MAC address is not set
I (722) system_api: read default base MAC address from EFUSE
I (728) phy_init: phy_version 4670,719f9f6,Feb 18 2021,17:07:07
I (1054) NETWORK_ADAPTER: ESP Bluetooth MAC addr: b8:d6:1a:6c:69:6a
I (1056) SDIO_SLAVE: Using SDIO interface

@mantriyogesh
Copy link
Collaborator

fatal error: protobuf-c/protobuf-c.h: No such file or directory
file protobuf-c/protobuf-c/protobuf-c.c is not exist。

Missed this documentation step:
Screenshot 2023-03-16 at 11 39 08 AM

I will update the code likewise, but CONFIG_SUPPORT_ESP_SERIAL is mandatory.

@shihui2014
Copy link
Author

I have already set CONFIG_SUPPORT_ESP_SERIAL = y

and esp32 log is :
root@myd-y6ull14x14:# insmod esp32_sdio.ko
[ 34.381029] esp_reset, ESP32: Resetpin of Host is 68
[ 34.455773] esp_sdio: probe of mmc1:0001:1 failed with error -16
[ 34.462340] esp_sdio: probe of mmc1:0001:2 failed with error -16
[ 34.479966] drivers/net/wireless/esp32/esp_sdio.c:806 esp32 sdio_register_driver ret:0
root@myd-y6ull14x14:
# [ 35.047012] can-3v3: disabling

kernel log is:
.
I (659) NETWORK_ADAPTER: *********************************************************************
I (665) NETWORK_ADAPTER: ESP-Hosted-FG Firmware version :: 0.0.5
I (673) NETWORK_ADAPTER: Transport used :: SDIO + UART
I (681) NETWORK_ADAPTER: *********************************************************************
I (689) NETWORK_ADAPTER: Supported features are:
I (693) NETWORK_ADAPTER: - WLAN over SDIO
I (697) ESP_BT: - BT/BLE
I (699) ESP_BT: - HCI Over UART
I (701) ESP_BT: - BT/BLE dual mode
I (705) NETWORK_ADAPTER: capabilities: 0x1b
I (717) BTDM_INIT: BT controller compile version [8020d24]
I (719) system_api: Base MAC address is not set
I (721) system_api: read default base MAC address from EFUSE
I (727) phy_init: phy_version 4670,719f9f6,Feb 18 2021,17:07:07
I (1055) NETWORK_ADAPTER: ESP Bluetooth MAC addr: b8:d6:1a:6c:69:6a
I (1057) SDIO_SLAVE: Using SDIO interface
ets Jul 29 2019 12:21:46

rst:0x1 (POWERON_RESET),boot:0x3b (SPI_FAST_FLASH_BOOT)
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 (27) boot: ESP-IDF v5.0-beta1-742-g7bd5af7f1e 2nd stage bootloader
I (27) boot: compile time 09:35:03
I (28) boot: chip revision: V300
I (32) boot_comm: chip revision: 3, min. bootloader chip revision: 0
I (39) boot.esp32: SPI Speed : 40MHz
I (44) boot.esp32: SPI Mode : DIO
I (48) boot.esp32: SPI Flash Size : 4MB
I (53) boot: Enabling RNG early entropy source...
I (58) boot: Partition Table:
I (62) boot: ## Label Usage Type ST Offset Length
I (69) boot: 0 nvs WiFi data 01 02 00009000 00004000
I (77) boot: 1 otadata OTA data 01 00 0000d000 00002000
I (84) boot: 2 phy_init RF data 01 01 0000f000 00001000
I (92) boot: 3 factory factory app 00 00 00010000 00100000
I (99) boot: 4 ota_0 OTA app 00 10 00110000 00100000
I (106) boot: 5 ota_1 OTA app 00 11 00210000 00100000
I (114) boot: End of partition table
I (118) boot: Defaulting to factory image
I (123) boot_comm: chip revision: 3, min. application chip revision: 0
I (130) esp_image: segment 0: paddr=00010020 vaddr=3f400020 size=288ach (166060) map
I (199) esp_image: segment 1: paddr=000388d4 vaddr=3ffbdb60 size=05864h ( 22628) load
I (208) esp_image: segment 2: paddr=0003e140 vaddr=40080000 size=01ed8h ( 7896) load
I (211) esp_image: segment 3: paddr=00040020 vaddr=400d0020 size=9d014h (643092) map
I (447) esp_image: segment 4: paddr=000dd03c vaddr=40081ed8 size=1c044h (114756) load
I (495) esp_image: segment 5: paddr=000f9088 vaddr=50000000 size=00010h ( 16) load
I (510) boot: Loaded app from partition at offset 0x10000
I (510) boot: Disabling RNG early entropy source...
I (522) cpu_start: Pro cpu up.
I (522) cpu_start: Starting app cpu, entry point is 0x400813dc
I (0) cpu_start: App cpu up.
I (538) cpu_start: Pro cpu start user code
I (538) cpu_start: cpu freq: 240000000 Hz
I (539) cpu_start: Application information:
I (543) cpu_start: Project name: network_adapter
I (549) cpu_start: App version: e0bb23b
I (554) cpu_start: Compile time: Oct 21 2022 09:34:49
I (560) cpu_start: ELF file SHA256: 985ab6d0449645a0...
I (566) cpu_start: ESP-IDF: v5.0-beta1-742-g7bd5af7f1e
I (573) heap_init: Initializing. RAM available for dynamic allocation:
I (580) heap_init: At 3FFAFF10 len 000000F0 (0 KiB): DRAM
I (586) heap_init: At 3FFB6388 len 00001C78 (7 KiB): DRAM
I (592) heap_init: At 3FFB9A20 len 00004108 (16 KiB): DRAM
I (598) heap_init: At 3FFCCA28 len 000135D8 (77 KiB): DRAM
I (604) heap_init: At 3FFE0440 len 00003AE0 (14 KiB): D/IRAM
I (611) heap_init: At 3FFE4350 len 0001BCB0 (111 KiB): D/IRAM
I (617) heap_init: At 4009DF1C len 000020E4 (8 KiB): IRAM
I (624) spi_flash: detected chip: gd
I (627) spi_flash: flash io: dio
W (631) spi_flash: Detected size(8192k) larger than the size in the binary image header(4096k). Using the size in the binary image header.
I (646) cpu_start: Starting scheduler on PRO CPU.
I (0) cpu_start: Starting scheduler on APP CPU.
I (659) NETWORK_ADAPTER: *********************************************************************
I (665) NETWORK_ADAPTER: ESP-Hosted-FG Firmware version :: 0.0.5
I (673) NETWORK_ADAPTER: Transport used :: SDIO + UART
I (681) NETWORK_ADAPTER: *********************************************************************
I (689) NETWORK_ADAPTER: Supported features are:
I (693) NETWORK_ADAPTER: - WLAN over SDIO
I (697) ESP_BT: - BT/BLE
I (699) ESP_BT: - HCI Over UART
I (701) ESP_BT: - BT/BLE dual mode
I (705) NETWORK_ADAPTER: capabilities: 0x1b
I (717) BTDM_INIT: BT controller compile version [8020d24]
I (719) system_api: Base MAC address is not set
I (721) system_api: read default base MAC address from EFUSE
I (727) phy_init: phy_version 4670,719f9f6,Feb 18 2021,17:07:07
I (1061) NETWORK_ADAPTER: ESP Bluetooth MAC addr: b8:d6:1a:6c:69:6a
I (1061) SDIO_SLAVE: Using SDIO interface

@mantriyogesh
Copy link
Collaborator

esp bins file for host side

0.0.5 work with latest current master 81778f6

But as you need might want to change the timing, You will need to flash from source.
It is easy to flash using source (and much usable as well).

If you need binaries only, Let me know.
I will get you FG 0.0.5 based binaries with timing adjusted (as above mentioned in #212 (comment))

@mantriyogesh
Copy link
Collaborator

Regarding #212 (comment), Can you please localise by adding prints in esp_sdio.c, which call fails?
Is the esp_probe() even entered once after loading module?

@shihui2014
Copy link
Author

for the err esp_sdio: probe of mmc1:0001:1 failed with error -16
Refer to this address #198 (comment) ihave add log
kernel log is :
[ 47.200294] mmc1: queuing unknown CIS tuple 0x01 (3 bytes)
[ 47.222244] mmc1: queuing unknown CIS tuple 0x1a (5 bytes)
[ 47.234302] mmc1: queuing unknown CIS tuple 0x1b (8 bytes)
[ 47.244269] esp_probe:741
[ 47.248749] esp_probe: ESP network device detected
[ 47.255570] init_sdio_func:659 sdio_enable_func:ret:0
[ 47.264732] init_sdio_func:666 sdio_claim_irq:ret:0
[ 47.271818]
[ 47.271818] Received INIT event from ESP32 peripheral
[ 47.271834] EVENT: 0
[ 47.284631] esp_probe:749 init_sdio_func ret:2130723472
[ 47.290082] ESP peripheral capabilities: 0x1b
[ 47.294453] Features supported are:
[ 47.301294] init_context:317
[ 47.304636] esp_probe:756 init_context ret:0
[ 47.311408] * WLAN
[ 47.313625] * BT/BLE
[ 47.315992] - HCI over UART
[ 47.357081] esp_probe:741
[ 47.359777] esp_sdio: probe of mmc1:0001:2 failed with error -22
[ 47.381836] - BT/BLE dual mode
[ 47.385276] EVENT: 3
root@myd-y6ull14x14:~#
esp side log is

I (627) spi_flash: flash io: dio
W (631) spi_flash: Detected size(8192k) larger than the size in the binary image header(4096k). Using the size in the binary image header.
I (646) cpu_start: Starting scheduler on PRO CPU.
I (0) cpu_start: Starting scheduler on APP CPU.
I (659) NETWORK_ADAPTER: *********************************************************************
I (665) NETWORK_ADAPTER: ESP-Hosted-FG Firmware version :: 0.0.5
I (673) NETWORK_ADAPTER: Transport used :: SDIO + UART
I (681) NETWORK_ADAPTER: *********************************************************************
I (689) NETWORK_ADAPTER: Supported features are:
I (693) NETWORK_ADAPTER: - WLAN over SDIO
I (697) ESP_BT: - BT/BLE
I (699) ESP_BT: - HCI Over UART
I (701) ESP_BT: - BT/BLE dual mode
I (705) NETWORK_ADAPTER: capabilities: 0x1b
I (717) BTDM_INIT: BT controller compile version [8020d24]
I (719) system_api: Base MAC address is not set
I (721) system_api: read default base MAC address from EFUSE
I (727) phy_init: phy_version 4670,719f9f6,Feb 18 2021,17:07:07
I (1053) NETWORK_ADAPTER: ESP Bluetooth MAC addr: b8:d6:1a:6c:69:6a
I (1053) SDIO_SLAVE: Using SDIO interface
I (3688187) wifi:wifi driver task: 3ffdb308, prio:23, stack:6656, core=1
I (3688187) wifi:wifi firmware version: 03528e0
I (3688189) wifi:wifi certification version: v7.0
I (3688189) wifi:config NVS flash: disabled
I (3688193) wifi:config nano formating: disabled
I (3688197) wifi:Init data frame dynamic rx buffer num: 32
I (3688201) wifi:Init management frame dynamic rx buffer num: 32
I (3688205) wifi:Init management short buffer num: 32
I (3688209) wifi:Init dynamic tx buffer num: 64
I (3688213) wifi:Init static rx buffer size: 1600
I (3688217) wifi:Init static rx buffer num: 16
I (3688219) wifi:Init dynamic rx buffer num: 32
I (3688223) wifi_init: rx ba win: 6
I (3688225) wifi_init: tcpip mbox: 32
I (3688229) wifi_init: udp mbox: 6
I (3688233) wifi_init: tcp mbox: 6
I (3688235) wifi_init: tcp tx win: 5744
I (3688239) wifi_init: tcp rx win: 5744
I (3688243) wifi_init: tcp mss: 1440I (3688247) NETWORK_ADAPTER: Start Data Path
m
I (3688251) wifi_init: WiFi IRAM OP enabled
I (3688255) wifi_init: WiFi RX IRAM OP enabled
I (3688261) wifi:mode : null
I (3688261) NETWORK_ADAPTER: Initial set up done
I (3689265) slave_ctrl: event ESPInit

@mantriyogesh
Copy link
Collaborator

great! everything looks great. proceed ahead with c demo app.

@shihui2014
Copy link
Author

But it doesn't seem to be running
printk(KERN_INFO "%s: ESP network device detected\n", func);

context = init_sdio_func(func);
printk(KERN_INFO "%s:%u init_sdio_func ret:%d\n",__func__,__LINE__,context);
if (!context) {
	return -ENOMEM;
}

@mantriyogesh
Copy link
Collaborator

[ 47.304636] esp_probe:756 init_context ret:0
[ 47.311408] * WLAN
[ 47.313625] * BT/BLE
[ 47.315992] - HCI over UART
[ 47.357081] esp_probe:741
[ 47.359777] esp_sdio: probe of mmc1:0001:2 failed with error -22
[ 47.381836] - BT/BLE dual mode
[ 47.385276] EVENT: 3

shows your sdio is fine.
It has received the init event as well.

Have you ported the rpi_init.sh to your platform as per stated in porting)guide?

@shihui2014
Copy link
Author

esp_hosted_fg\host\linux\host_control\c_support
Makefile
SRC += $(DIR_COMMON)/protobuf-c/protobuf-c/protobuf-c.c
the file protobuf-c.c dos not exist,so i can't compile c_support

@mantriyogesh
Copy link
Collaborator

@shihui2014
Copy link
Author

I don't understand what you mean?
I'm not using Raspberry-PI, so I can't use./rpi_init.sh directly on my board
I need to compile c_support first, then download it to the board and run c_support,
protobuf-c.c was missing when I compiled c_support

@mantriyogesh
Copy link
Collaborator

I know that you are not using Raspberry Pi.
But to build the code, you will still need full esp-hosted repo.
That includes submodules.

Where you have ESP-Hosted cloned, please update submodules as shown command in picture.
You should be able to find protobuf-c.c file after updating submodule.

rpi_init,sh is of course Raspberry Pi specific. But when you still need to port it as per your platform.
Basically, remove the things that are raspberry Pi specific but keep generic linux.
As I see you are interested in UART, still I suggest you to first get SDIO only working.

For UART, you may need to port rpi_init.sh to make you SoC UART GPIOs in correct alternate function.
Please check https://github.com/espressif/esp-hosted/blob/master/esp_hosted_fg/docs/Linux_based_host/porting_guide.md#122-rpi_initsh

@shihui2014
Copy link
Author

root@myd-y6ull14x14:~# ./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-y6ull14x14:~# ./test.out get_wifi_mode
Enable heartbeat with duration 20
Heartbeat operation successful
wifi mode is : none

Requested operation complete
Sleeping for some time just to showcase heartbeat
2021-12-07 11:33:25 > App EVENT: Heartbeat event [1]

^C
Clean-up and exit
Disable Heartbeat
Heartbeat operation successful
root@myd-y6ull14x14:~# ./test.out get_ap_scan_list
Enable heartbeat with duration 20
Heartbeat operation successful
Number of available APs is 1
0) ssid "zhoudaye" bssid "f0:b4:29:6e:bc:f6" rssi "-91" channel "2" auth mode "4"

Requested operation complete
Sleeping for some time just to showcase heartbeat
2021-12-07 11:34:24 > App EVENT: Heartbeat event [1]
2021-12-07 11:34:49 > App EVENT: Heartbeat event [1]
Disable Heartbeat

@mantriyogesh
Copy link
Collaborator

Great. You can now integrate the APIs into your application and control the ESP-Hosted right through your application.

Please do check ctrl_apis.md and serial_apis.md for all APIs from
https://github.com/espressif/esp-hosted/tree/master/esp_hosted_fg/docs/common

@shihui2014
Copy link
Author

hi,@mantriyogesh I scanned the wifi ssid using c_support!Thank you very much!

@shihui2014
Copy link
Author

okey,
Is ap hotspot supported?

@mantriyogesh
Copy link
Collaborator

Yes it is. You can check all supported APIs in ctrl_api.md.

If the things are as per your expectation, please help to close the issue.
Should you face anymore problems please re-open the same issue.

@shihui2014
Copy link
Author

Does wpa_supplicant or iw be supported?

@mantriyogesh
Copy link
Collaborator

You can use ESP-Hosted-NG flavour for that.

@shihui2014
Copy link
Author

okey,thanks a lot!

@shihui2014
Copy link
Author

Can you tell me how to connect wifi using c demo?the cmd is?c_demo.md It's not clear!

@shihui2014
Copy link
Author

I already know!

@shihui2014
Copy link
Author

shihui2014 commented Mar 17, 2023

How can a client obtain an ip address in AP mode?
I used the command./test.out softap_start, but the client couldn't get the ip from wifi.

@shihui2014
Copy link
Author

I used the command./test.out softap_start, but the client couldn't get the ip from wifi

@shihui2014 shihui2014 reopened this Mar 17, 2023
@mantriyogesh
Copy link
Collaborator

Dhcp software remains out of scope as every linux may have diff software. Anyway example of dnsmasq is provided as example

Please check docs.

@shihui2014
Copy link
Author

okey,
like this , $ sudo dnsmasq --no-daemon --no-resolv --no-poll
--dhcp-script=/system/bin/dhcp_announce
--dhcp-range=192.168.4.1,192.168.4.20,1h

$ sudo ifconfig ethap0 192.168.4.5 

i find by dnsmasq

@shihui2014
Copy link
Author

hello @mantriyogesh
We are ready for mass production,
But found a problem, can not enter the esp download mode,
Does it have anything to do with the external pull-up resistance?

@mantriyogesh
Copy link
Collaborator

Download mode selection depends on GPIO0 pin, EN pin. Please check some details and known ways to handle this behaviour.
https://docs.espressif.com/projects/esptool/en/latest/esp32/advanced-topics/boot-mode-selection.html

Also please have a look at 'strapping pins' in esp32 datasheet.

@mantriyogesh
Copy link
Collaborator

Hello @shihui2014 is the problem solved?

Strapping pins if need to be used, need to pull them up. Check specific Technical Reference manual for more info of pin.
Also make sure that you use pin correctly, for using boot mode and download mode.

These limitations will not happen if strapping pins are avoided.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants