0
0
FreeRTOSprogramming~10 mins

FreeRTOS interrupt priority restrictions - Interactive Code Practice

Choose your learning style9 modes available
Practice - 5 Tasks
Answer the questions below
1fill in blank
easy

Complete the code to define the maximum interrupt priority from which FreeRTOS API functions can be called.

FreeRTOS
#define configMAX_SYSCALL_INTERRUPT_PRIORITY [1]
Drag options to blanks, or click blank then click option'
A5
B1
C0
D3
Attempts:
3 left
💡 Hint
Common Mistakes
Setting the priority to 0, which is the highest priority and can cause system instability.
2fill in blank
medium

Complete the code to mask interrupts above the maximum syscall priority in FreeRTOS.

FreeRTOS
portENTER_CRITICAL();
uint32_t priority = [1];
portEXIT_CRITICAL();
Drag options to blanks, or click blank then click option'
AconfigMAX_SYSCALL_INTERRUPT_PRIORITY
BconfigKERNEL_INTERRUPT_PRIORITY
CconfigMIN_SYSCALL_INTERRUPT_PRIORITY
DconfigMAX_INTERRUPT_PRIORITY
Attempts:
3 left
💡 Hint
Common Mistakes
Using configKERNEL_INTERRUPT_PRIORITY which is the lowest priority, not the maximum syscall priority.
3fill in blank
hard

Fix the error in the interrupt handler priority check to ensure it complies with FreeRTOS restrictions.

FreeRTOS
void ISR_Handler(void) {
    if (NVIC_GetPriority(IRQn) [1] configMAX_SYSCALL_INTERRUPT_PRIORITY) {
        // Safe to call FreeRTOS API
    }
}
Drag options to blanks, or click blank then click option'
A>=
B!=
C==
D<=
Attempts:
3 left
💡 Hint
Common Mistakes
Using '<=' which would allow interrupts with too high priority (numerically low values) to call FreeRTOS APIs.
4fill in blank
hard

Fill both blanks to correctly define the interrupt priority grouping and the maximum syscall priority.

FreeRTOS
NVIC_SetPriorityGrouping([1]);
#define configMAX_SYSCALL_INTERRUPT_PRIORITY [2]
Drag options to blanks, or click blank then click option'
ANVIC_PRIORITYGROUP_4
BNVIC_PRIORITYGROUP_2
C5
D3
Attempts:
3 left
💡 Hint
Common Mistakes
Mixing priority grouping values or setting max syscall priority incompatible with grouping.
5fill in blank
hard

Fill all three blanks to create a dictionary comprehension that maps interrupt names to their priorities, filtering only those with priority less than the max syscall priority.

FreeRTOS
irq_priorities = {irq: [1] for irq, prio in irq_list.items() if prio [2] [3]
Drag options to blanks, or click blank then click option'
Aprio
B<
CconfigMAX_SYSCALL_INTERRUPT_PRIORITY
Dirq
Attempts:
3 left
💡 Hint
Common Mistakes
Using the interrupt name instead of priority as the dictionary value.
Using wrong comparison operators.