Hi,
I recently made a post about a crash in stream buffer when using ISR. The solution to that crash was defining ISR priority. This worked fine for a while(up to two hours), but later something really strange happens, the app stops running, there is no crash, it just stops.
For debugging purposes I simplified my code not to rely on ISR at all. The ISR is there just for tests, it does nothing. Here it is:
extern "C" void USART3_IRQHandler() { USART_ClearITPendingBit(USART3, USART_IT_RXNE); }
I have also modified my read method not to read data register:
uint8_t Uart3::readByte(char *output, uint32_t timeoutMs) { *output = 's'; return UART_OK; }
And here is how I enable ISR:
NVIC_InitTypeDef NVIC_InitStructure; NVIC_InitStructure.NVIC_IRQChannel = USART3_IRQn; NVIC_InitStructure.NVIC_IRQChannelPreemptionPriority = 1; NVIC_InitStructure.NVIC_IRQChannelSubPriority = 1; NVIC_InitStructure.NVIC_IRQChannelCmd = ENABLE; USART_ITConfig(USART3, USART_IT_RXNE, ENABLE); NVIC_Init(&NVIC_InitStructure); NVIC_EnableIRQ(USART3_IRQn); NVIC_SetPriority(USART3_IRQn, 254);
Now when I comment out NVIC_SetPriority everything works fine, but than I cannot use StreamBuffers. I tried setting various priority numbers, but without luck. Here is how priority is set in FreeRTOSConfig.h:
#define configKERNEL_INTERRUPT_PRIORITY 255 #define configMAX_SYSCALL_INTERRUPT_PRIORITY 191
I am using FreeRTOS V10.4.3, latest as of this writing.
Do you guys have any idea what could be happening?
Thanks in advance.