Sounds like an interrupt priority issue of the timer. Did you call NVIC_SetPriority
with an appropriate priority somewhere ?
In addition please see this
and Richard’s follow up.
You should better not define global variables like data_ready_sem
in a header file.
Just declare it extern SemaphoreHandle_t data_ready_sem;
and define it in one c-file if you want to use it (as a global variable) in multiple c-files later on.
If it’s intended use is limited to a single c-file (e.g. the timer driver/task module) better define it as static SemaphoreHandle_t data_ready_sem;
in this c-file.
Just a hint and to avoid unexpected ‘multiple definitions’ errors if you include the header file in another c-file later on.