-
Notifications
You must be signed in to change notification settings - Fork 3k
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
Debug build flag + change to sleep behavior in debug mode #4097
Conversation
/morph test-nightly |
Result: FAILUREYour command has finished executing! Here's what you wrote!
OutputBuild failed! |
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.
No tools changes, so they look fine.
FYI @bulislaw Looks like there's a build failure on this one |
One of the board was still declaring /morph test-nightly |
retest uvisor |
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.
+1
we might want to document this also in the mbed_sleep.h - why NDEBUG is not the way to go as mentioned in the first description here (develop has been the default profile). To answer any questions NDEBUG vs MBED_DEBUG?
I think we should document it, but it should be in some generic place, where we document macros, rather than for sleep specific. I don't think we have anything close to that. |
@Patater can you please check. All uvisor enabled profiles fail tests. |
Result: FAILUREYour command has finished executing! Here's what you wrote!
OutputBuild failed! |
Still maxim failure for sleep:
|
cefba0b
to
f0a79e6
Compare
/morph test-nightly |
Result: SUCCESSYour command has finished executing! Here's what you wrote!
OutputAll builds and test passed! |
I used git bisect on the commits in this PR, manually clearing all the pyc files between builds as otherwise the uVisor tests would still fail after going back to older commits. Indeed commit the commit "Disable sleep and deepsleep when MBED_DEBUG macro is defined" causes the uVisor release-mode tests to fail. I'm not sure why, as it doesn't appear like that commit should have any effect on the uVisor tests passing or not, but it does. Maybe the TARGET_DEBUG and TARGET_RELEASE feature is not working any longer after the addition of something after |
It's weird because sleep behavior is not changed for 'release' or 'debug' profiles, only the 'develop' profile changes. |
I debugged a bit further. Previously (before "Disable sleep and deepsleep when MBED_DEBUG macro is defined"), in uVisor-enabled release builds, the rtos idle thread never tried entering sleep Now, an attempt to enter sleep is made in uVisor-enabled release builds, but how sleep is being entered is faulting. The fault is due to attempting to read and write to the SCR register (in In uVisor-enabled debug builds, no attempt to enter sleep is made, so |
Ah right so you use mbed OS develop profile and uVisor release build, in this case yes the behaviour changed. But that means the bug was there, it was just hidden by the sleep not being there for default profile. I've changed it for two reasons, one is that many people use online ide therefore their boards wouldn't sleep at all, second, I was afraid we will hide bugs as most people will use and deploy develop profile. I'm guessing that's exactly what we hit, do you know what's going wrong with the sleep? |
Where can I read more about this "develop" and "default" profiles? I thought we only have "release" and "debug". Maybe this is another dimension. Yes, this bug was present in the past; your PR doesn't introduce it, only expose it. We never ran our tests with a version of mbed OS that actually attempted to sleep. |
Well some high level info here https://github.com/bulislaw/Handbook/blob/1d7783db92c6a514912ba0bfe841db40852d2dcd/docs/dev_tools/build_profiles.md and actual differences here https://github.com/ARMmbed/mbed-os/tree/master/tools/profiles |
The default profile is "develop" with the CLI tools. I had assumed it was "release". So, yes, I am running the "develop" profile and mistakenly calling it the "release" profile. What tests does mbed OS have to ensure that sleep is being entered appropriately? I'll run blinky with a debugger attached and see if we ever call Could your PR update https://github.com/ARMmbed/mbed-os/tree/master/tools/profiles to mention that develop now enters sleep? |
@bulislaw could you resolve the conflict? |
@bulislaw Can you please rebase (remove the merge commit) ? |
b96cbbc
to
c5f0ad5
Compare
@0xc0170 done |
/morph test-nightly |
/morph test-nightly |
Result: FAILUREYour command has finished executing! Here's what you wrote!
OutputExample Build failed! |
@bridadan that failure looks like CI issue, maybe it run out of license or something like that? no much info |
@bulislaw I've seen this issue crop up a few times and it's always on IAR, but I have trouble reproducing it. I'll punch it one more time. /morph test-nightly |
Result: FAILUREYour command has finished executing! Here's what you wrote!
OutputTest failed! |
Different error (not related I believe for this patch) /morph test-nightly |
Result: SUCCESSYour command has finished executing! Here's what you wrote!
OutputAll builds and test passed! |
This contains a fix for a bug that is blocking export builds. Merging. |
Given this takes a new macro and uVisor exclusion to resolve it seems fishy. What problem is this actually solving?
This is not a good reason to merge. That change is a fix unrelated to this PR therefore should not have been part of this PR. It would have been better sent as its own PR |
Going even further back 6a045a4 we seem to have added NDEBUG where version supported to work didnt make any efforts for release builds. https://github.com/ARMmbed/mbed-os/tree/db49c1edebc3516ee61197641f7cfbdeaea5482f I'm thinking this should be reverted and NDEBUG removed if it fixes an issue we broke between mbed OS 5 and mbed OS 2. Unless there is another reason for this but it all seems like something we may want, haven't documented therefore is very confusing. |
Main reason for this PR is confusing behavior, the original change was assuming that people actually will user release builds for 'release'. As it seems not only they can't while using online compiler, but usually don't when they use CLI. We got couple of people asking about the sleep not working and I agree it should be on in the default profile. At the same time it feels like sleep it should be disabled in debug mode, not to mention it breaks local file system (if we care about it). |
Description
MBED_DEBUG
that's only defined for debug profile. Right now NDEBUG is defined only for release profile, which makes it impossible to separate develop and debug builds features.Status
READY
CC: @theotherjimmy @0xc0170