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

Wrong Flash size detection, cannot use flash image more that 4Mb (QEMU-101) #66

Closed
listout opened this issue Feb 17, 2023 · 3 comments
Closed
Labels
Status: Done Issue is done internally

Comments

@listout
Copy link

listout commented Feb 17, 2023

This issue can be traced back to commit 0152246, specifically this line where 4MB (or gd25q32) is being hard coded as the flash_dev for some reason. Thus resulting in E (6755) spi_flash: Detected size(4096k) smaller than the size in the binary image header(8192k). Probe failed.

Currently the fix is to go into hw/xtensa/esp32.c file and edit line 688, replacing gd25q32 with gd25q64.

Full better log:

ets Jul 29 2019 12:21:46

rst:0xc (SW_CPU_RESET),boot:0x12 (SPI_FAST_FLASH_BOOT)
configsip: 0, SPIWP:0xee
clk_drv:0x00,q_drv:0x00,d_drv:0x00,cs0_drv:0x00,hd_drv:0x00,wp_drv:0x00
mode:DIO, clock div:2
load:0x3fff0030,len:6660
load:0x40078000,len:14948
load:0x40080400,len:3792
entry 0x40080694
I (6369) boot: ESP-IDF v4.4.3 2nd stage bootloader
I (6369) boot: compile time 21:54:47
I (6377) boot: chip revision: 3
I (6380) boot.esp32: SPI Speed      : 40MHz
I (6381) boot.esp32: SPI Mode       : DIO
I (6381) boot.esp32: SPI Flash Size : 8MB
I (6394) boot: Enabling RNG early entropy source...
I (6408) boot: Partition Table:
I (6408) boot: ## Label            Usage          Type ST Offset   Length
I (6409) boot:  0 nvs              WiFi data        01 02 00023000 00005000
I (6409) boot:  1 otadata          OTA data         01 00 00028000 00002000
I (6410) boot:  2 phy_init         RF data          01 01 0002a000 00001000
I (6410) boot:  3 factory          factory app      00 00 00030000 00200000
I (6411) boot:  4 ota_0            OTA app          00 10 00230000 00200000
I (6411) boot:  5 ota_1            OTA app          00 11 00430000 00200000
I (6411) boot:  6 storage          Unknown data     01 82 00630000 00100000
I (6412) boot:  7 mfg_data         WiFi data        01 02 00730000 00006000
I (6421) boot: End of partition table
I (6431) boot: Defaulting to factory image
I (6443) esp_image: segment 0: paddr=00030020 vaddr=3f400020 size=08a70h ( 35440) map
I (6473) esp_image: segment 1: paddr=00038a98 vaddr=3ffbdb60 size=03498h ( 13464) load
I (6499) esp_image: segment 2: paddr=0003bf38 vaddr=40080000 size=040e0h ( 16608) load
I (6531) esp_image: segment 3: paddr=00040020 vaddr=400d0020 size=15ac8h ( 88776) map
I (6573) esp_image: segment 4: paddr=00055af0 vaddr=400840e0 size=0893ch ( 35132) load
I (6614) esp_image: segment 5: paddr=0005e434 vaddr=50000000 size=00010h (    16) load
I (6637) boot: Loaded app from partition at offset 0x30000
I (6637) boot: Disabling RNG early entropy source...
I (6653) psram: This chip is ESP32-D0WD
I (6661) spiram: Found 16MBit SPI RAM device
I (6661) spiram: SPI RAM mode: flash 40m sram 40m
I (6661) spiram: PSRAM initialized, cache is in low/high (2-core) mode.
I (6679) cpu_start: Pro cpu up.
I (6682) cpu_start: Starting app cpu, entry point is 0x400811dc
I (6698) spiram: SPI [S0R;AM3 m2emmoryI te st (OK
1381) cpu_start: App cpu up.
I (6714) cpu_start: Pro cpu start user code
I (6714) cpu_start: cpu freq: 240000000
I (6714) cpu_start: Application information:
I (6714) cpu_start: Project name:     walk
I (6714) cpu_start: App version:      3869ec1-dirty
I (6714) cpu_start: Compile time:     Feb 16 2023 21:54:44
I (6715) cpu_start: ELF file SHA256:  cb20f5bce4aa7af8...
I (6715) cpu_start: ESP-IDF:          v4.4.3
I (6716) heap_init: Initializing. RAM available for dynamic allocation:
I (6717) heap_init: At 3FFAE6E0 len 0000F480 (61 KiB): DRAM
I (6717) heap_init: At 3FFC1A78 len 0001E588 (121 KiB): DRAM
I (6718) heap_init: At 3FFE0440 len 00003AE0 (14 KiB): D/IRAM
I (6718) heap_init: At 3FFE4350 len 0001BCB0 (111 KiB): D/IRAM
I (6718) heap_init: At 4008CA1C len 000135E4 (77 KiB): IRAM
I (6721) spiram: Adding pool of 2047K of external SPI memory to heap allocator
I (6740) spi_flash: detected chip: gd
I (6747) spi_flash: flash io: dio
E (6755) spi_flash: Detected size(4096k) smaller than the size in the binary image header(8192k). Probe failed.

assert failed: do_core_init startup.c:326 (flash_ret == ESP_OK)


Backtrace: 0x40081db6:0x3ffe3ab0 0x40086705:0x3ffe3ad0 0x4008b81a:0x3ffe3af0 0x400d13b8:0x3ffe3c10 0x40081515:0x3ffe3c50 0x40079544:0x3ffe3c80 |<-CORRUPTED




ELF file SHA256: cb20f5bce4aa7af8

Rebooting...
ets Jul 29 2019 12:21:46
@github-actions github-actions bot changed the title Wrong Flash size detection, cannot use flash image more that 4Mb Wrong Flash size detection, cannot use flash image more that 4Mb (QEMU-101) Feb 17, 2023
@listout
Copy link
Author

listout commented Feb 23, 2023

ping

@igrr
Copy link
Member

igrr commented Feb 23, 2023

Thanks for reporting this issue @listout! If you open a PR with your proposed change, I can merge it into the next release based on QEMU 8.0.

@listout
Copy link
Author

listout commented Feb 23, 2023

I'll do that

listout added a commit to listout/qemu that referenced this issue Feb 23, 2023
In commit 0152246 4MB (or gd25q32) was
being hardcoded, as a result we could not use larger image size could
not be used. This PR should fix it, by using the largest available
(gd25q64).

Fixes: espressif#66
Signed-off-by: listout <listout@protonmail.com>
listout added a commit to listout/qemu that referenced this issue Feb 23, 2023
In commit 0152246 4MB (or gd25q32) was
being hardcoded, as a result we could not use larger image size (> 4Mb).
This PR should fix it, by using the largest available (gd25q64).

Fixes: espressif#66
Signed-off-by: listout <listout@protonmail.com>
listout added a commit to listout/qemu that referenced this issue Mar 4, 2023
In commit
0152246
4MB (or gd25q32) was being hardcoded, as a result we could not use
larger image size (> 4Mb). This PR should fix it, by using the largest
available (gd25q64).

Fixes: espressif#66
Fixes: espressif#17
Signed-off-by: listout <listout@protonmail.com>
@igrr igrr closed this as completed in 65eec41 Apr 13, 2023
@espressif-bot espressif-bot added Status: Done Issue is done internally and removed Status: To Do labels Apr 13, 2023
espressif-bot pushed a commit that referenced this issue Jun 27, 2023
In commit
listout@0152246
4MB (or gd25q32) was being hardcoded, as a result we could not use
larger image size (> 4Mb). This PR should fix it, by using the largest
available (gd25q64).

Fixes: #66
Fixes: #17
Signed-off-by: listout <listout@protonmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Status: Done Issue is done internally
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants