-
Notifications
You must be signed in to change notification settings - Fork 93
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
Not receiving downlinks when using low power timers (STM32F070 / SX1276) #103
Comments
@PietKnaak Are you building with RTOS or non-RTOS ? Have you twiddled radio driver timers also to low power timeout ? |
ARM Internal Ref: IOTCELL-1458 |
@PietKnaak I have tested Deep Sleep with K64F + SX1276 and it worked as it should. #if DEVICE_LPTICKER
#include "LowPowerTimeout.h"
#define ALISAS_LORAWAN_TIMER mbed::LowPowerTimeout
#else
#include "Timeout.h"
#define ALISAS_LORAWAN_TIMER mbed::Timeout
#endif
// find it in private variablles
ALISAS_LORAWAN_TIMER tx_timeout_timer; That is it. 'use-lowpower-timer-ticker' doesn't have any effect for RTOS. For tracing that how much time you are spending in Deep Sleep: #include "mbed_stats.h"
static mbed_stats_cpu_t stats;
void my_func()
{
mbed_stats_cpu_get(&stats);
printf("Uptime %" PRId64 "\n", stats.uptime);
printf("idle time %" PRId64 "\n", stats.idle_time);
printf("sleep time %" PRId64 "\n", stats.sleep_time);
printf("depp sleep time %" PRId64 "\n", stats.deep_sleep_time);
} Here is the example output:
I don't have the platform you specified at my disposal, so you should make sure that it is capable of going into Deep Sleep. |
@hasnainvirk thank you for replying. We use mbed5.8 without RTOS. My mbed ignore looks like:
I'm using these radio drivers: https://github.com/ARMmbed/mbed-semtech-lora-rf-drivers#c4dd25eec9ae30f9532e498ea7e2cacd758c733e
Yes, but only with the LSI which results in downlinks on a high Data Rate, we are now modifying the board to use the LSE to see if that works more reliable. |
@PietKnaak I have just tried with latest Mbed OS without RTOS. .mbedignore will look like this:
Take this PR from radio driver ARMmbed/mbed-semtech-lora-rf-drivers#31 mbed_app.json settings: "platform.cpu-stats-enabled": true,
"events.use-lowpower-timer-ticker": true, Everything works nicely, except the trace being bonkers, e.g.,
I would recommend that you should use latest Mbed OS (patch release coming today). Size of the build: 10K RAM, 87K Flash. You can save at least 4-5K of RAM by using newlib-nano which would then result in RAM footprint of about ~5K. |
@hasnainvirk using an external LSE (low frequency xtal) and patching the timers as suggested in your PR solved the issue. I will update mbed-os tomorrow. Thanks a lot for your quick support! |
@hasnainvirk @PietKnaak Great! |
@PietKnaak Pleasure is all mine. Can you please go ahead and close the issue if you are satisfied ? |
I'm using a STM32F070 board with a SX1276 radio. When using the normal ticker all (joins, uplinks and downlinks) seems to work fine. When we switch to low power tickers (and enable the use-lowpower-timer-ticker in the events library config) the downlinks stop to work.
Has the stack been tested with low power tickers this or other processors?
For debugging, can you give us some pointers where to start digging?
The text was updated successfully, but these errors were encountered: