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

esp32 p4 + esp32 c5 SPI function run error (EHM-4) #4

Open
3 tasks done
skylin008 opened this issue Oct 14, 2024 · 19 comments
Open
3 tasks done

esp32 p4 + esp32 c5 SPI function run error (EHM-4) #4

skylin008 opened this issue Oct 14, 2024 · 19 comments
Labels
Status: Opened Issue is new

Comments

@skylin008
Copy link

Checklist

  • Checked the issue tracker for similar issues to ensure this is not a duplicate
  • Read the documentation to confirm the issue is not addressed there and your configuration is set correctly
  • Tested with the latest version to ensure the issue hasn't been fixed

How often does this bug occurs?

always

Expected behavior

Used latest Esp-hosted IDF v5.4-dev-3489-g6e5a178b31 . I had used Esp32-p4-Function_EV_Board and ESP32-C5-DevkitC to development, Esp32-p4 chip used SPI host function, ESP32-C5 chip used SPI slave function.
Used \examples\wifi\getting_started\station to running,Esp32 p4 host show the error information as:

**file: "./main/station_example_main.c" line 106
func: wifi_init_sta
expression: esp_wifi_init(&cfg)

abort() was called at PC 0x4ff0947b on core 0**

the esp32c5 show as error information:
I (2048) wifi:Init management short buffer num: 32
I (2053) wifi:Init static tx buffer num: 16
I (2057) wifi:Init tx cache buffer num: 32
W (2060) wifi:esf_buf_setup_static: alloc eb fail(10)
I (2065) wifi:Deinit lldesc rx mblock:0
I (2069) wifi:Deinit lldesc rx mblock:0
I (2072) wifi:Deinit lldesc rx mblock:0
W (2077) wifi_init: Failed to unregister Rx callbacks
E (2082) wifi_init: Failed to deinit Wi-Fi driver (0x3001)
E (2088) wifi_init: Failed to deinit Wi-Fi (0x3001)
E (2093) slave_ctrl: req_wifi_init:730 failed [esp_wifi_init(&cfg)] = [257]

Actual behavior (suspected bug)

run the demo example show error information.

Error logs or terminal output

slave log as follow :


I (23) boot: ESP-IDF v5.4-dev-3489-g6e5a178b31-dirty 2nd stage bootloader
I (24) boot: compile time Oct 10 2024 16:05:56
I (25) boot: chip revision: v0.0
I (28) boot: efuse block revision: v0.0
I (33) boot.esp32c5: SPI Speed      : 80MHz
I (38) boot.esp32c5: SPI Mode       : DIO
I (42) boot.esp32c5: SPI Flash Size : 4MB
I (47) boot: Enabling RNG early entropy source...
I (53) boot: Partition Table:
I (56) boot: ## Label            Usage          Type ST Offset   Length
I (63) boot:  0 nvs              WiFi data        01 02 00009000 00004000
I (71) boot:  1 otadata          OTA data         01 00 0000d000 00002000
I (78) boot:  2 phy_init         RF data          01 01 0000f000 00001000
I (86) boot:  3 ota_0            OTA app          00 10 00010000 00180000
I (93) boot:  4 ota_1            OTA app          00 11 00190000 00180000
I (101) boot: End of partition table
I (105) esp_image: segment 0: paddr=00010020 vaddr=420c0020 size=31b54h (203604) map
I (149) esp_image: segment 1: paddr=00041b7c vaddr=40800000 size=0e49ch ( 58524) load
I (162) esp_image: segment 2: paddr=00050020 vaddr=42000020 size=b8600h (755200) map
I (291) esp_image: segment 3: paddr=00108628 vaddr=4080e49c size=09fe0h ( 40928) load
I (300) esp_image: segment 4: paddr=00112610 vaddr=40818480 size=03f14h ( 16148) load
I (310) boot: Loaded app from partition at offset 0x10000
I (310) boot: Disabling RNG early entropy source...
I (322) cpu_start: Unicore app
W (330) clk: esp_perip_clk_init() has not been implemented yet
I (337) cpu_start: Pro cpu start user code
I (337) cpu_start: cpu freq: 240000000 Hz
I (337) app_init: Application information:
I (340) app_init: Project name:     network_adapter
I (345) app_init: App version:      1
I (349) app_init: Compile time:     Oct 10 2024 16:03:44
I (355) app_init: ELF file SHA256:  b44e430b9...
I (361) app_init: ESP-IDF:          v5.4-dev-3489-g6e5a178b31-dirty
I (368) efuse_init: Min chip rev:     v0.0
I (372) efuse_init: Max chip rev:     v0.99
I (377) efuse_init: Chip rev:         v0.0
I (382) heap_init: Initializing. RAM available for dynamic allocation:
I (389) heap_init: At 40822610 len 0003A390 (232 KiB): RAM
I (396) heap_init: At 4085C9A0 len 00002B60 (10 KiB): RAM
I (402) heap_init: At 50000000 len 00003FE8 (15 KiB): RTCRAM
I (409) spi_flash: detected chip: generic
I (413) spi_flash: flash io: dio
W (417) spi_flash: Detected size(8192k) larger than the size in the binary image header(4096k). Using the size in the binary image header.
I (430) sleep_gpio: Configure to isolate all GPIO pins in sleep state
I (437) sleep_gpio: Enable automatic switching of GPIO sleep configuration
I (444) coexist: coex firmware version: 49d5b702e
I (458) coexist: coexist rom version 78e5c6e42
I (459) main_task: Started on CPU0
I (459) main_task: Calling app_main()
I (463) fg_mcu_slave: *********************************************************************
I (472) fg_mcu_slave:                 ESP-Hosted-MCU Slave FW version :: 0.0.6
I (482) fg_mcu_slave:                 Transport used :: SPI only
I (491) fg_mcu_slave: *********************************************************************
I (500) fg_mcu_slave: Supported features are:
I (505) fg_mcu_slave: - WLAN over SPI
I (509) h_bt: - BT/BLE
I (512) fg_mcu_slave: capabilities: 0xa0
I (517) fg_mcu_slave: Supported extended features are:
I (523) h_bt: - BT/BLE (extended)
I (527) fg_mcu_slave: extended capabilities: 0x0
I (538) h_bt: ESP Bluetooth MAC addr: 60:55:f9:f9:67:5a
I (538) BLE_INIT: Using main XTAL as clock source
I (546) BLE_INIT: ble controller commit:[4f138b0]
W (549) BLE_INIT: BLE modem sleep is enabled
I (554) BLE_INIT: Bluetooth MAC: 60:55:f9:f9:67:5a
I (559) SPI_DRIVER: Using SPI interface
I (564) gpio: GPIO[26]| InputEn: 0| OutputEn: 1| OpenDrain: 0| Pullup: 0| Pulldown: 0| Intr:0
I (573) gpio: GPIO[13]| InputEn: 0| OutputEn: 1| OpenDrain: 0| Pullup: 0| Pulldown: 0| Intr:0
I (582) SPI_DRIVER: SPI Ctrl:1 mode: 3, Freq:ConfigAtHost
GPIOs: MOSI: 7, MISO: 2, CS: 10, CLK: 6 HS: 26 DR: 13

