StreamBuffer Crash on STM32F103. Asynchronous UART

first of all I would like to thank you guys, because FreeRTOS documentation is great(from my newbie perspective).
I have a problem with executing two tasks “at the same time”. First task is responsible for talking with another microcontroller via USART(this is higher priority task). Second task polls data from scanner every 100ms or so.
Now initially first task read data from USART by polling(checking if new data is available), but sometimes the other microcontroller is not responding for about a minute. This quickly became a problem as the second task did not run when the first task was in the loop(checking if new data is available).

Interrupts quickly came to my mind as a solution.
First I tried to use Binary Semaphore. USART’s ISR gave the Semaphore when the new data was available and the first(USART) task read data from USART register. That did not work at all, I think it was too slow.
Then I tried creating a Queue. This time data was read in the ISR and placed in a queue. That also seemed to be to slow as a lot of bytes were missing.
Finally I tried Stream Buffers. Again data was read from USART data register in the ISR and placed in the Stream Buffer. This was a huge improvement the data was read properly and no bytes were missing. However there is another problem after a couple (2-5) of minutes of communication there is a Hard Fault crash.

Here is what I was able to get out of the debugger:

 Breakpoint 1, HardFault_Handler () at src/SystemInterrupts.cpp:20
 20      extern "C" void HardFault_Handler(void) { writeMessage("\r\n\r\n\tHARD FAULT\r\n\r\n"); }
 (gdb) p/x $lr
 $2 = 0xfffffff1
 (gdb) p/x $msp
 $3 = 0x2000bf58
 (gdb) p/a *(uint32_t[8] *)$msp
 $4 = {0x2000c000, 0x0, 0x2000bfff, 0x0, 0xa, 0x8001fc1 <xTaskGenericNotifyFromISR+188>, 0x8002a20 <uxListRemove+36>, 0x21000037}

As you can see the crash is caused by the method uxListRemove which is called from xTaskGenericNotifyFromISR.

Here is my ISR function:

extern "C" void USART3_IRQHandler() {
   static StreamBufferHandle_t *readBytes = getReadBytes();
   char data = USART3->DR;
   xStreamBufferSendFromISR(*readBytes, &data, 1, NULL);

Here is StreamBufferHandle_t initialization:

readBytes = xStreamBufferCreate(100, 1);

And here is the code that reads the data from the buffer:

uint8_t Uart3::readByte(char *output, uint32_t timeoutMs) {
    if (xStreamBufferReceive(readBytes, output, sizeof( char ), pdMS_TO_TICKS(timeoutMs)) > 0) {
        return UART_OK;
    } else {
        return UART_TIMEOUT;

Am I doing something wrong or have I found a bug?
I am using FreeRTOS V10.4.3, latest as of this writing. I have not had any Hard Fault crash before using StreamBuffers. If I comment out the xStreamBufferReceive or xStreamBufferSendFromISR the crash stops.
Can anyone help me with that?

Thanks in advance.

Code looks good so far (although I’d propose to follow the xStreamBufferSendFromISR example and make use of the optionalxHigherPriorityTaskWoken flag.
2 common sources of trouble come into my mind: stack overflow or incorrect IRQ priorities.
Do you have configASSERT() defined and also stack overflow checking enabled (for development/debugging) ?

Thank you for reply. You were right it was incorrect IRQ priorities.
Here I found a good explanation of how they work.
Just in case someone cares, I changed my code from:

NVIC_InitTypeDef NVIC_InitStructure;
NVIC_InitStructure.NVIC_IRQChannel = USART3_IRQn;
NVIC_InitStructure.NVIC_IRQChannelPreemptionPriority = 0;
NVIC_InitStructure.NVIC_IRQChannelSubPriority = 0;
NVIC_InitStructure.NVIC_IRQChannelCmd = ENABLE;


NVIC_InitTypeDef NVIC_InitStructure;
NVIC_InitStructure.NVIC_IRQChannel = USART3_IRQn;
NVIC_InitStructure.NVIC_IRQChannelPreemptionPriority = 0x0F;
NVIC_InitStructure.NVIC_IRQChannelSubPriority = 0x0F;
NVIC_InitStructure.NVIC_IRQChannelCmd = ENABLE;
NVIC_SetPriority(USART3_IRQn, 255);  

Thanks again.