Interruption, but corresponding interrupt flag is not set?
Dear community,
I am having a strange problem with the STM32L431.
The ADC is set up for use with both the DMA and interruption. This is to de-interleave the adc results from 2 different channels, since there was problem with interleaved ADC results when only using DMA -- The order of ADC results in the DMA buffer would get messed up after running for a while for some unknown reason, so it was impossible to tell which result is from which channel. Therefore, I changed my code and started to use the ADC with DMA and interruption together.
Part of current ADC initializing code:
adc_reg_config.Channel = ADC_CHANNEL_1;
adc_reg_config.Rank = ADC_REGULAR_RANK_1;
adc_reg_config.SingleDiff = ADC_DIFFERENTIAL_ENDED;
adc_reg_config.SamplingTime = ADC_SAMPLETIME_24CYCLES_5;
HAL_ADC_ConfigChannel(p_adc_handle, &adc_reg_config);
adc_inj_config.InjectedChannel = ADC_CHANNEL_VREFINT;
adc_inj_config.InjectedRank = ADC_INJECTED_RANK_1;
adc_inj_config.InjectedSamplingTime = ADC_SAMPLETIME_24CYCLES_5;
adc_inj_config.InjectedSingleDiff = ADC_SINGLE_ENDED;
adc_inj_config.InjectedNbrOfConversion = 1;
adc_inj_config.AutoInjectedConv = ENABLE;
adc_inj_config.ExternalTrigInjecConv = ADC_INJECTED_SOFTWARE_START;
adc_inj_config.InjecOversamplingMode = ENABLE;
adc_inj_config.InjecOversampling = adc_inj_osp_config;
HAL_ADCEx_InjectedConfigChannel(p_adc_handle, &adc_inj_config);
HAL_ADCEx_Calibration_Start(p_adc_handle, ADC_DIFFERENTIAL_ENDED);
HAL_ADCEx_Calibration_Start(p_adc_handle, ADC_SINGLE_ENDED);
LL_ADC_EnableIT_JEOC(p_adc_handle->Instance);
LL_ADC_EnableIT_OVR(p_adc_handle->Instance);
LL_ADC_DisableIT_JEOS(p_adc_handle->Instance);
LL_ADC_DisableIT_JQOVF(p_adc_handle->Instance);
LL_ADC_DisableIT_EOC(p_adc_handle->Instance);
LL_ADC_DisableIT_EOS(p_adc_handle->Instance);
LL_ADC_DisableIT_EOSMP(p_adc_handle->Instance);
LL_ADC_DisableIT_ADRDY(p_adc_handle->Instance);
HAL_NVIC_EnableIRQ(ADC1_IRQn);
HAL_ADC_Start_DMA(p_adc_handle, (uint32_t*)reg_buf, BL);Problem: I get interrupt, but none of the two enabled ADC interrupt flag (JEOC and OVR) is set.
Enabled interrupts:
This breakpoint is reached once in a while (which means that there is ADC interruption, but neither the JEOC nor the OVR flag is set, right?)
Please help! Thanks in advance!