I (638) SPI_DRIVER: Hosted SPI queue size: Tx:20 Rx:20
I (638) gpio: GPIO[10]| InputEn: 0| OutputEn: 0| OpenDrain: 0| Pullup: 1| Pulldown: 0| Intr:0
I (647) gpio: GPIO[10]| InputEn: 1| OutputEn: 0| OpenDrain: 0| Pullup: 1| Pulldown: 0| Intr:0
I (658) SPI_DRIVER: Slave chip Id[12]
I (661) fg_mcu_slave: Initial set up done
I (666) slave_ctrl: event ESPInit
mem_dump free:114948 min-free:114908 lfb-dma:86016 lfb-def:86016 lfb-8bit:86016
I (1080) fg_mcu_slave: Slave init_config received from host
I (1080) fg_mcu_slave: Host capabilities: 44
I (1080) fg_mcu_slave: ESP<-Host high data throttle threshold [90%]
I (1087) fg_mcu_slave: ESP<-Host low data throttle threshold [60%]
I (2000) slave_ctrl: Resp_MSGId for req[0x116] is [0x216], uid 1
I (2000) slave_ctrl: Received Req [0x116]
I (2000) pp: pp rom version: edebfe68d
I (2005) net80211: net80211 rom version: edebfe68d
I (2011) wifi:wifi driver task: 40849b0c, prio:23, stack:6656, core=0
I (2018) wifi:wifi firmware version: 10e68d5
I (2020) wifi:wifi certification version: v7.0
I (2024) wifi:config NVS flash: enabled
I (2028) wifi:config nano formatting: disabled
I (2032) wifi:mac_version:HAL_MAC_ESP32AX_752MP,ut_version:N, band mode:0x3
I (2039) wifi:Init data frame dynamic rx buffer num: 64
I (2044) wifi:Init static rx mgmt buffer num: 5
I (2048) wifi:Init management short buffer num: 32
I (2053) wifi:Init static tx buffer num: 16
I (2057) wifi:Init tx cache buffer num: 32
W (2060) wifi:esf_buf_setup_static: alloc eb fail(10)
I (2065) wifi:Deinit lldesc rx mblock:0
I (2069) wifi:Deinit lldesc rx mblock:0
I (2072) wifi:Deinit lldesc rx mblock:0
W (2077) wifi_init: Failed to unregister Rx callbacks
E (2082) wifi_init: Failed to deinit Wi-Fi driver (0x3001)
E (2088) wifi_init: Failed to deinit Wi-Fi (0x3001)
E (2093) slave_ctrl: req_wifi_init:730 failed [esp_wifi_init(&cfg)] = [257]



