# vTaskStartScheduler() error

**URL:** <https://forums.freertos.org/t/vtaskstartscheduler-error/11880>\
**Category:** Kernel\
**Created:** [March 2, 2021, 7:58pm UTC](https://forums.freertos.org/t/vtaskstartscheduler-error/11880 "2021-03-02T19:58:10Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Joseph](https://avatars.discourse-cdn.com/v4/letter/j/dc4da7/32.png) [@Joseph](https://forums.freertos.org/u/Joseph)\
**Post date:** [March 2, 2021, 7:58pm UTC](https://forums.freertos.org/t/vtaskstartscheduler-error/11880/1 "2021-03-02T19:58:10Z")

</div>

hello I’m getting started with freeRTOS  
I’ve been trying to blink an led with a delay of 1sec but whenever I include vTaskStartScheduler() function the led blinks faster than the delay period what might be the problem ,here is my code

```auto
#include <stdio.h>

#include "freertos/FreeRTOS.h"

#include "freertos/task.h"

#include"freertos/FreeRTOSConfig.h"

#include "driver/gpio.h"

#include "sdkconfig.h"

/* Can use project configuration menu (idf.py menuconfig) to choose the GPIO to blink,

   or you can edit the following line and set a number here.

*/

#define BLINK_GPIO 1

void blink_1(void *parameters){

while(1) {

        /* Blink off (output low) */

        printf("Turning off the LED\n");

        gpio_set_level(BLINK_GPIO, 0);

        vTaskDelay(1000 / portTICK_PERIOD_MS);

        /* Blink on (output high) */

        printf("Turning on the LED\n");

        gpio_set_level(BLINK_GPIO, 1);

        vTaskDelay(1000 / portTICK_PERIOD_MS);

    }

}

void app_main()

{

    /* Configure the IOMUX register for pad BLINK_GPIO (some pads are

       muxed to GPIO on reset already, but some default to other

       functions and need to be switched to GPIO. Consult the

       Technical Reference for a list of pads and their default

       functions.)

    */

    gpio_pad_select_gpio(BLINK_GPIO);

    /* Set the GPIO as a push/pull output */

    gpio_set_direction(BLINK_GPIO, GPIO_MODE_OUTPUT);

      xTaskCreatePinnedToCore(blink_1,"blink_1",1024,NULL,configMAX_PRIORITIES-1,NULL,0);

     // xTaskCreate(blink_2,"blink_2",1024,NULL,0,NULL);

      vTaskStartScheduler();

}

```

thanks

---

<div class="post-metadata">

**Author:** ![lundinc](https://avatars.discourse-cdn.com/v4/letter/l/0ea827/32.png) [@lundinc](https://forums.freertos.org/u/lundinc)\
**Post date:** [March 2, 2021, 8:18pm UTC](https://forums.freertos.org/t/vtaskstartscheduler-error/11880/2 "2021-03-02T20:18:22Z")

</div>

Hi Joseph,

The issue is that the scheduler has already started before `app_main` is called. The solution is to comment out the call to `vTaskStartScheduler();`

See [[TW#17310] xTaskCreate -\> Guru Meditation Error of type InstrFetchProhibited occurred on core 0. (IDFGH-1540) · Issue #1457 · espressif/esp-idf · GitHub](https://github.com/espressif/esp-idf/issues/1457).

---

<div class="post-metadata">

**Author:** ![Joseph](https://avatars.discourse-cdn.com/v4/letter/j/dc4da7/32.png) [@Joseph](https://forums.freertos.org/u/Joseph)\
**Post date:** [March 2, 2021, 8:50pm UTC](https://forums.freertos.org/t/vtaskstartscheduler-error/11880/3 "2021-03-02T20:50:49Z")

</div>

Thanks ,commenting out the call worked
