Skip to content

In espidf use espressif__arduino-esp32 can not use and report host wrong #12149

@IWILLTBEST

Description

@IWILLTBEST

Board

ESP32P4

Device Description

No

Hardware Configuration

No

Version

v3.3.3

Type

Task

IDE Name

VsCode

Operating System

Win10

Flash frequency

80M

PSRAM enabled

yes

Upload speed

115200

Description

It runs normally in Arduino, but when using IDF and the ESP32espressif__arduino-esp32 library with the same code, it fails to work. When connecting with the C6 chip, the following error log is shown.

Sketch

#include "Arduino.h"
#include "freertos/FreeRTOS.h"
#include "freertos/task.h"
#include "esp_log.h"
#include <WiFi.h>
#include <esp_wifi_remote.h>

IPAddress local_ip(192, 168, 4, 1);
IPAddress network_gateway(192, 168, 4, 1);
IPAddress subnet_mask(255, 255, 255, 0);
#define SOFT_AP_SSID "WiFi AP"
#define SOFT_AP_PASSWORD "abcd1234*"
extern "C" void app_main()
{
    initArduino();
    Serial.begin(115200);
    WiFi.mode(WIFI_AP);
    WiFi.softAP(SOFT_AP_SSID, SOFT_AP_PASSWORD);
    WiFi.softAPConfig(local_ip, network_gateway, subnet_mask);
    while (1)
    {
        delay(1000);
    }
}

Debug Message

RX:ESP-ROM:esp32p4-eco2-20240710
Build:Jul 10 2024
rst:0x1 (POWERON),boot:0x10f (SPI_FAST_FLASH_BOOT)
SPI mode:DIO, clock div:1
load:0x4ff33ce0,len:0x17a4
load:0x4ff29ed0,len:0xfc0
load:0x4ff2cbd0,len:0x345c
entry 0x4ff29eda
I (25) boot: ESP-IDF v5.5.1 2nd stage bootloader
I (26) boot: compile time Dec 18 2025 14:02:20
I (26) boot: Multicore bootloader
I (27) boot: chip revision: v1.3
I (29) boot: efuse block revision: v0.3
I (32) qio_mode: Enabling default flash chip QIO
I (37) boot.esp32p4: SPI Speed      : 80MHz
I (40) boot.esp32p4: SPI Mode       : QIO
I (44) boot.esp32p4: SPI Flash Size : 32MB
I (48) boot: Enabling RNG early entropy source...
I (53) boot: Partition Table:
I (55) boot: ## Label            Usage          Type ST Offset   Length
I (61) boot:  0 nvs              WiFi data        01 02 00009000 00006000
I (68) boot:  1 phy_init         RF data          01 01 0000f000 00001000
I (74) boot:  2 factory          factory app      00 00 00010000 00100000
I (82) boot: End of partition table
I (84) esp_image: segment 0: paddr=00010020 vaddr=40070020 size=32d04h (208132) map
I (125) esp_image: segment 1: paddr=00042d2c vaddr=30100000 size=00068h (   104) load
I (127) esp_image: segment 2: paddr=00042d9c vaddr=4ff00000 size=0d27ch ( 53884) load
I (139) esp_image: segment 3: paddr=00050020 vaddr=40000020 size=6c440h (443456) map
I (209) esp_image: segment 4: paddr=000bc468 vaddr=4ff0d27c size=0716ch ( 29036) load
I (216) esp_image: segment 5: paddr=000c35dc vaddr=4ff14400 size=0327ch ( 12924) load
I (224) boot: Loaded app from partition at offset 0x10000
I (225) boot: Disabling RNG early entropy source...
I (237) hex_psram: vendor id    : 0x0d (AP)
I (237) hex_psram: Latency      : 0x01 (Fixed)
I (237) hex_psram: DriveStr.    : 0x00 (25 Ohm)
I (238) hex_psram: dev id       : 0x03 (generation 4)
I (243) hex_psram: density      : 0x07 (256 Mbit)
I (247) hex_psram: good-die     : 0x06 (Pass)
I (251) hex_psram: SRF          : 0x02 (Slow Refresh)
I (256) hex_psram: BurstType    : 0x00 ( Wrap)
I (260) hex_psram: BurstLen     : 0x03 (2048 Byte)
I (265) hex_psram: BitMode      : 0x01 (X16 Mode)
I (269) hex_psram: Readlatency  : 0x02 (10 cycles@Fixed)
I (274) hex_psram: DriveStrength: 0x00 (1/1)
I (278) MSPI DQS: tuning success, best phase id is 0

[2025-12-18 14:26:43.712]
RX:I (460) MSPI DQS: tuning success, best delayline id is 15
I (460) esp_psram: Found 32MB PSRAM device
I (460) esp_psram: Speed: 80MHz
I (461) hex_psram: psram CS IO is dedicated
I (464) cpu_start: Multicore app
I (479) cpu_start: Pro cpu start user code
I (479) cpu_start: cpu freq: 360000000 Hz
I (479) app_init: Application information:
I (479) app_init: Project name:     04_uart
I (483) app_init: App version:      1
I (486) app_init: Compile time:     Dec 18 2025 14:00:05
I (491) app_init: ELF file SHA256:  6dae3e61d...
I (495) app_init: ESP-IDF:          v5.5.1
I (499) efuse_init: Min chip rev:     v0.1
I (503) efuse_init: Max chip rev:     v1.99 
I (507) efuse_init: Chip rev:         v1.3
I (511) heap_init: Initializing. RAM available for dynamic allocation:
I (517) heap_init: At 4FF1A660 len 00020960 (130 KiB): RAM
I (522) heap_init: At 4FF3AFC0 len 00004BF0 (18 KiB): RAM
I (528) heap_init: At 4FF40000 len 00060000 (384 KiB): RAM
I (533) heap_init: At 50108080 len 00007F80 (31 KiB): RTCRAM
I (538) heap_init: At 30100068 len 00001F98 (7 KiB): TCM
I (543) esp_psram: Adding pool of 32768K of PSRAM memory to heap allocator
I (550) spi_flash: detected chip: gd
I (553) spi_flash: flash io: qio
I (556) host_init: ESP Hosted : Host chip_ip[18]
I (593) H_API: ESP-Hosted starting. Hosted_Tasks: prio:23, stack: 5120 RPC_task_stack: 5120
I (593) H_API: ** add_esp_wifi_remote_channels **
I (596) H_SDIO_DRV: sdio_data_to_rx_buf_task started
I (599) main_task: Started on CPU0
I (603) esp_psram: Reserving pool of 32K of internal memory for DMA/internal allocations
I E (622) esp_hosted_transport_config: Transport already initialized (through constructor?), reconfiguring not allowed
[    78][E][esp32-hal-hosted.c:67] hostedInit(): esp_hosted_init failed!
E (638) esp_hosted_transport_config: Transport already initialized (through constructor?), reconfiguring not allowed
[    95][E][esp32-hal-hosted.c:67] hostedInit(): esp_hosted_init failed!
[   111][E][AP.cpp:190] begin(): AP enable failed!
E (660) esp_hosted_transport_config: Transport already initialized (through constructor?), reconfiguring not allowed
[   116][E][esp32-hal-hosted.c:67] hostedInit(): esp_hosted_init failed!
[   133][E][AP.cpp:190] begin(): AP enable failed!

Other Steps to Reproduce

No response

I have checked existing issues, online documentation and the Troubleshooting Guide

  • I confirm I have checked existing issues, online documentation and Troubleshooting guide.

Metadata

Metadata

Assignees

Labels

Status: Needs investigationWe need to do some research before taking next steps on this issue

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions