Boot esp32-s3-wroom-2 doubts

Baldhead
Posts: 471
Joined: Sun Mar 31, 2019 5:16 am

Boot esp32-s3-wroom-2 doubts

Postby Baldhead » Sun Apr 24, 2022 5:15 am

Hi,

When i boot esp32-s3-wroom-2(ESP32-S3-DevKitC-1) this messages appear:

Code: Select all

--- WARNING: GDB cannot open serial ports accessed as COMx
--- Using \\.\COM3 instead...
--- idf_monitor on \\.\COM3 115200 ---
--- Quit: Ctrl+] | Menu: Ctrl+T | Help: Ctrl+T followed by Ctrl+H ---
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:0x3fcd0110,len:0x18d8
load:0x403b6000,len:0xb70
load:0x403b9000,len:0x31e4
SHA-256 comparison failed:
Calculated: 24810d56b99994ed1beaa5fd1164e4566b12e2f9f1dd05d21e9c6ef4cb4196c6
Expected: d752336c7a1b0b739728e6716781fb964a6eb878f4204bcc00a307787ae785af
Attempting to boot anyway...
entry 0x403b6240
I (51) boot: ESP-IDF v5.0-dev-2485-g04bcc17dcc-dirty 2nd stage bootloader
I (52) boot: compile time 19:46:56
I (52) boot: chip revision: 0
I (55) boot.esp32s3: Boot SPI Speed : 80MHz
I (60) boot.esp32s3: SPI Mode       : SLOW READ
I (65) boot.esp32s3: SPI Flash Size : 4MB
I (70) boot: Enabling RNG early entropy source...
I (76) boot: Partition Table:
I (79) boot: ## Label            Usage          Type ST Offset   Length
I (86) boot:  0 nvs              WiFi data        01 02 00009000 00006000
I (94) boot:  1 phy_init         RF data          01 01 0000f000 00001000
I (101) boot:  2 factory          factory app      00 00 00010000 00200000
I (109) boot:  3 storage          Unknown data     01 82 00210000 000f0000
I (116) boot: End of partition table
I (121) esp_image: segment 0: paddr=00010020 vaddr=3c040020 size=5f1c4h (389572) map
I (222) esp_image: segment 1: paddr=0006f1ec vaddr=3fc98010 size=00e2ch (  3628) load
I (223) esp_image: segment 2: paddr=00070020 vaddr=42000020 size=335c4h (210372) map
I (277) esp_image: segment 3: paddr=000a35ec vaddr=3fc98e3c size=02d28h ( 11560) load
I (281) esp_image: segment 4: paddr=000a631c vaddr=40378000 size=1000ch ( 65548) load
I (301) esp_image: segment 5: paddr=000b6330 vaddr=600fe000 size=00010h (    16) load
I (308) boot: Loaded app from partition at offset 0x10000
I (308) boot: Disabling RNG early entropy source...
W (322) FLASH: DO NOT USE FOR MASS PRODUCTION! Timing parameters will be updated in future IDF version.
I (323) opi psram: ECC is enabled
I (325) opi psram: vendor id    : 0x0d (AP)
I (329) opi psram: dev id       : 0x02 (generation 3)
I (335) opi psram: density      : 0x03 (64 Mbit)
I (340) opi psram: good-die     : 0x01 (Pass)
I (345) opi psram: Latency      : 0x01 (Fixed)
I (351) opi psram: VCC          : 0x00 (1.8V)
I (356) opi psram: SRF          : 0x01 (Fast Refresh)
I (361) opi psram: BurstType    : 0x00 ( Wrap)
I (366) opi psram: BurstLen     : 0x03 (1024 Byte)
I (372) opi psram: Readlatency  : 0x02 (10 cycles@Fixed)
I (378) opi psram: DriveStrength: 0x00 (1/1)
W (383) PSRAM: DO NOT USE FOR MASS PRODUCTION! Timing parameters will be updated in future IDF version.
I (394) spiram: Found 8MB SPI RAM device
I (398) spiram: Speed: 80MHz
I (401) spiram: Initialized, cache is in normal (1-core) mode.
I (408) cpu_start: Pro cpu up.
I (411) cpu_start: Starting app cpu, entry point is 0x40379510
0x40379510: call_start_cpu1 at C:/esp-idf/components/esp_system/port/cpu_start.c:152

