How are you determining the CPU is stuck in task 1? If you put a break point in task 2, is it ever hit - if so - how many times, just once or many times. What does task 2 do - does it block or suspend itself for any reason - please show the code. Is the tick interrupt executing (if you put a break point in vTaskSwitchContext() FreeRTOS-Kernel/tasks.c at master · FreeRTOS/FreeRTOS-Kernel · GitHub is it hit? Is the xTickCount variable in the same file incrementing?).
How are you determining the CPU is stuck in task 1? If you put a break point in task 2, is it ever hit - if so - how many times, just once or many times. What does task 2 do - does it block or suspend itself for any reason - please show the code. Is the tick interrupt executing (if you put a break point in vTaskSwitchContext() FreeRTOS-Kernel/tasks.c at master · FreeRTOS/FreeRTOS-Kernel · GitHub is it hit? Is the xTickCount variable in the same file incrementing?).