while compiling micropython , A fatal error: invalid segment count 25 (max 16)

kenjican
Posts: 2
Joined: Tue Sep 26, 2017 10:53 pm

while compiling micropython , A fatal error: invalid segment count 25 (max 16)

Postby kenjican » Fri Mar 22, 2019 3:10 am

Detailed error message as below:
GEN build/esp32.common.ld
LINK build/application.elf
text data bss dec hex filename
843420 214080 27868 1085368 108fb8 build/application.elf
Create build/application.bin
esptool.py v2.6

A fatal error occurred: Invalid segment count 25 (max 16). Usually this indicates a linker script problem.
Makefile:844: recipe for target 'build/application.bin' failed
make: *** [build/application.bin] Error 2

my environment:
OS: Ubuntu 18.04 64-bits
xtensa-esp32-elf-gcc version : gcc version 5.2.0 (crosstool-NG crosstool-ng-1.22.0-80-g6c4433a)
esp-idf commit hash :commit 5c88c5996dbde6208e3bec05abc21ff6cd822d26 ,the same as micropython's makefile
micropython : master branch

What should I do to make compiling move on? Thanks~~

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

Re: while compiling micropython , A fatal error: invalid segment count 25 (max 16)

Postby ESP_Angus » Fri Mar 22, 2019 7:08 am

This error usually indicates a problem with the linker script.

Are you using the IDF version that MicroPython recommends? MicroPython does not use the ESP-IDF build system and (the last time I checked) they had their own custom linker script rather than using the IDF one. This means that changing IDF versions inside MP can be a big job.

kenjican
Posts: 2
Joined: Tue Sep 26, 2017 10:53 pm

Re: while compiling micropython , A fatal error: invalid segment count 25 (max 16)

Postby kenjican » Sat Mar 23, 2019 5:27 am

Thanks Angus. I've check esptool source code. Error comes from this function : def verify(self) at line 1367, it means segment length is more than 16... Could you please tell me how to make the segment length less then 16? The linker script links redundant obj files?

Who is online

Users browsing this forum: Baidu [Spider], djixon, MicroController and 137 guests