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

Support for 32MB version of ESP32S3 Module is missing (IDFGH-6736) #8365

Closed
ganhailin opened this issue Feb 9, 2022 · 23 comments
Closed

Support for 32MB version of ESP32S3 Module is missing (IDFGH-6736) #8365

ganhailin opened this issue Feb 9, 2022 · 23 comments
Assignees
Labels
Awaiting Response awaiting a response from the author Resolution: Done Issue is done internally Status: Done Issue is done internally

Comments

@ganhailin
Copy link

Environment

  • Development Kit: ESP32-S3-DevKitC
  • Kit version (for WroverKit/PicoKit/DevKitC): V1
  • Module or chip used: ESP32-S3-WROOM-2 (N32R8V)
  • IDF version (run git describe --tags to find it):
    v5.0-dev-1429
  • Build System: CMake
  • Compiler version (run xtensa-esp32-elf-gcc --version to find it):
    xtensa-esp32s3-elf-gcc (crosstool-NG esp-2021r2) 8.4.0
  • Operating System: Linux
  • Using an IDE?: Yes, Clion with IDF_TARGET=esp32s3 set and export.sh as env script
  • Power Supply: USB

Problem Description

1.options in menuconfig does not contains 32Mbyte
2.esptool is unable to flash upper 16Mbit of flash (either with --no-stub or not),
  erasing or writing above 0x1000000 with --no-stub will warp to 0x00000000 then bootloader will overwride
  writing with stub will resault a error ,showing "opi_flash.c 363" at uart port.
  try to patch stub with ER4B cmd in the flash datasheet
https://www.macronix.com/Lists/Datasheet/Attachments/7693/MX25UM25645G,%201.8V,%20256Mb,%20v1.1.pdf
 and set addr_len to 32bit will do the same thing as --no-stub,
  it seems like the high 8bit addr is never sent out or sent zero
3.partition size can't be bigger than 16M
4.bootloader is not correctly parsing 32M flash or switch flash to opi_dtr mode
5.spi-flash api works fine, including erasing writing,even mount fatfs ,I don't under stand why stub can't behave as normal.
6.mmap to Data MMU can't be more than 16M
  Cache_Get_DROM_MMU_End() always returned 0x00000400,so map can't be more than 0x00000400/4×64K=16M,
  hardcoded Cache_Get_DROM_MMU_End() to Cache_Get_DROM_MMU_End()+128*4 works for me(not 256 to save last 8M for PSRAM)

Expected Behavior

all above works as it should be

Actual Behavior

see Problem Description

Steps to reproduce

  1. just run menuconfig
  2. esptool.py -c esp32s3 -p /dev/ttyUSB0 -b 2000000 --before=default_reset --after=hard_reset write_flash --no-compress --flash_mode dout --flash_freq 80m --flash_size 32MB 0x1000000 something.bin
     then you will find header be overrided
  3. add an partittion larger than 0x1000000 in partittion.csv and build
  4. just boot up and see the uart output shows you have a 2MB Flash
  5. with parttion in latter 16M of flash and format &mount as fatfs ,or just perform a partition read/write/erase,all work as it should be
  6. try to map an 16Mbyte partition and will return NO_MEM because get_mmu_region never gave you more than 256 mmu entry

Debug Logs

I already patch a lot at my idf clone ...so it looks likes below

