ESP32 resets while deleting task from another task
-
- Posts: 132
- Joined: Tue Aug 14, 2018 6:21 am
- Location: India
ESP32 resets while deleting task from another task
Hi all,
I want to delete the tasks from other task.(eg. task A and task B can be delete in task C).I am trying to delete this tasks using task handlers. but as I delete it, esp32 is reseting..
I want to delete the tasks from other task.(eg. task A and task B can be delete in task C).I am trying to delete this tasks using task handlers. but as I delete it, esp32 is reseting..
--
Somesh Burkule
Somesh Burkule
Re: ESP32 resets while deleting task from another task
Can you post command, how you delete it? I am suspecting you may pass pointer but vTaskDelete parameter is handle variable:
https://www.freertos.org/a00126.html
https://www.freertos.org/a00126.html
-
- Posts: 132
- Joined: Tue Aug 14, 2018 6:21 am
- Location: India
Re: ESP32 resets while deleting task from another task
I am trying like this->>chegewara wrote:Can you post command, how you delete it? I am suspecting you may pass pointer but vTaskDelete parameter is handle variable:
https://www.freertos.org/a00126.html
Code: Select all
TaskHandle_t vTaskCodeHandle= NULL;
TaskHandle_t vOtherFunctionHandle= NULL;
void vOtherFunction( void )
{
// Use the handle to delete the task.
if( vTaskCodeHandle!= NULL )
{
vTaskDelete( vTaskCodeHandle);
}
}
void vTaskCode( void )
{
while(1){
ESP_LOGI("TEST","DEBUG");
}
}
void app_main(void)
{
xTaskCreate( vTaskCode, "NAME", 2048, NULL, 1, &vTaskCodeHandle);
xTaskCreate( vOtherFunction, "name", 2048, NULL, 1, &vOtherFunctionHandle);
}
--
Somesh Burkule
Somesh Burkule
Re: ESP32 resets while deleting task from another task
The vOtherFunction task quits without vTaskDelete. Use while or for loop in it or delete on exit.
Re: ESP32 resets while deleting task from another task
It is probably better to use task notifications to request the specific task termination from another task.
-
- Posts: 132
- Joined: Tue Aug 14, 2018 6:21 am
- Location: India
Re: ESP32 resets while deleting task from another task
tried within while loop but also resets esp32chegewara wrote:The vOtherFunction task quits without vTaskDelete. Use while or for loop in it or delete on exit.
--
Somesh Burkule
Somesh Burkule
Re: ESP32 resets while deleting task from another task
This is what i meant:
PS Its weird that compiler allows you have task function with void type parameter, because task should have void* parameter.
Code: Select all
void vOtherFunction( void )
{
// Use the handle to delete the task.
if( vTaskCodeHandle!= NULL )
{
vTaskDelete( vTaskCodeHandle);
}
for(;;){ // <-- infinite loop to not allow task exit
}
// OR
while(1){}
// OR
vTaskDelete(NULL); // destroy this task (vOtherFunction)
}
-
- Posts: 132
- Joined: Tue Aug 14, 2018 6:21 am
- Location: India
Re: ESP32 resets while deleting task from another task
Not working. esp32 resets..chegewara wrote:This is what i meant:PS Its weird that compiler allows you have task function with void type parameter, because task should have void* parameter.Code: Select all
void vOtherFunction( void ) { // Use the handle to delete the task. if( vTaskCodeHandle!= NULL ) { vTaskDelete( vTaskCodeHandle); } for(;;){ // <-- infinite loop to not allow task exit } // OR while(1){} // OR vTaskDelete(NULL); // destroy this task (vOtherFunction) }
gives error-> store prohibited
--
Somesh Burkule
Somesh Burkule
-
- Posts: 33
- Joined: Wed Mar 28, 2018 6:58 am
Re: ESP32 resets while deleting task from another task
Hello there. I've been studying esp-idf FreeRTOS recently. You can read this in order to get an answer.
Regards, Kostas
Regards, Kostas
Re: ESP32 resets while deleting task from another task
Hi,
Would you please provide you crash logs for same? Also would you please try it by adding few delays between creating both tasks?
Because, we are also deleting tasks from other tasks into our application without any issue.
Would you please provide you crash logs for same? Also would you please try it by adding few delays between creating both tasks?
Because, we are also deleting tasks from other tasks into our application without any issue.
Regards,
Ritesh Prajapati
Ritesh Prajapati
Who is online
Users browsing this forum: Majestic-12 [Bot] and 100 guests