host log as follow:
I (25) boot: ESP-IDF v5.4-dev-3489-g6e5a178b31-dirty 2nd stage bootloader
I (26) boot: compile time Oct 10 2024 15:41:32
I (27) boot: Multicore bootloader
I (32) boot: chip revision: v0.1
I (34) boot: efuse block revision: v0.0
I (39) boot.esp32p4: SPI Speed      : 80MHz
I (44) boot.esp32p4: SPI Mode       : DIO
I (49) boot.esp32p4: 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 (70) boot:  0 nvs              WiFi data        01 02 00009000 00006000
I (77) boot:  1 phy_init         RF data          01 01 0000f000 00001000
I (84) boot:  2 factory          factory app      00 00 00010000 00177000
I (93) boot: End of partition table
I (96) esp_image: segment 0: paddr=00010020 vaddr=40060020 size=23a68h (146024) map
I (130) esp_image: segment 1: paddr=00033a90 vaddr=30100000 size=0002ch (    44) load
I (132) esp_image: segment 2: paddr=00033ac4 vaddr=3010002c size=0003ch (    60) load
I (137) esp_image: segment 3: paddr=00033b08 vaddr=4ff00000 size=0c510h ( 50448) load
I (155) esp_image: segment 4: paddr=00040020 vaddr=40000020 size=59150h (364880) map
I (217) esp_image: segment 5: paddr=00099178 vaddr=4ff0c510 size=07164h ( 29028) load
I (225) esp_image: segment 6: paddr=000a02e4 vaddr=4ff13680 size=028f8h ( 10488) load
I (232) boot: Loaded app from partition at offset 0x10000
I (233) boot: Disabling RNG early entropy source...
I (247) hex_psram: vendor id    : 0x0d (AP)
I (247) hex_psram: Latency      : 0x01 (Fixed)
I (247) hex_psram: DriveStr.    : 0x00 (25 Ohm)
I (251) hex_psram: dev id       : 0x03 (generation 4)
I (256) hex_psram: density      : 0x07 (256 Mbit)
I (262) hex_psram: good-die     : 0x06 (Pass)
I (267) hex_psram: SRF          : 0x02 (Slow Refresh)
I (272) hex_psram: BurstType    : 0x00 ( Wrap)
I (278) hex_psram: BurstLen     : 0x03 (2048 Byte)
I (283) hex_psram: BitMode      : 0x01 (X16 Mode)
I (288) hex_psram: Readlatency  : 0x04 (14 cycles@Fixed)
I (294) hex_psram: DriveStrength: 0x00 (1/1)
I (300) MSPI DQS: tuning success, best phase id is 2
I (488) MSPI DQS: tuning success, best delayline id is 11
I (488) esp_psram: Found 32MB PSRAM device
I (489) esp_psram: Speed: 200MHz
I (492) hex_psram: psram CS IO is dedicated
I (496) cpu_start: Multicore app
I (1450) esp_psram: SPI SRAM memory test OK
I (1460) cpu_start: Pro cpu start user code
I (1460) cpu_start: cpu freq: 360000000 Hz
I (1460) app_init: Application information:
I (1463) app_init: Project name:     wifi_station
I (1468) app_init: App version:      1
I (1473) app_init: Compile time:     Oct 10 2024 15:38:50
I (1479) app_init: ELF file SHA256:  a2daf24ad...
I (1484) app_init: ESP-IDF:          v5.4-dev-3489-g6e5a178b31-dirty
I (1491) efuse_init: Min chip rev:     v0.1
I (1496) efuse_init: Max chip rev:     v0.99
I (1501) efuse_init: Chip rev:         v0.1
I (1506) heap_init: Initializing. RAM available for dynamic allocation:
I (1513) heap_init: At 4FF18520 len 00022AA0 (138 KiB): RAM
I (1519) heap_init: At 4FF3AFC0 len 00004BF0 (18 KiB): RAM
I (1526) heap_init: At 4FF40000 len 00060000 (384 KiB): RAM
I (1532) heap_init: At 50108080 len 00007F80 (31 KiB): RTCRAM
I (1538) heap_init: At 30100068 len 00001F98 (7 KiB): TCM
I (1545) esp_psram: Adding pool of 32768K of PSRAM memory to heap allocator
I (1553) spi_flash: detected chip: generic
I (1557) spi_flash: flash io: dio
W (1561) spi_flash: Detected size(16384k) larger than the size in the binary image header(4096k). Using the size in the binary image header.
I (1574) host_init: ESP Hosted : Host chip_ip[18]
I (1594) H_API: ESP-Hosted starting. Hosted_Tasks: prio:23, stack: 5120 RPC_task_stack: 5120
spi_mempool_create free:33723388 min-free:33723388 lfb-def:33030144 lfb-8bit:33030144

