cancel
Showing results for 
Search instead for 
Did you mean: 

CubeMX + TouchGFX 'Error during code generation'

Ade W
Associate II

Hi,

I'm trying to generate a new project for the STM32F469IDISCOVERY using CubeMX 5.2.0 and TouchGFX 4.10.0. All peripherals are initialized with the default modes. I use STM32CubeIDE as toolchain/IDE.

After enabling the Graphics framework using TouchGFX in 'middleware', I press the 'generate code' button and code is generated. After that I press 'execute' to execute the TouchGFX GUI. Right after TouchGFX is started, I get the following error code: 'Error during code generation'.

The following errors can be observed from the log:

C:/TouchGFX/4.10.0/env/MinGW/msys/1.0/Ruby193/lib/ruby/gems/1.9.1/gems/touchgfx-cli-4.10.0/lib/touchgfx/generators/sw4_project_updater.rb:74:in `block in ensure_source_nodes': undefined method `add_child' for nil:NilClass (NoMethodError)

   from C:/TouchGFX/4.10.0/env/MinGW/msys/1.0/Ruby193/lib/ruby/gems/1.9.1/gems/touchgfx-cli-4.10.0/lib/touchgfx/generators/sw4_project_updater.rb:62:in `each'

   from C:/TouchGFX/4.10.0/env/MinGW/msys/1.0/Ruby193/lib/ruby/gems/1.9.1/gems/touchgfx-cli-4.10.0/lib/touchgfx/generators/sw4_project_updater.rb:62:in `ensure_source_nodes'

   from C:/TouchGFX/4.10.0/env/MinGW/msys/1.0/Ruby193/lib/ruby/gems/1.9.1/gems/touchgfx-cli-4.10.0/lib/touchgfx/generators/sw4_project_updater.rb:24:in `run'

   from C:/TouchGFX/4.10.0/env/MinGW/msys/1.0/Ruby193/lib/ruby/gems/1.9.1/gems/touchgfx-cli-4.10.0/lib/touchgfx/generators/update_project.rb:44:in `run'

   from C:/TouchGFX/4.10.0/env/MinGW/msys/1.0/Ruby193/lib/ruby/gems/1.9.1/gems/touchgfx-cli-4.10.0/lib/touchgfx/cli/inside.rb:45:in `update_project'

   from C:/TouchGFX/4.10.0/env/MinGW/msys/1.0/Ruby193/lib/ruby/gems/1.9.1/gems/thor-0.19.1/lib/thor/command.rb:27:in `run'

   from C:/TouchGFX/4.10.0/env/MinGW/msys/1.0/Ruby193/lib/ruby/gems/1.9.1/gems/thor-0.19.1/lib/thor/invocation.rb:126:in `invoke_command'

   from C:/TouchGFX/4.10.0/env/MinGW/msys/1.0/Ruby193/lib/ruby/gems/1.9.1/gems/thor-0.19.1/lib/thor.rb:359:in `dispatch'

   from C:/TouchGFX/4.10.0/env/MinGW/msys/1.0/Ruby193/lib/ruby/gems/1.9.1/gems/thor-0.19.1/lib/thor/base.rb:440:in `start'

   from C:/TouchGFX/4.10.0/env/MinGW/msys/1.0/Ruby193/lib/ruby/gems/1.9.1/gems/touchgfx-cli-4.10.0/lib/touchgfx.rb:16:in `<module:CLI>'

   from C:/TouchGFX/4.10.0/env/MinGW/msys/1.0/Ruby193/lib/ruby/gems/1.9.1/gems/touchgfx-cli-4.10.0/lib/touchgfx.rb:9:in `<module:TouchGFX>'

   from C:/TouchGFX/4.10.0/env/MinGW/msys/1.0/Ruby193/lib/ruby/gems/1.9.1/gems/touchgfx-cli-4.10.0/lib/touchgfx.rb:8:in `<top (required)>'

   from C:/TouchGFX/4.10.0/env/MinGW/msys/1.0/Ruby193/lib/ruby/site_ruby/1.9.1/rubygems/core_ext/kernel_require.rb:55:in `require'

   from C:/TouchGFX/4.10.0/env/MinGW/msys/1.0/Ruby193/lib/ruby/site_ruby/1.9.1/rubygems/core_ext/kernel_require.rb:55:in `require'

   from C:/TouchGFX/4.10.0/env/MinGW/msys/1.0/Ruby193/lib/ruby/gems/1.9.1/gems/touchgfx-cli-4.10.0/bin/touchgfx:6:in `<top (required)>'

   from C:/TouchGFX/4.10.0/env/MinGW/msys/1.0/Ruby193/bin/touchgfx:22:in `load'

   from C:/TouchGFX/4.10.0/env/MinGW/msys/1.0/Ruby193/bin/touchgfx:22:in `<main>'

No matter what I do in CubeMX, this error in TouchGFX is always the same. Is there something I do wrong? I just follow the CubeMX manual chapter 19.

Regards

John

12 REPLIES 12

You're building a C project, but TouchGFX is C++ so you have undefined references to symbols that come from cpp files (which don't get compiled).

Do you know when issue will be fixed?

FSTKMARO
Associate II

@Martin KJELDSEN thanks for your response. Can you be a bit more specific? You mention the .touchgfx file, which is fine but pardon me for being a newbie. Can you post more information as to where the file is located? Is the file within thouchgfx or within stm32cubeide and for that reason in cubemx? I'd like to get over this problem.

thank you