-
Notifications
You must be signed in to change notification settings - Fork 3k
FlashIAP & NVStore tests: Skip test if overwriting code in flash #7212
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
FlashIAP & NVStore tests: Skip test if overwriting code in flash #7212
Conversation
@jeromecoutant Would be glad if you could test this fix on your board, as I don't have it. If you can do it on all supported three toolchains (GCC_ARM, ARM, IAR), it would be best. Note that if it works, you should see a print telling the test was skipped. |
TESTS/mbed_drivers/flashiap/main.cpp
Outdated
#endif | ||
|
||
// This macro returns if flash test overwrites the code in flash. | ||
#define RETURN_IF_TEST_OVERWRITES_CODE(ADDRESS) \ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this would be nicer if its just a function, no need for a macro?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not a big macro fan myself. However, in this case, macro seems like the better solution, as it includes a return
inside. Turning this into a function would make the code a bit more bloated, as it would make all three tests check the return value, and return if it indicates that the code is getting overwritten. No biggie, can change if required.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍 Fine as it is
Hi But I couldn't compile for L475VG and ARM... [DEBUG] Errors: Error: L6218E: Undefined symbol Load$$LR$$LR_m_text$$Limit (referred from BUILD/tests/DISCO_L475VG_IOT01A/ARM/TESTS/mbed_drivers/flashiap/main.o). |
@jeromecoutant Yes I am able to reproduce this problem with the ARM compiler (the other toolchains seem to behave properly). Will probably need more time to investigate. |
5900707
to
a7657df
Compare
@jeromecoutant Please retest with the ARM compiler. Made a change that depends on another open PR, so even if it works, it'll be some time until it gets merged. You only need to pull TESTS/mbed_drivers/flashiap/main.cpp (other files aren't relevant for your target). |
a7657df
to
3097d66
Compare
Hi
|
908711d
to
dc5147f
Compare
OK, I think I understand the problem (has to do with the beginning of the text section). Pushed a fix for it now. Keeps working on the boards I have. |
dc5147f
to
102eeaa
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As discussed by mail, test seems OK with ARM, GCC and IAR now
102eeaa
to
0e7f7f4
Compare
Thanks @jeromecoutant. Just pushed a commit without the debug print. |
/morph build |
Build : FAILUREBuild number : 2412 |
@davidsaada Please review the build linker issues. |
@ARMmbed/mbed-os-storage Mind taking a quick look at the test changes? Should be fine. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks great to me
Test : FAILUREBuild number : 2549 |
Test needs to be rerun. Failure is on a timeout after flashing the image. Tried myself with the same board and it works OK. |
/morph test |
Remove unnecessary manual inclusion of tmpm64b_fc object file in linker script
Test : FAILUREBuild number : 2559 |
Welp, at least now the test that caused this PR to fail is not longer in the repo. /morph test |
/morph test |
7fddba1
to
876b5f7
Compare
/morph build |
Build : SUCCESSBuild number : 2821 Triggering tests/morph test |
/morph mbed2-build |
Exporter Build : SUCCESSBuild number : 2451 |
Test : SUCCESSBuild number : 2571 |
@cmonr Don't know what this failure is about, probably not related to this PR. Regardless, please note that this PR is depending on #7791. As both PRs are on the verge of merging (after uVisor test failure gets sorted out), I don't think we should rebase this one and go through the entire morph build process again. Please just take this into consideration if and when both PRs get merged. |
It's possible that a commit that was merged caused the uVisor test to break in a strange way. We've been keeping an eye on it this weekend since it's blocking a whole slew of PRs from being merged :( |
/morph uvisor-test |
…mall_flash FlashIAP & NVStore tests: Skip test if overwriting code in flash
Retagging for 5.10 since FLASHIAP_ROM_END is not in a patch release. |
Description
The FlashIAP test erases the last two sectors in some of its test cases. NVStore test does the same. However, with boards that have small flash components (and large last sectors), this test may overwrite the code section. This fix checks that scenario and skips the test if it is indeed the case.
Resolves #7149 and #7388.
Pull request type