I (1600) spi_wrapper: Transport: SPI, Mode:3 Freq:5MHz TxQ:20 RxQ:20
 GPIOs: MOSI:20 MISO:21 CLK:22 CS:23 HS:24 DR:25 SlaveReset:26
I (1614) H_API: ** add_esp_wifi_remote_channels **
I (1618) transport: Add ESP-Hosted channel IF[1]: S[0] Tx[0x4000d030] Rx[0x4001ade6]
--- 0x4000d030: transport_drv_sta_tx at D:/esp32_app/station/managed_components/espressif__esp_hosted/host/drivers/transport/transport_drv.c:208
0x4001ade6: esp_wifi_remote_channel_rx at D:/esp32_app/station/managed_components/espressif__esp_wifi_remote/esp_wifi_remote_net.c:19

I (1627) transport: Add ESP-Hosted channel IF[2]: S[0] Tx[0x4000cf78] Rx[0x4001ade6]
--- 0x4000cf78: transport_drv_ap_tx at D:/esp32_app/station/managed_components/espressif__esp_hosted/host/drivers/transport/transport_drv.c:238
0x4001ade6: esp_wifi_remote_channel_rx at D:/esp32_app/station/managed_components/espressif__esp_wifi_remote/esp_wifi_remote_net.c:19

I (1636) os_wrapper_esp: GPIO [24] configuring as Interrupt
I (1636) spi: No element in any queue found
I (1642) gpio: GPIO[24]| InputEn: 1| OutputEn: 0| OpenDrain: 0| Pullup: 1| Pulldown: 0| Intr:1
I (1642) main_task: Started on CPU0
I (1656) os_wrapper_esp: GPIO [25] configuring as Interrupt
I (1710) gpio: GPIO[25]| InputEn: 1| OutputEn: 0| OpenDrain: 0| Pullup: 1| Pulldown: 0| Intr:1
E (1710) gpio: gpio_install_isr_service(502): GPIO isr service already installed
I (1717) esp_psram: Reserving pool of 32K of internal memory for DMA/internal allocations
I (1725) main_task: Calling app_main()
I (1737) wifi station: ESP_WIFI_MODE_STA
before init wifi : free_heap_size = 34049544
I (1738) H_API: esp_wifi_remote_init
I (1743) transport: Attempt connection with slave: retry[0]
I (1749) transport: Reset slave using GPIO[26]
I (1754) os_wrapper_esp: GPIO [26] configured
I (1759) gpio: GPIO[26]| InputEn: 0| OutputEn: 1| OpenDrain: 0| Pullup: 0| Pulldown: 0| Intr:0
I (2918) transport: Received INIT event from ESP32 peripheral
I (2918) transport: EVENT: 12
I (2919) transport: EVENT: 11
I (2921) transport: capabilities: 0xa0
I (2925) transport: Features supported are:
I (2930) transport: EVENT: 13
I (2934) transport: ESP board type is : 23

I (2939) transport: Base transport is set-up

I (2944) transport: Slave chip Id[12]
I (2949) hci_stub_drv: Host BT Support: Disabled
I (2954) spi: Received INIT event
I (2959) rpc_wrap: Received Slave ESP Init
E (3978) rpc_rsp: Failure resp/event: possibly precondition not met
E (3979) rpc_wrap: Failed Control Response
ESP_ERROR_CHECK failed: esp_err_t 0x101 (ESP_ERR_NO_MEM) at 0x4001b370
--- 0x4001b370: wifi_init_sta at D:/esp32_app/station/main/station_example_main.c:106 (discriminator 1)

file: "./main/station_example_main.c" line 106
func: wifi_init_sta
expression: esp_wifi_init(&cfg)

abort() was called at PC 0x4ff0947b on core 0
--- 0x4ff0947b: _esp_error_check_failed at D:/Espressif/frameworks/esp-idf-master/components/esp_system/esp_err.c:49

--- Stack dump detected
Core  0 register dump:
MEPC    : 0x4ff00cb8  RA      : 0x4ff09486  SP      : 0x4ff230a0  GP      : 0x4ff13e80
--- 0x4ff00cb8: panic_abort at D:/Espressif/frameworks/esp-idf-master/components/esp_system/panic.c:468
0x4ff09486: __ubsan_include at D:/Espressif/frameworks/esp-idf-master/components/esp_system/ubsan.c:311

