I have a problem with DMA3 interrupt. I have used DMA0 for ADC1, DMA1 and DMA2 for SPI (receiving and transmitting, respectively) and DMA3 for ADC2. The other interrupts are timers 1, 2, 3, 5, 7; SPI4, SPI4 error, two external interrupts INT0 and INT1. the problem is that all thing works properly when I run it in debugging mode, but in release mode, the MCU is stuck. When I delete interrupt routine of DMA3 which is just a single line (flag clearing), it works properly. When I comment DMA and its interrupt initialization and keep interrupt routine, MCU stuck while rationally the program counter should not jump to this interrupt. The only way that the MCU works in release mode is that I delete both DMA3 initializations and its interrupt routine. I was wondering what is the problem? if there is a problem with programming why it works when I run it in debugging mode?
Thank you for your helps