Simple 2 Tasks Program Crash Core1 Panic

Olfox59
Posts: 11
Joined: Tue May 02, 2017 12:36 pm

Simple 2 Tasks Program Crash Core1 Panic

Postby Olfox59 » Sat Dec 16, 2017 10:20 pm

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.

WiFive
Posts: 3529
Joined: Tue Dec 01, 2015 7:35 am

Re: Simple 2 Tasks Program Crash Core1 Panic

Postby WiFive » Sun Dec 17, 2017 4:02 am

Printf requires larger stack try 2048

Olfox59
Posts: 11
Joined: Tue May 02, 2017 12:36 pm

Re: Simple 2 Tasks Program Crash Core1 Panic

Postby Olfox59 » Sun Dec 17, 2017 2:41 pm

Thank you very much it works !

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

Fix buffer size ?

Who is online

Users browsing this forum: No registered users and 92 guests