-
Notifications
You must be signed in to change notification settings - Fork 6.9k
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
ESP32 flash error with segment count error using esptool.py from esp-idf #20980
Comments
Okay, by changing the esptool.py segments >17 will fix the flashing error, but seems to me the code didn't really run. |
I would like to re-open this issue, not because I can't flash it onto the ESP32-wroom-32D dev kit, but because even if I change the esptool.py script to flash it, no sample project will run other than "hello-world". which is not very helpful. I compiled several samples, and all compiled successfully, but none will run on the target board. I tried at least these 4 samples, and managed to compile all of them, but when using 'west flash -d build/ --skip-rebuild --esp-device /dev/ttyS0', the 'hello-world' sample can flash and start the zephyr os, but all others won't flash.
|
This is due to the fact that esptool create an app image from the ELF sections. And there is more than 16 of them. This might be possible to fix this in the ESP32 linker script by merging sections |
Network subsystem and kernel objects utilize linker sections extensively to group data together. The definitions for those sections are common to all arch/SoCs/boards. We could re-implement them in ESP32's linker script by grouping them into fewer sections, but this will increase maintenance as changes to common scripts will need to be re-implement in ESP32's. |
When converting ELF to a flashable image, the esptool can only process up to 16 ELF sections. Zephyr has been happily grouping similar objects into linker sections which can easily go over esptool's limit. This patch consolidates the kernel, net, log, and shell objects into their own sections. Also remove the app_noinit section as no one is emitting anything into that section, and it's not being used by other arch/SoC/boards in Zephyr. Fixes zephyrproject-rtos#20980 Signed-off-by: Daniel Leung <[email protected]>
This issue has been marked as stale because it has been open (more than) 60 days with no activity. Remove the stale label or add a comment saying that you would like to have the label removed otherwise this issue will automatically be closed in 14 days. Note, that you can always re-open a closed issue at any time. |
When converting ELF to a flashable image, the esptool can only process up to 16 ELF sections. Zephyr has been happily grouping similar objects into linker sections which can easily go over esptool's limit. This patch consolidates the kernel, net, log, and shell objects into their own sections. Also remove the app_noinit section as no one is emitting anything into that section, and it's not being used by other arch/SoC/boards in Zephyr. Fixes zephyrproject-rtos#20980 Signed-off-by: Daniel Leung <[email protected]>
When converting ELF to a flashable image, the esptool can only process up to 16 ELF sections. Zephyr has been happily grouping similar objects into linker sections which can easily go over esptool's limit. This patch consolidates the kernel, net, log, and shell objects into their own sections. Also remove the app_noinit section as no one is emitting anything into that section, and it's not being used by other arch/SoC/boards in Zephyr. Fixes #20980 Signed-off-by: Daniel Leung <[email protected]>
After successfully build a project for ESP32, when running for west flash, there's an error:
west flash -d build/ --skip-rebuild --esp-device /dev/ttyS0
-- west flash: using runner esp32
-- runners.esp32: Converting ELF to BIN
esptool.py v2.9-dev
A fatal error occurred: Invalid segment count 17 (max 16). Usually this indicates a linker script problem.
ERROR: command exited with status 2: /usr/bin/python3 /esp-idf/components/esptool_py/esptool/esptool.py --chip esp32 elf2image /zephyr/samples/build/zephyr/zephyr.elf
The text was updated successfully, but these errors were encountered: