esptool error.

snahmad75
Posts: 445
Joined: Wed Jan 24, 2018 6:32 pm

esptool error.

Postby snahmad75 » Tue Nov 20, 2018 7:58 pm

I have updated my esptool.

Toolchain path: /opt/xtensa-esp32-elf/bin/xtensa-esp32-elf-gcc
Toolchain version: crosstool-ng-1.22.0-80-g6c4433a5
Compiler version: 5.2.0
Python requirements from C:/Work/library/esp32/master/esp-idf/requirements.txt are satisfied.
LD build/W2K-1-Release.elf
esptool.py v2.6-beta1
Traceback (most recent call last):
File "C:/Work/library/esp32/master/esp-idf/components/esptool_py/esptool/esptool.py", line 2865, in <module>
_main()
File "C:/Work/library/esp32/master/esp-idf/components/esptool_py/esptool/esptool.py", line 2858, in _main
main()
File "C:/Work/library/esp32/master/esp-idf/components/esptool_py/esptool/esptool.py", line 2631, in main
operation_func(args)
File "C:/Work/library/esp32/master/esp-idf/components/esptool_py/esptool/esptool.py", line 2195, in elf2image
image.save(args.output)
File "C:/Work/library/esp32/master/esp-idf/components/esptool_py/esptool/esptool.py", line 1566, in save
self.write_common_header(f, self.segments)
File "C:/Work/library/esp32/master/esp-idf/components/esptool_py/esptool/esptool.py", line 1338, in write_common_header
self.flash_mode, self.flash_size_freq, self.entrypoint))
struct.error: ubyte format requires 0 <= number <= 255
make: *** [/c/Work/library/esp32/master/esp-idf/components/esptool_py/Makefile.projbuild:59: /c/Work/Actisense/W2K1/build/W2K-1-Release.bin] Error 1
make: *** Waiting for unfinished jobs....

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

Re: esptool error.

Postby ESP_Angus » Wed Nov 21, 2018 4:06 am

Can you please run "make V=1" and post the full command line being passed to esptool.py?

snahmad75
Posts: 445
Joined: Wed Jan 24, 2018 6:32 pm

Re: esptool error.

Postby snahmad75 » Wed Nov 21, 2018 12:07 pm

python /c/Work/library/esp32/esp-idf/components/esptool_py/esptool/esptool.py --chip esp32 elf2image --flash_mode "dio" --flash_freq "40m" --flash_size "4MB" -o /c/Work/Actisense/W2K1-BootLoader/build/W2K1-BootLoader-Release.bin /c/Work/Actisense/W2K1-BootLoader/build/W2K1-BootLoader-Release.elf
esptool.py v2.3.1
Traceback (most recent call last):
File "C:/Work/library/esp32/esp-idf/components/esptool_py/esptool/esptool.py", line 2637, in <module>
_main()
File "C:/Work/library/esp32/esp-idf/components/esptool_py/esptool/esptool.py", line 2630, in _main
main()
File "C:/Work/library/esp32/esp-idf/components/esptool_py/esptool/esptool.py", line 2403, in main
operation_func(args)
File "C:/Work/library/esp32/esp-idf/components/esptool_py/esptool/esptool.py", line 2009, in elf2image
image.save(args.output)
File "C:/Work/library/esp32/esp-idf/components/esptool_py/esptool/esptool.py", line 1429, in save
self.write_common_header(f, self.segments)
File "C:/Work/library/esp32/esp-idf/components/esptool_py/esptool/esptool.py", line 1225, in write_common_header
self.flash_mode, self.flash_size_freq, self.entrypoint))
struct.error: ubyte format requires 0 <= number <= 255
make: *** [/c/Work/library/esp32/esp-idf/components/esptool_py/Makefile.projbuild:51: /c/Work/Actisense/W2K1-BootLoader/build/W2K1-BootLoader-Release.bin] Error 1

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

Re: esptool error.

Postby ESP_Angus » Wed Nov 21, 2018 11:04 pm

This is a really unusual error. Is it possible for you to PM me with a copy of your .elf file, please?

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

