ESP32S3 load_ram

mckey128
Posts: 3
Joined: Wed Apr 26, 2023 8:11 am

ESP32S3 load_ram

Postby mckey128 » Wed Sep 25, 2024 2:03 pm

Hello everyone,

I’m having several difficulties using the load_ram function with esptool. I need to load a simple startup firmware into RAM that makes an LED blink. The application is built and runs correctly in debug mode, but when I try to load it into RAM, the LED stays on constantly, so I believe the application isn't jumping to the correct memory locations.

Here are the commands I’m using:

Code: Select all

esptool.exe --chip esp32s3 elf2image app.elf
This generates the file app.bin.

If I then verify it with:

Code: Select all

esptool.exe image_info --version 2 app.bin
I get this error:

esptool.py v4.5.1
Detected image type: ESP8266
WARNING: Suspicious segment 0xee, length 9
WARNING: Suspicious segment 0x3c3fce38, length 4278190111

A fatal error occurred: End of file reading segment 0x3c3fce38, length 4278190111 (actual length 355535)


If I load it with the command:

Code: Select all

esptool.exe --port COM4 --no-stub load_ram app.bin
I get this output:

esptool.py v4.5.1
Serial port COM4
Connecting...
Detecting chip type... ESP32-S3
Chip is ESP32-S3 (revision v0.2)
Features: WiFi, BLE
Crystal is 40MHz
MAC: 80:65:99:d7:1c:a4
Enabling default SPI flash mode...
RAM boot...
Downloading 7996 bytes at 3fce3810... done!
Downloading 3456 bytes at 403c9700... done!
Downloading 12984 bytes at 403cc700... done!
All segments done, executing at 403c9948
Exiting immediately.


Now I have some questions:

1. My application also generates a binary for the bootloader and partition table, which I’m not actually using. For this reason, I also tried to merge the binaries as follows:

Code: Select all

esptool --chip ESP32-S3 merge_bin -o merged-flash.bin --flash_mode dio --flash_size 8MB 0x0000 bootloader.bin 0x8000 partition-table.bin [b]0x20000 [/b]app.bin
or

Code: Select all

esptool --chip ESP32-S3 merge_bin -o merged-flash.bin --flash_mode dio --flash_size 8MB 0x0000 bootloader.bin 0x8000 partition-table.bin [b]0x10000 [/b]app.bin
Can I load just the app.bin into RAM, or do I also need to include the bootloader and partition table, even though I’m not using them in my small program that runs in RAM?

2. When I analyze the image with

Code: Select all

esptool.exe image_info
, it says the image is for ESP8266, which is obviously wrong. What could be the reason for this?

3. Does anyone have a practical and simple example for loading a basic application into RAM?

4. What configuration should I use in SDKConfig? Right now, I’ve set it to "Single Application, no OTA."

Among the various tests, I also tried using:

Application build type:
Default (binary application + 2nd stage bootloader)
ELF file, loadable into RAM (EXPERIMENTAL)

Neither of these worked.

Unfortunately, the load_ram function isn’t well documented :oops: :oops: , and I’m unable to perform something that should be fairly simple.

mckey128
Posts: 3
Joined: Wed Apr 26, 2023 8:11 am

Re: ESP32S3 load_ram

Postby mckey128 » Fri Sep 27, 2024 1:23 pm

Does anybody have an idea?

Who is online

Users browsing this forum: Majestic-12 [Bot], snutw_ and 106 guests