STM32L4 ADC DMA only Triggers Once

for some reason my DMA only seems to update ADC values once. I've set it up so that the callback function simply raises a flag everytime the DMA converts the ADCs, this flag only seems to go off once. I tried going through the example and I cannot pinpoint what I'm doing wrong. Hopefully someone can help.

void SysTimer(void) {
..
PeriphClkInit.Lpuart1ClockSelection = RCC_LPUART1CLKSOURCE_PCLK1;
PeriphClkInit.UsbClockSelection = RCC_USBCLKSOURCE_HSI48;
HAL_RCCEx_PeriphCLKConfig(&PeriphClkInit);
}

//If I try to De-Init here first, I get an error

errHandle(2);
}

sConfig.Offset = 0;
errHandle(3);
}
}

void MX_DMA_Init(void) {
__HAL_RCC_DMA1_CLK_ENABLE();
HAL_NVIC_SetPriority(DMA1_Channel1_IRQn, 0, 0);
HAL_NVIC_EnableIRQ(DMA1_Channel1_IRQn);
}

}

int main(void) {
MX_DMA_Init();

while (1) {
}

HAL_GPIO_TogglePin(LD3_GPIO_Port, LD3_Pin);
HAL_Delay(500);
}
}


Edit (Solution): You need to init DMA before ADC because the HAL_ADC_Init file calls the HAL_ADC_MspInit, which configures your DMA. As such, you need to initialize your DMA channels before that.

• So I figured it out. I need to init DMA before I init ADC. – Momo Mar 29 at 23:10