6 years, 9 months ago.

How To use freertos for stm32f030r8 project?

freertos_test

https://os.mbed.com/users/chalikias/code/freertos_test/

The examples can not run on stm32f030r8

  1. include "mbed.h"
  2. include "FreeRTOS.h"
  3. include "task.h"

DigitalOut led1(PB_3); DigitalOut led2(PB_4); Serial pc(PA_9,PA_10);

void Task1 (void* pvParameters) { (void) pvParameters; Just to stop compiler warnings. for (;;) { led1 = !led1; pc.printf("Task1\n"); vTaskDelay(500); } }

void Task2 (void* pvParameters) { (void) pvParameters; Just to stop compiler warnings. for (;;) { led2= !led2; pc.printf("Task2\n"); vTaskDelay(5000); } }

int main (void) { pc.BAUD(115200); xTaskCreate( Task1, ( signed char * ) "Task1", configMINIMAL_STACK_SIZE, NULL, tskIDLE_PRIORITY, ( xTaskHandle * ) NULL ); xTaskCreate( Task2, ( signed char * ) "Task2", configMINIMAL_STACK_SIZE, NULL, tskIDLE_PRIORITY, ( xTaskHandle * ) NULL ); vTaskStartScheduler(); should never get here pc.printf("ERORR: vTaskStartScheduler returned!"); for (;;); }

Be the first to answer this question.