I am using FreeRTOS for my high traffic network application on CM4 without FPU. I am using CM3 port because there is no FPU on CM4.
I have configASSERT defined in FreeRTOS. My controller supports 3 Priority bits and I have defined below priority related macros which should be proper.
~~~
/* Cortex-M specific definitions. */
ifdef __NVICPRIOBITS
/* __BVIC_PRIO_BITS will be specified when CMSIS is being used. */
#define configPRIO_BITS __NVIC_PRIO_BITS
else
#define configPRIO_BITS 4 /* 15 priority levels */
endif
/* The lowest interrupt priority that can be used in a call to a “set priority”
function. */
define configLIBRARYLOWESTINTERRUPT_PRIORITY 0x7
/* The highest interrupt priority that can be used by any interrupt service
routine that makes calls to interrupt safe FreeRTOS API functions. DO NOT CALL
INTERRUPT SAFE FREERTOS API FUNCTIONS FROM ANY INTERRUPT THAT HAS A HIGHER
PRIORITY THAN THIS! (higher priorities are lower numeric values. */
define configLIBRARYMAXSYSCALLINTERRUPTPRIORITY 1
/* Interrupt priorities used by the kernel port layer itself. These are generic
to all Cortex-M ports, and do not rely on any particular library functions. */
define configKERNELINTERRUPTPRIORITY (configLIBRARYLOWESTINTERRUPTPRIORITY << (8 – configPRIOBITS))
/* !!!! configMAX
SYSCALLINTERRUPT_PRIORITY must not be set to zero !!!!
See http://www.FreeRTOS.org/RTOS-Cortex-M3-M4.html. */
define configMAXSYSCALLINTERRUPTPRIORITY (configLIBRARYMAXSYSCALLINTERRUPTPRIORITY << (8 – configPRIOBITS))
/* Normal assert() semantics without relying on the provision of an assert.h
header file. */
define configASSERT(x) if((x) == 0) {taskDISABLE_INTERRUPTS(); for(;;);}
~~~
NVIC
PRIOBITS is defined as 3. I am setting priority of my interrupt as 3 which is higher(logically lower) than configLIBRARY
MAXSYSCALL
INTERRUPTPRIORITY so it should be fine too for using FreeRTOS(ISR) APIs from ISR.
I am using FreeRTOS V9.0.0.
Problem statement:
I am using FreeRTOS queues for commmunication between ISR and Tasks. When i use portYIELD
FROMISR() inside ISR, Even if item is posted successfully to the Queue, Task which is blocking on QueueReceive is not getting unblocked. Everything works for sometime but suddenly this issue appears.
I tried stack overflow hooks but it is not hitting and i have provided enough stack for tasks and interrupts.
This issue appears only when i do YIELD from ISR otherwise everything works fine.
Anyone have any idea about the possible issue?