I am getting the following error messages sometimes when my application processes data received on the UART port:
OAT Task Index 2
Watch dog reset: Tsk 32
I’ve also seen Tsk 36, 31, and 29.
The Task index is correct, but I don’t know what the others are. I’m pretty sure the problem is how I’m processing data. I have one task which is mostly copy/paste from the UART example, it has a while(1), eventWait() loop. I have never seen that task ID cause a watchdog reset.
My Task ID 2 has a while(!done) eventWait() loop, and processes data when the event flag is set. This is the task I always crash in. I have tried using adl_wdPut2Sleep(ADL_TMR_S_TO_TICK(60)) to temporarily turn off the hardware watchdog, but this has no effect on the problem.
The loop only run for a few seconds at a time. Is this really the watchdog resetting the device? If it isn’t, what is the “Watch dog reset error” supposed to mean? I know loops are generally a bad idea here, but I’ve never had a problem with the task that reads the UART data crashing, only task ID 2. Thanks for any help or ideas!
while(!done) loops are a killer in the OpenAT environment. Don’t use them. Refactor your code to be an event driven Finite State Machine instead.
Remember that your whole OpenAT application is just another task to the firmware controlling the radio - which is where the TaskID’s you are seeing may be coming from. The Radio Firmware has some very tight constraints to work under when servicing the GSM stack. If the GSM stack is not serviced properly, you run the risk of the GSM network banning your (non-compliant) module from connecting to the network.
Also, there’s no way of knowing just which task is ‘patting’ the watchdog - which is why sometimes a delay of a couple of seconds works, and sometimes doesn’t.
Very true. I never get a reset when I unplug my external device, probably because I’m always waiting for data to become available. I suppose I’m reading enough data in the loop where it never gets a chance to do anything else.