Comments (5)
sorry, this assert fail appeared again after this modification.
i am doing more test and debug on it.
from sub-iot-stack.
add a log, and reproduce the assert fail.
#ifndef NDEBUG
//check that we didn't try to schedule a timer in the past
//normally this shouldn't happen but it IS theoretically possible...
fire_delay = (next_fire_time - timer_get_counter_value() - timer_info->min_delay_ticks) + 1;
//fire_delay should be in [0,COUNTER_OVERFLOW_INCREASE]. if this is not the case, it is because timer_get_counter() is
//now larger than next_fire_event, which means we 'missed' the event
if (((int32_t)fire_delay) <= 0) {
log_print_stack_string(LOG_STACK_FWK, "fire_delay %u, next_fire_time %u, counter_value %u, min_delay_ticks %u",
fire_delay, next_fire_time, timer_get_counter_value(),timer_info->min_delay_ticks );
}
assert(((int32_t)fire_delay) > 0);
#endif
log:
[237097] [PHY] Switching to sleep mode
[237098] [PHY] resuming from sleep mode
[237099] [PHY] sync_word = f498, ch_coding 2
[237100] [PHY] Switching to sleep mode
[237101] [PHY] resuming from sleep mode
[237102] [PHY] sync_word = f498, ch_coding 2
[237103] [PHY] Switching to sleep mode
[237104] [PHY] resuming from sleep mode
[237105] [PHY] sync_word = f498, ch_coding 2
[237106] [PHY] Switching to sleep mode
[237107] [NONE] fire_delay 0, next_fire_time 6575904, counter_value 6575900, min_delay_ticks 5assertion "((int32_t)fire_delay) > 0" failed: file "/Users/sam/dash7-ap-open-source-stack/stack/framework/components/timer/timer.c", line 306, function: configure_next_event
the timer_get_counter_value()
is increasing all the time cause its LPTIM hardware time. Every time we call it the result maybe increase.
So this feels that it is not very suitable to call it frequently here. I made a modification call at the top of configure_next_event()
store the current_time and use it in the whold function, i am testing this modification for serveral hours to see if there is any other error.
--
update:
i have tested this modification for 15 hours by keeping sending read requset cmd to sensor_pull
node and get the response, the gateway
and sensor_pull
works well without any error.
It seems like it works.
from sub-iot-stack.
ok thanks for the detailed information, I see the problem indeed. I did not notice it myself, probably because I'm not using debug builds for longer running tests, so this code is removed by precompiler. The modification you propose looks fine, can you create a PR please?
Related to this: we will probably re-add support for a normal timer next to LPTIMER as well, since for some internal timings the delay of setting the LPTIMER is too big
from sub-iot-stack.
Thanks for your reply. i make a PR for it. Please check if this is as your expectation.
from sub-iot-stack.
ok, merged. I will close this for now
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
- Assertion fail in timer_fired() HOT 5
- 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.