求助:esp32s3r8中,我的系统会无缘无故宕机

Carl-Ge1234
Posts: 6
Joined: Fri May 08, 2026 8:39 am

求助:esp32s3r8中,我的系统会无缘无故宕机

Postby Carl-Ge1234 » Fri May 08, 2026 9:11 am

Hi,

硬件环境:esp32s3r8+自定义主板
软件环境: idf 5.5.1
问题: 开启PSRAM的系统启动后,会在一些硬件的初始化过程中宕机(然后导致看门口触发重启),这些硬件包括:LCD, SD,flash上面的大文件。
引脚定义:
ESP32S3(主MCU):
GPIO0: ESP_BOOT
GPIO1:I2C_SDA
GPIO2:I2C_SCL
GPIO3:DVP_PCLK
GPIO4:DVP_XCLK
GPIO5:NRF_CS
GPIO6:NRF_SCK
GPIO7:NRF_MOSI
GPIO8:NRF_MISO
GPIO9:NRF_IRQ
GPIO10:ESP_RXD
GPIO11:ESP_TXD
GPIO12:I2S_DI
GPIO13:I2S_WS
GPIO14:I2S_BCK
XTAL_32K_P:DVP_D7
XTAL_32K_N:DVP_D6
GPIO17:DVP_D2
GPIO18:DVP_D5
GPIO19:DVP_D3
GPIO20:DVP_D4
GPIO21:DVP_D1
SPICS1:DVP_D0
SPIHD:SPIHD
SPIWP:SPIWP
SPICS0:SPICS0
SPICLK:SPICLK
SPIQ:SPIQ
SPID:SPID
GPIO38:I2S_MCK
MTCK:TF_CMD
MTDO:TF_MISO
MTDI:TF_CLK
MTMS:DVP_VSYNC
U0TXD:ESP_TX0
U0RXD:ESP_RX0
GPIO45:TF_CLK
GPIO46:DVP_HREF
日志:
........................................................................................................................�j..�.�+..R*j..V��,,[Y�J��Manual: set_audio_input_source() / audio_src mic|rf24
I (1796) AudioService: Disabling wake word detection
I (1796) audio_input: Console: audio_src mic|rf24
W (1806) Application: Audion service started
W (1806) Application: [RF24-AUTO] timer start: tick=100ms
I (1816) uart: queue free spaces: 100
I (1816) uart: UART driver FIFO:64
I (1816) AtUart: break
I (1826) AtModem: Detect: cold boot guard 1800ms before first baud probe
I (1826) AudioService: [WW-STATE] ww_init begin arm_after_ready=0 suspend_modem_uart=0
I (1836) AudioService: WakeWord isolate: TWDT 60s (no idle monitor) for multinet load
I (1846) AudioService: WakeWord isolate: keep modem UART tasks running (avoid 4G RX stall during preload)
I (1866) AudioService: WakeWord isolate: 500ms settle after suspending CPU1 peers
W (2366) CustomWakeWord: [HEAP-DIAG] ww_before_model_init integrity=SKIP free_heap=8428924
I (2366) CustomWakeWord: [WW-PSRAM] before esp_srmodel_init (local SR models from flash): spiram total=8388608 free=8386272 largest_block=8257536 | internal_free=74683
I (2376) MODEL_LOADER: The storage free size is 22272 KB
I (2376) MODEL_LOADER: The partition size is 960 KB
I (2386) MODEL_LOADER: Successfully load srmodels
E (2386) CustomWakeWord: Failed to initialize multinet, mn_name is nullptr
I (2396) CustomWakeWord: Please refer to https://pcn7cs20v8cr.feishu.cn/wiki/CpQ ... vrcxcbVnwh to add custom wake word
E (2406) AudioService: Should not be here, bits: 0
I (2406) AudioService: WakeWord isolate: TWDT restored (10s, no idle monitor)
W (2406) AudioService: Audio input task stopped
E (2416) AudioService: Wake word fault latched, further init attempts disabled
E (2426) AudioService: [WW-STATE] ww_init failed, fault latched
W (2436) RF24Bridge: [RF-SPI-RECOVER] resumed by external guard
W (2436) AudioService: [WW-STATE] resume RF24 RX + SPI recover after ww_init
I (3626) AtUart: DetectBaudRate: start probe rounds=3, attempts/baud=2
I (3626) AtUart: Detecting baud rate... (round 1/3)
I (6486) AtUart: break
I (7166) AtUart: Detected baud rate: 921600 (round 1 attempt 1)
I (7166) AtModem: Detected modem: ML307C-DL-CN-MBRH0S00
I (7186) AtModem: Waiting for network ready...
I (7766) Ml307Board: Network is ready (device_state=1)
I (7766) Ml307Board: Network ready on cold start, skip duplicate ReInitializeProtocol
I (7766) Ml307AtModem: PDP Context 1 IP: 10.181.9.15
I (7786) Ml307Board: ML307 Revision: ML307C-DL-CN-MBRH0S00
I (7786) Ml307Board: ML307 IMEI: 868381076224117
I (7786) Ml307Board: ML307 ICCID: 898604F50624D0036187
W (7796) Application: System time invalid (7), starting SNTP sync (max wait 0ms)
I (7796) Application: SNTP started; background sync only (no wait)
I (7806) MCP: Add tool: self.device.get_device_status
I (7806) MCP: Add tool: self.audio_speaker.set_volume
I (7816) MCP: Add tool: self.pm.set_sleepstatus
I (7816) MCP: Add tool: self.mode.set_recordingmode
I (7816) MCP: Add tool: self.device.get_device_version
I (7826) MCP: Add tool: self.device.get_device_id
I (7826) MCP: Add tool: self.network.get_quality
I (7836) MCP: Add tool: self.device.switch_network
I (7836) MCP: Add tool: self.mode.select_server
W (7846) Settings: [NVS] nvs_open(ns=mqtt rw=0) failed: ESP_ERR_NVS_NOT_FOUND
W (7846) Settings: [NVS] nvs_open(ns=websocket rw=0) failed: ESP_ERR_NVS_NOT_FOUND
W (7856) Application: [BOOTSTRAP] no cached endpoint; survival-first: OTA deferred 5000ms (HTTPS off critical path)
W (7866) Application: [PROTO-WDT] relax TWDT to 120s for ReInitializeProtocol
W (7876) Settings: [NVS] nvs_open(ns=mqtt rw=0) failed: ESP_ERR_NVS_NOT_FOUND
W (7886) Settings: [NVS] nvs_open(ns=websocket rw=0) failed: ESP_ERR_NVS_NOT_FOUND
W (7886) Application: No protocol specified in the OTA config, using MQTT
W (7896) Settings: [NVS] nvs_open(ns=mqtt rw=0) failed: ESP_ERR_NVS_NOT_FOUND
W (7906) MQTT: MQTT endpoint is not specified
I (7906) Application: [PROTO-WDT] restore TWDT to 10s
W (7906) Application: [BOOT-PROBE] defer RF24 RX start to OnAudioChannelOpened (post-ready, conditional)
W (7916) Application: [BOOT-PROBE] SetDeviceState(Idle) enter
I (7926) Application: STATE: starting -> idle
I (7926) Application: [RF24-LISTEN-GATE] close: state=idle, suspend RX + disable RF24 uplink
I (7936) Application: 启动Idle模式中...
I (7946) AudioService: Disabling voice processing
W (7946) Application: [BOOT-PROBE] SetDeviceState(Idle) exit dt=26ms
I (7956) Ota: Activation-Version:1
I (7956) Ota: Device-Id:a4:cb:8f:df:fd:a8
I (7956) Ota: Client-Id:948f6ddf-9680-43af-a117-6a7fb601516a
I (7966) Ota: User-Agent:hibiki_card_wifi/1.9.5.2
I (7966) SystemInfo: free sram: 101399 minimal sram: 74363
I (7976) SystemInfo: network quality: 4G csq=19 carrier=CHINA MOBILE
I (7976) Application: [RF24] post-boot: Rf24UplinkService + multiplex + audio_source hooks (SPI/RX 仍由 OnAudioChannelOpened bringup)
ESP-ROM:esp32s3-20210327
Build:Mar 27 2021
rst:0x7 (TG0WDT_SYS_RST),boot:0x1b (SPI_FAST_FLASH_BOOT)
Saved PC:0x40379a0b
SPIWP:0xee
mode:DIO, clock div:1
load:0x3fce2820,len:0x548
load:0x403c8700,len:0xc3c
load:0x403cb700,len:0x2e70
entry 0x403c8908
I (40) octal_psram: vendor id : 0x0d (AP)
I (40) octal_psram: dev id : 0x02 (generation 3)
I (40) octal_psram: density : 0x03 (64 Mbit)
I (42) octal_psram: good-die : 0x01 (Pass)
I (46) octal_psram: Latency : 0x01 (Fixed)
I (51) octal_psram: VCC : 0x01 (3V)
I (55) octal_psram: SRF : 0x01 (Fast Refresh)
I (59) octal_psram: BurstType : 0x01 (Hybrid Wrap)
I (64) octal_psram: BurstLen : 0x01 (32 Byte)
I (69) octal_psram: Readlatency : 0x02 (10 cycles@Fixed)
I (74) octal_psram: DriveStrength: 0x00 (1/1)
I (78) esp_psram: Found 8MB PSRAM device
I (81) esp_psram: Speed: 40MHz
I (84) cpu_start: Multicore app
I (610) esp_psram: SPI SRAM memory test OK
I (618) cpu_start: Pro cpu start user code
I (619) cpu_start: cpu freq: 240000000 Hz
I (619) app_init: Application information:
I (619) app_init: Project name: xiaotian
I (623) app_init: App version: 1.9.5.2
I (627) app_init: Compile time: May 8 2026 16:40:46
I (632) app_init: ELF file SHA256: e280de576...
I (636) app_init: ESP-IDF: v5.5.1-dirty
I (640) efuse_init: Min chip rev: v0.0
I (644) efuse_init: Max chip rev: v0.99
I (648) efuse_init: Chip rev: v0.2
I (652) heap_init: Initializing. RAM available for dynamic allocation:
I (658) heap_init: At 3FCB4C80 len 00034A90 (210 KiB): RAM
I (663) heap_init: At 3FCE9710 len 00005724 (21 KiB): RAM
I (668) heap_init: At 600FE060 len 00001F78 (7 KiB): RTCRAM
I (674) esp_psram: Adding pool of 8192K of PSRAM memory to heap allocator
I (681) spi_flash: detected chip: winbond
I (684) spi_flash: flash io: qio
I (688) sleep_gpio: Configure to isolate all GPIO pins in sleep state
I (693) sleep_gpio: Enable automatic switching of GPIO sleep configuration
I (700) main_task: Started on CPU0
I (730) esp_psram: Reserving pool of 32K of internal memory for DMA/internal allocations
I (730) main_task: Calling app_main()
I (730) main: PSRAM heap (MALLOC_CAP_SPIRAM): total=8388608 free=8386308
I (740) main: esp_reset_reason() raw=6
I (740) main: 上次复位原因: 6 (TASK_WDT)
I (750) main: [NVS] nvs_flash_init OK (ESP_OK)
I (750) main: 常规模式启动。
I (750) Board: UUID=948f6ddf-9680-43af-a117-6a7fb601516a SKU=hibiki_card_wifi
I (760) DualNetworkBoard: Initialize ML307 board
I (760) Board: UUID=948f6ddf-9680-43af-a117-6a7fb601516a SKU=hibiki_card_wifi
I (770) button: IoT Button Version: 4.1.6
I (770) HibikiWiFiBoard: [init] HibikiWiFiBoard ctor: start
I (860) HibikiWiFiBoard: [init] [order ①] I2C bus (i2c_new_master_bus once per port; legacy Wire 仅一次/端口)
I (860) HibikiWiFiBoard: [init] InitializeI2c_ArduinoStyle start (宽松:无 bus idle / 无「必须双高」门槛)
I (860) HibikiWiFiBoard: [init] Arduino-style pre-delay 75 ms (power rails / bus settle)
I (940) HibikiWiFiBoard: [i2c-bus] before wire-prep: SDA(GPIO1)=1 SCL(GPIO2)=1 → 双线高(电气空闲,非必需)
I (940) HibikiWiFiBoard: [i2c-wire-prep] skip i2c_driver_delete (HIBIKI_WIFI_I2C_PREP_CALL_LEGACY_DRIVER_DELETE=0)
I (950) HibikiWiFiBoard: [i2c-wire-prep] skip GPIO OD recover (HIBIKI_WIFI_I2C_PREP_GPIO_OD_RECOVER=0)
I (950) HibikiWiFiBoard: [init] skip legacy Wire simulate (HIBIKI_WIFI_I2C_LEGACY_WIRE_SIMULATE=0)
I (960) HibikiWiFiBoard: [i2c-bus] after wire-prep: SDA(GPIO1)=1 SCL(GPIO2)=1 → 双线高(电气空闲,非�
Attachments
WechatIMG1428.jpeg
主控引脚
WechatIMG1428.jpeg (284.02 KiB) Viewed 66 times

Carl-Ge1234
Posts: 6
Joined: Fri May 08, 2026 8:39 am

Re: 求助:esp32s3r8中,我的系统会无缘无故宕机

Postby Carl-Ge1234 » Sat May 09, 2026 3:03 am

🔧 问题描述
当在 sdkconfig 中启用 PSRAM(CONFIG_SPIRAM=y)后,系统在启动过程中初始化某些外设时会频繁崩溃,触发看门狗并不断重启。受影响的外设包括:
* SD 卡(通过 SDMMC 或 SPI 模式访问)
* 从外部 Flash 读取大文件
* LCD 显示屏驱动(通过 SPI 接口)
值得注意的是:在关闭 PSRAM 的情况下,上述所有外设均可单独或协同正常工作;而一旦开启 PSRAM,即使只初始化其中一个外设(如仅挂载 SD 卡),也会在首次 I/O 操作(如 sdmmc_card_init()、f_open() 或 LCD 寄存器写入)时发生死机。
🖥️ 硬件环境
* 主控芯片:ESP32-S3R8(内置 8 MB Octal PSRAM)
* PCB 设计:完全自定义设计(非官方开发板)
* 电源:外部 5V/2A 稳压电源,各关键芯片附近均配置了去耦电容
⚙️ 引脚分配(关键接口)
功能 使用的引脚 / 信号
Octal PSRAM 专用 Octal SPI 接口(默认引脚:SPICLK, SPICS0, SPIQ, SPID, SPIHD, SPIWP)
SD 卡 使用 SDMMC 接口:
MTCK (CMD)、MTDO (D0)、MTDI (CLK),
同时将 GPIO45 也连接到 TF_CLK —— 可能存在冲突
SPI 外设(LCD/nRF24) 共用 SPI 总线:
SPICLK、SPICS0(LCD 片选)、SPIQ (MOSI)、SPID (MISO)
nRF24L01 GPIO5 (CS)、GPIO6 (SCK)、GPIO7 (MOSI)、GPIO8 (MISO)
其他 I²C(GPIO1/2)、I²S(GPIO12–14, 38)、DVP 摄像头(GPIO3,4,17–21 等)
⚠️ 关键疑点:
SD 卡的时钟信号 TF_CLK 被同时连接到 MTDI 和 GPIO45,这可能违反了 ESP32-S3 的引脚复用规则,导致未定义行为。
📦 软件环境
* ESP-IDF 版本:v5.5.1(官方正式版)
* PSRAM 配置:Octal 模式,80 MHz(ESP32-S3R8 默认)
* 编译选项:GCC,优化等级 -Os
* 看门狗:任务看门狗(Task Watchdog)已启用(默认)
🧪 已尝试的排查措施
1. 确认 PSRAM 被正确识别:esp_spiram_get_size() 返回 8 MB。
2. 单独测试每个外设 + PSRAM 开启 → 均在初始化或首次 I/O 时崩溃。
3. 关闭 PSRAM → 所有外设稳定运行,无异常。
4. 降低 SPI 时钟频率(LCD/nRF24 降至 1 MHz)→ 问题依旧。
5. 使用示波器监测电源轨 → 崩溃瞬间无明显电压跌落。
6. 检查 strapping 引脚使用情况:GPIO0、GPIO45、GPIO46 虽被使用,但启动后配置合理。
❓ 具体技术疑问
1. SPI 总线资源冲突:Octal PSRAM、LCD 和 SD 卡(若误接至 SPI)是否因共享内部总线或 DMA 资源,在 PSRAM 启用时引发仲裁死锁?
2. IDF 已知问题:ESP-IDF v5.5.1 是否存在与 PSRAM + 外部 Flash/SD 卡并发访问 相关的缓存一致性或 DMA 问题?
3. 引脚配置合法性:将 TF_CLK 同时连接到 MTDI 和 GPIO45 是否违反 ESP32-S3 的 pinmux 规则?是否会导致内部信号冲突?

Who is online

Users browsing this forum: No registered users and 2 guests