Need to change interrupt priority for USART DMA RX Circular
I've got some code working from an example for USART RX DMA Circular. I'm to the point where I can receive the UART data but I need to now use a write to a protected (by a binary semaphore) circular buffer from the interrupt context HAL_UARTEx_RxEventCallback() which can be called from interrupt context DMA TC and HT events and UART IDLE line event.
Using FreeRTOS and configured is #define configLIBRARY_MAX_SYSCALL_INTERRUPT_PRIORITY 5 in FreeRTOSConfig.h.
When using xSemaphoreTakeFromISR and xSemaphoreGiveFromISR with a binary semaphore configured I get the following assert:
configASSERT( ucCurrentPriority >= ucMaxSysCallPriority );
Using NVIC_SetPriority(DMA1_Channel5_IRQn, 6); so I figure that should do the trick but it's not working. When I capture the values of ucMaxSysCallPriority and ucCurrentPriority, I get values of 80 and 48 respectively. I can understand that the values are lost in translation with the NVIC groups, preemption priority and subpriority. However I did expect the NVIC_SetPriority() call above to work.
If I disable the semaphores, I can get the USART RX data into my circular buffer. I believe that I just need to get past configuration of the interrupt at a lower priority than the configMAX_SYSCALL_INTERRUPT_PRIORITY. Looking at the Groups, preemption priorities, and sub-priorities doesn't make a lot of sense to me.
Please advise.
