Bird
0
0

Identify the error in this ISR code snippet if configMAX_SYSCALL_INTERRUPT_PRIORITY is set to 0x60:

medium📝 Debug Q14 of 15
FreeRTOS - Interrupt Management

Identify the error in this ISR code snippet if configMAX_SYSCALL_INTERRUPT_PRIORITY is set to 0x60:

void ISR_Handler(void) {
    NVIC_SetPriority(IRQn, 0x40);
    vTaskNotifyGiveFromISR(taskHandle, NULL);
}
AISR priority 0x40 is higher than allowed to call FreeRTOS API
BvTaskNotifyGiveFromISR cannot be called from ISR
CNVIC_SetPriority should not be called inside ISR
DNo error, code is correct
Step-by-Step Solution
Solution:
  1. Step 1: Check ISR priority against configMAX_SYSCALL_INTERRUPT_PRIORITY

    Priority 0x40 is higher urgency (lower number) than 0x60, so ISR cannot safely call FreeRTOS API.
  2. Step 2: Analyze API call in ISR

    Calling vTaskNotifyGiveFromISR requires ISR priority at or below 0x60, which is violated here.
  3. Final Answer:

    ISR priority 0x40 is higher than allowed to call FreeRTOS API -> Option A
  4. Quick Check:

    ISR priority must not exceed configMAX_SYSCALL_INTERRUPT_PRIORITY [OK]
Quick Trick: ISR priority must be equal or lower urgency than configMAX_SYSCALL_INTERRUPT_PRIORITY [OK]
Common Mistakes:
  • Ignoring priority set inside ISR
  • Thinking API calls are always allowed in ISR
  • Confusing priority numeric order

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More FreeRTOS Quizzes