FreeRTOS - Task SchedulingWhich of the following is the correct way to create a task with priority 3 in FreeRTOS?AxTaskCreate(taskFunction, "Task1", 1000, NULL, -1, NULL);BxTaskCreate(taskFunction, "Task1", 1000, NULL, 0, NULL);CxTaskCreate(taskFunction, "Task1", 1000, NULL, 3, NULL);DxTaskCreate(taskFunction, "Task1", 1000, NULL, 10, NULL);Check Answer
Step-by-Step SolutionSolution:Step 1: Understand xTaskCreate parametersThe fifth parameter is the task priority; valid priorities are non-negative integers within configMAX_PRIORITIES.Step 2: Check options for valid priorityxTaskCreate(taskFunction, "Task1", 1000, NULL, 3, NULL); uses priority 3, which is valid. xTaskCreate(taskFunction, "Task1", 1000, NULL, 0, NULL); uses 0 (lowest priority), C uses -1 (invalid), D uses 10 (may be invalid if max priorities < 11).Final Answer:xTaskCreate(taskFunction, "Task1", 1000, NULL, 3, NULL); -> Option CQuick Check:Priority parameter is fifth and must be valid integer [OK]Quick Trick: Priority is the 5th parameter in xTaskCreate [OK]Common Mistakes:Using negative priority valuesConfusing stack size with prioritySetting priority higher than configMAX_PRIORITIES
Master "Task Scheduling" in FreeRTOS9 interactive learning modes - each teaches the same concept differentlyLearnWhyDeepVisualTryChallengeProjectRecallTime
More FreeRTOS Quizzes RTOS Fundamentals - Why RTOS over bare-metal - Quiz 14medium RTOS Fundamentals - Real-time vs general-purpose OS - Quiz 10hard RTOS Fundamentals - Tick timer and scheduler - Quiz 11easy Task Creation and Management - Why tasks are the building blocks - Quiz 14medium Task Creation and Management - Task priority assignment - Quiz 12easy Task Creation and Management - Task function signature - Quiz 4medium Task Scheduling - vTaskDelay() for periodic tasks - Quiz 9hard Task Scheduling - Why scheduling determines real-time behavior - Quiz 7medium Task Scheduling - vTaskDelayUntil() for precise timing - Quiz 3easy Task Scheduling - Time-slicing for equal priority tasks - Quiz 4medium