2014-06-07 05:35 AM
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, #bug #adc #st32cubemx #injected #!bug #adc #cubemx2016-05-04 02:33 AM
Hi smith.john,
Thanks for bringing this feedback to us. I report this internally to our CubeMx team. -Hannibal-2016-09-30 05:24 AM
Hello Hannibal,
then please report the following: The linessConfigInjected.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, MK2016-09-30 05:47 AM
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.
2016-10-04 02:01 AM
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 oneHAL_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, MK2017-10-12 09:16 AM
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
2018-01-02 03:48 PM
In STM32CubeMX V4.23.0, I'm finding that sConfigInjected.InjectedNbrOfConversion is still not set by the generated code and must be added manually.
2018-05-25 04:31 AM
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