Quickstart for Processor Expert in Eclipse

Ok, you are probably new to Eclipse, and want to do the fun part: Creating an Eclipse Processor Expert project in CodeWarrior for MCU10.2. Cool! Here are some steps and tips to make it smooth from the beginning…

First, download and install CodeWarrior from here. Yep, that’s a big file to download and install. So better plan to do some other work in parallel…. Well, you could continue reading so you will be ready.

The first time you launch the IDE, it asks you to select a workspace:

Workspace Selection

Workspace Selection

Go with the default or select a new folder. Press OK.

This launches the Eclipse IDE. Once loaded, it shows the Welcome View. Select ‘Go to Workbench’:

Eclipse Welcome

Eclipse Welcome

Now it is time to create a new Processor Expert Project with the Wizard. Use the menu File > New > Bareboard Project:

Menu to create new bareboard project

Menu to create new Bareboard Project

In the wizard, give a project name and select the device you want to use. If you don’t care, simply select the MCF51JM128.

Tip: Use filtering, e.g. *mcf51jm

MCF51JM128 selected as Device

MCF51JM128 selected as Device

Specify what method for debugging you want to use (depending on what you have). Go through the wizard with the default settings, except for this one:

Processor Expert Selection in the Wizard

Processor Expert Selection in the Wizard

Here select the Processor Expert option, and press Next. Depending on the microcontroller selected you will be offered a dialog asking for the pin variant and configuration: select what fits best for you.

Press Finish, and the project will be created for you. If this is the first time you use Processor Expert, this might now take a little bit longer. Once you project has been created, it should you see something like this:

CodeWarrior Eclipse with Processor Expert Views

CodeWarrior Eclipse with Processor Expert Views

You can show/hide the Processor Expert views using this menu:

Show and Hide Processor Expert Views

Show and Hide Processor Expert Views

Time to inspect the Processor Expert Components in the project. Go to the Project Panel View and unfold the ProcessorExpert.pe group (this is actually an XML file in the root of your project):

Project Panel View with Processor Expert File

Project Panel View with Processor Expert File

Let’s add a component to toggle a LED or an I/O pin. For this go to the Components Library view and select the Alphabetical tab:

Adding Component to Project

Adding Component to Project

To add a component to a project, check first that the right project is active. You can see this on the bottom of the Components Library view. Otherwise first select the project. Then select the component to add and press the ‘add’ icon in the Components Library Toolbar.

Select the newly added component and choose the Inspector from the context menu:

Selecting Inspector

Selecting Inspector

This opens the Component Inspector View. Specify a Pin for your I/O:

Component Inspector View

Component Inspector View

Tip: Notice the little star (*) in the Component Inspector. This means that things are not save yet. Select the Tab and Press CTRL-S to save the settings, and the * goes away.

Use Ctrl-S to save settings

Use Ctrl-S to save settings

Unfold the BitIO you have added. It will show all the methods. Notice that some methods are disabled and marked with an X. Enable the NegVal() method with the context menu:

Toggle Enable/Disable

Toggle Enable/Disable

To use the Processor Expert method, simply drag&drop the Method into your source. To learn more about drag&drop with Processor Expert, see this post.

Drag&Drop of a method

Drag&Drop of a method

This gives you now the code in the main():

main() function in Processor Expert.c

main() function in Processor Expert.c

Tip: Notice again little star (*) in view. This means that things are not save yet. Use CTRL-S to save the file.

To generate Processor Expert code, select the project folder and press the Generate Processor Expert Code button:

Generating Code Steps

Generating Code Steps

After code has been generated, we need to build it. Here again, eclipse is using the ‘current project’ approach. Select the project folder and use the ‘hammer’ button:

Building the Project

Building the Project

The Problems View should show no error:

Problems View with no Error shown

Problems View with no Error shown

Tip: An case you get a “mingw32-make: *** No rule to make target” error: Use the menu Project > Clean… to recreate the make files.

And the Console View should just show what the compiler and linker had to say:

