cancel
Showing results for 
Search instead for 
Did you mean: 

STM32Cube - BUG report : bug in ADC1 injected channels and bad code generation

st239955_stm1
Associate II
Posted on June 07, 2014 at 14:35

Hi,

I'm using STM32CubeMX for a STM32F205 MCU.

There is a problem with the use of the ADC1 configuration, regarding Injected Groups.

 1/ when I choose the number of injected conversions, lots of intrusive 'ranks' display on the frame (normally, you should have the same number of visible ranks than the chosen number of conversions). I join a screenshot. Note that the generation of the code is consistent with the display - but then it generates a wrong code, that doesn't work, and that need to be manually changed. 

 2/ the number of injected conversions is missing at the code generation, and then the configuration of the ADC1 is wrong, the register JSQR is not filled, and it doesn't work. You must add it manually too.  ''sConfigInjected.InjectedNbrOfConversion = 1...4''.

Idem for ADC2.

3/   the JAUTO mode is missing at the code generation, and then the configuration of the ADC1 is wrong (I don't even know why JAUTO is set without doing anything!) and it doesn't work. You must add it manually too.  ''sConfigInjected.AutoInjectedConv = DISABLE;''.  

Idem for ADC2.

4/ in the configuration tab (of ADC1), when pushing on 'Apply' or 'OK' button, CubeMX crashes often. I'm on Windows7 pro 64. 

Can the ST team : 

 - confirm that it is a bug ?

 - let us know when it will be fixed ?

 - let us know when is planned the next update ? 

Thanks,

0690X00000605XFQAY.png

#bug #adc #st32cubemx #injected #!bug #adc #cubemx
26 REPLIES 26
Walid FTITI_O
Senior II
Posted on May 04, 2016 at 11:33

Hi smith.john,

Thanks for bringing this feedback to us. I report this internally to our CubeMx team.

-Hannibal-
mklatt9
Associate II
Posted on September 30, 2016 at 14:24

Hello Hannibal,

then please report the following:

The lines

sConfigInjected.InjectedNbrOfConversion sConfigInjected.InjectedContMode 

are not missing. They should be set later in the HAL_SDADC_InjectedConfigChannel function. But this is called in the wrong way through the CubeMX generated code with multiple calls per channel.

In my case (STM32CubeF3 with SDADC module - seems to use the same code basis - all in the current releases HAL 1.6.0 CubeMX 4.1) CubeMX generates this as initialization of injected channels:

if (HAL_SDADC_InjectedConfigChannel(&hsdadc1, SDADC_CHANNEL_8, SDADC_CONTINUOUS_CONV_OFF) != HAL_OK)

{

Error_Handler();

}

...

if (HAL_SDADC_InjectedConfigChannel(&hsdadc1,

SDADC_CHANNEL_7, SDADC_CONTINUOUS_CONV_OFF) != HAL_OK)

{

Error_Handler();

}

but correct would be - and this is the code I call after that to fix this bug:

HAL_SDADC_InjectedConfigChannel(&hsdadcIntADC, SDADC_CHANNEL_8 | SDADC_CHANNEL_7, SDADC_CONTINUOUS_CONV_OFF);

Please check and confirm for all (SD)ADC HAL implementations. Bad - this is around for many months now and no fix provided!

I hope there will be a public bug tracker - it is not really state-of-the-art to handle this count of bugs in a forum.

Thanks, MK

Amel NASRI
ST Employee
Posted on September 30, 2016 at 14:47

Hi mk@sch,

Could you please create a new discussion in which we may track the new reported issue?

-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.

mklatt9
Associate II
Posted on October 04, 2016 at 11:01

Hi Mayla,

this is no new bug. It's about the problem described in 2) at the first post, seems not to be fixed since then in some of the packages for ADC and/or SDADC.

Please test and confirm that generated code make the wrong use of the own HAL by generating more than one 

HAL_SDADC_InjectedConfigChannel

line. Fix it. No new discussion needed. ;)

Sorry for asking again: What about a bug tracker - the mass of bug duplicates, solved issues and missing versioning information is nearly not manageable in a forum. Could you please install this wish somewhere or report ST's arguments against it?

Thanks, MK

Posted on October 12, 2017 at 16:16

Hi

‌,

To conclude this thread, recent versions of the CubeMx (currently 4.2X) tool work correctly as far as ADC configurations are concerned.

Thank you for your contribution.

May you confirm it works now as you were expecting?

Regards.

Cyril

Posted on January 02, 2018 at 23:48

In STM32CubeMX V4.23.0, I'm finding that sConfigInjected.InjectedNbrOfConversion is still not set by the generated code and must be added manually.

Posted on May 25, 2018 at 11:31

Hi

wdecook

,

Thank you for your feedback.

May you share your CubeMX project to lead investigations for your particular use-case (MCU family, detailed configuration for ADC or SDADC)?

Thank you for your contribution.

Regards.

Cyril