ESP-ROM:esp32s3-20210327
Build:Mar 27 2021
rst:0x1 (POWERON),boot:0x18 (SPI_FAST_FLASH_BOOT)
SPIWP:0xee
Octal Flash Mode Enabled
For OPI Flash, Use Default Flash Boot Mode
mode:SLOW_RD, clock div:1
load:0x3fcd0108,len:0x21b8
load:0x403b6000,len:0xd50
load:0x403ba000,len:0x3498
entry 0x403b6298
I (36) boot: ESP-IDF v5.0-dev-1429-ga10d9abba0-dirty 2nd stage bootloader
I (36) boot: compile time 05:01:58
D (36) bootloader_flash: non-XMC chip detected by SFDP Read (87), skip.
D (43) bootloader_flash: mmu set block paddr=0x00000000 (was 0xffffffff)
I (49) boot: chip revision: 0
I (53) boot.esp32s3: magic e9
I (57) boot.esp32s3: segments 03
I (61) boot.esp32s3: spi_mode 03
I (65) boot.esp32s3: spi_speed 0f
I (69) boot.esp32s3: spi_size 05
I (72) boot.esp32s3: Boot SPI Speed : 80MHz
I (77) boot.esp32s3: SPI Mode       : SLOW READ
I (83) boot.esp32s3: SPI Mode  (reg): 0x002c0008
I (88) boot.esp32s3: SPI Flash Size : 32MB
D (93) boot: Enabling RTCWDT(9000 ms)
I (96) boot: Enabling RNG early entropy source...
D (102) bootloader_flash: mmu set paddr=00000000 count=1 size=c00 src_addr=8000 src_addr_aligned=0
D (111) boot: mapped partition table 0x8000 at 0x3c008000
D (116) flash_parts: partition table verified, 5 entries
I (122) boot: Partition Table:
I (125) boot: ## Label            Usage          Type ST Offset   Length
D (133) boot: load partition table entry 0x3c008000
D (138) boot: type=1 subtype=2
I (141) boot:  0 nvs              WiFi data        01 02 00009000 00006000
D (148) boot: load partition table entry 0x3c008020
D (153) boot: type=1 subtype=1
I (156) boot:  1 phy_init         RF data          01 01 0000f000 00001000
D (164) boot: load partition table entry 0x3c008040
D (169) boot: type=0 subtype=0
I (172) boot:  2 factory          factory app      00 00 00010000 00100000
D (180) boot: load partition table entry 0x3c008060
D (185) boot: type=1 subtype=81
I (188) boot:  3 storage          Unknown data     01 81 01000000 01000000
I (195) boot: End of partition table
D (200) boot: Trying partition index -1 offs 0x10000 size 0x100000
D (206) esp_image: reading image header @ 0x10000
D (211) bootloader_flash: mmu set block paddr=0x00010000 (was 0xffffffff)
D (217) esp_image: image header: 0xe9 0x07 0x03 0x05 4037993c
V (223) esp_image: loading segment header 0 at offset 0x10018
V (229) esp_image: segment data length 0x17f00 data starts 0x10020
V (235) esp_image: segment 0 map_segment 1 segment_data_offs 0x10020 load_addr 0x3c080020
I (244) esp_image: segment 0: paddr=00010020 vaddr=3c080020 size=17f00h ( 98048) map
D (252) esp_image: free data page_count 0x0000003f
D (257) bootloader_flash: mmu set paddr=00010000 count=2 size=17f00 src_addr=10020 src_addr_aligned=10000
V (290) esp_image: loading segment header 1 at offset 0x27f20
D (290) bootloader_flash: mmu set block paddr=0x00020000 (was 0xffffffff)
V (291) esp_image: segment data length 0x46ac data starts 0x27f28
V (297) esp_image: segment 1 map_segment 0 segment_data_offs 0x27f28 load_addr 0x3fc9d6e0
I (306) esp_image: segment 1: paddr=00027f28 vaddr=3fc9d6e0 size=046ach ( 18092) load
D (314) esp_image: free data page_count 0x0000003f
D (319) bootloader_flash: mmu set paddr=00020000 count=1 size=46ac src_addr=27f28 src_addr_aligned=20000
V (333) esp_image: loading segment header 2 at offset 0x2c5d4
D (334) bootloader_flash: mmu set block paddr=0x00020000 (was 0xffffffff)
V (341) esp_image: segment data length 0x3a3c data starts 0x2c5dc
V (347) esp_image: segment 2 map_segment 0 segment_data_offs 0x2c5dc load_addr 0x40378000
I (356) esp_image: segment 2: paddr=0002c5dc vaddr=40378000 size=03a3ch ( 14908) load
D (364) esp_image: free data page_count 0x0000003f
D (369) bootloader_flash: mmu set paddr=00020000 count=2 size=3a3c src_addr=2c5dc src_addr_aligned=20000
V (383) esp_image: loading segment header 3 at offset 0x30018
D (384) bootloader_flash: mmu set block paddr=0x00030000 (was 0xffffffff)
V (391) esp_image: segment data length 0x7cd3c data starts 0x30020
V (398) esp_image: segment 3 map_segment 1 segment_data_offs 0x30020 load_addr 0x42000020
I (406) esp_image: segment 3: paddr=00030020 vaddr=42000020 size=7cd3ch (511292) map
D (414) esp_image: free data page_count 0x0000003f
D (419) bootloader_flash: mmu set paddr=00030000 count=8 size=7cd3c src_addr=30020 src_addr_aligned=30000
V (550) esp_image: loading segment header 4 at offset 0xacd5c
D (550) bootloader_flash: mmu set block paddr=0x000a0000 (was 0xffffffff)
V (552) esp_image: segment data length 0x11c9c data starts 0xacd64
V (558) esp_image: segment 4 map_segment 0 segment_data_offs 0xacd64 load_addr 0x4037ba3c
I (566) esp_image: segment 4: paddr=000acd64 vaddr=4037ba3c size=11c9ch ( 72860) load
D (575) esp_image: free data page_count 0x0000003f
D (579) bootloader_flash: mmu set paddr=000a0000 count=2 size=11c9c src_addr=acd64 src_addr_aligned=a0000
V (609) esp_image: loading segment header 5 at offset 0xbea00
D (609) bootloader_flash: mmu set block paddr=0x000b0000 (was 0xffffffff)
V (611) esp_image: segment data length 0x10 data starts 0xbea08
V (617) esp_image: segment 5 map_segment 0 segment_data_offs 0xbea08 load_addr 0x50000000
I (625) esp_image: segment 5: paddr=000bea08 vaddr=50000000 size=00010h (    16) load
D (633) esp_image: free data page_count 0x0000003f
D (638) bootloader_flash: mmu set paddr=000b0000 count=1 size=10 src_addr=bea08 src_addr_aligned=b0000
V (648) esp_image: loading segment header 6 at offset 0xbea18
D (654) bootloader_flash: mmu set block paddr=0x000b0000 (was 0xffffffff)
V (660) esp_image: segment data length 0x28 data starts 0xbea20
V (666) esp_image: segment 6 map_segment 0 segment_data_offs 0xbea20 load_addr 0x600fe000
I (675) esp_image: segment 6: paddr=000bea20 vaddr=600fe000 size=00028h (    40) load
D (683) esp_image: free data page_count 0x0000003f
D (688) bootloader_flash: mmu set paddr=000b0000 count=1 size=28 src_addr=bea20 src_addr_aligned=b0000
V (697) esp_image: image start 0x00010000 end of last section 0x000bea48
D (704) bootloader_flash: mmu set block paddr=0x000b0000 (was 0xffffffff)
D (711) boot: Calculated hash: 5eac53517a2714dda6568d16dab7950b23e799570413871a181fc07ca6326ec7
I (729) boot: Loaded app from partition at offset 0x10000
I (729) boot: Disabling RNG early entropy source...
D (731) boot: Mapping segment 0 as DROM
D (735) boot: Mapping segment 3 as IROM
D (739) boot: calling set_cache_and_start_app
D (744) boot: configure drom and irom and start
V (748) boot: d mmu set paddr=00010000 vaddr=3c080000 size=98048 n=2
V (755) boot: rc=0
V (757) boot: i mmu set paddr=00030000 vaddr=42000000 size=511292 n=8
V (763) boot: rc=0
D (765) boot: start: 0x4037993c
W (780) FLASH: DO NOT USE FOR MASS PRODUCTION! Timing parameters will be updated in future IDF version.                                                                           
I (781) opi psram: vendor id    : 0x0d (AP)
I (784) opi psram: dev id       : 0x02 (generation 3)
I (789) opi psram: density      : 0x03 (64 Mbit)
I (795) opi psram: good-die     : 0x01 (Pass)
I (800) opi psram: Latency      : 0x01 (Fixed)
I (805) opi psram: VCC          : 0x00 (1.8V)
I (810) opi psram: SRF          : 0x01 (Fast Refresh)
I (816) opi psram: BurstType    : 0x01 (Hybrid Wrap)
I (821) opi psram: BurstLen     : 0x01 (32 Byte)
I (826) opi psram: Readlatency  : 0x02 (10 cycles@Fixed)
I (832) opi psram: DriveStrength: 0x00 (1/1)
W (837) PSRAM: DO NOT USE FOR MASS PRODUCTION! Timing parameters will be updated in future IDF version.                                                                           
I (848) spiram: Found 8MB SPI RAM device
I (852) spiram: Speed: 80MHz
I (856) spiram: Initialized, cache is in normal (1-core) mode.
I (862) spiram: mapping psram at 0x3d800000 size 8388608 n=128
I (869) cpu_start: Pro cpu up.
I (872) cpu_start: Starting app cpu, entry point is 0x40379890
I (0) cpu_start: App cpu up.
I (1292) spiram: SPI SRAM memory test OK
I (1301) cpu_start: Pro cpu start user code
I (1301) cpu_start: cpu freq: 240000000 Hz
I (1301) cpu_start: Application information:
I (1304) cpu_start: Project name:     iperf
I (1309) cpu_start: App version:      1
I (1313) cpu_start: Compile time:     Feb  9 2022 05:02:45
I (1320) cpu_start: ELF file SHA256:  38b3c29605f2bf56...
I (1326) cpu_start: ESP-IDF:          v5.0-dev-1429-ga10d9abba0-dirty
I (1333) heap_init: Initializing. RAM available for dynamic allocation:
I (1340) heap_init: At 3FCA59D0 len 0003A630 (233 KiB): D/IRAM
I (1347) heap_init: At 3FCE0000 len 0000EE34 (59 KiB): STACK/DRAM
I (1353) heap_init: At 3FCF0000 len 00008000 (32 KiB): DRAM
I (1360) heap_init: At 600FE028 len 00001FD8 (7 KiB): RTCRAM
I (1366) spiram: Adding pool of 8192K of external SPI memory to heap allocator
I (1374) spi_flash: detected chip: mxic (opi)
I (1379) spi_flash: flash io: opi_dtr
I (1384) sleep: Configure to isolate all GPIO pins in sleep state
I (1390) sleep: Enable automatic switching of GPIO sleep configuration
I (1398) cpu_start: Starting scheduler on PRO CPU.
I (0) cpu_start: Starting scheduler on APP CPU.
I (1413) spiram: Reserving pool of 32K of internal memory for DMA/internal allocations
I (1430) example: found partition
Erase 0 MB
Erase 1 MB
Erase 2 MB
Erase 3 MB
Erase 4 MB
Erase 5 MB
Erase 6 MB
Erase 7 MB
Erase 8 MB
Erase 9 MB
Erase 10 MB
Erase 11 MB
Erase 12 MB
Erase 13 MB
Erase 14 MB
Erase 15 MB                                                                              
writing at 0xffff00                                                                      
done                                                                                     
Cache_Get_DROM_MMU_End() returned:0x00000400                                             
E (180146) example: mmap return :0                                                       
I (180148) example: Mapped partition to data memory address 0x3c0a0000                   
reading at 0xfffc00                                                                      
done                                                                                     
I (208503) example: Data matches                                                         
I (208507) example: Unmapped partition from data memory                                  
I (208513) example: Example end                                                          
I (208516) example: Mounting FAT filesystem                                              
W (209426) vfs_fat_spiflash: f_mount failed (13)
I (209426) vfs_fat_spiflash: Formatting FATFS partition, allocation unit size=4096
I (209743) vfs_fat_spiflash: Mounting again
I (209743) example: Opening file
I (209924) example: File written
I (209924) example: Reading file
I (209925) example: Read from file: 'This is written by the device'
    const esp_partition_t *partition = esp_partition_find_first(ESP_PARTITION_TYPE_DATA, ESP_PARTITION_SUBTYPE_ANY, "storage");
    assert(partition != NULL);
    ESP_LOGI(TAG, "found partition");
