Comments (5)
Hi! Is this still the case with other sleep modes (changing FRAMEWORK_SCHEDULER_LP_MODE to 0, 1 or 255)? Can you also reproduce it in an independent, bare-bones application?
from sub-iot-stack.
Changing FRAMEWORK_SCHEDULER_LP_MODE does not seem to have any effect, However I did manage to make a minimum reproduction of this issue:
#include "framework_defs.h"
#include "hwleds.h"
#include "platform.h"
#include "scheduler.h"
#include "timer.h"
// this is needed as we're not using the filesystem, also possible to remove blockdevices from platf_main.c
uint8_t d7ap_volatile_files_data[FRAMEWORK_FS_VOLATILE_STORAGE_SIZE];
static void end_flash() { led_off(0); }
void led_flash()
{
led_on(0);
timer_post_task_delay(&end_flash, TIMER_TICKS_PER_SEC * 0.1);
}
void repeating_task()
{
led_toggle(0);
printf("Repeating task\n");
}
void bootstrap()
{
printf("Device booted at time: %ld\n", timer_get_counter_value());
sched_register_task(&repeating_task);
sched_register_task(&end_flash);
led_flash();
timer_post_task_prio(
&repeating_task, timer_get_counter_value() + 1, DEFAULT_PRIORITY, TIMER_TICKS_PER_SEC / 2, NULL);
}
It seems that calling led_flash()
which schedules a task, just before starting the repeating task causes the repeating task to only be run twice before it crashes.
The serial output is:
Device booted at time: 0
Repeating task
Repeating task
Device booted at time: 0
Repeating task
Repeating task
Device booted at time: 0
Repeating task
Repeating task
So we can see that it reboots due to the watchdog. If it wouldn't crash we would see Repeating task
printed ad infinitum.
Tested on the B_L072Z_LRWAN1 platform. I just replaced simple_leds/app.c
content with the code above and ran cmake ../Sub-IoT-Stack/stack -DAPP_SIMPLE_LEDS=y; make
from sub-iot-stack.
I created a pull request (#121) with a possible fix, tried it on the example, and it seems to work, could you test if it's also working for your actual application?
from sub-iot-stack.
That's fast! Just tested it and it seems to work indeed!
from sub-iot-stack.
that's great news! Happy to help!
from sub-iot-stack.
Related Issues (20)
- noise_logger.c compile fails - userbutton.h not found HOT 2
- sniffer.c compile fails - alp_cmd_handler.h not found HOT 1
- I2C on B_L072Z_LRWAN1 platform HOT 2
- Sensor Action example: assertion "is_fs_init_completed" failed HOT 1
- Sensor Action example: incorrect value in RTT logs HOT 4
- STM32 hw_get_unique_id() bug HOT 4
- Gateway software ? HOT 1
- RTT Logging does not work well with Sleep
- Performance results available? HOT 1
- Bug scheduling messages in the unsollicited response callback HOT 8
- Board resets when sending message using default access class at index 1 set to normal rate. HOT 6
- Scheduler hangs when scheduling a task through interrupt service routine HOT 1
- Unkown hardfault when running C++ on B-L072Z-LRWAN1 HOT 2
- Enforce .clang-format
- Some compiler flags that cause errors now that might be worth it to be fixed HOT 2
- ALP_ITF_ID_D7ASP interface config format doesn't seem to match spec (same with pyd7a impl) HOT 2
- alp_received_unsolicited_data_cb does not get called anymore HOT 5
- ALP layer: unsolicited commands are sent back in the response HOT 1
- Compilation Error while running make HOT 4
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from sub-iot-stack.