cancel
Showing results for 
Search instead for 
Did you mean: 

STM32Cubemx stuck in ''Generating user source code''

n.serina
Associate III
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 

29 REPLIES 29
Posted on May 05, 2017 at 21:56

Thanks for checking that out for me. It does seem like some odd combination of java, cube and the ioc file history. I'm working on one F0 chip and 3 F4 chips now and it's just the F469 project that's not working.

Posted on May 05, 2017 at 22:44

Did you tried to run CubeMX from command prompt or generate project in new

ioc file with this same or similar uC?

On Fri, May 5, 2017 at 9:57 PM, Glen Larson <st-microelectronics@jiveon.com>

Posted on May 06, 2017 at 04:11

Got it!

When I ran from the command line it barfed a long stream of Java faults that started with complaining about a path.

Looking into the file it was on this key:

ProjectManager.ToolChainLocation=

It pointed to an invalid location as I had moved the project and deleted the old tree. I pointed it to the right location and it worked fine. Oddly enough, when I saved the file that key was empty as above.

Thanks so much!

Posted on June 28, 2017 at 07:47

Hi Imen,

I got same problem with CubeMx 4.21.0. 

It can generating code well after I added some codes in USER CODE area and change CubeMX configuration. But after I changed some code in debug.h and cc.h for Lwip, and then I changed some lwip configuration in CubeMX, Finally it will stuck in Generating user source code... as followed pic.

0690X00000607XRQAY.png

The only method to make it work again is to make a new project with same .ioc file.

I use IAR7.7 in window 8.

May I change Lwip files with cubemx?

umut ANKARALI
Associate
Posted on October 31, 2017 at 11:22

Hi

I got the same problem My cubemx version is 4.23.0 and i am using cubeF4 lib V1.17.0 is only stuck with F4 series when I use F0 series there is no problem, is working well. I updated java to 8.151 but it didnt work. i added my ioc file

https://drive.google.com/file/d/0B3GYXIYVe_UxQTU0WFgzUGJXYkU/view?usp=sharing

Jeroen3
Senior
Posted on October 31, 2017 at 16:32

I experienced this as well, and determined this was due to other processed accessing the generated files immediately.

Think about Dropbox, Owncloud or other indexing and cloud software.

Moving out of these managed folders resolved the problem.

Pausing these services while inside the managed folder resolved the problem.

Posted on December 13, 2017 at 00:22

The following line in .ioc file hangs the generator

ProjectManager.ToolChainLocation=C\:\\STM32L4AzureSeminar\\Hands_On\\ \\Lab1

(bad copy paste)

Argh...

Peter

Tomasz Majoch
Associate II
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
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
Associate
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.