-
Notifications
You must be signed in to change notification settings - Fork 2k
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
xtimer_usleep not working on AVR and msp430 boards #6392
Comments
Just realised that it doesn't work either on msp430... |
I don't think I will have any time to look at this within the near future, sorry. |
Have you checked what the underlying |
I'll check. It also fails on cc2538... |
Ok I made some tests and found a strange behaviour on avr-gcc compiler (I think). While doing: #define ONE_SEC_SLEEP (1 * 1000U * 1000U)
int main (void)
{
while (1) {
printf("Sleeping for 1 sec...\n");
xtimer_usleep(ONE_SEC_SLEEP);
}
return 0;
} The boards arduino-mega2560 and arduino-uno displays the text without sleeping any second. BUT if I change the define by: #define ONE_SEC_SLEEP (1 * 1000000U) it works... Any hints? For boards like waspmote-pro and remote-reva which use different frequencies for the xtimer the test fails anyways. |
Doesn't the |
This was the problem. There is some some code on RIOT which doesn't take into account this limitation (xbee driver for instance) so such code doesn't work on 16 and 8 bit platforms. What can we do? |
Open a PR to fix it. |
It's maybe hard to find ALL the places when such a thing was coded... For now I'll fix the XBee driver but for the rest I'll try to find some time to look further. |
Well, obviously we can only fix what we are aware of. Not sure what answer you expected. Code reviews and testing should prevent these kind of bugs, but unless we have a CI that runs tests on various platforms, I don't see what else we can do. |
Well the reason of this issue was because some integers were not correctly sized for these platforms, so we can close it. However, the problem of a broken XTIMER persists in boards which are not using compatible clock speeds. Namely, for now, waspmote-pro and cc2538. |
If the problem persists, why are you closing this issue. Is it noted somewhere else? CC2538 is not avr or msp430. |
There is no problem with xtimer_usleep() as far as I understood it. The problem was rather that |
While testing some drivers I found that the function
xtimer_usleep()
has no impact on AVR8 based boards.I'm trying to look for a solution but as I'm not an xtimer expert it can take long time...
Any hints @kaspar030 @gebart ?
The text was updated successfully, but these errors were encountered: