Disable my Code Generation

Processor Expert in MCU10 generates a lot of files for me. But sometimes I need to tweak things a bit. I change the generated sources to fit my needs, and then I want to prevent that my changes get overwritten by the next code generation.
First, I need to know which files are generated: the information in “Dissection of MCU10 Projects” helps me to identify them. But how can I prevent code generation for each component? Or for other generated files? Or how to completely disable code generation?

For each component: If I have made a modification in the generated code, I can disable this with a the context menu:

Don't write generated component modules

Don’t write generated component modules

I notice that the Icon of the component changes to show that code generation is disabled:

Component Icon Decorator for Disabled Code Generation

Component Icon Decorator for Disabled Code Generation

With this I can control the code generation for each Processor Expert Embedded Component. But what about the shared Files maintained by Processor Expert? Here I find the settings in the project properties (Project > Properties > Processor Expert) panel:

Processor Expert Project Options to Control Code Generation

Processor Expert Project Options to Control Code Generation

That way I can prevent creation of the shared module completely with the ‘Do not generate’ setting. Or having code created, but not changed afterwards with the ‘Create, but do not change’ setting.

To disable code generation completely, I use the ‘Freeze code generation‘ setting:

Freeze Code Generation and Controlling Build

Freeze Code Generation and Controlling Build

The same dialog gives me control over the build process: If I want to disable code generation when I do a build, I can control this with the ‘Generate code before build automatically‘ setting.

If I need to do changes in the linker file as outlined in “USB or not: CDC with Processor Expert”, then I can disable this in the CPU component. I use the Inspector View on the CPU and disable linker file generation in the ‘Build options‘ tab: Here I can disable not only the linker file generation, but as well the debugger configuration files:

Debugger and Linker File Generation

Debugger and Linker File Generation

With this I have complete control over my code generation.

Happy Disabling 🙂

21 thoughts on “Disable my Code Generation

  1. It seems that “For Each Component” section is not working for some cases. These are cases where the component contains files not meeting the normal assortment of .c and .h files with the expected name. This should be addressed on CW10.3.

    In the meantime, some use of the “freeze code generation” may be needed, more so than would otherwise be expected.


    • I cannot reproduce this, at least with my components. E.g. my RTOS component creates other files than *.c and *.h, and suspending code generation for it works. So it might be indeed related to a special component you are using. All what I can say is that the setting should inhibit code generation. If not, then this sounds like a bug. I propose that you submit the details to support/CW team?


  2. Pingback: Tutorial: FreeRTOS on DEMOJM | MCU on Eclipse

  3. Pingback: Processor Expert, gcc C++ and Kinetis-L and MQXLite | MCU on Eclipse

  4. Pingback: Removal of Processor Expert for a Project | MCU on Eclipse

  5. Pingback: Review of CodeWarrior for MCU10.4 | MCU on Eclipse

  6. Hi Erich,
    I assume this means that you then add your customized generated code files into version control. Is that true?
    (I’m trying to figure out how to automate my builds including the PE code generation… I’m almost settling for just checking in all the generated code along with the .pe file from which it was generated.)


    • Hi John,
      yes. If you change the generated code, then definitely you have to put it under version control. And I know that some users put the whole generated code under version control, regardless if modified or not. That makes sometimes sense, especially if you want to track the differences in the code generation. I’m not doing it during the development cycle. But I put everything (including the object files/etc) into a (different) repository once I have finished the project. Just to capture everything else.


      • Thanks for the advice Erich! BTW, you don’t happen to know if there’s a way to make PE generate the code from the command line do you – something I could stick in a batch file? It does not seem like there is – but I thought I’d ask since you’ve clearly had a lot of experience with the Freescale tools.


        • Hi John,
          I have not done it, but I know it is possible to run the IDE from a batch file and to perform some actions, and one if it is to build a project.
          See https://mcuoneclipse.com/2012/08/03/codewarrior-flash-programming-from-a-dos-shell/
          As part of the build/make it would generate the code. I’m not aware of a special command just to trigger the code generation. But if you would delete the Generated_Code folder, the code generation process should be kicked off. I’ll browse around if I can find something else.


        • Hi Erich,
          Well, I just tried it out using ecd.exe and found that PE code generation does *not* happen as part of an ecd.exe run. Once I generate the PE code in the IDE, I’m able to build the rest of the project using ecd.exe, but that manual step is indeed required first.

          I guess I’ll just have to check in all the files that PE generates.

          Thanks again for all your help!



        • Hi John,
          ok, then my hopes were all wrong. I have started an inquiry at Freescale if there is a way to trigger a code generation by a script. Once I get a response, I’ll post an article about this for sure 🙂


  7. Hello Erich,

    if i want processor expert to not generate code for certain lines in a file, is there any defined macro that can do that? i want to test freertos version 8, and i need to add pendsvhandler and systick handler to vectors.c, but without rtos component, it will reset the vector table everytime.


    • In MCU10.5, you can disable code generation for the CPU component. With this disabled, then I think the vector table remains untouched.
      I planned to look at V8.0 of FreeRTOS over the next weekend if time permits.


  8. Pingback: Generating Static FreeRTOS Source Code | MCU on Eclipse

  9. Pingback: Binary Files for the mbed Bootloader with Eclipse and GNU ARM Eclipse Plugins | MCU on Eclipse

  10. Pingback: Problem: undefined reference to ‘__end__’ if using Semihosting | MCU on Eclipse

  11. Pingback: Overview: Processor Expert | MCU on Eclipse

  12. Hi Erich
    I am working on to build the Bootloader in Freescale KL25z Freedom board. Everything is in place , except me facing a problem of not being able to find two Processor Expert component. they are:
    1. CLS1: Shell
    2. CS1: Critical Section
    If you could kindly help me by sending or sharing from where I can get these components then it would be a great help.


  13. Pingback: USB with the TWR-K60F120M and TWR-K70F120M | MCU on Eclipse

What do you think?

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.