Understanding priority levels of ISR and FreeRTOS APIs

API functions contain critical sections so if you call an API function from an interrupt that has a LOGICAL priority above the maximum system call interrupt priority then critical sections will not work and corruption can occur.

sorry but how does having an interrupt of a logically higher priority than configMAX_SYSCALL_INTERRUPT_PRIORITY corrupt the critical sections? Is the logic that you don’t want to interrupt the processor while a critical section is being executed hence why the kernel disables the interrupts? Also, doesn’t interrupt priority <= configMAX_SYSCALL_INTERRUPT_PRIORITY means logically higher priority given the NVIC priority levels?

What priority are you trying to set it to?

just anything configMAX_SYSCALL_INTERRUPT_PRIORITY such that it doesn’t complain. According to the docs, I should be setting it to <= configMAX_SYSCALL_INTERRUPT_PRIORITY. And I see NVIC_SetPriority() does some bit shift but not sure why ucCurrentPriority is even 0