Page 1 of 1

Task watchdog triggered after continues i2c burst reads

Posted: Fri Apr 07, 2017 11:36 am
by preetam
Hi Team,

i am working on sparkfun MAX10305 with sparkfun esp32. Below is the pseudo code which i am running in a task

Code: Select all

void taskname(void *pvParameter){

check the part id and revision id // i2c writes and reads

setup max10305 // 6 i2c writes

// loop
while(1){

vTaskDelay(1000/ portTICK_PERIOD_MS);

1. start I2C burst read and store the value // for red 
2. start I2C burst read and store the value // for IR
3. start I2C burst read and store the value // for green

}

}
Issue is the loop executes good for 10 to 15 mins and then task watchdog gets triggered. As i have already given a delay of 1 second there should not be watchdog triggered.

Do i need to specify more delay in the loop. at present this is the only task running

Code: Select all

 - IDLE (CPU 0)
Tasks currently running:
CPU 0: taskname
CPU 1: IDLE

Re: Task watchdog triggered after continues i2c burst reads

Posted: Fri Apr 07, 2017 12:16 pm
by preetam
i am getting E (308941) i2c: i2c command link malloc error before the task watchdog is triggered . so thought of increasing stack for the task from 2048 to 8192. Still issue persists\

from
xTaskCreate(&taskname, "taskname", 2048, NULL, 5, NULL);
to
xTaskCreate(&taskname, "taskname", 8192, NULL, 5, NULL);

Re: Task watchdog triggered after continues i2c burst reads

Posted: Fri Apr 07, 2017 11:26 pm
by kolban
You have only given pseudo code for the I2C interactions ... but I suspect you will be using i2c_master_cmd_begin(). This has a parameter on it which is how long it should block before giving up trying to receive the command. Is it possible that the sum of your timeouts exceeds the watchdog timer?

Re: Task watchdog triggered after continues i2c burst reads

Posted: Thu Apr 13, 2017 8:12 am
by preetam
Hi Kolban,

Thank you for your reply,

I had a lingering i2c_cmd_link_create() command before starting the new i2c_cmd_link_create() , may be this created an issue. however i did change waiting time to i2c_master_cmd_begin(I2C_MASTER_NUM, cmd, 100 / portTICK_RATE_MS) and it works fine.

Thank you
Paul