IRQs being disabled

I am having a problem with a STM32 and USART ISRs with the queue API. From what I understand, I should be able to fill a queue till it blocks by specifying portDELAY_MAX and having INCLUDE_vTaskDelay defined to 1. What is occuring is it works fine for the first 5-6 or so iterations, when it then enters an infinite loop in list.c on line 150. I read the commented warning, I have increased stack size heaps to be sure its not an overflow, and set my NVIC priority group to 4. The NVIC IRQ handler preemption priority is set to configLIBRARY_KERNEL_INTERRUPT_PRIORITY which is defined as 15. Here is the code that I am using:
http://www.spacevs.com/usart.c I have been desperately stuck on this problem for the last week and I am sure its a face palm type error…. If someone can please look at it and tell me where I have gone wrong it would be GREATLY appreciated. Thanks in advance

IRQs being disabled

Oh, and ill add that when it gets into the infinite loop, my breakpoint on the systick hook no longer fires indicating that interrupts have been left disabled….

IRQs being disabled

ortDELAY_MAX and having INCLUDE_vTaskDelay defined to 1
portMAX_DELAY will be an indefinite block time if INCLUDE_vTaskSuspend is set to 1, not INCLUDE_vTaskDelay.
and set my NVIC priority group to 4
I think the examples just leave that at 0.
Oh, and ill add that when it gets into the infinite loop, my breakpoint on the systick hook no longer fires indicating that interrupts have been left disabled….
Not necessarily. To know if interrupts were disabled or not check the relevant status bits. If a low priority interrupt is not firing then maybe you are just looping in a higher priority interrupt.

IRQs being disabled

One thing that looks suspicious to me is this code in usart_read
    portENTER_CRITICAL();
    while(USART_GetFlagStatus(h->port, USART_FLAG_RXNE) == RESET)
        return USART_ERR_NODATA;
    *byte = USART_ReceiveData(h->port) & 0x7F;
    portEXIT_CRITICAL();
    return USART_ERR_OK;
If the condition of the while loop is true, then the function immediately exits with an error return code, leaving you in a critical section (and the while loop will NEVER repeat, because it exits with a return).

IRQs being disabled

Sorry, yes, I ment INCLUDE_vTaskSuspend, it is defined. Nope, the examples all set it to group_4. Further investigation shows that portNVIC_PENDSVSET is being set, but setting a breakpoint on the IRQ handler never triggers once the application gets stuck in its loop. I think I have narrowed it down… My application starts an init task which sets up IRQ’s and then creates the other tasks, which once done, it then calls vTaskDelete(NULL). According to docs this should be safe, could this be the issue?

IRQs being disabled

@richard_damon: That is an issue, thanks for the heads up, however the USART_MODE_IRQ flag is set in my test app with the issue, so that code is not actually running.

IRQs being disabled

Found the problem, and yes it was a facepalm one…. had an extra taskEXIT_CRITICAL in a function that never called ENTER… caused all sorts of weirdness