Re: esptool error.

Postby ESP_Angus » Fri Nov 23, 2018 3:06 am

Hi snahmad75,

Thanks for sending me the ELF. Also, another issue which looks the same has been reported on GitHub:
https://github.com/espressif/esp-idf/issues/2727

The root cause of your error (and the error linked above) is that the ELF file has hundreds of loadable sections in it when it should only have around 5. Once the ELF has more than 255 sections, the error you're seeing appears.

I can't reproduce this problem, even with the modified linker script you sent. It must be something to do with the build environment or a modification to IDF, but I don't know which.

- Can you please send the output of 'git describe --tags --dirty` when run in the ESP-IDF directory.
- Is there anything else unusual about the build environment, or any other modifications to IDF or the linker arguments?
- Could you attach here (or PM me) the build file "build/esp32/esp32.common.ld", please?

Thanks,

Angus

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

Re: esptool error.

Postby ESP_Angus » Fri Nov 23, 2018 7:17 am

(At the GitHub issue the reporter mentions that pulling latest master branch appears to have fixed the problem. Also they were running the Windows terminal via msys2.exe not mingw32.exe which is the supported configuration, this may have contributed to the problem.)

snahmad75
Posts: 445
Joined: Wed Jan 24, 2018 6:32 pm

Re: esptool error.

Postby snahmad75 » Fri Nov 23, 2018 9:30 am

ESP_Angus wrote:
Fri Nov 23, 2018 7:17 am
(At the GitHub issue the reporter mentions that pulling latest master branch appears to have fixed the problem. Also they were running the Windows terminal via msys2.exe not mingw32.exe which is the supported configuration, this may have contributed to the problem.)
I am using mingw32.exe not msys2.exe. Should I try msys2.exe?

snahmad75
Posts: 445
Joined: Wed Jan 24, 2018 6:32 pm

Re: esptool error.

Postby snahmad75 » Fri Nov 23, 2018 9:35 am

ESP_Angus wrote:
Fri Nov 23, 2018 3:06 am
Hi snahmad75,

Thanks for sending me the ELF. Also, another issue which looks the same has been reported on GitHub:
https://github.com/espressif/esp-idf/issues/2727

The root cause of your error (and the error linked above) is that the ELF file has hundreds of loadable sections in it when it should only have around 5. Once the ELF has more than 255 sections, the error you're seeing appears.

I can't reproduce this problem, even with the modified linker script you sent. It must be something to do with the build environment or a modification to IDF, but I don't know which.

- Can you please send the output of 'git describe --tags --dirty` when run in the ESP-IDF directory.
- Is there anything else unusual about the build environment, or any other modifications to IDF or the linker arguments?
- Could you attach here (or PM me) the build file "build/esp32/esp32.common.ld", please?

Thanks,

Angus

Yes We have change /esp32/esp32.common.ld to include our section.

Vector.cpp contains const C++ structure which i need to keep. Is there better way of doing it?

under .flash.rodata :

Some for comments.

/* Beginning-Of-Flash Vectors must be first in this Section */
_bofvectors_start = ABSOLUTE(.);
*Vector.o(.rodata .rodata.*)
/* Must force KEEP _BOFVectors[] as not referenced */
/* KEEP(Vector.o(.rodata .rodata.*));*/
_bofvectors_end = ABSOLUTE(.);

snahmad75
Posts: 445
Joined: Wed Jan 24, 2018 6:32 pm

Re: esptool error.

Postby snahmad75 » Fri Nov 23, 2018 10:23 pm

ESP_Angus wrote:
Fri Nov 23, 2018 7:17 am
(At the GitHub issue the reporter mentions that pulling latest master branch appears to have fixed the problem. Also they were running the Windows terminal via msys2.exe not mingw32.exe which is the supported configuration, this may have contributed to the problem.)
Now I am using latest master branch. and download and using latest msys zip

https://docs.espressif.com/projects/esp ... setup.html

It is better now. I will try out signed bins now.

Who is online

Users browsing this forum: Baidu [Spider], Bing [Bot] and 108 guests