Question
CubeF4: ADC interrupt corruptes USB FS CDC on STM32F405
Posted on August 12, 2014 at 11:42
I have implemented USB FS CDC on STM32F405 (OLIMEX H405 prototype board) using CubeMX.
A LED indicates (hUsbDevice_0->dev_state == USBD_STATE_CONFIGURED) and a communication with VCP on PC works in both directions. Now I have added a handling of ADC1 (single channel, continous conversion, no DMA, interrupt) using CubeMX again. I use Priority Grouping 4 and set the interrupt priority 0 for SysTick, 1 for ADC and 2 for USB. There is currently nothing in the ADC handler except HAL_NVIC_ClearPendingIRQ(ADC_IRQn) and the interrupt is fired (debugger). If I do not disable the ADC interrupt (to comment __HAL_ADC_ENABLE_IT(hadc, ADC_IT_EOC) in HAL_ADC_Start_IT(...)) the LED is not getting and USB communication cannot work. The board is still seen in the Windows Device Manager as enumerated without a problem (no yellow exclamation mark). Any opinion or advice welcome. #cubemx-stm32f405-adc-usb-cdc