-
Notifications
You must be signed in to change notification settings - Fork 6.8k
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
Twister "FLASH overflow" does not account for imgtool trailer. #50386
Comments
This links with #46194 in that depending on mcuboot configuration, a generated firmware image might be useless because of mcuboot swap status data, but there would need to be a way for the application (at build time) to know details of the mcuboot configuration |
Adding mcuboot maintainers, you have any ideas? I'm thinking either reducing the flash size in the board config when imgtool is enabled or detecting the specific error in twister. @nashif |
Unfortunately, the trailer size isn't easy to determine as it depends on signature sizes and other things. But, imgtool should fail if the image is too large, is that not happening? |
It is, the problem is that then twister detects that as a generic "build failure" and fails the test, while normally it would skip instead in case of flash overflow. So I guess the other option is for twister to detect this specific error condition and detect it as flash overflow. |
Do you have any ideas on how this could be done? I think that imgtool just raises an exception. |
Yeah actually it seems fairly easy, something like: --- a/scripts/pylib/twister/twisterlib/runner.py
+++ b/scripts/pylib/twister/twisterlib/runner.py
@@ -220,10 +220,14 @@ class CMake:
if log_msg:
overflow_found = re.findall("region `(FLASH|ROM|RAM|ICCM|DCCM|SRAM|dram0_1_seg)' overflowed by", log_msg)
+ imgtool_overflow_found = re.findall("Error: Image size \(.*\) \+ trailer \(.*\) exceeds requested size", log_msg)
if overflow_found and not self.options.overflow_as_errors:
logger.debug("Test skipped due to {} Overflow".format(overflow_found[0]))
self.instance.status = "skipped"
self.instance.reason = "{} overflow".format(overflow_found[0])
+ elif imgtool_overflow_found and not self.options.overflow_as_errors:
+ self.instance.status = "skipped"
+ self.instance.reason = "imgtool overflow"
else:
self.instance.status = "error"
self.instance.reason = "Build failure" I'll send a PR. |
Describe the bug
Twister has a check for skipping (rather than failing) builds that trigger a flash overflow error. That does not work for board that call imgtool through, where the build image is under the flash size, but the image + imgtool trailer is not. The build fails CI with an error like:
To Reproduce
Steps to reproduce the behavior:
Expected behavior
The test should be skipped.
Impact
Annoyance, unrelated CI failures.
Logs and console output
n/a
Environment (please complete the following information):
The text was updated successfully, but these errors were encountered: