Deal with "Watchdog Tripped Error - Code Executed Too Long" in some targets

Former Member
Former Member
How to deal with:
Failed invoking <symbol>
Watchdog Tripped Error - Code Executed Too Long


In some target devices such as D2 Bravo or Fenix 3 this error in simulator occurs. In Vivofit HR, epix or Fenix 5 it is ok. My new code is using a "big" array for read-write-access and iterates in two nested for loops through it. Is this due to hardware limitation reasons?
  • The watchdog timer does vary by device. You can do more before it's triggered on faster devices (the va-hr and f5 are faster than the d2 or f3). In the SDK, in the bin directory, is devices.xml, and if you look at it it you'll see "watchdog_count" which defines when it trips per device. (I think it's the number of byte codes that can be executed in a function called by the VM before it's triggered.)

    The only way to avoid it is to restructure how you're doing something. Maybe split something so you only handle 1/2 the data in the first call, and the next time, the second half (with a return to the vm between the calls). If it's something like walking an array looking for min/max/average, don't walk the array, but determines those things as you add to the array and don't walk the array.