TP      : 0x4ff23300  T0      : 0x37363534  T1      : 0x7271706f  T2      : 0x33323130
S0/FP   : 0x00000004  S1      : 0x4ff23104  A0      : 0x4ff230cc  A1      : 0x4ff23102
A2      : 0x00000000  A3      : 0x4ff230f9  A4      : 0x00000001  A5      : 0x4ff18000
A6      : 0x00000000  A7      : 0x76757473  S2      : 0x00000000  S3      : 0x00000000
S4      : 0x00000000  S5      : 0x00000000  S6      : 0x00000000  S7      : 0x00000000
S8      : 0x00000000  S9      : 0x00000000  S10     : 0x00000000  S11     : 0x00000000
T3      : 0x6e6d6c6b  T4      : 0x6a696867  T5      : 0x66656463  T6      : 0x62613938
MSTATUS : 0x00011880  MTVEC   : 0x4ff00003  MCAUSE  : 0x00000002  MTVAL   : 0x00000000
MHARTID : 0x00000000

Steps to reproduce the behavior

Power on ,as show the error information.

Project release version

(25) boot: ESP-IDF v5.4-dev-3489-g6e5a178b31-dirty 2nd stage bootloader

System architecture

Intel/AMD 64-bit (modern PC, older Mac)

Operating system

Windows

Operating system version

windows 10

Shell

CMD

Additional context

No response

@mantriyogesh
Copy link
Collaborator

Can you please confirm if you have installed latest esp-hosted from https://components.espressif.com/components/espressif/esp_hosted/versions/0.0.22

Please use latest master esp-idf if you wish to use c5 as slave.

@skylin008
Copy link
Author

Thanks @mantriyogesh. Yes, I had update to 0.0.22 , the error issue as follow:

**I (33) boot: ESP-IDF v5.4-dev-3489-g6e5a178b31-dirty 2nd stage bootloader
I (33) boot: compile time Oct 15 2024 10:18:40
I (34) boot: Multicore bootloader
I (39) boot: chip revision: v0.1
I (42) boot: efuse block revision: v0.0
I (47) boot.esp32p4: SPI Speed : 80MHz
I (51) boot.esp32p4: SPI Mode : DIO
I (56) boot.esp32p4: SPI Flash Size : 16MB
I (61) boot: Enabling RNG early entropy source...
I (66) boot: Partition Table:
I (70) boot: ## Label Usage Type ST Offset Length
I (77) boot: 0 nvs WiFi data 01 02 00009000 00006000
I (85) boot: 1 phy_init RF data 01 01 0000f000 00001000
I (92) boot: 2 factory factory app 00 00 00010000 00177000
I (100) boot: End of partition table
I (104) esp_image: segment 0: paddr=00010020 vaddr=40060020 size=23a18h (145944) map
I (133) esp_image: segment 1: paddr=00033a40 vaddr=30100000 size=0002ch ( 44) load
I (135) esp_image: segment 2: paddr=00033a74 vaddr=3010002c size=0003ch ( 60) load
I (140) esp_image: segment 3: paddr=00033ab8 vaddr=4ff00000 size=0c560h ( 50528) load
I (157) esp_image: segment 4: paddr=00040020 vaddr=40000020 size=59184h (364932) map
I (209) esp_image: segment 5: paddr=000991ac vaddr=4ff0c560 size=070ech ( 28908) load
I (215) esp_image: segment 6: paddr=000a02a0 vaddr=4ff13680 size=028f8h ( 10488) load
I (222) boot: Loaded app from partition at offset 0x10000
I (222) boot: Disabling RNG early entropy source...
I (238) hex_psram: vendor id : 0x0d (AP)
I (239) hex_psram: Latency : 0x01 (Fixed)
I (239) hex_psram: DriveStr. : 0x00 (25 Ohm)
I (242) hex_psram: dev id : 0x03 (generation 4)
I (248) hex_psram: density : 0x07 (256 Mbit)
I (253) hex_psram: good-die : 0x06 (Pass)
I (258) hex_psram: SRF : 0x02 (Slow Refresh)
I (264) hex_psram: BurstType : 0x00 ( Wrap)
I (269) hex_psram: BurstLen : 0x03 (2048 Byte)
I (275) hex_psram: BitMode : 0x01 (X16 Mode)
I (280) hex_psram: Readlatency : 0x04 (14 cycles@Fixed)
I (286) hex_psram: DriveStrength: 0x00 (1/1)
I (291) MSPI DQS: tuning success, best phase id is 2
I (479) MSPI DQS: tuning success, best delayline id is 11
I (480) esp_psram: Found 32MB PSRAM device
I (480) esp_psram: Speed: 200MHz
I (484) hex_psram: psram CS IO is dedicated
I (488) cpu_start: Multicore app
I (1441) esp_psram: SPI SRAM memory test OK
I (1451) cpu_start: Pro cpu start user code
I (1451) cpu_start: cpu freq: 360000000 Hz
I (1451) app_init: Application information:
I (1454) app_init: Project name: wifi_station
I (1460) app_init: App version: 1
I (1464) app_init: Compile time: Oct 15 2024 10:17:28
I (1470) app_init: ELF file SHA256: 86612ff7b...
I (1476) app_init: ESP-IDF: v5.4-dev-3489-g6e5a178b31-dirty
I (1483) efuse_init: Min chip rev: v0.1
I (1487) efuse_init: Max chip rev: v0.99
I (1493) efuse_init: Chip rev: v0.1
I (1497) heap_init: Initializing. RAM available for dynamic allocation:
I (1505) heap_init: At 4FF18520 len 00022AA0 (138 KiB): RAM
I (1511) heap_init: At 4FF3AFC0 len 00004BF0 (18 KiB): RAM
I (1517) heap_init: At 4FF40000 len 00060000 (384 KiB): RAM
I (1524) heap_init: At 50108080 len 00007F80 (31 KiB): RTCRAM
I (1530) heap_init: At 30100068 len 00001F98 (7 KiB): TCM
I (1536) esp_psram: Adding pool of 32768K of PSRAM memory to heap allocator
I (1544) spi_flash: detected chip: generic
I (1548) spi_flash: flash io: dio
I (1552) host_init: ESP Hosted : Host chip_ip[18]
I (1586) H_API: ESP-Hosted starting. Hosted_Tasks: prio:23, stack: 5120 RPC_task_stack: 5120
spi_mempool_create free:33723388 min-free:33723388 lfb-def:33030144 lfb-8bit:33030144

