title: NVIC User Interrupt Priority
body: <p>Im using FreeRTOX V9.0.0 on a Cortex M3 (Silicon Labs EFM32GG380F1024).
  I get a assert failure when i use the TaskResumeFromISR via the GPIO Irq Handler.</p>
  
  <p>The assert fails here in port.c (GCC ARM CM3) in function "void vPortValidateInterruptPriority( void )" 
  on line "configASSERT( ucCurrentPriority >= ucMaxSysCallPriority );" 
  The values are: ucCurrentPriority is 0 and ucMaxSysCallPriority is 160.</p>
  
  <pre><code>// NVIC CORTEX M3
  #define configPRIO_BITS 3
  
  // FreeRTOS Config
  #define configLIBRARY_MAX_SYSCALL_INTERRUPT_PRIORITY ( 0x05 )
  #define configKERNEL_INTERRUPT_PRIORITY ( configLIBRARY_LOWEST_INTERRUPT_PRIORITY &lt;&lt; (8 - configPRIO_BITS) )
  #define configMAX_SYSCALL_INTERRUPT_PRIORITY ( configLIBRARY_MAX_SYSCALL_INTERRUPT_PRIORITY &lt;&lt; (8 - configPRIO_BITS) )
  
  // port.c
  ucMaxSysCallPriority = configMAX_SYSCALL_INTERRUPT_PRIORITY &amp; ucMaxPriorityValue; // ( ( 0x05 ) &lt;&lt; (8 - ( 3 )) ) &amp; 224 = 160
  </code></pre>
  
  <p>In the user code, when i read the interrupt priority (where i currently use default "0") i get all interrupt priorities are zero except the 2 
  that are set up by the kernel (PendSV and Systick) which are 7.</p>
  
  <pre><code>// user code
  prio = hal::nvic::getPriority(NonMaskableInt_IRQn); // =0
  prio = hal::nvic::getPriority(HardFault_IRQn); // =0
  prio = hal::nvic::getPriority(MemoryManagement_IRQn); // =0
  prio = hal::nvic::getPriority(BusFault_IRQn); // =0
  prio = hal::nvic::getPriority(UsageFault_IRQn); // =0
  prio = hal::nvic::getPriority(SVCall_IRQn); // =0
  prio = hal::nvic::getPriority(DebugMonitor_IRQn); // =0
  prio = hal::nvic::getPriority(PendSV_IRQn); // =7
  prio = hal::nvic::getPriority(SysTick_IRQn); // =7
  prio = hal::nvic::getPriority(GPIO_EVEN_IRQn); // =0
  prio = hal::nvic::getPriority(GPIO_ODD_IRQn); // =0
  prio = hal::nvic::getPriority(USART1_RX_IRQn); // =0
  prio = hal::nvic::getPriority(USART1_TX_IRQn); // =0
  prio = hal::nvic::getPriority(LETIMER0_IRQn); // =0
  prio = hal::nvic::getPriority(RTC_IRQn); // =0
  prio = hal::nvic::getPriority(BURTC_IRQn); // =0
  </code></pre>
  
  <p>As soon as i define my interrupt priority 7 or higher, i have no more trouble.</p>
  
  <p>When i now define each priority for each interrupt, what values can i use (where lower is higher priority and i should go bigger
  than 7 since my interrupts should have lower prio than the kernel).</p>
  
  <p>So should i start at 8 and go up until where??</p>
  
  <p>Thank you</p>