Hello!
I'm using dialog serial port host reference design as a base for my project. Upon receiving an advertising packet, I use user_on_adv_report_ind() function to process the advertising data. Inside this function, I call another function sim900_send_sms() to interface with a GPRS module (send AT commands). The problem arises when I make a delay of 2000ms inside sim900_send_sms(). In other words, the code hangs when I delay 2000ms. It works when I reduce the delay to 1000ms. I've already disabled watchdog timer in da1458x_ config_basic.h. Then I read the DA1458x software platform reference, it mentions about the timing constraints of app_on_ble_powered() and app_on_system_powered().
So, I suspect the code hangs because I violated the timing constrains in app_on_ble_powered(), not because of the watchdog timer. Am I correct?
What are the values of the timing constraints for the following callbacks?
- app_on_ble_powered()
- app_on_system_powered()
- app_before_sleep()
- app_validate_sleep()
- app_going_to_sleep()
- app_resume_from_sleep()
Hi quangng,
Things are not that simple, its not possible to define the exact time constrains for the execution of the functions that you mention, in general you can't spend to much time in the app_on_ble_powered() and the time that you can spend on this function in order to perform operations for your application is defined by the connection interval that your system has, for example if an interval is set to 20 ms you cant spend 1000ms in your function since the connection interval message that the device should transmit its not going to be scheduled and therefore your device will miss the scheduled event that has arranged with the master. And in general you have to run the scheduler frequently in order for pending messages from the stack to get executed. For extra information regarding the timing constrains you can have a look at the UM-B-051 Software Platform Reference .pdf on paragraph 7.
Also you mention that your code hangs, that doens't give me enough information to understand the cause of it, it hangs where ? You have a watchdog interrupt (most probably) a hardfault interrupt ?
Thanks MT_dialog