Skip to main content
n.serina
Associate III
April 8, 2017
Solved

STM32Cubemx stuck in ''Generating user source code''

  • April 8, 2017
  • 13 replies
  • 9139 views
Posted on April 08, 2017 at 08:29

Hello, 

I recently installed cubemx 4.20 latest version 4.20.1

I can generate the project only 1 time, later if i try to update the project by adding new peripherals, i can not able to generate the code, the whole application is stuck in 'Generating user source code '. the only way i can close this application is killing it by 'Task manager'. it happens every time. Please help 

    This topic has been closed for replies.
    Best answer by Jeanne Joly
    Posted on April 12, 2017 at 15:15

    Hello

    n.serina

    ,

    In fact, the problem you highlighted is solved in CubeMX4.1.

    Please, upgrade with the latest release of CubeMX.

    Here is a screen shot of the CubeMX4.1 release note :

    0690X00000606kEQAQ.png

    Hope it will help you and that you won't encounter this issue in the future.

    BR. Eric

    13 replies

    Tomasz Majoch
    Visitor II
    January 24, 2018
    Posted on January 24, 2018 at 11:04

    After update stm32cubemx to  4.24.0 version code generation stuck  for RTC module.

    In log:

    2018-01-24 10:42:33,129 [INFO] CodeEngine:179 - oldGeneratedFile, C:\Users\Tomek\Documents\STM32Testy\eLB22\Src\rtc.c_save

    2018-01-24 10:42:33,238 [ERROR] runtime:96 -

    Expression usedDriverFlag is undefined on line 730, column 75 in ip_c.ftl.

    The problematic instruction:

    ----------

    ==> ${usedDriverFlag} [on line 730, column 73 in ip_c.ftl]

     in user-directive generateServiceCode [on line 1234, column 5 in ip_c.ftl]

    ----------

    In ip_c.ftl:

        [#if serviceType=='Init']

            [#if !ipName?contains('I2C')&& !ipName?contains('USB')] [#-- if not I2C --]

                [#if initService.clock??]

                    [#if initService.clock!='none']

                        [#if FamilyName=='STM32F1' && ipName=='RTC']debuggg ${usedDriverFlag} // line 730

                            [#if usedDriverFlag?? && !usedDriverFlag?contains('LL')]

                            #t#tHAL_PWR_EnableBkUpAccess();

                            #t#t/* Enable BKP CLK enable for backup registers */

                            #t#t__HAL_RCC_BKP_CLK_ENABLE();   

                            [#else]

                            #t#tLL_PWR_EnableBkUpAccess();

                            #t#t/* Enable BKP CLK enable for backup registers */

                            #t#tLL_APB1_GRP1_EnableClock(LL_APB1_GRP1_PERIPH_BKP);

                            [/#if]

                        [/#if]

    #n#t/* USER CODE END ${words[0]?replace('I2S','SPI')}_MspInit 0 */

        [@generateServiceCode ipName=words[0] serviceType='Init' modeName=mode instHandler=mode?lower_case+'Handle' tabN=2/]  // line1234

    #t/* USER CODE BEGIN ${words[0]?replace('I2S','SPI')}_MspInit 1 */

    When remove RTC from project all generates.

    I using STM32F103RETx, HAL, SW4STM32

    PS. For this line if Auto Predivider Calculation for RTC is disabled we can set in CubeMX in RTC Configuration dialog Asynchronous Predivider value from 0 to 127. Correct will be from 0 to 1048575 (RTC_DIVH / RTC_DIVL registers)
    Sirma Siang
    ST Employee
    January 25, 2018
    Posted on January 25, 2018 at 14:59

    Hello

    Majoch.Tomasz

    ,

    First I thank you for your feedback, and error reported.

    As this thread has been marked 'answerred' I suggest that you open a new thread with your error report.

    In the mean time, I confirm that this 'debug' trace has been pass through all our validation tests.

    You can remove the following 'debuggg ${usedDriverFlag}'until this correction is propagated into the new CubeMX release.

    I apology for this unforgivable regression.

    Kind regards

    Sirma

    Humberto Marquez
    Visitor II
    March 16, 2018
    Posted on March 16, 2018 at 10:51

    Hi,

    I am using cubemx Version 4.24 to generate a code for a project on IAR EWARM and i get same problem with the cubemx, it starts but it gets stuck in middle the code generation.