One project for two MCU

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

One project for two MCU

1,267 Views
hasaur
Contributor II

Hello.

I am developing on MC9S12XEP100 and MC9S08DZ128. I would like to make one program that can be used for both MCU : I put #define MODE1 (for one of the MCU) or 2(for the other MCU) at the start of an included file and all the others files are doing something different in the two cases (#ifdef MODE1 ..... #endif   #ifdef MODE2 ........ #endif). The problem is that I have to use different CodeWarrior IDE for the two MCU.

Please if someone has a solution for doing it.

Thank you.

Labels (1)
Tags (1)
0 Kudos
4 Replies

368 Views
CrasyCat
Specialist III

Hello

 

You may want to use 2 distinct build targets here.


- Which version of CodeWarrior are you using?
  To retrieve that info:
    - Start CodeWarrior
    - Select Help -> About Freescale CodeWarrior
    - Click on "Install Products"
    - CodeWarrior version used is displayed on top in the Installed Products dialog.

- Which edition of CodeWarrior are you running )Special, Standard, Professional)?

 

CrasyCat

0 Kudos

368 Views
hasaur
Contributor II

Hello and thank you for your help.

For the MC9S12XEP100, I'm using the version 5.0, build 9061 Special Edition.

For the MC9S08DZ128, I'm using the version 6.3, build 9279 Special Edition.

Thank you.

0 Kudos

368 Views
CrasyCat
Specialist III

Hello

 

Sorry I did not read your previous post carefully enough.

In fact you intend to use the same project for MC9S12XEP100 and MC9S08DZ128.

 

Thes is not possible as you require 2 distinct version of CodeWarrior for these MCUs.

You need CodeWarrior for HC12 for MC9S12XEP100 and CodeWarrior for MCU for MC9S08DZ128.

 

So you need 2 different .mcp file. One for each MCU.

What you can do is make both .mcp use the same source files (i.e. use physically the same files on the disk).

Same source files can be added to each project using  "Add Files".

Then in order to activate code generation for one or the other MCU just add the corresponding option to your compiler command line.

    -DMODE1 for first MCU and

   - DMODE2 for second one.

 

Option -D is equivalent to #define, but can be specified on command line.

 

CrasyCat

0 Kudos

368 Views
hasaur
Contributor II

Hi.

Thank you for your answer.

That's what I've done before writing this post, but I was hoping that there was another way to do this.

Thanks.

0 Kudos