# vTaskStartScheduler is not working in Keil uVision 5 with FreeRTOS

**URL:** <https://forums.freertos.org/t/vtaskstartscheduler-is-not-working-in-keil-uvision-5-with-freertos/17774>\
**Category:** Kernel\
**Created:** [July 6, 2023, 9:54pm UTC](https://forums.freertos.org/t/vtaskstartscheduler-is-not-working-in-keil-uvision-5-with-freertos/17774 "2023-07-06T21:54:28Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![miguelrodmen](https://avatars.discourse-cdn.com/v4/letter/m/71e660/32.png) [@miguelrodmen](https://forums.freertos.org/u/miguelrodmen)\
**Post date:** [July 6, 2023, 9:54pm UTC](https://forums.freertos.org/t/vtaskstartscheduler-is-not-working-in-keil-uvision-5-with-freertos/17774/1 "2023-07-06T21:54:28Z")

</div>

I’m working with Keil uVision and freeRTOS by first time, but I don’t know why once a load the code to my board (Nucleo-F302R8) it is not working.

I’m working with the following, for testing I’m just trying to blink two LEDs, and I’m trying to keep it standalone (not using Cube). Looking for a solution I found that some people had missing

> ```
> /* Map the FreeRTOS port interrupt handlers to their CMSIS standard names. */ #define xPortPendSVHandler PendSV_Handler #define vPortSVCHandler SVC_Handler #define xPortSysTickHandler SysTick_Handler
> 
> ```

But in my case this was already included, also I saw that I needed to change #define configUSE\_TIMERS from 0 to 1 so I did it, but stills not working.

```auto
#include "stm32f3xx.h"
#include "FreeRTOS.h"
#include "task.h"

const TickType_t xDelay = 500 / portTICK_PERIOD_MS;

void vLED1Task(void *pvParameters);
void vLED2Task(void *pvParameters);

void vLED1Task(void *pvParameters)
{
   

     while(1)
     {
        GPIOB->BSRR = GPIO_BSRR_BS_13;

        vTaskDelay(pdMS_TO_TICKS(500));

        GPIOB->BSRR = GPIO_BSRR_BR_13;

        vTaskDelay(xDelay);

    }
}

void vLED2Task(void *pvParameters)
{
    

     while(1)
     {
        GPIOB->BSRR = GPIO_BSRR_BS_14;

        vTaskDelay(xDelay);

        GPIOB->BSRR = GPIO_BSRR_BR_14;

        vTaskDelay(xDelay);

            
    }
}

int main(void)
{
 RCC->AHBENR |= RCC_AHBENR_GPIOBEN;
 GPIOB->MODER |= GPIO_MODER_MODER13_0;
 GPIOB->MODER |= GPIO_MODER_MODER14_0;

 xTaskCreate(vLED1Task, "LED1Task", configMINIMAL_STACK_SIZE, NULL, configMAX_PRIORITIES - 1, NULL);
 xTaskCreate(vLED2Task, (const portCHAR *)"LED2_Task", configMINIMAL_STACK_SIZE, NULL, 1, NULL);

 vTaskStartScheduler();  
    
  
}

```

---

<div class="post-metadata">

**Author:** ![miguelrodmen](https://avatars.discourse-cdn.com/v4/letter/m/71e660/32.png) [@miguelrodmen](https://forums.freertos.org/u/miguelrodmen)\
**Post date:** [July 7, 2023, 5:48am UTC](https://forums.freertos.org/t/vtaskstartscheduler-is-not-working-in-keil-uvision-5-with-freertos/17774/2 "2023-07-07T05:48:34Z")

</div>

I set configUSE\_TIMERS as 2 and it worked, I thought it was a binary value, does any know why it required to set as 2 to work?

---

<div class="post-metadata">

**Author:** ![aggarg](https://d3iykfbgfh8zhg.cloudfront.net/user_avatar/forums.freertos.org/aggarg/32/4245_2.png) [@aggarg](https://forums.freertos.org/u/aggarg)\
**Post date:** [July 7, 2023, 6:06am UTC](https://forums.freertos.org/t/vtaskstartscheduler-is-not-working-in-keil-uvision-5-with-freertos/17774/3 "2023-07-07T06:06:07Z")

</div>

> [@miguelrodmen](#):
>
> I set configUSE\_TIMERS as 2 and it worked

It should not make any difference. Can you revert it back to 0 and break it in the debugger and see what the code is doing when it appears stuck?
