Skip to content

LittleFS Flash operation fail when enable 80MHz PSRAM on ESP32S3 #87938

Open
@phb98

Description

@phb98

Describe the bug
Running LittleFS Sample. When enable those config to enable 80mhz psram on ESP32S3 N16R8

CONFIG_ESP_SPIRAM=y
CONFIG_SPIRAM_TYPE_ESPPSRAM64=y
CONFIG_SPIRAM_MODE_OCT=y
CONFIG_SPIRAM_SPEED_80M=y

The example will fail to mount file system
Disable CONFIG_SPIRAM_SPEED_80M and the sample runs succesfully again

To Reproduce
-Enable and set PSRAM size to 8M in Devicetree
-Build LittleFS example with above configs and run.

Expected behavior
-Example runs successfully with 80mhz psram
Impact

Logs and console output

This is the log of fail run

ESP-ROM:esp32s3-20210327
Build:Mar 27 2021
rst:0x1 (POWERON),boot:0x8 (SPI_FAST_FLASH_BOOT)
SPIWP:0xee
mode:DIO, clock div:1
load:0x3fc90b30,len:0x26d8
load:0x40374000,len:0xcb20
SHA-256 comparison failed:
Calculated: 47b3c6355d41ad601982855281840f16343639a1f8a1fc0664f09a46dbbd3ceb
Expected: 00000000c00d0000000000000000000000000000000000000000000000000000
Attempting to boot anyway...
entry 0x40379358
I (65) soc_init: ESP Simple boot
I (65) soc_init: compile time Apr  1 2025 10:09:10
W (65) soc_init: Unicore bootloader
I (66) soc_init: chip revision: v0.2
I (68) flash_init: Boot SPI Speed : 80MHz
I (72) flash_init: SPI Mode       : DIO
I (75) flash_init: SPI Flash Size : 8MB
I (79) boot: DRAM: lma 0x00000020 vma 0x3fc90b30 len 0x26d8   (9944)
I (85) boot: IRAM: lma 0x00002700 vma 0x40374000 len 0xcb20   (52000)
I (91) boot: IRAM: lma 0x0000f238 vma 0x00000000 len 0xdc0    (3520)
I (97) boot: IMAP: lma 0x00010000 vma 0x42000000 len 0xa790   (42896)
I (103) boot: IRAM: lma 0x0001a798 vma 0x00000000 len 0x5860   (22624)
I (109) boot: DMAP: lma 0x00020000 vma 0x3c010000 len 0x21c0   (8640)
I (116) boot: Image with 6 segments
I (119) boot: IROM segment: paddr=00010000h, vaddr=42000000h, size=0A78Eh ( 42894) map
I (126) boot: DROM segment: paddr=00020000h, vaddr=3c010000h, size=021C0h (  8640) map
I (145) boot: libc heap size 330 kB.
I (146) spi_flash: detected chip: gd
I (146) spi_flash: flash io: dio
W (146) spi_flash: Detected size(16384k) larger than the size in the binary image header(8192k). Using the size in the binary image header.
I (156) octal_psram: vendor id    : 0x0d (AP)
I (160) octal_psram: dev id       : 0x02 (generation 3)
I (165) octal_psram: density      : 0x03 (64 Mbit)
I (169) octal_psram: good-die     : 0x01 (Pass)
I (174) octal_psram: Latency      : 0x01 (Fixed)
I (178) octal_psram: VCC          : 0x01 (3V)
I (182) octal_psram: SRF          : 0x01 (Fast Refresh)
I (187) octal_psram: BurstType    : 0x01 (Hybrid Wrap)
I (192) octal_psram: BurstLen     : 0x01 (32 Byte)
I (196) octal_psram: Readlatency  : 0x02 (10 cycles@Fixed)
I (202) octal_psram: DriveStrength: 0x00 (1/1)
I (206) MSPI Timing: PSRAM timing tuning index: 5
I (210) esp_psram: Found 8MB PSRAM device
I (214) esp_psram: Speed: 80MHz
I (669) esp_psram: SPI SRAM memory test OK
*** Booting Zephyr OS build v4.1.0-1515-g012f90c666fc ***
Sample program to r/w files on littlefs
Area 7 at 0x3b0000 on flash-controller@60002000 for 196608 bytes
I: LittleFS version 2.10, disk version 2.1
I: FS at flash-controller@60002000:0x3b0000 is 48 0x1000-byte blocks with 512 cycle
I: partition sizes: rd 16 ; pr 16 ; ca 64 ; la 32
E: WEST_TOPDIR/deps/modules/fs/littlefs/lfs.c:1389: Corrupted dir pair at {0x1, 0x0}
W: can't mount (LFS -84); formatting
E: Flash erase error: 261
E: format failed (LFS -5)
E: fs mount error (-5)
FAIL: mount id 7 at /lfs: -5

Environment (please complete the following information):

ESP32S3 n16r8 build as esp32s3_devkitc board with modifed psram node.
Zephyr v4.1
Additional context

Metadata

Metadata

Assignees

Labels

bugThe issue is a bug, or the PR is fixing a bugplatform: ESP32Espressif ESP32priority: lowLow impact/importance bug

Type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions