2019-10-30 08:01 AM
Tested on STM32F334R8 nucleo board. Attempting to stop ADC in regular dual simultaneous mode doesn't work in latest HAL, though does work for prior version of the IDE 1.0.2. Do something like this to reproduce:
void HAL_ADC_ConvCpltCallback(ADC_HandleTypeDef* hadc) {
if (HAL_ADCEx_MultiModeStop_DMA(&hadc1) != HAL_OK) {
print("You've reached the bug on ADC1\n");
}
if (HAL_ADC_Stop_IT(&hadc2) != HAL_OK) {
print("You've reached the bug on ADC2\n");
}
}
Error code seems to be 0x04U which I believe is a DMA error. I'll let you guys confirm & diagnose. Sorry I can't invest more time in it.
Also, I can't tell you the HAL driver versions because when I browse the file you guys don't note the version your comments header so I have to quote the IDE version instead which is clumsy.
Edit: I've uploaded the main.c file used to test and confirm the bug for the two IDE versions here. Ignore the DAC stuff, it's for another bug test. PA5 is intended to be connected to PA0 and PA4, though obviously that's not necessary to actually confirm the bug. Hopefully it saves someone some time.
2022-03-19 02:22 AM
I get the same issue in STM32Cube_FW_F7_V1.16.2 for STM32F767 on the nucleo 144 board. in my case the result of HAL_ADCEx_MultiModeStop_DMA(&hadc1) == 0x80 which indicates the CR2 register ADON flag is high. I believe. Noob here!
I have stried various combinations of stopping ADC3 and ADC2 before calling the multifunction stop etc but no luck.
I dont know if the sequence of use by me is just not correct or what.
Any answers about this aspect yet?