cancel
Showing results for 
Search instead for 
Did you mean: 

Problem with initialization ADC2 STM32L476RET in HAL

Oleg Lozhechkin
Associate II
Posted on November 10, 2016 at 15:10

Good day!

I use microcontroller stm32l476ret.

In CubeMX create desired configuration and  create  project for Keil v.5.

The Keil everything compiles without errors.

Pour the code into the microcontroller.

The microcontroller runs and freezes on

ADC2 initialization error.

If  remove the ADC2 initialization code all working properly.

I tried to pass in debug mode -

see

that cycling is on ADC2 initialization error.

I tried to do the minimum configuration: ADC2, SWD, quartz and GPIO.

Hangs on initialization.

Tried different modes ADC2  - the result of initialization error.

I am t

ried 2 different chips

This problem occurs only with the ADC2.

ADC1 and ADC3 working properly.

I am use CubeMX 4.17, fw package for stm32l4 1.5.2, Keil 5.21a.

Maybe it's a bug in the HAL?

2 REPLIES 2
slimen
Senior
Posted on November 10, 2016 at 15:43

Hello,

What about DMA configuration ?

You can share your code to have more insight your ADC2 initialization and understand your issue.

Regards

Oleg Lozhechkin
Associate II
Posted on November 11, 2016 at 09:38

Hello,

I am not use DMA.

I am a little correct file stm32l4xx_hal_adc_ex.c and ADC2 was

initialized OK.

As I am see any peoples have problem with ADC2

initialization.