This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

ANCS add WDT

In the ANCS service to add wdt, the program has been reset, the use of the protocol stack is SDK9.0.0

Parents
  • Hi Zhang,

    From your code I can see that if there is no application interrupt /BLE event occur the dog will not be fed. This is because power_manage() will put CPU to sleep and won't let the loop to get out if there is no event.

    You can try to remove power_manage(), this will allow wdt_feed() be called all the time. But this will cause the CPU to be active all the time, consuming current.

    You can replace power_manage() with __SEV();__WFE();__WFE();. This will put CPU to sleep, and still allow it to wake up and execute other command in the main loop when there is any BLE activity. Basically anytime the Softdevice is active.

  • The main difference between __SEV (); __WFE (); __WFE (); and power_manage (); is when should it get out of the function and let the CPU continue the loop , so that wdt_feed() can be called. power_manager(); won't let the CPU to continue the loop if there is no application event or BLE event.

    __SEV (); __WFE (); __WFE (); let the CPU continue if it has to wake up for anything. This includes the BLE activity that the softdevice handle in the back ground. In other words, this solution let the wdt_feed() to be called every time you have a connection event or advertising event, when power_manager() doesn't.

    connection events and BLE events are not the same. BLE events are event that the softdevice send to application. Connection events is the event occurs on BLE interval even there is no data to send.

Reply
  • The main difference between __SEV (); __WFE (); __WFE (); and power_manage (); is when should it get out of the function and let the CPU continue the loop , so that wdt_feed() can be called. power_manager(); won't let the CPU to continue the loop if there is no application event or BLE event.

    __SEV (); __WFE (); __WFE (); let the CPU continue if it has to wake up for anything. This includes the BLE activity that the softdevice handle in the back ground. In other words, this solution let the wdt_feed() to be called every time you have a connection event or advertising event, when power_manager() doesn't.

    connection events and BLE events are not the same. BLE events are event that the softdevice send to application. Connection events is the event occurs on BLE interval even there is no data to send.

Children
No Data
Related