Closed rimb05 closed 7 months ago
Some more info on the crash I get. This is using Linux 5.2 on a v3s board (Licheepi Zero). I'm using SDIO mode. The firmware on the ESP is 0.0.5, and I built the esp32_sdio.ko module using the source included in the firmware zip. I have 10K pullups on all the pins except reset and CMD
Here's what I run:
modprobe bluetooth insmod esp32_sdio.ko resetpin=197
The crash happens in esp_init_net_dev when it tries to call: ether_addr_copy(ndev->dev_addr, priv->mac_address);
I would really appreciate any insights
dmesg output:
[ 28.497905] esp32_sdio: loading out-of-tree module taints kernel.
[ 28.505584] esp_reset, ESP32: Resetpin of Host is 65
[ 28.505666] sun8i-v3s-pinctrl 1c20800.pinctrl: 1c20800.pinctrl supply vcc-pc not found, using dummy regulator
[ 28.516085] esp_reset, ESP32: Triggering ESP reset.
[ 28.517905] esp_sdio: probe of mmc1:0001:1 failed with error -110
[ 29.442267] mmc1: card 0001 removed
[ 30.610752] mmc1: queuing unknown CIS tuple 0x01 (3 bytes)
[ 30.623985] mmc1: queuing unknown CIS tuple 0x1a (5 bytes)
[ 30.632924] mmc1: queuing unknown CIS tuple 0x1b (8 bytes)
[ 30.639785] mmc1: queuing unknown CIS tuple 0x80 (1 bytes)
[ 30.646068] mmc1: queuing unknown CIS tuple 0x81 (1 bytes)
[ 30.651766] mmc1: queuing unknown CIS tuple 0x82 (1 bytes)
[ 30.658141] mmc1: queuing unknown CIS tuple 0x80 (1 bytes)
[ 30.664454] mmc1: queuing unknown CIS tuple 0x81 (1 bytes)
[ 30.670041] mmc1: queuing unknown CIS tuple 0x82 (1 bytes)
[ 30.676337] mmc1: new SDIO card at address 0001
[ 30.681381] esp_probe: ESP network device detected
[ 30.690887] Unable to handle kernel NULL pointer dereference at virtual address 00000001
[ 30.699082] pgd = (ptrval)
[ 30.701822] [00000001] *pgd=00000000
[ 30.705409] Internal error: Oops: 805 [#1] SMP ARM
[ 30.710200] Modules linked in: esp32_sdio(O)
[ 30.714481] CPU: 0 PID: 5 Comm: kworker/0:0 Tainted: G O 5.2.0 #2
[ 30.721873] Hardware name: Allwinner sun8i Family
[ 30.726592] Workqueue: events_freezable mmc_rescan
[ 30.731404] PC is at esp_add_interface.constprop.0+0x110/0x180 [esp32_sdio]
[ 30.738369] LR is at esp_add_interface.constprop.0+0xfc/0x180 [esp32_sdio]
[ 30.745240] pc : [
ESP32 log:
rst:0x1 (POWERON_RESET),boot:0x3f (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:25:50
I (27) 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=28444h (164932) map
I (198) esp_image: segment 1: paddr=0003846c vaddr=3ffbdb60 size=05874h ( 22644) load
I (207) esp_image: segment 2: paddr=0003dce8 vaddr=40080000 size=02330h ( 9008) load
I (211) esp_image: segment 3: paddr=00040020 vaddr=400d0020 size=9c740h (640832) map
I (446) esp_image: segment 4: paddr=000dc768 vaddr=40082330 size=1bbech (113644) load
I (493) esp_image: segment 5: paddr=000f835c vaddr=50000000 size=00010h ( 16) load
I (509) boot: Loaded app from partition at offset 0x10000
I (509) boot: Disabling RNG early entropy source...
I (520) cpu_start: Pro cpu up.
I (521) cpu_start: Starting app cpu, entry point is 0x400813dc
I (0) cpu_start: App cpu up.
I (537) cpu_start: Pro cpu start user code
I (537) cpu_start: cpu freq: 240000000 Hz
I (537) cpu_start: Application information:
I (542) cpu_start: Project name: network_adapter
I (547) cpu_start: App version: e0bb23b
I (552) cpu_start: Compile time: Oct 21 2022 09:25:38
I (558) cpu_start: ELF file SHA256: e190dae174510bac...
I (564) cpu_start: ESP-IDF: v5.0-beta1-742-g7bd5af7f1e
I (571) heap_init: Initializing. RAM available for dynamic allocation:
I (578) heap_init: At 3FFAFF10 len 000000F0 (0 KiB): DRAM
I (584) heap_init: At 3FFB6388 len 00001C78 (7 KiB): DRAM
I (590) heap_init: At 3FFB9A20 len 00004108 (16 KiB): DRAM
I (596) heap_init: At 3FFCCA38 len 000135C8 (77 KiB): DRAM
I (603) heap_init: At 3FFE0440 len 00003AE0 (14 KiB): D/IRAM
I (609) heap_init: At 3FFE4350 len 0001BCB0 (111 KiB): D/IRAM
I (615) heap_init: At 4009DF1C len 000020E4 (8 KiB): IRAM
I (623) spi_flash: detected chip: generic
I (626) spi_flash: flash io: dio
W (630) spi_flash: Detected size(16384k) larger than the size in the binary image header(4096k). Using the size in the binary image header.
I (644) cpu_start: Starting scheduler on PRO CPU.
I (0) cpu_start: Starting scheduler on APP CPU.
I (658) NETWORK_ADAPTER:
I (664) NETWORK_ADAPTER: ESP-Hosted-FG Firmware version :: 0.0.5
I (672) NETWORK_ADAPTER: Transport used :: SDIO only
I (680) NETWORK_ADAPTER:
I (688) NETWORK_ADAPTER: Supported features are:
I (692) NETWORK_ADAPTER: - WLAN over SDIO
I (696) ESP_BT: - BT/BLE
I (698) ESP_BT: - HCI Over SDIO
I (700) ESP_BT: - BT/BLE dual mode
I (704) NETWORK_ADAPTER: capabilities: 0x1d
I (716) BTDM_INIT: BT controller compile version [8020d24]
I (718) system_api: Base MAC address is not set
I (718) system_api: read default base MAC address from EFUSE
I (724) phy_init: phy_version 4670,719f9f6,Feb 18 2021,17:07:07
I (1050) NETWORK_ADAPTER: ESP Bluetooth MAC addr: 34:94:54:39:c6:6a
I (1052) SDIO_SLAVE: Using SDIO interface
I am digesting your complete story, by the time check below:
I have 10K pullups on all the pins except reset and CMD
Did you mean resetpin & CLK? Please check, https://docs.espressif.com/projects/esp-idf/en/latest/esp32/api-reference/peripherals/sd_pullup_requirements.html#sd-pull-up-requirements
the CMD and DATA (DAT0 - DAT3) lines of the SD bus must be pulled up by 10 kOhm resistors.
SD cards and SDIO devices should also have pull-ups
on all above-mentioned lines (regardless of whether these lines are connected to the host)
in order to prevent them from entering a wrong state.
Yes, sorry, I meant except CLK. I have pullups on CMD, DAT0, DAT1, DAT2, DAT3. I don't have a pullup on the reset pin (although it is resetting fine)
Apologies for the delayed response.
Basically, define a different function, say ether_addr_copy_temp() using above definition and call it instead. Interested to understand if unaligned access. (most likely not the case)
I will try this right now, thanks.
OK, I created a new function:
static inline void ether_addr_copy_2(u8 dst, const u8 src) { u16 a = (u16 )dst; const u16 b = (const u16 )src;
a[0] = b[0];
a[1] = b[1];
a[2] = b[2];
}
Same crash happens when calling this (I put printk statements before and after, and only the one before prints).
I also tested both ndev_dev_addr and priv->mac_address. Neither of them are NULL.
I then tried this: printk(KERN_ERR "%d\n", priv->mac_address[0]); printk(KERN_ERR "%d\n", priv->mac_address[1]); printk(KERN_ERR "%d\n", priv->mac_address[2]); printk(KERN_ERR "%d\n", priv->mac_address[3]); printk(KERN_ERR "%d\n", priv->mac_address[4]); printk(KERN_ERR "%d\n", priv->mac_address[5]);
printk(KERN_ERR "%d\n", ndev->dev_addr[0]);
printk(KERN_ERR "%d\n", ndev->dev_addr[1]);
printk(KERN_ERR "%d\n", ndev->dev_addr[2]);
printk(KERN_ERR "%d\n", ndev->dev_addr[3]);
printk(KERN_ERR "%d\n", ndev->dev_addr[4]);
printk(KERN_ERR "%d\n", ndev->dev_addr[5]);
Here's what I get: 0 0 0 0 0 0
Then it crashes. So it can't access ndev->dev_addr[0]
We will check and get back to you.
Hi Yogesh,
I put that kernel on hold and tried working with an older one. I have gotten much further progress using 4.10.15. This is a kernel that was patched specifically for this chip, so I thought I might have better luck here.
I was able to get both SDIO and SPI to work, however I am having trouble with the control mechanism. I built the c_support code (test.out), and created the character device using:
mknod /dev/esps0 c 221 0 chmod 666 /dev/esps0
I checked, and on my system 221 is not used by any other drivers.
When I try to use test.out, for example with: "test.out scan" it times out. However I can see that the ESP module received the command because on its log I see all the access points being discovered. So it's receiving commands, but the communications seem to only be in one direction.
I am using the same source as the firmware version (from the same release). I tried 0.0.5, and I also tried 0.4, and I get the same result.
Any ideas?
Although it looks like timing issue, Can you please send both side logs to understand exactly?
Sure, here are the log from both sides. The strange thing is the same problem occurs with both SDIO or SPI. So it doesn't seem like it's a hardware problem. The communication seems to only be one direction (host -> ESP).
The following logs are after I ran these commands:
modprobe bluetooth insmod esp32_spi.ko resetpin=197 mknod /dev/esps0 c 221 0 chmod 666 /dev/esps0 ./test.out scan
rst:0x1 (POWERON_RESET),boot:0x13 (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:0x3fff0018,len:4
load:0x3fff001c,len:12
load:0x3fff0028,len:7432
load:0x40078000,len:15100
ho 0 tail 12 room 4
load:0x40080400,len:3904
entry 0x400806b8
I (80) boot: Chip Revision: 3
I (81) boot_comm: chip revision: 3, min. bootloader chip revision: 0
I (44) boot: ESP-IDF v4.0.3-215-gbe7df8bce9-dirty 2nd stage bootloader
I (44) boot: compile time 17:19:23
I (45) boot: Enabling RNG early entropy source...
I (50) boot: SPI Speed : 40MHz
I (54) boot: SPI Mode : DIO
I (58) boot: SPI Flash Size : 4MB
I (63) boot: Partition Table:
I (66) boot: ## Label Usage Type ST Offset Length
I (73) boot: 0 nvs WiFi data 01 02 00009000 00004000
I (81) boot: 1 otadata OTA data 01 00 0000d000 00002000
I (88) boot: 2 phy_init RF data 01 01 0000f000 00001000
I (96) boot: 3 factory factory app 00 00 00010000 00100000
I (103) boot: 4 ota_0 OTA app 00 10 00110000 00100000
I (111) boot: 5 ota_1 OTA app 00 11 00210000 00100000
I (118) boot: End of partition table
I (123) boot: Defaulting to factory image
I (127) boot_comm: chip revision: 3, min. application chip revision: 0
I (135) esp_image: segment 0: paddr=0x00010020 vaddr=0x3f400020 size=0x202a8 (131752) map
I (191) esp_image: segment 1: paddr=0x000302d0 vaddr=0x3ffbdb60 size=0x03d40 ( 15680) load
I (197) esp_image: segment 2: paddr=0x00034018 vaddr=0x40080000 size=0x00400 ( 1024) load
I (198) esp_image: segment 3: paddr=0x00034420 vaddr=0x40080400 size=0x0bbf0 ( 48112) load
I (227) esp_image: segment 4: paddr=0x00040018 vaddr=0x400d0018 size=0x8eab8 (584376) map
I (436) esp_image: segment 5: paddr=0x000cead8 vaddr=0x4008bff0 size=0x123b0 ( 74672) load
I (486) boot: Loaded app from partition at offset 0x10000
I (486) boot: Disabling RNG early entropy source...
I (486) cpu_start: Pro cpu up.
I (490) cpu_start: Application information:
I (495) cpu_start: Project name: network_adapter
I (500) cpu_start: App version: release0.4-60-g22180f7
I (506) cpu_start: Compile time: Jan 24 2022 17:19:16
I (513) cpu_start: ELF file SHA256: 0f66794e8494e214...
I (519) cpu_start: ESP-IDF: v4.0.3-215-gbe7df8bce9-dirty
I (525) cpu_start: Starting app cpu, entry point is 0x400812fc
I (0) cpu_start: App cpu up.
I (536) heap_init: Initializing. RAM available for dynamic allocation:
I (543) heap_init: At 3FFAFF10 len 000000F0 (0 KiB): DRAM
I (549) heap_init: At 3FFB6388 len 00001C78 (7 KiB): DRAM
I (555) heap_init: At 3FFB9A20 len 00004108 (16 KiB): DRAM
I (561) heap_init: At 3FFBDB5C len 00000004 (0 KiB): DRAM
I (567) heap_init: At 3FFC80E0 len 00017F20 (95 KiB): DRAM
I (573) heap_init: At 3FFE0440 len 00003AE0 (14 KiB): D/IRAM
I (579) heap_init: At 3FFE4350 len 0001BCB0 (111 KiB): D/IRAM
I (586) heap_init: At 4009E3A0 len 00001C60 (7 KiB): IRAM
I (592) cpu_start: Pro cpu start user code
I (610) spi_flash: detected chip: generic
I (611) spi_flash: flash io: dio
W (611) spi_flash: Detected size(16384k) larger than the size in the binary image header(4096k). Using the size in the binary image h.
I (622) cpu_start: Starting scheduler on PRO CPU.
I (0) cpu_start: Starting scheduler on APP CPU.
I (636) NETWORK_ADAPTER:
I (642) NETWORK_ADAPTER: ESP-Hosted Firmware version :: 0.4
I (650) NETWORK_ADAPTER: Transport used :: SPI
I (658) NETWORK_ADAPTER:
I (664) NETWORK_ADAPTER: Supported features are:
I (668) NETWORK_ADAPTER: - WLAN over SPI
I (672) ESP_BT: - BT/BLE
I (676) ESP_BT: - HCI Over SPI
I (678) ESP_BT: - BT/BLE dual mode
I (688) BTDM_INIT: BT controller compile version [14ea243]
I (690) system_api: Base MAC address is not set, read default base MAC address from BLK0 of EFUSE
I (696) phy_init: phy_version 4660,0162888,Dec 23 2020
I (1024) system_api: Base MAC address is not set, read default base MAC address from BLK0 of EFUSE
I (1026) NETWORK_ADAPTER: ESP Bluetooth MAC addr: 34-94-54-39-17-9e
I (1030) SPI_DRIVER: Using SPI interface I (1034) gpio: GPIO[2]| InputEn: 0| OutputEn: 1| OpenDrain: 0| Pullup: 0| Pulldown: 0| Intr:0 I (1040) gpio: GPIO[4]| InputEn: 0| OutputEn: 1| OpenDrain: 0| Pullup: 0| Pulldown: 0| Intr:0 I (2052) wifi:wifi driver task: 3ffd69e0, prio:23, stack:6656, core=1 I (2052) system_api: Base MAC address is not set, read default base MAC address from BLK0 of EFUSE I (2056) system_api: Base MAC address is not set, read default base MAC address from BLK0 of EFUSE I (2064) wifi:wifi firmware version: e58bf82 I (2066) wifi:config NVS flash: disabled I (2068) wifi:config nano formating: disabled I (2072) wifi:Init data frame dynamic rx buffer num: 32 I (2076) wifi:Init management frame dynamic rx buffer num: 32 I (2080) wifi:Init management short buffer num: 32 I (2084) wifi:Init dynamic tx buffer num: 64 I (2088) wifi:Init static rx buffer size: 1600 I (2090) wifi:Init static rx buffer num: 16 I (2094) wifi:Init dynamic rx buffer num: 32 I (2098) phy_init: phy_version 4660,0162888,Dec 23 2020 I (2110) wifi:mode : null I (2110) NETWORK_ADAPTER: Initial set up done I (13204) wifi:mode : sta (34:94:54:39:17:9c) I (13206) slave_commands: Station mode set in scan handler I (14506) slave_commands: Total APs scanned = 19 I (14506) slave_commands: Details of AP no 0 I (14506) slave_commands: SSID 6771491bb43aeb74b481efdd401ab9ae I (14510) slave_commands: RSSI -51 I (14514) slave_commands: Channel 6 I (14518) slave_commands: BSSID 28:80:88:fe:94:e4 I (14522) slave_commands: Auth mode 3
I (14526) slave_commands: Details of AP no 1 I (14530) slave_commands: SSID test I (14534) slave_commands: RSSI -56 I (14538) slave_commands: Channel 11 I (14542) slave_commands: BSSID f0:72:ea:50:96:e3 I (14546) slave_commands: Auth mode 3
I (14550) slave_commands: Details of AP no 2 I (14554) slave_commands: SSID test2 I (14558) slave_commands: RSSI -56 I (14562) slave_commands: Channel 11 I (14566) slave_commands: BSSID f2:79:ea:70:96:e8 I (14570) slave_commands: Auth mode 3
I (14574) slave_commands: Details of AP no 3 I (14578) slave_commands: SSID DIRECT-76-HP M255 LaserJet I (14584) slave_commands: RSSI -60 I (14588) slave_commands: Channel 11 I (14590) slave_commands: BSSID 52:c2:e8:bf:79:79 I (14596) slave_commands: Auth mode 3
[ 0.000000] Booting Linux on physical CPU 0x0 [ 0.000000] Linux version 4.10.15-licheepi-zero+ (root@parallels-Parallels-Virtual-Platform) (gcc version 10.4.0 (Buildroot 2022.02.6) ) #3 Wed No v 30 10:03:05 CST 2022 [ 0.000000] CPU: ARMv7 Processor [410fc075] revision 5 (ARMv7), cr=10c53c7d [ 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: Blueberry PI [ 0.000000] Memory policy: Data cache writeback [ 0.000000] On node 0 totalpages: 16384 [ 0.000000] free_area_init_node: node 0, pgdat c093161c, node_mem_map c3f4c000 [ 0.000000] Normal zone: 128 pages used for memmap [ 0.000000] Normal zone: 0 pages reserved [ 0.000000] Normal zone: 16384 pages, LIFO batch:3 [ 0.000000] psci: probing for conduit method from DT. [ 0.000000] psci: Using PSCI v0.1 Function IDs from DT [ 0.000000] CPU: All CPU(s) started in HYP mode. [ 0.000000] CPU: Virtualization extensions available. [ 0.000000] pcpu-alloc: s0 r0 d32768 u32768 alloc=1*32768 [ 0.000000] pcpu-alloc: [0] 0 [ 0.000000] Built 1 zonelists in Zone order, mobility grouping on. Total pages: 16256 [ 0.000000] Kernel command line: console=ttyS0,115200 panic=5 console=tty0 rootwait root=/dev/mmcblk0p2 earlyprintk rw [ 0.000000] PID hash table entries: 256 (order: -2, 1024 bytes) [ 0.000000] Dentry cache hash table entries: 8192 (order: 3, 32768 bytes) [ 0.000000] Inode-cache hash table entries: 4096 (order: 2, 16384 bytes) [ 0.000000] Memory: 56204K/65536K available (5120K kernel code, 199K rwdata, 1116K rodata, 1024K init, 235K bss, 9332K reserved, 0K cma-reserved, 0K highmem) [ 0.000000] Virtual kernel memory layout: [ 0.000000] vector : 0xffff0000 - 0xffff1000 ( 4 kB) [ 0.000000] fixmap : 0xffc00000 - 0xfff00000 (3072 kB) [ 0.000000] vmalloc : 0xc4800000 - 0xff800000 ( 944 MB) [ 0.000000] lowmem : 0xc0000000 - 0xc4000000 ( 64 MB) [ 0.000000] pkmap : 0xbfe00000 - 0xc0000000 ( 2 MB) [ 0.000000] modules : 0xbf000000 - 0xbfe00000 ( 14 MB) [ 0.000000] .text : 0xc0008000 - 0xc0600000 (6112 kB) [ 0.000000] .init : 0xc0800000 - 0xc0900000 (1024 kB) [ 0.000000] .data : 0xc0900000 - 0xc0931ea0 ( 200 kB) [ 0.000000] .bss : 0xc0933000 - 0xc096dfb8 ( 236 kB) [ 0.000000] SLUB: HWalign=64, Order=0-3, MinObjects=0, CPUs=1, Nodes=1 [ 0.000000] NR_IRQS:16 nr_irqs:16 16 [ 0.000000] arm_arch_timer: Architected cp15 timer(s) running at 24.00MHz (phys). [ 0.000000] clocksource: arch_sys_counter: mask: 0xffffffffffffff max_cycles: 0x588fe9dc0, max_idle_ns: 440795202592 ns [ 0.000006] sched_clock: 56 bits at 24MHz, resolution 41ns, wraps every 4398046511097ns [ 0.000015] Switching to timer-based delay loop, resolution 41ns [ 0.000144] clocksource: timer: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 79635851949 ns [ 0.000331] Console: colour dummy device 80x30 [ 0.000691] console [tty0] enabled [ 0.000727] Calibrating delay loop (skipped), value calculated using timer frequency.. 48.00 BogoMIPS (lpj=240000) [ 0.000761] pid_max: default: 32768 minimum: 301 [ 0.000871] Mount-cache hash table entries: 1024 (order: 0, 4096 bytes) [ 0.000894] Mountpoint-cache hash table entries: 1024 (order: 0, 4096 bytes) [ 0.001484] CPU: Testing write buffer coherency: ok [ 0.002010] Setting up static identity map for 0x40100000 - 0x40100058 [ 0.002913] devtmpfs: initialized [ 0.005646] VFP support v0.3: implementor 41 architecture 2 part 30 variant 7 rev 5 [ 0.005930] clocksource: jiffies: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 19112604462750000 ns [ 0.005976] futex hash table entries: 256 (order: -1, 3072 bytes) [ 0.006079] pinctrl core: initialized pinctrl subsystem [ 0.007038] NET: Registered protocol family 16 [ 0.007432] DMA: preallocated 256 KiB pool for atomic coherent allocations [ 0.008332] hw-breakpoint: found 5 (+1 reserved) breakpoint and 4 watchpoint registers. [ 0.008376] hw-breakpoint: maximum watchpoint size is 8 bytes. [ 0.016207] of_get_named_gpiod_flags: can't parse 'gpio' property of node '/vcc3v0[0]' [ 0.016496] of_get_named_gpiod_flags: can't parse 'gpio' property of node '/vcc3v3[0]' [ 0.016719] of_get_named_gpiod_flags: can't parse 'gpio' property of node '/vcc5v0[0]' [ 0.017326] SCSI subsystem initialized [ 0.017589] usbcore: registered new interface driver usbfs [ 0.017685] usbcore: registered new interface driver hub [ 0.017778] usbcore: registered new device driver usb [ 0.017897] pps_core: LinuxPPS API ver. 1 registered [ 0.017918] pps_core: Software ver. 5.3.6 - Copyright 2005-2007 Rodolfo Giometti giometti@linux.it [ 0.017962] PTP clock support registered [ 0.017991] EDAC MC: Ver: 3.0.0 [ 0.019914] clocksource: Switched to clocksource arch_sys_counter [ 0.027787] NET: Registered protocol family 2 [ 0.028350] TCP established hash table entries: 1024 (order: 0, 4096 bytes) [ 0.028397] TCP bind hash table entries: 1024 (order: 0, 4096 bytes) [ 0.028425] TCP: Hash tables configured (established 1024 bind 1024) [ 0.028518] UDP hash table entries: 256 (order: 0, 4096 bytes) [ 0.028549] UDP-Lite hash table entries: 256 (order: 0, 4096 bytes) [ 0.028699] NET: Registered protocol family 1 [ 0.030452] workingset: timestamp_bits=30 max_order=14 bucket_order=0 [ 0.037501] jffs2: version 2.2. © 2001-2006 Red Hat, Inc. [ 0.041331] Block layer SCSI generic (bsg) driver version 0.4 loaded (major 249) [ 0.041379] io scheduler noop registered [ 0.041394] io scheduler deadline registered [ 0.041596] io scheduler cfq registered (default) [ 0.041988] sun4i-usb-phy 1c19400.phy: could not find pctldev for node /soc/pinctrl@1c20800/usbid@0, deferring probe [ 0.042839] gpio gpiochip0: (1c20800.pinctrl): added GPIO chardev (254:0) [ 0.043213] gpiochip_setup_dev: registered GPIOs 0 to 223 on device: gpiochip0 (1c20800.pinctrl) [ 0.043229] gpio gpiochip0: (1c20800.pinctrl): created GPIO range 32->32 ==> 1c20800.pinctrl PIN 32->32 [ 0.043237] gpio gpiochip0: (1c20800.pinctrl): created GPIO range 33->33 ==> 1c20800.pinctrl PIN 33->33 [ 0.043244] gpio gpiochip0: (1c20800.pinctrl): created GPIO range 34->34 ==> 1c20800.pinctrl PIN 34->34 [ 0.043251] gpio gpiochip0: (1c20800.pinctrl): created GPIO range 35->35 ==> 1c20800.pinctrl PIN 35->35 [ 0.043258] gpio gpiochip0: (1c20800.pinctrl): created GPIO range 36->36 ==> 1c20800.pinctrl PIN 36->36 [ 0.043265] gpio gpiochip0: (1c20800.pinctrl): created GPIO range 37->37 ==> 1c20800.pinctrl PIN 37->37 [ 0.043272] gpio gpiochip0: (1c20800.pinctrl): created GPIO range 38->38 ==> 1c20800.pinctrl PIN 38->38 [ 0.043279] gpio gpiochip0: (1c20800.pinctrl): created GPIO range 39->39 ==> 1c20800.pinctrl PIN 39->39 [ 0.043286] gpio gpiochip0: (1c20800.pinctrl): created GPIO range 40->40 ==> 1c20800.pinctrl PIN 40->40 [ 0.043293] gpio gpiochip0: (1c20800.pinctrl): created GPIO range 41->41 ==> 1c20800.pinctrl PIN 41->41 [ 0.043300] gpio gpiochip0: (1c20800.pinctrl): created GPIO range 64->64 ==> 1c20800.pinctrl PIN 64->64 [ 0.043307] gpio gpiochip0: (1c20800.pinctrl): created GPIO range 65->65 ==> 1c20800.pinctrl PIN 65->65 [ 0.043314] gpio gpiochip0: (1c20800.pinctrl): created GPIO range 66->66 ==> 1c20800.pinctrl PIN 66->66 [ 0.043321] gpio gpiochip0: (1c20800.pinctrl): created GPIO range 67->67 ==> 1c20800.pinctrl PIN 67->67 [ 0.043328] gpio gpiochip0: (1c20800.pinctrl): created GPIO range 128->128 ==> 1c20800.pinctrl PIN 128->128 [ 0.043335] gpio gpiochip0: (1c20800.pinctrl): created GPIO range 129->129 ==> 1c20800.pinctrl PIN 129->129 [ 0.043342] gpio gpiochip0: (1c20800.pinctrl): created GPIO range 130->130 ==> 1c20800.pinctrl PIN 130->130 [ 0.043350] gpio gpiochip0: (1c20800.pinctrl): created GPIO range 131->131 ==> 1c20800.pinctrl PIN 131->131 [ 0.043357] gpio gpiochip0: (1c20800.pinctrl): created GPIO range 132->132 ==> 1c20800.pinctrl PIN 132->132 [ 0.043363] gpio gpiochip0: (1c20800.pinctrl): created GPIO range 133->133 ==> 1c20800.pinctrl PIN 133->133 [ 0.043370] gpio gpiochip0: (1c20800.pinctrl): created GPIO range 134->134 ==> 1c20800.pinctrl PIN 134->134 [ 0.043378] gpio gpiochip0: (1c20800.pinctrl): created GPIO range 135->135 ==> 1c20800.pinctrl PIN 135->135 [ 0.043385] gpio gpiochip0: (1c20800.pinctrl): created GPIO range 136->136 ==> 1c20800.pinctrl PIN 136->136 [ 0.043392] gpio gpiochip0: (1c20800.pinctrl): created GPIO range 137->137 ==> 1c20800.pinctrl PIN 137->137 [ 0.043398] gpio gpiochip0: (1c20800.pinctrl): created GPIO range 138->138 ==> 1c20800.pinctrl PIN 138->138 [ 0.043405] gpio gpiochip0: (1c20800.pinctrl): created GPIO range 139->139 ==> 1c20800.pinctrl PIN 139->139 [ 0.043412] gpio gpiochip0: (1c20800.pinctrl): created GPIO range 140->140 ==> 1c20800.pinctrl PIN 140->140 [ 0.043419] gpio gpiochip0: (1c20800.pinctrl): created GPIO range 141->141 ==> 1c20800.pinctrl PIN 141->141 [ 0.043426] gpio gpiochip0: (1c20800.pinctrl): created GPIO range 142->142 ==> 1c20800.pinctrl PIN 142->142 [ 0.043433] gpio gpiochip0: (1c20800.pinctrl): created GPIO range 143->143 ==> 1c20800.pinctrl PIN 143->143 [ 0.043441] gpio gpiochip0: (1c20800.pinctrl): created GPIO range 144->144 ==> 1c20800.pinctrl PIN 144->144 [ 0.043449] gpio gpiochip0: (1c20800.pinctrl): created GPIO range 145->145 ==> 1c20800.pinctrl PIN 145->145 [ 0.043471] gpio gpiochip0: (1c20800.pinctrl): created GPIO range 146->146 ==> 1c20800.pinctrl PIN 146->146 [ 0.043478] gpio gpiochip0: (1c20800.pinctrl): created GPIO range 147->147 ==> 1c20800.pinctrl PIN 147->147 [ 0.043485] gpio gpiochip0: (1c20800.pinctrl): created GPIO range 148->148 ==> 1c20800.pinctrl PIN 148->148 [ 0.043492] gpio gpiochip0: (1c20800.pinctrl): created GPIO range 149->149 ==> 1c20800.pinctrl PIN 149->149 [ 0.043499] gpio gpiochip0: (1c20800.pinctrl): created GPIO range 150->150 ==> 1c20800.pinctrl PIN 150->150 [ 0.043506] gpio gpiochip0: (1c20800.pinctrl): created GPIO range 151->151 ==> 1c20800.pinctrl PIN 151->151 [ 0.043513] gpio gpiochip0: (1c20800.pinctrl): created GPIO range 152->152 ==> 1c20800.pinctrl PIN 152->152 [ 0.043520] gpio gpiochip0: (1c20800.pinctrl): created GPIO range 160->160 ==> 1c20800.pinctrl PIN 160->160 [ 0.043527] gpio gpiochip0: (1c20800.pinctrl): created GPIO range 161->161 ==> 1c20800.pinctrl PIN 161->161 [ 0.043534] gpio gpiochip0: (1c20800.pinctrl): created GPIO range 162->162 ==> 1c20800.pinctrl PIN 162->162 [ 0.043540] gpio gpiochip0: (1c20800.pinctrl): created GPIO range 163->163 ==> 1c20800.pinctrl PIN 163->163 [ 0.043548] gpio gpiochip0: (1c20800.pinctrl): created GPIO range 164->164 ==> 1c20800.pinctrl PIN 164->164 [ 0.043555] gpio gpiochip0: (1c20800.pinctrl): created GPIO range 165->165 ==> 1c20800.pinctrl PIN 165->165 [ 0.043562] gpio gpiochip0: (1c20800.pinctrl): created GPIO range 166->166 ==> 1c20800.pinctrl PIN 166->166 [ 0.043568] gpio gpiochip0: (1c20800.pinctrl): created GPIO range 192->192 ==> 1c20800.pinctrl PIN 192->192 [ 0.043575] gpio gpiochip0: (1c20800.pinctrl): created GPIO range 193->193 ==> 1c20800.pinctrl PIN 193->193 [ 0.043582] gpio gpiochip0: (1c20800.pinctrl): created GPIO range 194->194 ==> 1c20800.pinctrl PIN 194->194 [ 0.043589] gpio gpiochip0: (1c20800.pinctrl): created GPIO range 195->195 ==> 1c20800.pinctrl PIN 195->195 [ 0.043596] gpio gpiochip0: (1c20800.pinctrl): created GPIO range 196->196 ==> 1c20800.pinctrl PIN 196->196 [ 0.043603] gpio gpiochip0: (1c20800.pinctrl): created GPIO range 197->197 ==> 1c20800.pinctrl PIN 197->197 [ 0.045538] sun8i-v3s-pinctrl 1c20800.pinctrl: initialized sunXi PIO driver [ 0.048762] Serial: 8250/16550 driver, 8 ports, IRQ sharing disabled [ 0.051266] console [ttyS0] disabled [ 0.071483] 1c28000.serial: ttyS0 at MMIO 0x1c28000 (irq = 34, base_baud = 1500000) is a U6_16550A [ 0.566056] console [ttyS0] enabled [ 0.571888] libphy: Fixed MDIO Bus: probed [ 0.576082] usbcore: registered new interface driver asix [ 0.581611] usbcore: registered new interface driver ax88179_178a [ 0.587766] usbcore: registered new interface driver cdc_ether [ 0.593667] usbcore: registered new interface driver net1080 [ 0.599364] usbcore: registered new interface driver cdc_subset [ 0.605338] usbcore: registered new interface driver zaurus [ 0.610988] usbcore: registered new interface driver cdc_ncm [ 0.616938] ehci_hcd: USB 2.0 'Enhanced' Host Controller (EHCI) Driver [ 0.623512] ehci-platform: EHCI generic platform driver [ 0.629037] ohci_hcd: USB 1.1 'Open' Host Controller (OHCI) Driver [ 0.635290] ohci-platform: OHCI generic platform driver [ 0.640802] usbcore: registered new interface driver uas [ 0.646188] usbcore: registered new interface driver usb-storage [ 0.652859] input: 1c22800.lradc as /devices/platform/soc/1c22800.lradc/input/input0 [ 0.660998] evbug: Connected device: input0 (1c22800.lradc at sun4i_lradc/input0) [ 0.661571] sun6i-rtc 1c20400.rtc: rtc core: registered rtc-sun6i as rtc0 [ 0.668385] sun6i-rtc 1c20400.rtc: RTC enabled [ 0.672975] i2c /dev entries driver [ 0.677016] sunxi-wdt 1c20ca0.watchdog: Watchdog enabled (timeout=16 sec, nowayout=0) [ 0.685195] softdog: initialized. soft_noboot=0 soft_margin=60 sec soft_panic=0 (nowayout=0) [ 0.694636] sunxi-mmc 1c0f000.mmc: GPIO lookup for consumer cd [ 0.694644] sunxi-mmc 1c0f000.mmc: using device tree for GPIO lookup [ 0.694656] of_get_named_gpiod_flags: can't parse 'cd-gpios' property of node '/soc/mmc@1c0f000[0]' [ 0.694662] of_get_named_gpiod_flags: can't parse 'cd-gpio' property of node '/soc/mmc@1c0f000[0]' [ 0.694666] sunxi-mmc 1c0f000.mmc: using lookup tables for GPIO lookup [ 0.694672] sunxi-mmc 1c0f000.mmc: lookup for GPIO cd failed [ 0.694679] sunxi-mmc 1c0f000.mmc: GPIO lookup for consumer wp [ 0.694682] sunxi-mmc 1c0f000.mmc: using device tree for GPIO lookup [ 0.694687] of_get_named_gpiod_flags: can't parse 'wp-gpios' property of node '/soc/mmc@1c0f000[0]' [ 0.694691] of_get_named_gpiod_flags: can't parse 'wp-gpio' property of node '/soc/mmc@1c0f000[0]' [ 0.694695] sunxi-mmc 1c0f000.mmc: using lookup tables for GPIO lookup [ 0.694700] sunxi-mmc 1c0f000.mmc: lookup for GPIO wp failed [ 0.749949] sunxi-mmc 1c0f000.mmc: base:0xc48ac000 irq:23 [ 0.755898] usbcore: registered new interface driver usbhid [ 0.761539] usbhid: USB HID core driver [ 0.765831] ip_tables: (C) 2000-2006 Netfilter Core Team [ 0.771268] NET: Registered protocol family 17 [ 0.775769] Key type dns_resolver registered [ 0.783307] sun4i-usb-phy 1c19400.phy: GPIO lookup for consumer usb0_id_det [ 0.783316] sun4i-usb-phy 1c19400.phy: using device tree for GPIO lookup [ 0.783331] of_get_named_gpiod_flags: can't parse 'usb0_id_det-gpios' property of node '/soc/phy@1c19400[0]' [ 0.783349] of_get_named_gpiod_flags: parsed 'usb0_id_det-gpio' property of node '/soc/phy@1c19400[0]' - status (0) [ 0.783386] sun4i-usb-phy 1c19400.phy: GPIO lookup for consumer usb0_vbus_det [ 0.783390] sun4i-usb-phy 1c19400.phy: using device tree for GPIO lookup [ 0.783396] of_get_named_gpiod_flags: can't parse 'usb0_vbus_det-gpios' property of node '/soc/phy@1c19400[0]' [ 0.783401] of_get_named_gpiod_flags: can't parse 'usb0_vbus_det-gpio' property of node '/soc/phy@1c19400[0]' [ 0.783405] sun4i-usb-phy 1c19400.phy: using lookup tables for GPIO lookup [ 0.783411] sun4i-usb-phy 1c19400.phy: lookup for GPIO usb0_vbus_det failed [ 0.784205] ehci-platform 1c1a000.usb: EHCI Host Controller [ 0.791267] ehci-platform 1c1a000.usb: new USB bus registered, assigned bus number 1 [ 0.799228] ehci-platform 1c1a000.usb: irq 25, io mem 0x01c1a000 [ 0.829934] ehci-platform 1c1a000.usb: USB 2.0 started, EHCI 1.00 [ 0.836231] usb usb1: New USB device found, idVendor=1d6b, idProduct=0002 [ 0.843065] usb usb1: New USB device strings: Mfr=3, Product=2, SerialNumber=1 [ 0.850311] usb usb1: Product: EHCI Host Controller [ 0.855192] usb usb1: Manufacturer: Linux 4.10.15-licheepi-zero+ ehci_hcd [ 0.861989] usb usb1: SerialNumber: 1c1a000.usb [ 0.867325] hub 1-0:1.0: USB hub found [ 0.871210] hub 1-0:1.0: 1 port detected [ 0.884287] mmc0: host does not support reading read-only switch, assuming write-enable [ 0.896842] mmc0: new high speed SDHC card at address aaaa [ 0.903017] mmcblk0: mmc0:aaaa SC16G 14.8 GiB [ 0.911817] mmcblk0: p1 p2 [ 1.020096] ohci-platform 1c1a400.usb: Generic Platform OHCI controller [ 1.027009] ohci-platform 1c1a400.usb: new USB bus registered, assigned bus number 2 [ 1.034944] ohci-platform 1c1a400.usb: irq 26, io mem 0x01c1a400 [ 1.114093] usb usb2: New USB device found, idVendor=1d6b, idProduct=0001 [ 1.120917] usb usb2: New USB device strings: Mfr=3, Product=2, SerialNumber=1 [ 1.128149] usb usb2: Product: Generic Platform OHCI controller [ 1.134079] usb usb2: Manufacturer: Linux 4.10.15-licheepi-zero+ ohci_hcd [ 1.140878] usb usb2: SerialNumber: 1c1a400.usb [ 1.146083] hub 2-0:1.0: USB hub found [ 1.149940] hub 2-0:1.0: 1 port detected [ 1.154505] sun6i-rtc 1c20400.rtc: setting system clock to 1970-01-01 00:00:03 UTC (3) [ 1.162685] vcc5v0: disabling [ 1.168923] EXT4-fs (mmcblk0p2): couldn't mount as ext3 due to feature incompatibilities [ 1.179875] EXT4-fs (mmcblk0p2): couldn't mount as ext2 due to feature incompatibilities [ 1.206094] random: fast init done [ 1.230299] EXT4-fs (mmcblk0p2): recovery complete [ 1.236551] EXT4-fs (mmcblk0p2): mounted filesystem with ordered data mode. Opts: (null) [ 1.244760] VFS: Mounted root (ext4 filesystem) on device 179:2. [ 1.253395] devtmpfs: mounted [ 1.257689] Freeing unused kernel memory: 1024K [ 1.407217] EXT4-fs (mmcblk0p2): re-mounted. Opts: data=ordered [ 1.974505] Bluetooth: Core ver 2.22 [ 1.978189] NET: Registered protocol family 31 [ 1.982723] Bluetooth: HCI device and connection manager initialized [ 1.989098] Bluetooth: HCI socket layer initialized [ 1.994006] Bluetooth: L2CAP socket layer initialized [ 1.999111] Bluetooth: SCO socket layer initialized [ 22.041838] esp32_spi: loading out-of-tree module taints kernel. [ 22.048753] esp_reset, ESP32: Resetpin of Host is 197 [ 22.048898] esp_reset, ESP32: Triggering ESP reset. [ 22.049456] ESP32 peripheral is registered to SPI bus [32766],chip select [0], SPI Clock [5]
Apologies for the late reply. Did you get it working? It looks like you have some issues with Basic SPI and GPIO connections.
Please look reference here: https://github.com/espressif/esp-hosted/issues/192#issuecomment-1382656599
In general, please remember exact same git commit to be used with ESP code and Host kernel building. In case you are using the released binary, please use 'Source code (zip)' from that release for host side kernel module building.
The next thing is to configure the SPI config in your Linux Device Tree (the bus should be usable) & configuring the Handshake, Data_Ready & Reset GPIO pins configured and getting them working. In your very recent log I see that initial transaction has not received. Unless the initial transaction is working, Any data pushed toward ESP (using say test.out), would be non useful.
Closing due to inactivity.
Hi, I’m starting to build an esp_hosted-fg project on an Allwinner v3s platform. Which Linux kernel is currently recommended, combined with which hosted_fg release? I tried Linux 5.2x with fg release 0.0.5 and ran into some issues with crashing when it calls ether_addr_copy.
I’m using fg because I need AP functionality which ng doesn’t have.
Would love to get some feedback about a working firmware/kernel combo to try. I could use either SPI or SDIO.
Thanks in advance! Rim