Tip / Sign in to post questions, reply, level up, and achieve exciting badges. Know more

cross mob

How to disable automatic code generation for ModusToolbox™ 3.x applications – KBA238242

How to disable automatic code generation for ModusToolbox™ 3.x applications – KBA238242

50 replies posted 25 likes received 25 replies posted

1.1 Background

When you build a ModusToolbox™ application, various configurators run and regenerate code behind the scenes. This is also true if you perform a "make <IDE>" command to generate files for IDEs such as Eclipse, Visual Studio Code, etc. During active development of your application, this might be desired behavior. You may be making changes to various pins or clocks; therefore, you want this code updated.

However, if you have finished development, and you want to make sure code no longer gets generated, follow these instructions.

1.2 ModusToolbox™ version 3.1 applications

In 3.1, a new feature has been provided through the use of a "make" variable called
SKIP_CODE_GEN. Simply set this variable in your application Makefile to any non-empty value. For example:


Setting the variable prevents code generation for configurators from occurring during a build or various other actions such as make <IDE>. However, code generation for configurators will still occur if you intentionally save changes from a configurator.

Note: If you are using Git for revision control, you should remove "GeneratedSource/" from the .gitignore file so that the generated source files are checked in.

1.3 ModusToolbox™ version 3.0 applications

In 3.0, you have to update the core-make library from version 3.0.x to version 3.2.x using the Library Manager.



After updating the application, you can then use the SKIP_CODE_GEN variable in the same manner as in 3.1 applications.

This will not work for applications using core-make 2.x or earlier.