-
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
Add LOWPOWERTIMER for NUCLEO_F401RE and DISCO_F429ZI #3319
Conversation
LGTM 👍 |
@mbed-bot: TEST HOST_OSES=ALL |
/morph test |
/morph test |
That's refactoring. It should be fine to merge this one in as adding new extension, and refactor will come later. (if these PR are not connect, assuming there are not) @jeromecoutant happy with this one coming in first, then refactor? |
Yes, you can merge. Thx |
Result: SUCCESSYour command has finished executing! Here's what you wrote!
OutputAll builds and test passed! |
The normal tests won't run the low power timer tests. I'll kick off a nightly. /morph test-nightly |
Result: FAILUREYour command has finished executing! Here's what you wrote!
OutputTest failed! |
@jeromecoutant The test |
21b0cfd
to
e686100
Compare
Thanks for the update @jeromecoutant, let's get #3345 merged in before we rerun the bots on this. |
#3345 merged, lets rerun CI |
/morph test-nightly |
Result: FAILUREYour command has finished executing! Here's what you wrote!
OutputTest failed! |
@jeromecoutant Still lp ticker 500us fails , for nucleo 411re ? Same as reported above:
|
@0xc0170 |
@jeromecoutant Could you please retry with GCC version 4.9.3 as we don't currently support v5.x. |
If you can reproduce the failure on your machine with that version of the compiler (available here) then I'm curious what about the STM32F4 code is causing this issue (since it works on other targets just fine). |
Hi ... | NUCLEO_F401RE-GCC_ARM | NUCLEO_F401RE | tests-mbed_drivers-lp_timeout | 1ms LowPowerTimeout | 1 | 0 | OK | 0.05 | |
Does Ci use the same compilation options....? |
Yes, it does. It uses the default profile. We will try to reproduce this locally , will report back |
Ok @jeromecoutant I think I know how you can reproduce this.
This SHOULD cause the failure we're seeing. The missing bit was the heap stat tracking that we enable in CI (we also enable stack stat tracking with If you remove the heap stack tracking, it'll start passing again, which is what you're currently seeing. FYI @c1728p9 |
Have you had any luck reproducing this @jeromecoutant? Thanks for your patience. |
@jeromecoutant Have you been able to reproduce it? |
@jeromecoutant bump |
e756fc1
to
d1d2500
Compare
Rebase and fix applied Note about the fix: Only when MBED_HEAP_STATS_ENABLED is enabled, __wrap__free_r needs to initialize Singleton. This can be done only when IT are enabled... So to be sure that mktime is called at the first time while IT are enabled, rtc_read is called once once during init. |
Can you provide this info to the commit message. To me it's not clear this workaround, why it fails only when heap stats is enabled. Can't this be reproduced during a regular use ? |
@jeromecoutant Does this need to be wrapped in |
Goal is to keep the code size unchanged for user, as this patch is only needed for CI test. |
@jeromecoutant Ah good point! Can you fix the merge conflict please? |
/* __wrap__free_r needs to initialize Singleton not in ISR */ | ||
/* rtc_read is called at each ticker setup which call core_util_critical_section_enter */ | ||
/* so rtc_read is called once once before other calls */ | ||
rtc_read(); |
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.
If malloc or free get called on first call to rtc_read then this is a problem regardless of whether MBED_HEAP_STATS_ENABLED is set, and could lead to a crash. To make this implementation of lp ticker truly interrupt safe then the call to mktime needs to be removed.
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.
But malloc is not called if MBED_HEAP_STATS_ENABLED is not set...
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 am with @c1728p9 . That function call should not be removed if stats are enabled as it has nothing in common with lp ticker or rtc read function. rtc_read
is the one that causing the problems, that one should be changed.
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.
@jeromecoutant MBED_HEAP_STATS_ENABLED does not effect the number of calls to free or malloc, it just hooks those functions to record the number of calls.
@jeromecoutant Can you remove/replace |
Add a workaround in lp_ticker_init function for CI tests
d1d2500
to
63c5c7d
Compare
Rebase done |
To replace |
Hi |
Back to this one. Having the code conditionally compiled based on stats flag is not acceptable. The root cause should be found. I do not fully understand why rtc_read() is causing problems and why is it placed in the lp_ticker init. There are platforms that use RTC peripheral for RTC and lp ticker and did not hit this problem. We shall pull this code and run it locally to see the failure. |
Description
Add LOWPOWERTIMER for NUCLEO_F401RE and DISCO_F429ZI
Status
READY
Tests
Tests done on top of #3316
Thx