Console View with Build Tools Output

Console View with Build Tools Output

Same ‘have a project selected’ theme for debugging: make sure you have a project selected and press the ‘debug’ button:

Start Debugging

Start Debugging

This then (hopefully) downloads the binary to the target board. Eclipse might ask you if you want to switch to the Debug Perspective. Say Yes. The Debug Perspective is for debugging (ah, that was obvious!):

Debug Perspective

Debug Perspective

In the Debug View you have toolbar icons to resume, stop, disconnect and stepping. Hoover over the toolbar buttons to find out more:

Debug View with debugging buttons

Debug View with debugging buttons

Use the Terminate button in the Debug View Toolbar  to terminate the debugging session:

Terminate the Debug Session

Terminate the Debug Session

To switch back to the C/C++ Perspective use the C/C++ button. In case the button is not visible, simply use your mouse to enlarge the button area:

Back to C/C++ Perspective

Back to C/C++ Perspective

Now you are back to your project, and ready to start coding….

Happy Experting 🙂

14 thoughts on “Quickstart for Processor Expert in Eclipse

  1. Pingback: USB or not: CDC with Processor Expert | MCU on Eclipse

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

  3. Pingback: Code Warrior, Eclipse, and Freedom boards | Raspberry Alpha Omega

  4. Thanks for that. I’m looking for useful informations about these boards for hours now. CW 10.6 is installed and it looks different than the version used here. I can’t import any demo code, I’m starting to wonder whether these MCUs are meant to be programmed at all. Support by freescale for these boards is really bad.

    Anyway, I’m stuck at adding the IO pin. ProcessorExpert.pde is an empty folder. Nothing was added. I get some warnings at the bottom “This setting is useless for target cpu.” lol Screenshot: http://foto.arcor-online.net/palb/alben/29/1907129/6161316662613563.jpg

    Enjoy the weekend,
    Stephan

    Like

    • Hi Stefan,
      the warning is easy: it asks you to set the ‘safe mode’ setting to ‘no’ in the properties of the pins, as they do not make sense. I think you can double click on the warning and it will open the settings (you might have to enable the ‘Advanced’ button in the component inspector view.
      Which demo code do you want to import?
      And what is this ProcessorExpert.pde? Or you mean ProcessorExpert.pe?

      I hope this helps,
      Erich

      Like

    • OK, got that finally but I can’t flash. Thingy is not recognized by CW. Moving applications to the board does not work. Plug-off and -on again and the files are gone…

      Like

      • Hi Erich,

        democode I found at freescale in some quickstart package. I would like to know how to program these MCUs. There is no useful info found at freescale. Anyway, as the debug brigde ain’t working, there’s no point anymore. I’m just a hobbyist with some experience with MSP430 and Stellaris/Tiva and wanted to try something different. Epic fail, I get back to TI chips. They provide good documentation and working tools.
        Almost a full saturday wasted…

        Stephan

        Like

        • Hi Stephan,
          Not sure what is causing this on your side. I never understood why Freescale ships their FRDM boards with the mass storage bootloader by default. It is nice to download a S19 file, but developers want to develop, not to program S19 files produced by someone else. What Windows version are you using? I know that the boards shipping have an issue with Windows 8.1 because Windows seems to do weird things with USB.

          Like

  5. Yeah I tried but the files don’t stick at (whatever) storage of the board. I tried 2 times using Explorer and once via console and copy command. No worky, prolly needs some kind of special bithammer to slam them in…

    Like

  6. HA – silly me. It’s blinking ! I had to plug the board without holding down reset. So this SDA thingy is working now. Now I need some manuals…

    Thanks,
    Stephan
    (my full nick is OppaErich 🙂

    Like

  7. Hello,
    I am using processor expert and configured and generated code. The problem is i have changed one file which is generated by PE. Now when ever i change some settings in PE and generate again my changes in that file are changed but i want to keep those changes in that file. How can i do it.

    Thanks,

    Like

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 )

Google photo

You are commenting using your Google 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.