I tried to send the data recieved from a sensor to the queue using xQueueSendToFrontFromISR Api , but it gets stuck at line# 947 queue.c : portASSERT_IF_INTERRUPT_PRIORITY_INVALID();
Following are the configurations:
#define configLIBRARY_MAX_SYSCALL_INTERRUPT_PRIORITY (0x01)
Is there any changes we need to make ?
welcome to the forum!
The assert is fairly self explanatory. The interrupt that attempts to queue the data obviously runs at a priority higher than configLIBRARY_MAX_SYSCALL_INTERRUPT_PRIORITY which is not allowed (please cf. the FreeRTOS ISR docs for details). Added: FreeRTOS - The Free RTOS configuration constants and configuration options - FREE Open Source RTOS for small real time embedded systems
Thanks for the document, How can we set the interrupt priority for the one which uses Free Rtos Api?
Impossible to answer without knowing what target and eco system you use… interrupt priorites for MCU devices are assigned on the processor initialization level. That’s completly beyond the scope of FreeRTOS.
Hi, We are using S32K146 microcontroller.
then check with the MCU documentation, find the place in your code where the processor gets initialized, and change the priority of that ISR to one below configLIBRARY_MAX_SYSCALL_INTERRUPT_PRIORITY. It is fairly unusual for configLIBRARY_MAX_SYSCALL_INTERRUPT_PRIORITY to be 1, though. You need to understand its meaning and then tailor your interrupt priorites accordingly.
Seems it’s a Cortex-M4 with NVIC. So you’ve to set the NVIC IRQ prio according to the docs (e.g. right before the line where you enable it).