cancel
Showing results for 
Search instead for 
Did you mean: 

STM32CubeMX generated code for STM32F373 SDADC buggy

blechleitner
Associate II
Posted on July 01, 2016 at 12:13

Dear Guys,

im working on an project where I have to sample 4 sensors which are connected to two SDADC's, two on each. The system is triggered by timer 19 and makes continuous conversions into a memory buffer by means of the DMA. So far the software is working fine, but with one exception.

When I configure the system in CubeMX, the generated code  contains a call of HAL_SDADC_InjectedConfigChannel() for each single channel, one time for channel 7 and the second one then for channel 8. The problem is nw, inside the HAL function, the bit field JCHG[8:0] is written directly. So the setting from the first call is overwritten and only the second call is active and finally only one channel is converted.

If i change the <channel> parameter in the second call with the ored value for

SDADC_CHANNEL_7 and SDADC_CHANNEL_8, the system converts both channels consecutively like expected.

So either the HAL function or the CubeMX code generation has to be changed tu fix that issue.

To the ST Team:

Can you please confirm this as a bug or tell me if I'm doing someting wrong?

Until when can this bug be solved?

Thanks in advance and best regards,

Bernhard Lechleitner

#f373-sdadc
3 REPLIES 3
Amel NASRI
ST Employee
Posted on July 13, 2016 at 17:30

Hi lechleitner.bernhard,

Could you please share your .ioc file? I need it to investigate the problem based on your exact configuration.

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

Amel NASRI
ST Employee
Posted on July 22, 2016 at 13:25

Hi lechleitner.bernhard,

As first analysis, I confirm that this is a bug in CubeMX side as the HAL driver allows to provide a combination of channels as parameter for the function HAL_SDADC_InjectedConfigChannel.

This is reported internally, you will be informed as soon as there more details about the planning to fix this.

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

Sirma Siang
ST Employee
Posted on July 04, 2017 at 17:58

Hello,

I have tested it using with the coming CubeMX4.22 with the firmware version 1.8.0 and 1.9.0.

The 'or' is done correctly.

Kind regards

Sirma