1 Reply Latest reply on Mar 29, 2019 7:49 AM by YeshwanthK_56

    Using FreeRTOS, where is best place to initialize tasks?

    MiRo_263836

      This is the 1st time that I am using FreeRTOS in WICED (on an STM32F429) and I want to make sure that I am initializing tasks in the best place.  I did it right after wiced_init() in the application start. 

       

      void application_start( )

      {

          wiced_init( );

       

          TaskConfigID_handle = xTaskCreateStatic( TaskConfigID, "AssignID", CONFIG_TASK_STACK_SIZE, NULL, WICED_PRIORITY_TO_NATIVE_PRIORITY(WICED_APPLICATION_PRIORITY), ConfigIDStack, &ConfigID_buffer );

          TaskICM20948_handle = xTaskCreateStatic( TaskICM20948, "IMU", IMU_TASK_STACK_SIZE, NULL, WICED_PRIORITY_TO_NATIVE_PRIORITY(WICED_APPLICATION_PRIORITY), ICM20948Stack, &ICM20948_buffer );

          TaskBQ27411_handle  = xTaskCreateStatic( TaskBQ27411, "FuelGauge", BAT_TASK_STACK_SIZE, NULL, WICED_PRIORITY_TO_NATIVE_PRIORITY(WICED_APPLICATION_PRIORITY), BQ28411Stack, &BQ27411_buffer );

          TaskUI_handle       = xTaskCreateStatic( TaskUI, "UserLED", UI_TASK_STACK_SIZE, NULL, WICED_PRIORITY_TO_NATIVE_PRIORITY(WICED_APPLICATION_PRIORITY), UIStack, &UI_buffer );

          TaskSFlash_handle   = xTaskCreateStatic( TaskSFlash, "SFlash", SFLASH_TASK_STACK_SIZE, NULL, WICED_PRIORITY_TO_NATIVE_PRIORITY(WICED_APPLICATION_PRIORITY), SFlashStack, &SFlash_buffer );

          TaskDebug_handle    = xTaskCreateStatic( TaskDebug, "Debug", DEBUG_TASK_STACK_SIZE, NULL, WICED_PRIORITY_TO_NATIVE_PRIORITY(WICED_APPLICATION_PRIORITY), DebugStack, &Debug_buffer );

          TaskUSB_HS_handle   = xTaskCreateStatic( TaskUSB, "USB_HS",USB_TASK_STACK_SIZE, NULL, WICED_PRIORITY_TO_NATIVE_PRIORITY(WICED_APPLICATION_PRIORITY), USB_HS_Stack, &USB_HS_buffer );

          TaskWIFI_handle     = xTaskCreateStatic( TaskWIFI, "WIFI", WIFI_TASK_STACK_SIZE, NULL, WICED_PRIORITY_TO_NATIVE_PRIORITY(WICED_APPLICATION_PRIORITY), WIFIStack, &WIFI_buffer );

          TaskBlue_handle     = xTaskCreateStatic( TaskWIFI, "Blue", BLUE_TASK_STACK_SIZE, NULL, WICED_PRIORITY_TO_NATIVE_PRIORITY(WICED_APPLICATION_PRIORITY), BlueStack, &Blue_buffer );

          TaskRTC_handle      = xTaskCreateStatic( TaskWIFI, "RTC", RTC_TASK_STACK_SIZE, NULL, WICED_PRIORITY_TO_NATIVE_PRIORITY(WICED_APPLICATION_PRIORITY), RTCStack, &RTC_buffer );

          TaskOTA_handle      = xTaskCreateStatic( TaskWIFI, "OTA", OTA_TASK_STACK_SIZE, NULL, WICED_PRIORITY_TO_NATIVE_PRIORITY(WICED_APPLICATION_PRIORITY), OTAStack, &OTA_buffer );