EOC flag clears when entering ISR

When I start the ADC conversion the code jumps to ADC1_COMP_IRQHandlerIn ADC isr the EOC flag clears after first assembly instruction of isr code. So when I check for EOC flag if is set...the flag is already zero.

A workaround would be to not check that flag and read the ADC anyway, if I have just the EOC event as IRQ source enabled. Is EOC flag clearing by hardware? How to prevent it?

" EOC is cleared by software writing 1 to it or by reading the ADCx_DR register "

As Clive said, you might read DR register via debugger in watch window or with other register view window (depends on development tool). Read by debugger will clear EOC flag the same as read by CPU will.