[esptool.py] Maximum number of segments in the binary

roel00
Posts: 3
Joined: Sat Sep 29, 2018 6:52 am

[esptool.py] Maximum number of segments in the binary

Postby roel00 » Sat Sep 29, 2018 6:55 am

The esptool.py contains the following code

Code: Select all

    def load_common_header(self, load_file, expected_magic):
            (magic, segments, self.flash_mode, self.flash_size_freq, self.entrypoint) = struct.unpack('<BBBBI', load_file.read(8))

            if magic != expected_magic or segments > 16:
                raise FatalError('Invalid firmware image magic=%d segments=%d' % (magic, segments))
            return segments
Why is the firmware corrupt when it contains more than 16 segments?

ESP_Angus
Posts: 2344
Joined: Sun May 08, 2016 4:11 am

Re: [esptool.py] Maximum number of segments in the binary

Postby ESP_Angus » Mon Oct 01, 2018 5:21 am

Hi roel,

Currently the ESP-IDF bootloader only accommodates up to 16 segments in an app binary image:
https://github.com/espressif/esp-idf/bl ... rmat.h#L96

There may be a similar limit in the ESP32 ROM (for the bootloader image), I don't recall.

Do you need more than 16 segments in the binary?


Angus

roel00
Posts: 3
Joined: Sat Sep 29, 2018 6:52 am

Re: [esptool.py] Maximum number of segments in the binary

Postby roel00 » Sat Oct 06, 2018 10:28 am

ESP_Angus wrote:Hi roel,

Currently the ESP-IDF bootloader only accommodates up to 16 segments in an app binary image:
https://github.com/espressif/esp-idf/bl ... rmat.h#L96

There may be a similar limit in the ESP32 ROM (for the bootloader image), I don't recall.

Do you need more than 16 segments in the binary?


Angus
I accidentally got more then 16 segments while screwing with the linker script, and was trying to figure out why it lead to a non working binary, thanks for the answer!

Who is online

Users browsing this forum: No registered users and 80 guests