Looping in a simple task

User avatar
kolban
Posts: 131
Joined: Tue Jun 16, 2015 1:09 pm
Location: Fort Worth, Texas, USA

Looping in a simple task

Postby kolban » Mon Nov 09, 2015 1:39 pm

I am practicing with the latest RTOS SDK. I have created an application which creates a task and in that task I display some data and then sleep and then loop some more repeating the display/sleep pair. When I run the application, it displays between 8-20 iterations from the loop and then WDT resets. Then it may do this for 3 or 4 more times and then seems to "lock up". I am unable to see any logic errors in my coding. Am I mistaken in assuming that a call to vTaskDelay() suspends the current running task allowing the RTOS and other tasks to get control?

Here is my application:

Code: Select all

#include "esp_common.h"

void taskConnect(void *pData) {
   printf("Hello from taskConnect!\n");
   int count = 0;
   while(1) {
      count++;
      printf("count - %d\n", count);
      vTaskDelay(10);
   }
}

void user_init(void) {
   printf("SDK version:%s\n", system_get_sdk_version());
   printf("user_init running ...\n");
   wifi_set_opmode(NULL_MODE);
   xTaskCreate(taskConnect, "taskConnect", 200, NULL, 3, NULL);
}

User avatar
kolban
Posts: 131
Joined: Tue Jun 16, 2015 1:09 pm
Location: Fort Worth, Texas, USA

Re: Looping in a simple task

Postby kolban » Fri Nov 20, 2015 1:30 pm

I decided to rebuild my application again without reference to what I did before ... this time it worked perfectly. This tells me that I must have messed up my previous build technology. I don't know what I might have done ... but that is no longer important as I now have a recipe that works and have copied it to be safe. This issue is now closed.

Who is online

Users browsing this forum: No registered users and 140 guests