cancel
Showing results for 
Search instead for 
Did you mean: 

STM CubeMX32 F4xx rel. 1.5.0: Issue with ADC Code generation (Bug?)

cavizzano9
Associate II
Posted on April 27, 2015 at 12:03

Dear Developers,

First of all, thank you very much for the nice development environment who

really reduces the development time and increase the portability across the

whole uC series.

I noticed an apparent bug in the code generation when the user is programming DAC component with embedded sequencer feature.

In particular the BUG is related to the RANK programming which is not properly set. For instance. In particular it seems that the first RANK in the sequencer is mismatches with the overall number of ADC channels in the conversion. This is for instance the case of 3 sequence with 3 channels:

  sConfig.Channel = ADC_CHANNEL_1;

  sConfig.Rank = 3;

  sConfig.SamplingTime = ADC_SAMPLETIME_28CYCLES;

  HAL_ADC_ConfigChannel(&hadc1, &sConfig);

    /**Configure for the selected ADC regular channel its corresponding rank in the sequencer and its sample time.

    */

  sConfig.Channel = ADC_CHANNEL_2;

  sConfig.Rank = 2;

  sConfig.SamplingTime = ADC_SAMPLETIME_56CYCLES;

  HAL_ADC_ConfigChannel(&hadc1, &sConfig);

    /**Configure for the selected ADC regular channel its corresponding rank in the sequencer and its sample time.

    */

  sConfig.Channel = ADC_CHANNEL_3;

  sConfig.Rank = 3;

  sConfig.SamplingTime = ADC_SAMPLETIME_3CYCLES;

  HAL_ADC_ConfigChannel(&hadc1, &sConfig);

As you may see the rank is not properly set in the case of the first ADC conversion.

Now, I know that the BUG can easily be corrected by hand, by unfortunately

I am currently using CubeMX in a shared development environment with my own copy of simulink F4xx toolset, where the code generated by STMcube is

automatically imported and compiled into a simulink scheme, hence the error

is propagated directly in the executable.

I would be grateful if this behavior can be corrected in the next library version.

Kind regards and thank you in advance

C.Alberto Avizzano

PS: for more details I am available at c.avizzano@sssup.it

#stm-cube-32-f4xx---fw-1.5.0-bug
1 REPLY 1
cavizzano9
Associate II
Posted on May 25, 2015 at 17:06

Firmware version 4.7.1 now corrects the BUG.

Thank you !