I (1592) spi_wrapper: Transport: SPI, Mode:3 Freq:5MHz TxQ:20 RxQ:20
GPIOs: MOSI:4 MISO:22 CLK:26 CS:33 HS:32 DR:20 SlaveReset:2
I (1605) H_API: ** add_esp_wifi_remote_channels **
I (1610) transport: Add ESP-Hosted channel IF[1]: S[0] Tx[0x4000d036] Rx[0x4001adf4]
--- 0x4ff056e8: cpu_utility_ll_reset_cpu at D:/Espressif/frameworks/esp-idf-master/components/hal/esp32p4/include/hal/cpu_utility_ll.h:23
(inlined by) esp_cpu_reset at D:/Espressif/frameworks/esp-idf-master/components/esp_hw_support/cpu.c:49

--- 0x4ff05844: esp_cpu_wait_for_intr at D:/Espressif/frameworks/esp-idf-master/components/esp_hw_support/cpu.c:57 (discriminator 1)

--- 0x4000d036: transport_drv_sta_tx at D:/esp32_app/station/managed_components/espressif__esp_hosted/host/drivers/transport/transport_drv.c:208
0x4001adf4: esp_wifi_remote_channel_rx at D:/esp32_app/station/managed_components/espressif__esp_wifi_remote/esp_wifi_remote_net.c:19

I (1618) transport: Add ESP-Hosted channel IF[2]: S[0] Tx[0x4000cf7e] Rx[0x4001adf4]
--- 0x4000cf7e: transport_drv_ap_tx at D:/esp32_app/station/managed_components/espressif__esp_hosted/host/drivers/transport/transport_drv.c:238
0x4001adf4: esp_wifi_remote_channel_rx at D:/esp32_app/station/managed_components/espressif__esp_wifi_remote/esp_wifi_remote_net.c:19

I (1627) os_wrapper_esp: GPIO [32] configuring as Interrupt
I (1627) spi: No element in any queue found
I (1637) gpio: GPIO[32]| InputEn: 1| OutputEn: 0| OpenDrain: 0| Pullup: 1| Pulldown: 0| Intr:1
I (1637) main_task: Started on CPU0
I (1647) os_wrapper_esp: GPIO [20] configuring as Interrupt
I (1657) gpio: GPIO[20]| InputEn: 1| OutputEn: 0| OpenDrain: 0| Pullup: 1| Pulldown: 0| Intr:1
E (1667) gpio: gpio_install_isr_service(502): GPIO isr service already installed
I (1677) esp_psram: Reserving pool of 32K of internal memory for DMA/internal allocations
I (1687) main_task: Calling app_main()
I (1697) wifi station: ESP_WIFI_MODE_STA
I (1697) H_API: esp_wifi_remote_init
I (1697) transport: Attempt connection with slave: retry[0]
I (1707) transport: Reset slave using GPIO[2]
I (1707) os_wrapper_esp: GPIO [2] configured
I (1717) gpio: GPIO[2]| InputEn: 0| OutputEn: 1| OpenDrain: 0| Pullup: 0| Pulldown: 0| Intr:0
I (2877) transport: Received INIT event from ESP32 peripheral
I (2877) transport: EVENT: 12
I (2877) transport: EVENT: 11
I (2877) transport: capabilities: 0xa0
I (2877) transport: Features supported are:
I (2887) transport: EVENT: 13
I (2887) transport: ESP board type is : 23