//    static const char store_data[] = "ESP-IDF Partition Memory Map Example";

    // Prepare data to be read later using the mapped address
    for(int i=0;i<16;i++)
    {
        printf("Erase %d MB\n",i);
        ESP_ERROR_CHECK(esp_partition_erase_range(partition, i*1024*1024, 1024*1024));
    }
//    ESP_ERROR_CHECK(esp_partition_write(partition, 0, store_data, sizeof(store_data)));
//    ESP_LOGI(TAG, "Written sample data to partition: %s", store_data);
    int countint_0=0;
    int databuffer[64];
    for(int i=0;i<16*1024*1024;i+=4*64){
        printf("writing at %p\r",(void*)i);
        for(int j=0;j<64;j++)
        {
            databuffer[j]=(countint_0)*(countint_0)^0x5aa5a55a;
            countint_0++;
        }
        esp_partition_write(partition, i, databuffer, sizeof(int)*64);
    }
    printf("\ndone\n");

    const void *map_ptr;
    spi_flash_mmap_handle_t map_handle;

    uint32_t Cache_Get_DROM_MMU_End(void);
    printf("Cache_Get_DROM_MMU_End() returned:0x%08x\n",Cache_Get_DROM_MMU_End());
    esp_err_t ret2 = esp_partition_mmap(partition, 0, partition->size, SPI_FLASH_MMAP_DATA, &map_ptr, &map_handle);
    // Map the partition to data memory
    ESP_LOGE(TAG,"mmap return :%d",ret2);
    ESP_ERROR_CHECK(ret2);
    ESP_LOGI(TAG, "Mapped partition to data memory address %p", map_ptr);

    // Read back the written verification data using the mapped memory pointer
