Skip to main content
Leonardo Volponi
Associate
March 23, 2017
Solved

STM32F373Rxx ADC1 triggered by Timer4 CC? probable HAL library error

  • March 23, 2017
  • 2 replies
  • 870 views
Posted on March 23, 2017 at 19:38

The problem is a complier error because in the cube MX (version 4.20.0)

for the STM32F373R8Tx

using ADC1 (12 bits ADC) I can choose, in the configuration tab,

ADC1 and as external trigger source for regular conversion the TIM4 CC4 event....

this will generate this code:

....

hadc1.Instance = ADC1;

hadc1.Init.ScanConvMode = ADC_SCAN_ENABLE;

hadc1.Init.ContinuousConvMode = DISABLE;

hadc1.Init.DiscontinuousConvMode = ENABLE;

hadc1.Init.NbrOfDiscConversion = 8;

hadc1.Init.ExternalTrigConv = ADC_EXTERNALTRIGCONV_T4_CC4; <-- compiling this will generate an undefined error !

hadc1.Init.DataAlign = ADC_DATAALIGN_RIGHT;

hadc1.Init.NbrOfConversion = 8;

....

in the HAL libary header (version 1.7.0 lates up to date) stm32f3xx_hal_adc_ex.h

at the line 1349 there is: &sharpdefine ADC_EXTERNALTRIGCONV_T4_CC2 ADC_EXTERNALTRIG_T4_CC2

at the line 1827 there is: &sharpdefine ADC_EXTERNALTRIG_T4_CC2 ((uint32_t)(ADC_CR2_EXTSEL_2 | ADC_CR2_EXTSEL_0))

Reading at the manual STM32F37xx Reference Manual (RM0313) in the chapter 12.12.3 ADC control register 2 (ADC_CR2) the documentation report:

......

EXTSEL[2:0] External event selector for regular group:

the value (bits) 101 that is (ADC_CR2_EXTSEL_2 | ADC_CR2_EXTSEL_0)

the manual reports that with this configuration the trigger source should be TIM4 CC4 Event.

.....

is there anybody that can explain this ?

Thank you very much in advance for your help !

Best regards

Leonardo

#stm32f373-adc-trigger
This topic has been closed for replies.
Best answer by Imen.D
Posted on April 03, 2017 at 14:42

Hi

Volponi.Leonardo

,

I would inform you that your reported bug is confirmed and will be fixed in the coming version.

Thank you for bringing this to our attention.

Imen

2 replies

Technical Moderator
March 29, 2017
Posted on March 29, 2017 at 18:21

Hi

Volponi.Leonardo

,

I want to thank you for your issue report.I will raise it internally and keep you informed with updates.

Imen

In order to give better visibility on the answered topics, please click on 'Best answer' on the reply which solved your issue or answered your question. Thanks
Imen.DBest answer
Technical Moderator
April 3, 2017
Posted on April 03, 2017 at 14:42

Hi

Volponi.Leonardo

,

I would inform you that your reported bug is confirmed and will be fixed in the coming version.

Thank you for bringing this to our attention.

Imen

In order to give better visibility on the answered topics, please click on 'Best answer' on the reply which solved your issue or answered your question. Thanks