Bird
0
0

Given the following FreeRTOS configuration snippet for a Cortex-M processor with 3 priority bits:

medium📝 Predict Output Q13 of 15
FreeRTOS - Interrupt Management

Given the following FreeRTOS configuration snippet for a Cortex-M processor with 3 priority bits:

#define configMAX_SYSCALL_INTERRUPT_PRIORITY 0x20

void ISR_Handler(void) {
    /* This interrupt calls FreeRTOS API */
    BaseType_t xHigherPriorityTaskWoken = pdFALSE;
    xSemaphoreGiveFromISR(&xSemaphore, &xHigherPriorityTaskWoken);
    portYIELD_FROM_ISR(xHigherPriorityTaskWoken);
}

What will happen if this ISR runs at priority 0x10?

ASystem may crash or behave unpredictably due to priority violation
BISR runs normally and FreeRTOS API calls succeed
CISR is masked and never runs
DFreeRTOS disables all interrupts during ISR
Step-by-Step Solution
Solution:
  1. Step 1: Compare ISR priority with configMAX_SYSCALL_INTERRUPT_PRIORITY

    ISR priority 0x10 is higher (numerically lower) than 0x20, which is the max allowed to call FreeRTOS API.
  2. Step 2: Understand consequences of calling API at too high priority

    Calling FreeRTOS API from an interrupt with priority above configMAX_SYSCALL_INTERRUPT_PRIORITY can cause system instability or crashes.
  3. Final Answer:

    System may crash or behave unpredictably due to priority violation -> Option A
  4. Quick Check:

    ISR priority < max syscall priority = crash risk [OK]
Quick Trick: ISR priority must be equal or lower than max syscall priority [OK]
Common Mistakes:
  • Assuming ISR always runs safely
  • Confusing higher priority with higher numeric value
  • Thinking ISR is masked automatically

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More FreeRTOS Quizzes