Retargeting a project

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

Retargeting a project

Jump to solution
777 Views
Richly
Contributor III

I recall seeing demos showing how easy it is to retarget CW projects from one processor to another -- just a few clicks of the mouse, with minimal editing.  However, I can't find instructions for doing this.  Maybe I'm looking in the wrong places, or maybe I just imagined this.

 

I have a project that runs on the MC9S08SH16 but is running out of space, so I want to retarget it to the MC9S08SH32.  Any help will be appreciated.

 

Thanks,

    Richly

Labels (1)
Tags (1)
0 Kudos
1 Solution
467 Views
BlackNight
NXP Employee
NXP Employee

Hello,

You probably linking with a library with no floating point support.

 

Floating point support is basically done in two places:

- libraries: make sure you have the same library set up as in your previous project. They are in project > Properties > C/C++ Build > Settings > Linker > Input

- For no floating point support, there is a __NO_FLOAT__ define set. Remove it from project > Properties > C/C++ Build > Settings > Compiler > Preprocessor

 

Hope this helps,

BK

View solution in original post

0 Kudos
6 Replies
467 Views
BlackNight
NXP Employee
NXP Employee

Hello,

you can find the change wizard under the menu Project > Change Device/Connection.

 

Hope this helps,

BK

0 Kudos
467 Views
Richly
Contributor III

Thanks.  I had stumbled across that once before and couldn't find it again.  If you haven't selected the project, the menu item is greyed out, so I skipped over it many times.

 

After running the wizard, I got a whole bunch of undefined symbols.  Looking at them, I think the problem is that all the floating point routines are missing.  Any idea how to convince the newly targeted project to include (32-bit) floating point, which the original target successfully used?

 

Thanks,

    Richly

0 Kudos
468 Views
BlackNight
NXP Employee
NXP Employee

Hello,

You probably linking with a library with no floating point support.

 

Floating point support is basically done in two places:

- libraries: make sure you have the same library set up as in your previous project. They are in project > Properties > C/C++ Build > Settings > Linker > Input

- For no floating point support, there is a __NO_FLOAT__ define set. Remove it from project > Properties > C/C++ Build > Settings > Compiler > Preprocessor

 

Hope this helps,

BK

0 Kudos
467 Views
Richly
Contributor III

Many thanks for your excellent information!  It solved the floating point problem.  I really appreciate your laying out the steps to find the places to change.  That made it quite easy.

 

I should probably two bug reports about retargeting:

  (1) the failure to include floating point support

  (2) the failure to use the altered values in the linker parameter file (project.prm).  I had doubled the stack size and commented out the definition of VECTOR 0, and neither of these made it into the retargeted project.

 

Thanks again,

    Richly

0 Kudos
467 Views
Richly
Contributor III

Oops.  Found another bug related to retargeting.  I am using 32-bit floating point. The retargeting lost two flags: -TD2 and -Fd.  I'm not totally sure how to generate both of these, but there are two more things I changed:

   (1) project > Properties > C/C++ Build > Settings > HCS08 Compiler > Code Generation

         I checked Use IEEE32 for double (default is IEEE64)

    (2) project > Properties > C/C++ Build > Settings > HCS08 Compiler > Type Sizes

         I selected IEEE32 for double.

 

These two changes seem to have fixed the problem more completely...but more testing may be necessary!

 

Cheers,

    Richly

0 Kudos
467 Views
Richly
Contributor III

Gosh...now another missing piece:

 

To prevent initialization of RAM at power on reset, the original project had the following definition in the compiler's options:

 

        -D__ONLY_INIT_SP

 

This is missing in the retargeted project.  The only way I could find to generate it was to go to

        project > Properties > C/C++ Build > Settings > HCS08 Compiler > Preprocessor

and manually add 

        __ONLY_INIT_SP

 

Perhaps the last piece...now the before and after lists of compiler options match each other.

    - Richly

0 Kudos