Task watchdog triggered after continues i2c burst reads

preetam
Posts: 49
Joined: Thu Jan 26, 2017 2:31 pm
Location: Germany

Task watchdog triggered after continues i2c burst reads

Postby preetam » Fri Apr 07, 2017 11:36 am

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

preetam
Posts: 49
Joined: Thu Jan 26, 2017 2:31 pm
Location: Germany

Re: Task watchdog triggered after continues i2c burst reads

Postby preetam » Fri Apr 07, 2017 12:16 pm

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);

User avatar
kolban
Posts: 1683
Joined: Mon Nov 16, 2015 4:43 pm
Location: Texas, USA

Re: Task watchdog triggered after continues i2c burst reads

Postby kolban » Fri Apr 07, 2017 11:26 pm

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?
Free book on ESP32 available here: https://leanpub.com/kolban-ESP32

preetam
Posts: 49
Joined: Thu Jan 26, 2017 2:31 pm
Location: Germany

Re: Task watchdog triggered after continues i2c burst reads

Postby preetam » Thu Apr 13, 2017 8:12 am

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

Who is online

Users browsing this forum: Baidu [Spider] and 108 guests