Bird
0
0

What is wrong with this usage?

medium📝 Debug Q7 of 15
FreeRTOS - Interrupt Management

What is wrong with this usage?
#define configMAX_SYSCALL_INTERRUPT_PRIORITY (0x80)
On a Cortex-M with 4 priority bits.

APriority value exceeds maximum allowed for 4 bits
BPriority value is not shifted left
CPriority value is too low
DNo error, this is valid
Step-by-Step Solution
Solution:
  1. Step 1: Calculate max priority value for 4 bits

    Max priority number is 2^4 - 1 = 15, shifted left by (8 - 4) = 4 bits gives max 15 << 4 = 0xF0.
  2. Step 2: Compare given value

    0x80 is 128 decimal, which corresponds to priority 8 shifted left 4 bits (8 << 4 = 128), so it is shifted correctly.
  3. Step 3: Check if 0x80 exceeds max allowed

    0x80 is less than max 0xF0, so it does not exceed maximum allowed.
  4. Final Answer:

    No error, this is valid -> Option D
  5. Quick Check:

    Priority must be shifted left by (8 - priority bits) [OK]
Quick Trick: Max priority = (2^bits -1) << (8 - bits) [OK]
Common Mistakes:
  • Ignoring max priority range
  • Not shifting priority
  • Assuming any hex is valid

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More FreeRTOS Quizzes