I (0) cpu_start: App cpu up.
I (710) spiram: SPI SRAM memory test OK
I (719) cpu_start: Pro cpu start user code
I (719) cpu_start: cpu freq: 240000000 Hz
I (719) cpu_start: Application information:
I (722) cpu_start: Project name:     wss_server
I (727) cpu_start: App version:      1
I (731) cpu_start: Compile time:     Apr 21 2022 20:27:11
I (738) cpu_start: ELF file SHA256:  b16cb0c7bbe64784...
I (744) cpu_start: ESP-IDF:          v5.0-dev-2485-g04bcc17dcc-dirty
I (751) heap_init: Initializing. RAM available for dynamic allocation:
I (758) heap_init: At 3FCA6438 len 00039BC8 (230 KiB): D/IRAM
I (764) heap_init: At 3FCE0000 len 0000EE34 (59 KiB): STACK/DRAM
I (771) heap_init: At 600FE014 len 00001FEC (7 KiB): RTCRAM
I (777) spiram: Adding pool of 7680K of external SPI memory to heap allocator
I (785) spi_flash: detected chip: mxic (opi)
I (790) spi_flash: flash io: opi_dtr
W (794) spi_flash: Detected size(32768k) larger than the size in the binary image header(4096k). Using the size in the binary image header.
I (808) sleep: Configure to isolate all GPIO pins in sleep state
I (814) sleep: Enable automatic switching of GPIO sleep configuration
I (822) cpu_start: Starting scheduler on PRO CPU.
I (0) cpu_start: Starting scheduler on APP CPU.
Detected flash size: Unknown:

Code: Select all

c:\esp-idf>esptool.py flash_id
esptool.py v3.3.1-dev
Found 1 serial ports
Serial port COM3
Connecting....
Detecting chip type... ESP32-S3
Chip is ESP32-S3
Features: WiFi, BLE
Crystal is 40MHz
MAC: 7c:df:a1:e1:1d:84
Uploading stub...
Running stub...
Stub running...
Manufacturer: c2
Device: 8039
Detected flash size: Unknown
Hard resetting via RTS pin...

1) Some problem with this warning or i can to disregard ?
WARNING: GDB cannot open serial ports accessed as COMx

2) For OPI Flash, Use Default Flash Boot Mode ?

3) What does SLOW READ configuration of flash memory mean ?
boot.esp32s3: SPI Mode : SLOW READ

4) SHA-256 comparison failed, Attempting to boot anyway... ?

5) spi_flash: Detected size(32768k) larger than the size in the binary image header(4096k). Using the size in the binary image header ?
boot.esp32s3: SPI Flash Size : 4MB
spi_flash: detected chip: mxic (opi)
spi_flash: flash io: opi_dtr
Note: i already erased the flash memory with: idf.py erase-flash

6) Is this configuration good or bad or does it depend on the application ?
spiram: Initialized, cache is in normal (1-core) mode.

7) FLASH: DO NOT USE FOR MASS PRODUCTION! Timing parameters will be updated in future IDF version and PSRAM: DO NOT USE FOR MASS PRODUCTION! Timing parameters will be updated in future IDF version ?

NOTE: The application are running.

ESP_Sprite
Posts: 9770
Joined: Thu Nov 26, 2015 4:08 am

Re: Boot esp32-s3-wroom-2 doubts

Postby ESP_Sprite » Sun Apr 24, 2022 6:19 am

Baldhead wrote:
Sun Apr 24, 2022 5:15 am
1) Some problem with this warning or i can to disregard ?
WARNING: GDB cannot open serial ports accessed as COMx
Windows vs Unix thing. It's a warning only, esp-idf corrects for this under the hood.
2) For OPI Flash, Use Default Flash Boot Mode ?
3) What does SLOW READ configuration of flash memory mean ?
boot.esp32s3: SPI Mode : SLOW READ
From what I know, the bootloader isn't capable of controlling the OPI flash in OPI mode. What it does instead is to fallback to a single-wire SPI mode that OPI flash supports as well. As soon as the 2nd bootloader takes over (IIRC, could also be the app), the flash is switched to OPI mode.
4) SHA-256 comparison failed, Attempting to boot anyway... ?
Not sure. Will ask around.
5) spi_flash: Detected size(32768k) larger than the size in the binary image header(4096k). Using the size in the binary image header ?
boot.esp32s3: SPI Flash Size : 4MB
spi_flash: detected chip: mxic (opi)
spi_flash: flash io: opi_dtr
Note: i already erased the flash memory with: idf.py erase-flash
You selected 4MiB of flash in menuconfig (under serial flasher options iirc) but you have 32MiB of octal psram. The app will pretend that there's only 4MiB installed.
6) Is this configuration good or bad or does it depend on the application ?
spiram: Initialized, cache is in normal (1-core) mode.
Should be OK, I think it's a remnant of ESP32 code.
7) FLASH: DO NOT USE FOR MASS PRODUCTION! Timing parameters will be updated in future IDF version and PSRAM: DO NOT USE FOR MASS PRODUCTION! Timing parameters will be updated in future IDF version ?

