-
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
USTICKER can not be removed from compilation #9853
Comments
Internal Jira reference: https://jira.arm.com/browse/MBOCUSTRIA-923 |
We shall fix this asap as its blocking PR #9221 cc @ARMmbed/mbed-os-hal @kjbracey-arm |
Our Mbed Enabled defines ticker as a must: https://www.mbed.com/en/about-mbed/mbed-enabled/requirements/ ticker is considered as a basic functionality. If we have a valid use case, we might need to send a fix. |
From the Musca PR: When moving Error: L6218E: Undefined symbol us_ticker_clear_interrupt (referred from BUILD/ARM_MUSCA_A1_S/ARMC6/mbed-os/hal/mbed_us_ticker_api.o).
Error: L6218E: Undefined symbol us_ticker_disable_interrupt (referred from BUILD/ARM_MUSCA_A1_S/ARMC6/mbed-os/hal/mbed_us_ticker_api.o).
Error: L6218E: Undefined symbol us_ticker_fire_interrupt (referred from BUILD/ARM_MUSCA_A1_S/ARMC6/mbed-os/hal/mbed_us_ticker_api.o).
Error: L6218E: Undefined symbol us_ticker_free (referred from BUILD/ARM_MUSCA_A1_S/ARMC6/mbed-os/hal/mbed_us_ticker_api.o).
Error: L6218E: Undefined symbol us_ticker_init (referred from BUILD/ARM_MUSCA_A1_S/ARMC6/mbed-os/hal/mbed_us_ticker_api.o).
Error: L6218E: Undefined symbol us_ticker_read (referred from BUILD/ARM_MUSCA_A1_S/ARMC6/mbed-os/hal/mbed_us_ticker_api.o).
Error: L6218E: Undefined symbol us_ticker_set_interrupt (referred from BUILD/ARM_MUSCA_A1_S/ARMC6/mbed-os/hal/mbed_us_ticker_api.o).
Finished: 0 information, 2 warning and 7 error messages. When looking into |
It appears the problem is that mbed_die() implementation calls wait_us() which calls |
The fact that As a quick workaround you could conditionalise |
And if lp ticker is not defined as well? |
So this is the secure side or something - super limited environment, so no timers at all? In that case you'll could have a condition in mbed_die to avoid the blinky LED that uses the timing. Or maybe we could have |
Was considering this, the units used now in mbed_die would be OK for |
When is #9812 expected to be merged? 5.12.0 as well? |
Conceivably you could unconditionally use
|
@kjbracey-arm I saw that |
Call |
@kjbracey-arm Maybe change the void wait_us(int us)
{
#if DEVICE_USTICKER
const ticker_data_t *const ticker = get_us_ticker_data();
uint32_t start = ticker_read(ticker);
while ((ticker_read(ticker) - start) < (uint32_t)us);
#else
uint32_t iterations = us / 1000;
uint32_t last_ns = us % 1000;
for (uint32_t i = 0; i < iterations; ++i) {
wait_ns(1000000);
}
if (last_ns > 0) {
wait_ns(last_ns);
}
#endif
} |
Yes, that would make sense. I would save the division by just doing
Still, accuracy of |
Exactly.. therefor the ifdef #DEVICE_USTICKER |
My concern is what is the caller of |
The use-case are constrained devices (in our case the secure part of a PSA target). I am completely fine with putting this logic in |
Mind you, we do have existing examples of tolerating poor timing. There's a config option for STM targets that makes the lpticker be based on some circuit that has maybe 20% error rather than a proper 32.768kHz crystal... |
I'm fine putting this in |
I still get errors building a secure target without USTICKER, now Error: L6218E: Undefined symbol get_us_ticker_data (referred from BUILD/ARM_MUSCA_A1_S/ARMC6/mbed-os/drivers/Timer.o). |
Description
Discussion started here:
#9221 (comment)
@ARMmbed/mbed-os-psa
Issue request type
The text was updated successfully, but these errors were encountered: