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.
#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();
}