2025-01-06 07:06 AM - edited 2025-01-06 07:13 AM
I have STM32F4, using ADC3 for injected conversions. Driver code is generated using the latest CubeMX. I have 4 channels in group and was using LL_ADC_INJ_ReadConversionData12(ADC3, ADC_INJECTED_RANK_1) for reading (where rank was from 1 to 4). But the values that I got back were all exactly the same and consistent with expected value on the first channel. Accessing ADC3->JDR1 to JDR4 gives correct results. If I understand LL_ADC_INJ_ReadConversionData12 correctly, then this is a bug.
volatile uint32_t jsqr = ADC3->JSQR;
volatile uint32_t j1 = ADC3->JDR1;
volatile uint32_t j2 = ADC3->JDR2;
volatile uint32_t j3 = ADC3->JDR3;
volatile uint32_t j4 = ADC3->JDR4;
volatile uint16_t h1 = LL_ADC_INJ_ReadConversionData12(ADC3, ADC_INJECTED_RANK_1);
volatile uint16_t h2 = LL_ADC_INJ_ReadConversionData12(ADC3, ADC_INJECTED_RANK_2);
volatile uint16_t h3 = LL_ADC_INJ_ReadConversionData12(ADC3, ADC_INJECTED_RANK_3);
volatile uint16_t h4 = LL_ADC_INJ_ReadConversionData12(ADC3, ADC_INJECTED_RANK_4);
volatile uint16_t regular = LL_ADC_REG_ReadConversionData12(ADC3);