cancel
Showing results for 
Search instead for 
Did you mean: 

STM32Cube ADC injected channel TIM2 trig error in STM32F301C8

omeryaman
Associate II
Posted on September 28, 2016 at 10:11

I'm using STM32F301C8microcontroller in my project. I use STM32Cube for init code generation.In ADC init part i configured injected channels to be externallytriggered from TIM2. 

After code generation i tried to build the project in IAR but i got an error:

Error[Pe020]: identifier ''ADC_EXTERNALTRIGINJECCONV_T2_TRGO'' is undefined...

Isit caused from a STM32Cube error or doesn't STM32F301C8microcontrollers ADCs injected channels have a feature of beingexternally triggered from TIM2.

Regards;

Omer 

#stm32cube
1 ACCEPTED SOLUTION

Accepted Solutions
Imen.D
ST Employee
Posted on January 16, 2017 at 12:09

Hello

‌,

Your request is fixed in the new release of STM32CubeF3 V1.7.0:  

ADC_EXTERNALTRIGINJECCONV_T2_TRGO is defined for  STM32F301x8.

Thanks for bringing this issue to our attention.

Regards

Imen

When your question is answered, please close this topic by clicking "Accept as Solution".
Thanks
Imen

View solution in original post

5 REPLIES 5
slimen
Senior
Posted on September 28, 2016 at 11:33

Hello,

To have more insight into ADC applications, I recommend you to check the ADC example in the STM32CubeF3: 

 STM32Cube_FW_F3_V1.6.0\Projects\STM32303E_EVAL\Examples\ADC\ADC_TriggerMode

This example describes how to use the ADC and TIM2 to convert continuously data from ADC channel. 

So, compare the provided code there with your code to figure out what is missed there.

Ensure that you have correctly configure both ADC and Timer. 

Then, share your code if this issue is not resolved.

This

http://www.st.com/content/ccc/resource/technical/document/reference_manual/a5/e0/21/a3/78/00/41/1e/DM00094350.pdf/files/DM00094350.pdf/jcr:content/translations/en.DM00094350.pdf

 may help you, in section 12 Analog-to-digital converters (ADC) and Table 34. ADC1 - External trigger for injected channels.

Regards

omeryaman
Associate II
Posted on September 28, 2016 at 12:02

I checked some examples about it. But all examples are about STM32F303 series and everything is OK about it. My question is about STM32F301 series microcontrollers.

In stm32f3xx_hal_adc_ex.h header, ADC_EXTERNALTRIGINJECCONV_T2_TRGO isn't defined when the microcontroller is defined as STM32F301x8. This is because of #if preprocessors. When i look at the ref. manual it says TIM2 is available for external triggering for STM32F301 but it is not defined in the header file. 

So i'm not sure if STM32F301 injected ADC channels can be externally triggered from TIM2 or not

slimen
Senior
Posted on September 28, 2016 at 14:17

Hi,

I checked this case and I confirm this issue.

Regards

Amel NASRI
ST Employee
Posted on September 28, 2016 at 16:40

Hi yaman.omer.002,

Thanks for highlighting this issue. It is reported internally to be fixed in coming versions.

-Mayla-

To give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.

Imen.D
ST Employee
Posted on January 16, 2017 at 12:09

Hello

‌,

Your request is fixed in the new release of STM32CubeF3 V1.7.0:  

ADC_EXTERNALTRIGINJECCONV_T2_TRGO is defined for  STM32F301x8.

Thanks for bringing this issue to our attention.

Regards

Imen

When your question is answered, please close this topic by clicking "Accept as Solution".
Thanks
Imen