Page 1 of 1

Simple 2 Tasks Program Crash Core1 Panic

Posted: Sat Dec 16, 2017 10:20 pm
by Olfox59
Hi Every body,
After succesfully installed eclipse and run few examples "by hand" , i'm starting a simple program.

I started from blinck exemple, and add a second tasks.

Led connected to pin5 blinks well. My second tasks executed each 1 second a printf("hello"):

Code: Select all

void my_task2(void *pvParameter)
{

    while (1){
    	printf("task in loop\n\r");
    	vTaskDelay(1000 / portTICK_PERIOD_MS);
    } // end while

//	vTaskDelete(NULL);
}
my main.c really simple:

Code: Select all

void app_main()
{
	printf("app main\n\r");
  //  xTaskCreate(&blink_task, "blink_task", configMINIMAL_STACK_SIZE, NULL, 5, NULL);

    xTaskCreate(&my_task2,"task2",1000,NULL, 4, NULL);


 //   vTaskStartScheduler ();					// Start the real time kernel with preemption.

    // Will not get here unless a task calls vTaskEndScheduler ()
}
But esp32 doesnt like it , and i can see in uart console rebooting and making this error:

Code: Select all

Error: Core 1 panic'ed (StoreProhibited). Exception was unhandled.
When i disable the printf , no more error.

I don't really see what i did wrong here. i found freertos really nice, at the moment ... on paper :(

Thanls a lot for your help.

Re: Simple 2 Tasks Program Crash Core1 Panic

Posted: Sun Dec 17, 2017 4:02 am
by WiFive
Printf requires larger stack try 2048

Re: Simple 2 Tasks Program Crash Core1 Panic

Posted: Sun Dec 17, 2017 2:41 pm
by Olfox59
Thank you very much it works !

How is it possible that this function require so much space ?

Fix buffer size ?