Skip to main content
Zheng Liang
Associate III
July 11, 2017
Question

Bug in STM32CubeMX v 4.22.0 with dual ADC mode

  • July 11, 2017
  • 2 replies
  • 638 views
Posted on July 11, 2017 at 18:48

When I had generated code with dual ADC on regular simultaneous mode from STM32CubeMX, the code after compiled couldn't get to work and rised error handler, so I traced the problem, found that there is a multiple mode configure function in ADC init function, but the configure function only works with ADC1, here is the reason. and I will illustarte it below:

  1. Here is the configure of ADC1 and ADC20690X00000603wIQAQ.jpg

    0690X00000603szQAA.jpg
  2. This is the code in ADC2_Init function:

    0690X00000603t0QAA.jpg
  3. The source code of this function, in the read box, the statement will be false:

    0690X00000603wMQAQ.jpg
  4. Here is the macros:

    0690X00000603wRQAQ.jpg

So, this code in ADC2_Init is meaningless, and bolck the program, I have to delete it everytime after I regenerated the project.

Hopes It's usefull for your guys.

Best Regards,

Zheng.

    This topic has been closed for replies.

    2 replies

    Zheng Liang
    Associate III
    July 12, 2017
    Posted on July 12, 2017 at 03:57

    And, the code generated in ADC2_Init function, lacking 'hadc2.Init.ExternalTrigConv = ADC_SOFTWARE_START;' as Ali said in

    https://community.st.com/0D50X00009XkY1hSAF

    ST Technical Moderator
    July 12, 2017
    Posted on July 12, 2017 at 09:44

    Hello

    Liang.Zheng

    ,

    Thank you for your reported issue.I will raise this issue internally for checking and come back to you.

    Thanks

    Imen

    In order to give better visibility on the answered topics, please click on 'Best answer' on the reply which solved your issue or answered your question. Thanks
    Cyril FENARD
    ST Employee
    September 7, 2017
    Posted on September 07, 2017 at 17:03

    Hi

    Liang.Zheng

    ,

    Thanks for having reported the issue.

    The correction is going to be delivered in next CubeMx v4.1.

    Regards.

    Cyril