cancel
Showing results for 
Search instead for 
Did you mean: 

stm32f373 hangs when enabling ADC1

jan_soe
Associate
Posted on September 08, 2016 at 03:56

Hello,

I am trying to get the ADC1 running on the F373. The code was generated with CubeMx 4.15.0.

I tried single and 4Ch scan mode (regular), continuous mode, with polling, IT and DMA. I always get the same hang up

when coming to the instruction:

#define __HAL_ADC_ENABLE(__HANDLE__)                                           \

  (SET_BIT((__HANDLE__)->Instance->CR2, (ADC_CR2_ADON)))

Up to there the ADC_Init() is running through and setting the registers correctly (as far as I have checked in the register view).

But as soon as the adc enable instruction is done the cpu hangs. Especially when using DMA that should never happen but resulting in no or wrong data if there was a configuration error.

I realized the the ADON bit is never set in the peripheral/adc register view, although I can see all the other settings. I tried to set it by clicking on it, but it turns back to reset.

Is this behaviour normal? In docu it is not mentioned that this is a bit that returns '0' when reading....

Somewhere in the code it is written that the ADON is checked to make sure the ADC is not running. Is it only a uVision problem?

How can the start/enable of the ADC1 block the program?

Does anyone know this behaviour?

I found the error, it was a solder problem on the pin VDDA which was not soldered on one of the prototypes. This created a very high resistance between the pad and the pin. The effect was that on the pad the voltage was 3.3V but on the pin only 1.9V which obviously was not enough to start the ADC1. After soldering everything is fine.

Hope this might help someone in the future...

0 REPLIES 0