cancel
Showing results for 
Search instead for 
Did you mean: 

DMA1_Channel1_IRQHandler() is not getting triggered

kb24
Senior

Hello, I am using STM32G030F6Px, it has 32 KB flash memory and I need free space to save data in flash, also it needs to have bootloader. That's why I decided to use bare metal code instead of HAL library, of course I did this by examining HAL libraries. I could set system clock to 64 MHz, also I could use UART with interrupts, timers with interrupts and PWM. Until this point I was successful, 15 KB library code became 2.5 KB. Then I tried to add ADC with DMA. I created this "uint32_t adcValues[2]" variable and gave it to DMA. I put breakpoint in DMA1_Channel1_IRQHandler but it never comes here in the debug session. When I suspend it in anywhere else I see I can get correct analog values from "adcValues[2]". I did same project with HAL libraries and in there DMA1_Channel1_IRQHandler gets triggered. In the debug session I compared the registers and its all same. I set Bit 4 OVRIE: Overrun interrupt enable for ADC->IER, Bit 3 TEIE: transfer error interrupt enable, Bit 2 HTIE: half transfer interrupt enable, Bit 1 TCIE: transfer complete interrupt enable for DMA->CCR1, also I set NVIC bit for DMA1_Channel1(DMA1 channel 1 interrupt). As I said before register values are same for ADC, DMA, DMAMUX. How can I make DMA1_Channel1_IRQHandler is getting triggered? Sorry for this question with long history, I tried to explain why I cant use HAL libraries.

11 REPLIES 11

Thanks for the info.

JW

kb24
Senior

I am so sorry to all of you. It was all my mistake. In the startup file function name was DMA_Channel1_IRQHandler instead of DMA1_Channel1_IRQHandler. When I changed that it worked. Thanks to this silly question I learned what can cause interrupt to not get fired and VECTACTIVE bits so I can understand a function is called from thread mode or interrupt handler if yes which interrupt handler. I hope it helps others. Thanks a lot.