I (2897) transport: Base transport is set-up

I (2897) transport: Slave chip Id[12]
I (2907) hci_stub_drv: Host BT Support: Disabled
I (2907) spi: Received INIT event
I (2917) rpc_wrap: Received Slave ESP Init
E (3937) rpc_rsp: Failure resp/event: possibly precondition not met
E (3937) rpc_wrap: Failed Control Response
ESP_ERROR_CHECK failed: esp_err_t 0x101 (ESP_ERR_NO_MEM) at 0x4001b35a
--- 0x4001b35a: wifi_init_sta at D:/esp32_app/station/main/station_example_main.c:105 (discriminator 1)

file: "./main/station_example_main.c" line 105
func: wifi_init_sta
expression: esp_wifi_init(&cfg)

abort() was called at PC 0x4ff0947d on core 0
--- 0x4ff0947d: _esp_error_check_failed at D:/Espressif/frameworks/esp-idf-master/components/esp_system/esp_err.c:49

--- Stack dump detected
Core 0 register dump:
MEPC : 0x4ff00cb8 RA : 0x4ff09488 SP : 0x4ff230a0 GP : 0x4ff13e80
--- 0x4ff00cb8: panic_abort at D:/Espressif/frameworks/esp-idf-master/components/esp_system/panic.c:468
0x4ff09488: __ubsan_include at D:/Espressif/frameworks/esp-idf-master/components/esp_system/ubsan.c:311

TP : 0x4ff23300 T0 : 0x37363534 T1 : 0x7271706f T2 : 0x33323130
S0/FP : 0x00000004 S1 : 0x4ff23104 A0 : 0x4ff230cc A1 : 0x4ff23102
A2 : 0x00000000 A3 : 0x4ff230f9 A4 : 0x00000001 A5 : 0x4ff18000
A6 : 0x00000000 A7 : 0x76757473 S2 : 0x00000000 S3 : 0x00000000
S4 : 0x00000000 S5 : 0x00000000 S6 : 0x00000000 S7 : 0x00000000
S8 : 0x00000000 S9 : 0x00000000 S10 : 0x00000000 S11 : 0x00000000
T3 : 0x6e6d6c6b T4 : 0x6a696867 T5 : 0x66656463 T6 : 0x62613938
MSTATUS : 0x00011880 MTVEC : 0x4ff00003 MCAUSE : 0x00000002 MTVAL : 0x00000000
--- 0x4ff00003: _vector_table at ??:?

MHARTID : 0x00000000**

How to solve this issue?

@mantriyogesh
Copy link
Collaborator

Can you please confirm, if the slave is also using 0.0.22?

https://components.espressif.com/components/espressif/esp_hosted/versions/0.0.22/examples/slave?language=en

idf.py create-project-from-example "espressif/esp_hosted^0.0.22:slave"

@skylin008
Copy link
Author

Yes, the slave is also using 0.0.22. Can you build the latest firmware for test, or ours build environment is other issue.

@mantriyogesh
Copy link
Collaborator

I can test this tomorrow earliest. Let you know my test results.

@mantriyogesh
Copy link
Collaborator

i am checking this now. let you update in while

@mantriyogesh
Copy link
Collaborator

c5_p4_std_spi_0.0.22_idf_6e5a17.tgz

We don't face this on idf commit you mentioned.
The binaries I have attached for you to try, for c5 and p4.

No code change, idf.py menuconfig used to change the needed spi pins. Check readme.txt for details.

I have used iperf example by the way, so that you can enter the ssid and password which you wish to connect to.

@dmartauz
Copy link

I am getting the same error while trying to use C6 of ESP32-P4-Function-EV-Board via SDIO using esp_wifi_remote 0.4.1 and esp_hosted 0.0.22:

I (3472) sdio_wrapper: SDIO master: Data-Lines: 4-bit Freq(KHz)[40000 KHz]
I (3472) sdio_wrapper: GPIOs: CLK[18] CMD[19] D0[14] D1[15] D2[16] D3[17] Slave_Reset[54]
I (3472) H_SDIO_DRV: Starting SDIO process rx task
I (3472) sdio_wrapper: Queues: Tx[20] Rx[20] SDIO-Rx-Mode[1]
I (3512) gpio: GPIO[15]| InputEn: 0| OutputEn: 0| OpenDrain: 0| Pullup: 1| Pulldown: 0| Intr:0
I (3512) gpio: GPIO[17]| InputEn: 0| OutputEn: 0| OpenDrain: 0| Pullup: 1| Pulldown: 0| Intr:0
Name:
Type: SDIO
Speed: 40.00 MHz (limit: 40.00 MHz)
Size: 0MB
CSD: ver=1, sector_size=0, capacity=0 read_bl_len=0
SCR: sd_spec=0, bus_width=0
TUPLE: DEVICE, size: 3: D9 01 FF
TUPLE: MANFID, size: 4
  MANF: 0092, CARD: 6666
