-
Notifications
You must be signed in to change notification settings - Fork 147
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
Scons program fails with recent development builds of OpenOCD #985
Comments
I can confirm this bug for STM32G4 and SAMV71; and it's probably related to modm because programming Details SAMV71
Details STM32G474 Rust-Toolchain
|
The error does not depend on the GCC version, I can reproduce it with GCC10 and GCC12 (ARM and xPack variants). The code section in OpenOCD that emits the error has not been touched in the last 5 years: https://github.com/openocd-org/openocd/blob/b6b4f9d46a48aadc1de6bb5152ff4913661c9059/src/flash/nor/core.c#L806-L818 I assume change 7513 (target/image: zero-initialize ELF segments up to p_memsz) in OpenOCD causes our issue. |
It must be an issue with our linkerscript, I just remembered that this sounded familiar: #922 |
I might have found the issue.
The change in openocd @rleh linked removes the code that ignores sections with zero file size (like
When I move the
|
I have tried to fix the openocd programming issue with the development build but I suspect that the openocd development branch is currently broken. Even if all the addresses in the ELF file are correct it tries to program the NOLOAD sections which are correctly marked
It skips programming the RAM sections with a warning because it knows there is no flash at these addresses but verification fails afterwards for the RAM sections. EDIT: There must be something else wrong. I have found some other ELF files that work, but the one generated by the Rust toolchain also outputs |
Interesting! It may be interesting to use pyelftools to write a test that actually validates the assumptions we make about our linkerscripts. Sections of certain naming schemes in the right place, alignment properties fulfilled, correct order of sections. We've had a number of these bugs already. I guess I'll put it on my TODO list… |
With recent OpenOCD development builds of OpenOCD (such as https://github.com/rleh/openocd-build/releases/tag/0.12.0%2Bdev-snapshot.20230320.2313 or https://github.com/rleh/openocd-build/releases/tag/0.12.0%2Bdev-snapshot.20230307.1505)
Scons program
fails on Ubuntu 22.04 with the error:Error: Section at 0x0800XXXX overlaps section ending at 0x0800XXXX
The behavior is persistent across several machines I tested and occurs with different programmers (Tested J-Link and ST-LInk).
One example output for the Nucleo F446RE Blink Example is
Error: Section at 0x080012ac overlaps section ending at 0x080012f0
Here are some files maybe relevant for this (.elf, .map, .lss and linkerscript):
scons-release.zip
I am not sure if the problem is due to the linkerscript or due to OpenOCD incorrectly assuming the overlap, but in any case this can serve as a cautionary heads-up.
The text was updated successfully, but these errors were encountered: