PlatformIO Community

Freertos blinky

Hi i’m trying to put together a preliminary blinky with freeRTOS. but the task doesnt exedcute!!! xTaskCreate retruns with success 1 though???

i somehow think this is a clock config problem…

   #include "stm32f1xx.h"
   #define LEDPORT (GPIOC)
   #define LED1 (13)
   #define ENABLE_GPIO_CLOCK (RCC->APB2ENR |= RCC_APB2ENR_IOPCEN)
   #define _MODER    CRH
   #define GPIOMODER (GPIO_CRH_MODE13_0)

   #include "FreeRTOS.h"
   #include "task.h"


   /* void ms_delay(int ms)
   {
      while (ms-- > 0) {
         volatile int x=500;
         while (x-- > 0)
            __asm("nop");
      }
   } */

   static void
   task1(void *args __attribute((unused))) {

      for (;;) {
         LEDPORT->ODR ^= (1<<LED1);  // toggle diodes
         vTaskDelay(pdMS_TO_TICKS(50));
      }
   }

   //Alternates blue and green LEDs quickly
   int main(void)
   {
      ENABLE_GPIO_CLOCK;              // enable the clock to GPIO
      LEDPORT->_MODER |= GPIOMODER;   // set pins to be general purpose output

      xTaskCreate(task1,"LED",100,NULL,configMAX_PRIORITIES-1,NULL);
      vTaskStartScheduler();
      
      for (;;) {
      //ms_delay(500);
      LEDPORT->ODR ^= (1<<LED1);  // toggle diodes
      }



      return 0;
   }

ini specs:

[env:genericSTM32F103C8]
platform = ststm32
board = genericSTM32F103C8
framework = cmsis
lib_deps =

     # RECOMMENDED
     # Accept new functionality in a backwards compatible manner and patches
     bojit/PlatformIO-FreeRTOS @ ^2.1.3

nevermind scratch that! moved to zephyr and got blinky to work