TUPLE: FUNCID, size: 2: 0C 00
TUPLE: FUNCE, size: 4: 00 00 02 32
TUPLE: CONFIG, size: 5: 01 01 00 02 07
TUPLE: CFTABLE_ENTRY, size: 8
  INDX: C1, Intface: 1, Default: 1, Conf-Entry-Num: 1
  IF: 41
  FS: 30, misc: 0, mem_space: 1, irq: 1, io_space: 0, timing: 0, power: 0
  IR: 30, mask: 1,   IRQ: FF FF
  LEN: FFFF
TUPLE: END
I (3562) sdio_wrapper: Function 0 Blocksize: 512
I (3572) sdio_wrapper: Function 1 Blocksize: 512
I (3572) H_SDIO_DRV: SDIO Host operating in STREAMING MODE
I (3582) H_SDIO_DRV: generate slave intr
I (3592) transport: Received INIT event from ESP32 peripheral
I (3592) transport: EVENT: 12
I (3592) transport: EVENT: 11
I (3602) transport: capabilities: 0xd
I (3602) transport: Features supported are:
I (3612) transport:      * WLAN
I (3612) transport:        - HCI over SDIO
I (3622) transport:        - BLE only
I (3622) transport: EVENT: 13
I (3622) transport: ESP board type is : 13

I (3632) transport: Base transport is set-up

I (3632) transport: Slave chip Id[12]
I (3642) hci_stub_drv: Host BT Support: Disabled
I (3642) H_SDIO_DRV: Received INIT event
I (3662) rpc_wrap: Received Slave ESP Init
I (4712) H_API: esp_wifi_remote_connect
E (4732) rpc_rsp: Failure resp/event: possibly precondition not met
E (4732) rpc_wrap: Failed Control Response

C6 contains factory firmware. Does it need to be updated?

@mantriyogesh
Copy link
Collaborator

@dmartauz , this is different query. Can you please trigger different issue? I will check by the time.

@mantriyogesh
Copy link
Collaborator

@dmartauz , the answer is P4 0.0.22 is still compatible with on-board C6 (based on 0.0.6)

Original binaries on-board were flashed with:
2024.05.31_hosted_c6_bins_with_ota.tgz Ignore P4 binaries in this and only refer to C6 binaries.

Current P4 binary: p4_0.0.22.tgz

Slightly unrelated, but good to know. Although, it would be important to note that 0.0.6 based code base need some changes if latest IDF is used. However, if original IDF that time was used, it would still build fine.

Nevertheless, P4 latest binaries are still compatible with on-board C6 binaries.

@dmartauz
Copy link

@mantriyogesh I am testing with custom application using recent clone of esp-idf master branch. In this case do I need to update the C6?

@mantriyogesh
Copy link
Collaborator

Despite of #4, I think it is better to setup slave with latest firmware changes.

I would say it is recommended but not mandatory.

@dmartauz
Copy link

Ok, I will build the slave with recent esp-idf and find out how to flash it to C6 locally without esp-prog according to https://github.com/espressif/esp-hosted/blob/feature/esp_as_mcu_host/docs/esp32_p4_function_ev_board.md#52-using-esp-prog

In the meantime, could you please share some minimal application code for the P4 which tests C6's WiFi over SDIO, e.g. performs connection to an AP?

@mantriyogesh
Copy link
Collaborator

I think it is better to open new issue. this issue was created by @skylin008 , so lets us try to keep it clean.

@dmartauz
Copy link

@mantriyogesh you are right, I created new request here: #3

@skylin008
Copy link
Author

@mantriyogesh Thank you for your supported. From your firmware ,the same issue show. Can you had tested the firmware in ESP32P4 and esp32c5 board?

@mantriyogesh
Copy link
Collaborator

I tested it myself, I did not observe any issues.
Can you please make sure if the binaries I sent are flashed?

@mantriyogesh
Copy link
Collaborator

I would wait ahead.

@mantriyogesh
Copy link
Collaborator

I had reproduced the issue. The problem is memory.

Easy workaround: If you are not using Bluetooth, disable using idf.py menuconfig.

Else need to lower wifi buffers, to conserve the iram.
I will send you today, the sdkconfig.defaults.esp32c5 changes, which should work.

@mantriyogesh mantriyogesh transferred this issue from espressif/esp-hosted Nov 5, 2024
@espressif-bot espressif-bot added the Status: Opened Issue is new label Nov 5, 2024
@github-actions github-actions bot changed the title esp32 p4 + esp32 c5 SPI function run error esp32 p4 + esp32 c5 SPI function run error (EHM-4) Nov 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Status: Opened Issue is new
Projects
None yet
Development

No branches or pull requests

4 participants