← All CET Flashcard Decks

Embedded Systems & Programming Flashcards

7 cards from real CET practice questions. Tap to flip, then mark Knew It or Still Learning — missed cards come back until you master them.

Read the first 7 Embedded Systems & Programming flashcards as text
  1. In a Real-Time Operating System (RTOS), what is the primary purpose of a semaphore?

    Answer: To synchronize access to shared resources or signal events between tasks

    A semaphore is a signaling mechanism that controls access to shared resources and coordinates task execution order in an RTOS.

  2. What is 'priority inversion' in the context of RTOS scheduling?

    Answer: When a low-priority task holds a resource needed by a high-priority task, indirectly blocking it

    Priority inversion occurs when a high-priority task is blocked waiting for a resource held by a low-priority task, allowing medium-priority tasks to preempt and delay the high-priority one.

  3. How does a mutex differ from a binary semaphore in most RTOS implementations?

    Answer: A mutex enforces ownership—only the task that took it can release it—while a binary semaphore has no ownership

    A mutex tracks which task owns it and prevents other tasks from releasing it, enabling priority inheritance; a binary semaphore has no owner concept.

  4. What scheduling algorithm assigns each ready task an equal, fixed time slice in a round-robin fashion?

    Answer: Time-sliced round-robin preemptive scheduling

    Round-robin preemptive scheduling cycles through ready tasks of equal priority, preempting each after its time slice expires to ensure fairness.

  5. What is a race condition in embedded firmware?

    Answer: Undefined behavior that occurs when multiple execution contexts access shared data without proper synchronization

    A race condition arises when the outcome of concurrent accesses to shared data depends on the unpredictable order of execution, leading to intermittent bugs.

  6. In FreeRTOS, which API call suspends the calling task for a specified number of ticks?

    Answer: vTaskDelay()

    `vTaskDelay()` places the calling task in the Blocked state for the given tick count, freeing the CPU for other tasks.

  7. Why must Interrupt Service Routines (ISRs) in an RTOS use ISR-safe API variants (e.g., `xSemaphoreGiveFromISR`)?

    Answer: Standard RTOS calls may block or invoke the scheduler, which is illegal from interrupt context

    Standard RTOS API functions may block or trigger a context switch; calling them from an ISR corrupts kernel state, so ISR-safe variants use a non-blocking signaling path instead.