A. vTaskDelay() argument should be in ticks, not milliseconds
B. printf() cannot be used inside tasks
C. while(1) should be for(;;)
D. Missing task notification call
Solution
Step 1: Check vTaskDelay argument type
vTaskDelay() expects delay in ticks, not milliseconds directly.
Step 2: Correct usage
Use pdMS_TO_TICKS(1000) to convert 1000 ms to ticks for vTaskDelay.
Final Answer:
vTaskDelay() argument should be in ticks, not milliseconds -> Option A
Quick Check:
vTaskDelay(ms) wrong, use pdMS_TO_TICKS(ms) [OK]
Hint: Always convert ms to ticks with pdMS_TO_TICKS() [OK]
Common Mistakes:
Passing milliseconds directly to vTaskDelay()
Thinking printf() is disallowed in tasks
Believing while(1) is invalid syntax
5. You want to implement a heartbeat task that signals system health by toggling an LED every 500 ms and also logs a message every 5 seconds. Which approach is best?
hard
A. Create two separate tasks: one toggling LED every 500 ms, another logging every 5 seconds
B. Use one task with vTaskDelay(500) to toggle LED and count loops to log every 5 seconds
C. Use a single task with vTaskDelay(5000) to do both toggle and log at once
D. Toggle LED and log message without any delay to maximize responsiveness
Solution
Step 1: Understand timing requirements
LED toggles every 500 ms, logging every 5 seconds require different intervals.
Step 2: Evaluate task design options
Two separate tasks allow independent timing without complex counting or blocking.
Step 3: Consider drawbacks of other options
Single task with 500 ms delay and counting adds complexity; 5000 ms delay misses LED timing; no delay wastes CPU.
Final Answer:
Create two separate tasks: one toggling LED every 500 ms, another logging every 5 seconds -> Option A
Quick Check:
Separate tasks for different intervals = clean design [OK]
Hint: Use separate tasks for different heartbeat intervals [OK]
Common Mistakes:
Trying to handle all timing in one task
Using long delays missing faster toggles
No delays causing CPU overload
Recommended
Ready to prove it?
Pass the test and this pattern moves unknownstrongwhile earning +1 Grip toward your certificate.