Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[TW#27558] esptool error during "make" when processing ELF file #2727

Closed
pilnikov opened this issue Nov 22, 2018 · 15 comments
Closed

[TW#27558] esptool error during "make" when processing ELF file #2727

pilnikov opened this issue Nov 22, 2018 · 15 comments

Comments

@pilnikov
Copy link

pilnikov commented Nov 22, 2018

when I try to build a project with version 3.2.1Beta when processing .elf file, I get a
struct.error: ubyte format requires 0 <= number <= 255
in esptool.py
esptool
image

@pilnikov
Copy link
Author

pilnikov commented Nov 22, 2018

Note! if i use idf ver 3.1.1 - All OK with the same project.

@pilnikov pilnikov changed the title esptool error [TW#27551]esptool error Nov 22, 2018
@projectgus
Copy link
Contributor

Hi @pilnikov ,

Is this an open source project? If so, are you able to attach the sdkconfig and the KaRadio32.elf file from the build directory? If you can't share them it's OK, can figure out another approach.

@projectgus projectgus changed the title [TW#27551]esptool error esptool error during "make" when processing ELF file, v3.2-beta1 Nov 22, 2018
@Alvin1Zhang Alvin1Zhang changed the title esptool error during "make" when processing ELF file, v3.2-beta1 [TW#27558] esptool error during "make" when processing ELF file, v3.2-beta1 Nov 22, 2018
@igrr
Copy link
Member

igrr commented Nov 22, 2018

backlink karawin/Ka-Radio32#65

@pilnikov
Copy link
Author

Yes of course. Its karadio from https://github.com/karawin/Ka-Radio32
1.ZIP

@projectgus
Copy link
Contributor

projectgus commented Nov 22, 2018

Thanks for posting those.

Something seems to have gone wrong in the linker script for both v3.1.1 and v3.2-beta1.

The ELF files both have hundreds of loadable sections when they should have about 5 (you can look at the output with xtensa-esp32-elf-objdump -h ELFFILE).

KaRadio32_311.elf has exactly 254 loadable sections so the .bin file is generated - however the generated .bin file won't boot as the bootloader can only handle up to 16 loadable sections.

KaRadio32_321.elf has more than 255 loadable sections so the esptool error appears when this value is packed into a single byte.

I'll fix the error message to be more informative, but the problem is with the ELF file not the elf2binary step.

I can't reproduce the ELF problem with ESP-IDF examples or by building the Ka-Radio32 project locally. Is it possible you've edited some of the linker script files in the IDF repository itself which is causing a bad link?

projectgus added a commit to espressif/esptool that referenced this issue Nov 22, 2018
…n 16 loadable sections

(More than 16 sections in the output .bin will not boot, and there is a hard limit of 255 sections
in the .bin file format.)

Related to espressif/esp-idf#2727
@projectgus
Copy link
Contributor

Is it possible you've edited some of the linker script files in the IDF repository itself which is causing a bad link?

One other question, can you please post the output of git describe --tags --dirty when run in the IDF directory? Thanks.

@pilnikov
Copy link
Author

image

@pilnikov
Copy link
Author

I can't reproduce the ELF problem with ESP-IDF examples or by building the Ka-Radio32 project locally. Is it possible you've edited some of the linker script files in the IDF repository itself which is causing a bad link?

Tru make without paremeter
e.g.
make -j4

@pilnikov
Copy link
Author

pilnikov commented Nov 23, 2018

image

@pilnikov
Copy link
Author

after git pull & git submodule update
image

@pilnikov
Copy link
Author

2.zip
Files after make all with updated 3.2 beta1
Size .elf = 6m

@projectgus
Copy link
Contributor

projectgus commented Nov 23, 2018

The binary seems to be building correctly now, so it appears some change on master branch has fixed this.

One thing I noticed in your screenshots is you are running MSYS2 via "msys.exe", not "mingw32.exe". This is not supported - if you look in the build output you'll see a warning about it. The root cause may be something to do with that, and using an MSYS rather than a MINGW32 Python. But I'm just guessing.

(BTW, I can't explain why your copy of git describes commit 4c88170 as being based on v3.2-beta1-182-g4c881708d. This commit is actually v3.3-dev-180-g4c881708d, and if I clone from github on Windows and then check it out then it's described correctly. Strange! Maybe a git fetch will correct this.)

@projectgus projectgus changed the title [TW#27558] esptool error during "make" when processing ELF file, v3.2-beta1 [TW#27558] esptool error during "make" when processing ELF file Nov 23, 2018
@pilnikov
Copy link
Author

image

@pilnikov
Copy link
Author

3.zip

@projectgus
Copy link
Contributor

Everything looks 100% correct now (both binary and version)! Are you experiencing any more issues with ESP-IDF?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants