It seems that using the comparators with interrupts on the stm32f373 series with HAL drivers blocks the program in infinite loop.
I attach the full code as a file and the relevant part here - for the evaluation board STM32373C-EVAL in which the red LED blinks a few times until the comparator is activated and blocks the execution.Is there a workaround to make the comparator work...