idf-extra-components icon indicating copy to clipboard operation
idf-extra-components copied to clipboard

spi_nand_flash 长时间运行报错 (IEC-359)

Open logicDance-mcu opened this issue 4 months ago • 1 comments

Answers checklist.

  • [x] I have read the component documentation ESP-IDF Components and the issue is not addressed there.
  • [x] I am using target and esp-idf version as defined in component's idf_component.yml
  • [x] I have searched the issue tracker for a similar issue and not found any related issue.

Which component are you using? If you choose Other, provide details in More Information.

argtable3

ESP-IDF version.

v5.4.0

Development Kit.

ESP32-P4

Used Component version.

V0.11.0

More Information.

assert failed: nand_read nand_impl.c:248 (page < handle->chip.num_blocks * (1 << handle->chip.log2_ppb)) --- Stack dump detected Core 0 register dump: MEPC : 0x4ff00cb0 RA : 0x4ff130c6 SP : 0x485d3270 GP : 0x4ff1e680
--- 0x4ff00cb0: panic_abort at /Users/logicdance/esp/esp-idf/components/esp_system/panic.c:482 --- 0x4ff130c6: flash_read at /Users/logicdance/esp/esp-idf/components/esp_system/port/image_process.c:77

TP : 0x485d3790 T0 : 0x37363534 T1 : 0x7271706f T2 : 0x33323130
S0/FP : 0x00000001 S1 : 0x485d33f8 A0 : 0x485d32c8 A1 : 0x4ff23589
A2 : 0x00000001 A3 : 0x00000029 A4 : 0x00000001 A5 : 0x4ff29000
A6 : 0x0000000c A7 : 0x76757473 S2 : 0x0000005f S3 : 0x485d32c8
S4 : 0x485d32c8 S5 : 0x485d34cc S6 : 0x485d347c S7 : 0x0000004a
S8 : 0xffffffff S9 : 0x00000020 S10 : 0x80000000 S11 : 0x485d3620
T3 : 0x6e6d6c6b T4 : 0x6a696867 T5 : 0x66656463 T6 : 0x62613938
MSTATUS : 0x00011880 MTVEC : 0x4ff00003 MCAUSE : 0x00000002 MTVAL : 0x00000000
--- 0x4ff00003: _vector_table at ??:?

MHARTID : 0x00000000

--- Backtrace:

panic_abort (details=details@entry=0x485d32c8 "assert failed: nand_read nand_impl.c:248 (page < handle->chip.num_blocks * (1 << handle->chip.log2_ppb))") at /Users/logicdance/esp/esp-idf/components/esp_system/panic.c:482 482 asm("unimp"); // should be an invalid operation on RISC-V targets #0 panic_abort (details=details@entry=0x485d32c8 "assert failed: nand_read nand_impl.c:248 (page < handle->chip.num_blocks * (1 << handle->chip.log2_ppb))") at /Users/logicdance/esp/esp-idf/components/esp_system/panic.c:482 #1 0x4ff130c6 in esp_system_abort (details=details@entry=0x485d32c8 "assert failed: nand_read nand_impl.c:248 (page < handle->chip.num_blocks * (1 << handle->chip.log2_ppb))") at /Users/logicdance/esp/esp-idf/components/esp_system/port/esp_system_chip.c:87 #2 0x4ff1cbe4 in __assert_func (file=, file@entry=0x4822a894 "", line=line@entry=248, func=, func@entry=0x48263fec <func.5> "", expr=, expr@entry=0x4822a828 "") at /Users/logicdance/esp/esp-idf/components/newlib/assert.c:80 #3 0x4802f646 in nand_read (handle=handle@entry=0x482c4904, page=, offset=, length=, data=0x485d33fc "Kh") at /Users/logicdance/Documents/Z2/Z2_CODE/components/espressif__spi_nand_flash/src/nand_impl.c:248 #4 0x4802e940 in dhara_nand_read (n=, p=, offset=, length=, data=, err=0x485d34c8) at /Users/logicdance/Documents/Z2/Z2_CODE/components/espressif__spi_nand_flash/src/dhara_glue.c:230 #5 0x48152d22 in dhara_journal_read_meta (j=j@entry=0x482c5a0c, p=p@entry=771764547, buf=buf@entry=0x485d33fc "Kh", err=err@entry=0x485d34c8) at /Users/logicdance/Documents/Z2/Z2_CODE/managed_components/espressif__dhara/dhara/dhara/journal.c:529 #6 0x48151d8a in trace_path (m=0x482c5a0c, target=74, loc=loc@entry=0x485d34cc, new_meta=new_meta@entry=0x0, err=err@entry=0x485d34c8) at /Users/logicdance/Documents/Z2/Z2_CODE/managed_components/espressif__dhara/dhara/dhara/map.c:155 #7 0x481520a4 in dhara_map_find (m=, target=, loc=loc@entry=0x485d34cc, err=err@entry=0x485d34c8) at /Users/logicdance/Documents/Z2/Z2_CODE/managed_components/espressif__dhara/dhara/dhara/map.c:185 #8 0x481520b8 in dhara_map_read (m=, s=, data=0x482c5200 "", err=err@entry=0x485d34ec) at /Users/logicdance/Documents/Z2/Z2_CODE/managed_components/espressif__dhara/dhara/dhara/map.c:195 #9 0x4802e858 in dhara_read (handle=0x482c4904, buffer=0x482c635c "", sector_id=) at /Users/logicdance/Documents/Z2/Z2_CODE/components/espressif__spi_nand_flash/src/dhara_glue.c:61 #10 0x4802e5d6 in spi_nand_flash_read_sector (handle=handle@entry=0x482c4904, buffer=0x482c635c "", sector_id=sector_id@entry=74) at /Users/logicdance/Documents/Z2/Z2_CODE/components/espressif__spi_nand_flash/src/nand.c:234 #11 0x480300de in ff_nand_read (pdrv=, buff=0x482c635c "", sector=74, count=1) at /Users/logicdance/Documents/Z2/Z2_CODE/components/espressif__spi_nand_flash/diskio/diskio_nand.c:42 #12 0x4814cd46 in move_window (fs=0x482c6324, sect=74) at /Users/logicdance/esp/esp-idf/components/fatfs/src/ff.c:1095 #13 move_window (fs=0x482c6324, sect=74) at /Users/logicdance/esp/esp-idf/components/fatfs/src/ff.c:1082 #14 0x4814db5a in dir_find (dp=dp@entry=0x485d3620) at /Users/logicdance/esp/esp-idf/components/fatfs/src/ff.c:2427 #15 0x4814e01a in follow_path (dp=dp@entry=0x485d3620, path=0x482c7380 "") at /Users/logicdance/esp/esp-idf/components/fatfs/src/ff.c:3100 #16 0x4814e43e in f_open (fp=0x482c8584, path=, mode=1 '\001') at /Users/logicdance/esp/esp-idf/components/fatfs/src/ff.c:3755 #17 0x00000000 in ?? () Backtrace stopped: frame did not save the PC

报错信息如上,请问如何修复,系统在运行不定时间的时候会卡死报错

logicDance-mcu avatar Aug 30 '25 06:08 logicDance-mcu

Hello @logicDance-mcu , thank you for reporting the issue. Could you please share a few more details? Specifically, which NAND flash are you using, what SPI frequency and mode (SIO, DIO, etc.) you configured, and how the NAND flash is connected to your ESP32-P4? If possible, please also provide a photograph of your setup and the schematics.

RathiSonika avatar Sep 09 '25 09:09 RathiSonika