NOTE: The application are running.
It's what it says. Running octal flash/psram on the maximum speeds needs some timing parameters which we probably got 'ballpark correct', but we might update them after doing more tests.

ESP_Sprite
Posts: 9770
Joined: Thu Nov 26, 2015 4:08 am

Re: Boot esp32-s3-wroom-2 doubts

Postby ESP_Sprite » Sun Apr 24, 2022 1:36 pm

Got an update: Seems the SHA check failed might also be because of the wrongly selected flash... seems esptool.py under some circumstances auto-corrects some values in the bootloader header in order to make those match the detected flash, however this makes the SHA1 checksum not match anymore. We're working on a fix for this; for now you can ignore it.

Baldhead
Posts: 471
Joined: Sun Mar 31, 2019 5:16 am

Re: Boot esp32-s3-wroom-2 doubts

Postby Baldhead » Tue Apr 26, 2022 12:43 am

You selected 4MiB of flash in menuconfig (under serial flasher options iirc) but you have 32MiB of octal psram. The app will pretend thlat there's only 4MiB installed.
I set to 32MiB in menuconfig.

I have two files inside root project directory.

Sdkconfig and sdkconfig.old

Will esp-idf be using the sdkconfig.old file ?
Last edited by Baldhead on Tue Apr 26, 2022 1:03 am, edited 1 time in total.

ESP_Sprite
Posts: 9770
Joined: Thu Nov 26, 2015 4:08 am

Re: Boot esp32-s3-wroom-2 doubts

Postby ESP_Sprite » Tue Apr 26, 2022 12:57 am

Then how are you flashing the binary? Are you invoking `idf.py flash` or using esptool.py manually?

Baldhead
Posts: 471
Joined: Sun Mar 31, 2019 5:16 am

Re: Boot esp32-s3-wroom-2 doubts

Postby Baldhead » Tue Apr 26, 2022 2:04 am

I am flashing using flash icon from "ESP-IDF VS Code Extension" in visual studio code.

Note: i added more information in my previous answer.

ESP_bignacio
Posts: 229
Joined: Wed May 02, 2018 12:12 pm

Re: Boot esp32-s3-wroom-2 doubts

Postby ESP_bignacio » Wed Apr 27, 2022 7:29 am

Did you make sure that ESPTOOLPY_FLASHSIZE_DETECT (Serial Flasher config -> Detect flash size when flashing bootloader) is disabled ? It is usually enabled by default. This will override any user defined flash size.

The visual studio code extension uses the project's build/flasher_args.json file for esptool flashing arguments, which are set by sdkconfig values.

Baldhead
Posts: 471
Joined: Sun Mar 31, 2019 5:16 am

Re: Boot esp32-s3-wroom-2 doubts

Postby Baldhead » Wed Apr 27, 2022 11:20 pm

@ESP_bignacio,

sdk_config and flasher_args.json image in annex.

Dout mode is only for flashing the program on esp32-s3, correct ?
In "running" mode the esp32-s3 flash memory communication is octal, correct ?

"flash_mode": "dout" in file flasher_args.json.
Attachments
flasher_args.json.png
flasher_args.json.png (75.09 KiB) Viewed 8612 times
sdk_config.png
sdk_config.png (107.01 KiB) Viewed 8612 times

ESP_Sprite
Posts: 9770
Joined: Thu Nov 26, 2015 4:08 am

Re: Boot esp32-s3-wroom-2 doubts

Postby ESP_Sprite » Thu Apr 28, 2022 2:08 am

Disable that 'Detect flash size when flashing bootloader', and see if that helps, please.

Baldhead
Posts: 471
Joined: Sun Mar 31, 2019 5:16 am

Re: Boot esp32-s3-wroom-2 doubts

Postby Baldhead » Thu Apr 28, 2022 9:55 pm

ESP_Sprite wrote:
Thu Apr 28, 2022 2:08 am
Disable that 'Detect flash size when flashing bootloader', and see if that helps, please.

I disabled the 'Detect flash size when flashing bootloader' and the sha error and flash size error disappeared.

Shouldn't it work with 'Detect flash size when flashing bootloader' enabled ?
There must be some bug, right ?

Code: Select all