//    char read_data[sizeof(store_data)];
//    memcpy(read_data, map_ptr, sizeof(read_data));
//    ESP_LOGI(TAG, "Read sample data from partition using mapped memory: %s", (char*) read_data);

//    assert(strcmp(store_data, read_data) == 0);
    int countint_1=0;
    for(int i=0;i<16*1024*1024;i+=4){
        if((i%1024)==0)printf("reading at %p\r",(void*)i);
        int bytetowrite=(countint_1)*(countint_1)^0x5aa5a55a;
        countint_1++;
        if(((int*)map_ptr)[i/4]!=bytetowrite)
            break;
    }
    printf("\ndone\n");

Other items if possible

@espressif-bot espressif-bot added the Status: Opened Issue is new label Feb 9, 2022
@github-actions github-actions bot changed the title Support for 32MB version of ESP32S3 Module is missing Support for 32MB version of ESP32S3 Module is missing (IDFGH-6736) Feb 9, 2022
@ginkgm
Copy link
Collaborator

ginkgm commented Feb 9, 2022

Hi @ganhailin ,
I think the module you got is still in NPI status, we are still completing the support for those modules.
Sorry for inconvenience.

@igrr
Copy link
Member

igrr commented Feb 21, 2022

Issue 1 (lack of menuconfig options) and issue 3 (partition size can't be bigger than 16MB) have now been resolved by merging #7688.

@TGiles1998
Copy link

TGiles1998 commented Apr 5, 2022

@igrr Hi, Unfortunately I can't seem to flash the 32MB either. Im using the lastest esp-idf-v4.2.3. It just resorts back to 2MB.

(0) cpu_start: ApESP-ROM:esp32s3-20210327
Build:Mar 27 2021
rst:0x10 (RTCWDT_RTC_RST),boot:0x8 (SPI_FAST_FLASH_BOOT)
SPIWP:0xee
Octal Flash Mode Enabled
For OPI Flash, Use Default Flash Boot Mode
mode:SLOW_RD, clock div:1
load:0x3fcd0108,len:0x1648
load:0x403b6000,len:0xb7c
load:0x403ba000,len:0x2f58
entry 0x403b6248
I (33) boot: ESP-IDF v4.4 2nd stage bootloader
I (33) boot: compile time 21:04:11
I (33) boot: chip revision: 0
I (34) boot.esp32s3: Boot SPI Speed : 80MHz
I (39) boot.esp32s3: SPI Mode : SLOW READ
I (44) boot.esp32s3: SPI Flash Size : 2MB
I (49) boot: Enabling RNG early entropy source...
I (55) boot: Partition Table:
I (58) boot: ## Label Usage Type ST Offset Length
I (65) boot: 0 nvs WiFi data 01 02 00009000 00006000
I (73) boot: 1 phy_init RF data 01 01 0000f000 00001000
I (80) boot: 2 factory factory app 00 00 00010000 00100000
I (88) boot: End of partition table
I (92) esp_image: segment 0: paddr=00010020 vaddr=3c020020 size=07c40h ( 31808) map
I (108) esp_image: segment 1: paddr=00017c68 vaddr=3fc90dc0 size=02940h ( 10560) load
I (112) esp_image: segment 2: paddr=0001a5b0 vaddr=40374000 size=05a68h ( 23144) load
I (124) esp_image: segment 3: paddr=00020020 vaddr=42000020 size=17190h ( 94608) map
I (148) esp_image: segment 4: paddr=000371b8 vaddr=40379a68 size=07350h ( 29520) load
I (157) esp_image: segment 5: paddr=0003e510 vaddr=50000000 size=00010h ( 16) load
I (162) boot: Loaded app from partition at offset 0x10000
I (162) boot: Disabling RNG early entropy source...

@igrr
Copy link
Member

igrr commented Apr 5, 2022

@TGiles1998 I'm sorry, there must be some mistake. You say you are using esp-idf v4.2.3, but this SDK version has no support for esp32-s3 chip at all. Are you sure that is the version you are using? (The bootloader log says ESP-IDF v4.4 2nd stage bootloader)

Assuming you are using IDF v4.4, I think the issue is that it doesn't have support for flash sizes >16MB. This support has been added in master branch, we will backport it to release/v4.4 after the upcoming bugfix release (v4.4.1). So it will be released in v4.4.2.

@TGiles1998
Copy link

TGiles1998 commented Apr 5, 2022 via email

@igrr
Copy link
Member

igrr commented Apr 5, 2022

No problem! Please note that Github simply shows releases in the chronological order. As mentioned in the release notes of v4.2.3 (2nd paragraph):

ESP-IDF v4.2.3 is a bugfix update for ESP-IDF v4.2. At the time of writing, ESP-IDF v4.4 is the latest stable release.

@Alvin1Zhang Alvin1Zhang added the Awaiting Response awaiting a response from the author label Apr 28, 2022
@TGiles1998
Copy link

Hi @igrr @Alvin1Zhang ,

Sorry didn't realise this was still open, I've been able to access 32MB of RAM but have yet to find a solution to access 32MB of PSRAM?

Any help would be amazing thank you!

Thomas

@thyclouds
Copy link

thyclouds commented Jun 7, 2022

Hi @igrr!

We have followed work by @ESP32DE very closely and were able to get the Winbond chip recognized.

image

However trying to flash and cross the 24-bit boundry, above the 16MB and switch to 32-bit mode via SPI command like @ESP32DE did. But from what you wrote in #7670 : "there are still some things which aren't supported, like placing the app itself outside of the lower 16MB area"

image

We then tried to create separate partitions above 16MB and place files there and read:

image

But then it failed to read it:
image

In #7670 you wrote that "basic usage of 32MB and larger flash for data storage should work".

@igrr - Could you pls advise on how to access flash above the 16MB?

@AndrewCapon
Copy link

I know it's nearly been a year but is there a way of working with larger flash sizes now?

@igrr
Copy link
Member

igrr commented May 7, 2023

@AndrewCapon yes, there are a few flash models > 16MB which are supported, listed in the documentation.

If you are running into a problem, I recommend opening a new issue and providing information such as IDF version, flash model, as well as the program you are trying to run.

@AndrewCapon
Copy link

Hi @igrr

Thanks for the info, I will double check here.

Andy

@higaski
Copy link
Contributor

higaski commented Mar 17, 2024

What's the current state of >16MB flash support?

As far as I know they ROM bootloader still does not (and probably never will?) support >16MB flash. For that very reason the esptool --no-stub option does not work above 16MB either. This has the unpleasant side effect that the esp-serial-flasher library does not support >16MB at the moment.

Sorry to be so blunt, but that's pretty sad considering you've been selling those devices for like what... 3 years now?

@kylefmohr
Copy link

Sorry to be so blunt, but that's pretty sad considering you've been selling those devices for like what... 3 years now?

@higaski This is also my understanding of the situation. The 32MB version is still being sold in Espressif's official Amazon store. In their Official AliExpress store, the 32MB still shows up, but appears to be out of stock. Kinda seems like false advertising!

@igrr
Copy link
Member

igrr commented Mar 18, 2024

Hi folks,
I think all the problems described in the original issue report at the top have been fixed for a while now. There is also a list of supported flash chips linked in one of the comments above.

@higaski As for the support for larger flash sizes in the esp-serial-flasher, this is something that could be implemented by adding flasher stub support in that project.

@kylefmohr If you need to order a module with 32MB flash but can't find it in stock, please contact Espressif sales team (via the form on the website) and they will try to help you.

@higaski
Copy link
Contributor

higaski commented Mar 18, 2024

@higaski As for the support for larger flash sizes in the esp-serial-flasher, this is something that could be implemented by adding flasher stub support in that project.

Then please either appoint someone to that task or offer me some assistance in implementing it. I'd just need a couple of pointers to start from... but I'm not a python wizard and just looking at the code of esptool I couldn't even find where the stubs are.

@igrr
Copy link
Member

igrr commented Mar 18, 2024

@higaski Okay, I'll reply in that esp-serial-flasher issue.

@higaski
Copy link
Contributor

higaski commented Mar 23, 2024

Before I open another issue... Any chance that there is a known bug that app partitions can't be placed above 16MB?

Flashing the following partition table for example

# ESP-IDF Partition Table
# Name,   Type, SubType, Offset,  Size, Flags
phy_init, data, phy,     ,        4K,
storage,  data, spiffs,  ,        16320K,
nvs,      data, nvs,     ,        1M,
factory,  app,  factory, ,        4M,

results in "image has invalid magic byte" errors.

Swapping the order

# ESP-IDF Partition Table
# Name,   Type, SubType, Offset,  Size, Flags
phy_init, data, phy,     ,        4K,
factory,  app,  factory, ,        4M,
storage,  data, spiffs,  ,        16320K,
nvs,      data, nvs,     ,        1M,

there is no issue.

Tested with ESP-IDF v5.2

@ZenanLin1999
Copy link

I have the same problem when trying to upload an APP over 16MB to a ESP32-S3-N32R8 board. It's really strange to have an issue reboot over and over again. So, I googled and found this open issue. Really disappointed. Hopefully, this issue can be closed soon!

@espressif-bot espressif-bot assigned mythbuster5 and unassigned ginkgm Jan 20, 2025
@espressif-bot espressif-bot added Status: Done Issue is done internally and removed Status: Opened Issue is new labels Jan 20, 2025
@espressif-bot espressif-bot added the Resolution: Done Issue is done internally label Jan 20, 2025
@mythbuster5
Copy link
Collaborator

We don'y have official 32MB flash module, but over 16MB module is supported on idf, I will close this issue. If you have more information to update, please reopen it. Thanks!

@higaski
Copy link
Contributor

higaski commented Jan 20, 2025

We don'y have official 32MB flash module, but over 16MB module is supported on idf, I will close this issue. If you have more information to update, please reopen it. Thanks!

Huh? The ESP32-S3-WROOM-2-N32R8V is an official Espressif module with 32MB of flash memory?

@igrr
Copy link
Member

igrr commented Jan 20, 2025

ESP32-S3-WROOM-2-N32R8V is marked as EoL, but there is indeed ESP32-S3-WROOM-2-N32R16V which is in production.

@higaski
Copy link
Contributor

higaski commented Jan 20, 2025

Before I open another issue... Any chance that there is a known bug that app partitions can't be placed above 16MB?

Flashing the following partition table for example

# ESP-IDF Partition Table
# Name,   Type, SubType, Offset,  Size, Flags
phy_init, data, phy,     ,        4K,
storage,  data, spiffs,  ,        16320K,
nvs,      data, nvs,     ,        1M,
factory,  app,  factory, ,        4M,

results in "image has invalid magic byte" errors.

Swapping the order

# ESP-IDF Partition Table
# Name,   Type, SubType, Offset,  Size, Flags
phy_init, data, phy,     ,        4K,
factory,  app,  factory, ,        4M,
storage,  data, spiffs,  ,        16320K,
nvs,      data, nvs,     ,        1M,

there is no issue.

Tested with ESP-IDF v5.2

Just for reference for anyone reading this. This restriction is documented here:
https://docs.espressif.com/projects/esp-idf/en/latest/esp32/api-reference/peripherals/spi_flash/spi_flash_optional_feature.html#restrictions

It's, as always, just a matter of carefully reading (and finding) the documentation. 😄

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Awaiting Response awaiting a response from the author Resolution: Done Issue is done internally Status: Done Issue is done internally
Projects
None yet
Development

No branches or pull requests