Chat freely about anything...

User avatar
By kolban
#33655 I'm starting to examine the FreeRTOS support and am playing with starting a task and having it delay for a period of time. My thinking was that when we started a task and it executed a delay, this would cause the task scheduler to run an alternate task (i.e. the ESP8266 processing). However, what I am finding is that the Watch Dog timer is firing. Here is my code:

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);
      //taskYIELD();
      vTaskDelay(10);
   }
   vTaskDelete(NULL);
   printf("Task end\n");
}

void user_init(void) {
   UART_SetBaudrate(0,115200);
   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);
}


When it starts, it creates a task (taskConnect). I see the taskConnect task run for about 20 iterrations and then my ESP8266 resets with a WDT timer reset. I had assumed that the vTaskDelay() would have allowed the scheduler to give the rest of the ESP8266 the time it needed to do its work ... but it seems I am missing some concept. Has anyone walked this path before and have any advice to offer?
User avatar
By martinayotte
#33660 I'm anxious to do some followup on Kolban issue.
I'm using RTOS on STM32 without problem, but I didn't yet on ESP since I'm using ArduinoESP (I've even thought porting the RTOS Arduino_STM32 into ArduinoESP, but to much time to spend).
In other world, this is an interesting thread ... ;)
User avatar
By march_seven
#33756
martinayotte wrote:I'm anxious to do some followup on Kolban issue.
I'm using RTOS on STM32 without problem, but I didn't yet on ESP since I'm using ArduinoESP (I've even thought porting the RTOS Arduino_STM32 into ArduinoESP, but to much time to spend).
In other world, this is an interesting thread ... ;)



are you sure????

do you find the strncasscmp()? and the stroul()?????
User avatar
By tve
#33761 The main task on which user_main ran has a certain priority and now you're running the taskConnect at some other priority. The Espressif Wifi stuff runs on the main task, that's why user_init has to return. Now, if your taskConnect task has a higher priority than the main task, you will starve the wifi processing and hence the wdt fires. At least that's how I'd explain what you observe. You can get and print the task priorities to verify by calling some FreeRTOS function, I believe...