Wakeup a task from ISR

I have a task that I want to block until some data arrive from a serial port.
I have setup the serial port to trigger an interrupt every time a byte is received.

I want to notify a task to unblock and process the data.

I tried with ulTaskNotifyTake and vTaskNotifyGiveFromISR but the program seems to deadlock somewhere…

TaskHandle_t my_task_handle = NULL;
xTaskCreate(my_task, "TSK", configMINIMAL_STACK_SIZE, ( void * ) 0x1111UL, 2, &my_task_handle );

void my_task(void)
{
    enable_serial_port();
while(true)
	{
		my_task_handle = xTaskGetCurrentTaskHandle();
		thread_notification = ulTaskNotifyTake(pdTRUE, portMAX_DELAY);
        print("my_task running\r\n");
	}
}

void ISR(void)
{
	BaseType_t xHigherPriorityTaskWoken = pdFALSE;
	led_toggle();
	vTaskNotifyGiveFromISR(my_task_handle, &xHigherPriorityTaskWoken);
	portYIELD_FROM_ISR(xHigherPriorityTaskWoken);
}

Any ideas?
PS: The drivers work, the serial port works and the interrupt can trigger. If I comment out vTaskNotifyGiveFromISR and portYIELD_FROM_ISR the led blinks. Otherwise the program seems to block forever…

EDIT: Just found out that portASSERT_IF_INTERRUPT_PRIORITY_INVALID() fails.
The code runs on Cortex-M4

My 1st guess configMINIMAL_STACK_SIZE is way too small (for a task using stack hungry printf-family functions).
2nd issue might be an incorrect interrupt priority.
Edit: You also should check the return codes of xTaskCreate etc.

How do you ensure that interrupt is not fired before you set my_task_handle? If enable_serial_port() enables the UART interrupt, should you not change the definition to the following -

void my_task(void)
{
    my_task_handle = xTaskGetCurrentTaskHandle();
    enable_serial_port();
while(true)
	{	
		thread_notification = ulTaskNotifyTake(pdTRUE, portMAX_DELAY);
        print("my_task running\r\n");
	}
}

Your second guess is correct. There’s something wrong with portASSERT_IF_INTERRUPT_PRIORITY_INVALID() because it fails…

Some good resources for that -

Thanks, I already started looking at them.

Thank you for your help! It worked