--- WARNING: GDB cannot open serial ports accessed as COMx
--- Using \\.\COM6 instead...
--- idf_monitor on \\.\COM6 115200 ---
--- Quit: Ctrl+] | Menu: Ctrl+T | Help: Ctrl+T followed by Ctrl+H ---
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:0x3fcd0110,len:0x18d8
load:0x403b6000,len:0xb70 
load:0x403b9000,len:0x31e4
entry 0x403b6240
I (33) boot: ESP-IDF v5.0-dev-2485-g04bcc17dcc-dirty 2nd stage bootloader
I (33) boot: compile time 18:27:42
I (33) boot: chip revision: 0
I (37) boot.esp32s3: Boot SPI Speed : 80MHz
I (42) boot.esp32s3: SPI Mode       : SLOW READ
I (47) boot.esp32s3: SPI Flash Size : 32MB
I (52) boot: Enabling RNG early entropy source...
I (57) boot: Partition Table:
I (61) boot: ## Label            Usage          Type ST Offset   Length  
I (68) boot:  0 nvs              WiFi data        01 02 00009000 00006000
I (76) boot:  1 phy_init         RF data          01 01 0000f000 00001000
I (83) boot:  2 factory          factory app      00 00 00010000 00200000
I (91) boot:  3 storage          Unknown data     01 82 00210000 000f0000
I (98) boot: End of partition table
I (102) esp_image: segment 0: paddr=00010020 vaddr=3c040020 size=5f1c4h (389572) map
I (203) esp_image: segment 1: paddr=0006f1ec vaddr=3fc98010 size=00e2ch (  3628) load
I (205) esp_image: segment 2: paddr=00070020 vaddr=42000020 size=3365ch (210524) map
I (259) esp_image: segment 3: paddr=000a3684 vaddr=3fc98e3c size=02d28h ( 11560) load
I (262) esp_image: segment 4: paddr=000a63b4 vaddr=40378000 size=1000ch ( 65548) load
I (283) esp_image: segment 5: paddr=000b63c8 vaddr=600fe000 size=00010h (    16) load
I (290) boot: Loaded app from partition at offset 0x10000
I (290) boot: Disabling RNG early entropy source...
W (303) FLASH: DO NOT USE FOR MASS PRODUCTION! Timing parameters will be updated in future IDF version.
I (304) opi psram: ECC is enabled
I (306) opi psram: vendor id    : 0x0d (AP)
I (311) opi psram: dev id       : 0x02 (generation 3)
I (317) opi psram: density      : 0x03 (64 Mbit)
I (322) opi psram: good-die     : 0x01 (Pass)
I (327) opi psram: Latency      : 0x01 (Fixed)
I (332) opi psram: VCC          : 0x00 (1.8V)
I (337) opi psram: SRF          : 0x01 (Fast Refresh)
I (343) opi psram: BurstType    : 0x00 ( Wrap)
I (348) opi psram: BurstLen     : 0x03 (1024 Byte)
I (354) opi psram: Readlatency  : 0x02 (10 cycles@Fixed)
I (360) opi psram: DriveStrength: 0x00 (1/1)
W (365) PSRAM: DO NOT USE FOR MASS PRODUCTION! Timing parameters will be updated in future IDF version.
I (375) spiram: Found 8MB SPI RAM device
I (379) spiram: Speed: 80MHz
I (383) spiram: Initialized, cache is in normal (1-core) mode.
I (389) cpu_start: Pro cpu up.
I (393) cpu_start: Starting app cpu, entry point is 0x40379510
0x40379510: call_start_cpu1 at C:/esp-idf/components/esp_system/port/cpu_start.c:152

I (0) cpu_start: App cpu up.
I (691) spiram: SPI SRAM memory test OK
I (700) cpu_start: Pro cpu start user code
I (700) cpu_start: cpu freq: 240000000 Hz
I (701) cpu_start: Application information:
I (703) cpu_start: Project name:     wss_server
I (709) cpu_start: App version:      1
I (713) cpu_start: Compile time:     Apr 28 2022 18:27:27
I (719) cpu_start: ELF file SHA256:  5a06cb1c25d77a06...
I (725) cpu_start: ESP-IDF:          v5.0-dev-2485-g04bcc17dcc-dirty
I (732) heap_init: Initializing. RAM available for dynamic allocation:
I (739) heap_init: At 3FCA6438 len 00039BC8 (230 KiB): D/IRAM
I (746) heap_init: At 3FCE0000 len 0000EE34 (59 KiB): STACK/DRAM
I (753) heap_init: At 600FE014 len 00001FEC (7 KiB): RTCRAM
I (759) spiram: Adding pool of 7680K of external SPI memory to heap allocator
I (767) spi_flash: detected chip: mxic (opi)
I (772) spi_flash: flash io: opi_dtr
I (776) sleep: Configure to isolate all GPIO pins in sleep state
I (783) sleep: Enable automatic switching of GPIO sleep configuration
I (790) cpu_start: Starting scheduler on PRO CPU.
I (0) cpu_start: Starting scheduler on APP CPU.

Who is online

Users browsing this forum: No registered users and 83 guests