Link Errors during make of ETPU2 functions + ETPU_GCT + RAppID Code + CW for MPC55xx and MPC56xx 2.10 -> Errors Code: undefined '__div2i'

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

Link Errors during make of ETPU2 functions + ETPU_GCT + RAppID Code + CW for MPC55xx and MPC56xx 2.10 -> Errors Code: undefined '__div2i'

Jump to solution
961 Views
henriquemescuan
Contributor I

Hello,

 

I am beginner in Freescale applications

 

In my first application, I am finding problems during linking files with CodeWarrior:

 

Below is the configuration of my project:

PC: Windows7 SP1 x386 + 4GB RAM + Dual Core M350

MCU: MPC5634M

CodeWarrior: CW for MPC55xx and MPC56xx 2:10

ETPUGCT: 1.4.0.4

RappID: 1.1.0.3

ETPU2 Functions: ETPU WEB Generator (CAM + CRANK + SPARK + FUEL)

 

Description of the problem:

When I compile my application with basic ETPU2 functions, eg PWM, the CodeWarrior works very well.

But when I insert more complex functions like (CAM + CRANK + SPARK + FUEL), the CodeWarrior return link errors:

 

Link Error: undefined: '__div2i'

Referenced from 'fs_etpu_app_eng_pos_init' etpu_app_eng_pos.o in

 

Link Error: undefined: '__div2i'

Referenced from 'fs_etpu_app_eng_pos_init' etpu_app_eng_pos.o in

 

Link Error: undefined: '__div2i'

Referenced from 'fs_etpu_app_eng_pos_init' etpu_app_eng_pos.o in

 

Link Error: undefined: '__div2i'

Referenced from 'fs_etpu_app_eng_pos_init' etpu_app_eng_pos.o in

 

Link Error: undefined: '__div2i'

Referenced from 'fs_etpu_app_eng_pos_init' etpu_app_eng_pos.o in

 

Link Error: undefined: '__div2i'

Referenced from 'fs_etpu_app_eng_pos_init' etpu_app_eng_pos.o in

 

Link Error: undefined: '__div2i'

Referenced from 'fs_etpu_app_eng_pos_init' etpu_app_eng_pos.o in

 

Link Error: undefined: '__div2i'

Referenced from 'fs_etpu_app_eng_pos_init' etpu_app_eng_pos.o in

 

Link Error: undefined: '__div2i'

Referenced from 'fs_etpu_spark_init_4cylinders' etpu_spark.o in

 

Link Error: undefined: '__div2i'

Referenced from 'fs_etpu_spark_init_4cylinders' etpu_spark.o in

 

Link Error: undefined: '__div2i'

Referenced from 'fs_etpu_spark_init_4cylinders' etpu_spark.o in

 

Link Error: undefined: '__div2i'

Referenced from 'fs_etpu_spark_init_4cylinders' etpu_spark.o in

 

Link Error: undefined: '__div2i'

Referenced from 'fs_etpu_spark_init_4cylinders' etpu_spark.o in

 

Link Error: undefined: '__div2i'

Referenced from 'fs_etpu_spark_init_4cylinders' etpu_spark.o in

 

Link Error: undefined: '__div2i'

Referenced from 'fs_etpu_spark_init_4cylinders' etpu_spark.o in

 

Link Error: undefined: '__div2i'

Referenced from 'fs_etpu_spark_init_4cylinders' etpu_spark.o in

 

Link Error: undefined: '__div2i'

Referenced from 'fs_etpu_spark_init_4cylinders' etpu_spark.o in

 

Link Error: undefined: '__div2i'

Referenced from 'fs_etpu_spark_init_4cylinders' etpu_spark.o in

 

Link Error: undefined: '__div2i'

Referenced from 'fs_etpu_spark_init_4cylinders' etpu_spark.o in

 

Link Error: undefined: '__div2i'

Referenced from 'fs_etpu_spark_init_4cylinders' etpu_spark.o in

 

Link Error: undefined: '__div2i'

Referenced from 'fs_etpu_spark_init_4cylinders' etpu_spark.o in

 

Link Error: undefined: '__div2i'

Referenced from 'fs_etpu_fuel_init_4cylinders' etpu_fuel.o in

 

Link Error: undefined: '__div2i'

Referenced from 'fs_etpu_fuel_init_4cylinders' etpu_fuel.o in

 

Link Error: undefined: '__div2i'

Referenced from 'fs_etpu_fuel_init_4cylinders' etpu_fuel.o in

 

Link Error: undefined: '__div2i'

Referenced from 'fs_etpu_fuel_init_4cylinders' etpu_fuel.o in

 

Link Error: undefined: '__div2i'

Referenced from 'fs_etpu_fuel_init_4cylinders' etpu_fuel.o in

 

Link Error: undefined: '__div2i'

Referenced from 'fs_etpu_fuel_init_4cylinders' etpu_fuel.o in

 

Link Error: undefined: '__div2i'

Referenced from 'fs_etpu_fuel_init_4cylinders' etpu_fuel.o in

 

The complete project is attached!

Anybody know how to help me?

 

Original Attachment has been moved to: ECU.zip

Labels (1)
0 Kudos
1 Solution
621 Views
stanish
NXP Employee
NXP Employee

Hello Henrique,

Your project is missing the runtime library which contains 64-bit signed integer divide routine "__div2i"  among other .

I'd recommend you to add this library file into your project:

"<CW for MPC55xx and MPC56xx 2.10>\PowerPC_EABI_Support\Runtime\Lib\Runtime.PPCEABI.VS.UC.a"

if you also intend to use standard C routines (e.g. memcpy, sprint...) I'd recommend you to add also MSL library too:

"<CW for MPC55xx and MPC56xx 2.10>\PowerPC_EABI_Support\MSL\MSL_C\PPC_EABI\Lib\MSL_C.PPCEABI.bare.VS.UC.a"

These libraries are part of the CodeWarrior Wizard generated project by default.

I'd also suggest you to update your .lcf file and include .init and .init_vle sections to avoid a linker error. These sections are used by the runtime lib and linker so they should be defined in .lcf file:

   GROUP : {          __argv=.;

        __env=.;                 .init  : {}         .init_vle (VLECODE) : {         *(.init)         *(.init_vle)         }

        .text_vle (VLECODE): {             *(.text_vle)             *(.text)          }         .text : {  }         .rodata (CONST): { *(.rodata) }         .sdata2 : {  }         .sbss2 : {  }         __DATA_ROM=.; } >int_sram

Hope it helps.

Stan

View solution in original post

0 Kudos
2 Replies
622 Views
stanish
NXP Employee
NXP Employee

Hello Henrique,

Your project is missing the runtime library which contains 64-bit signed integer divide routine "__div2i"  among other .

I'd recommend you to add this library file into your project:

"<CW for MPC55xx and MPC56xx 2.10>\PowerPC_EABI_Support\Runtime\Lib\Runtime.PPCEABI.VS.UC.a"

if you also intend to use standard C routines (e.g. memcpy, sprint...) I'd recommend you to add also MSL library too:

"<CW for MPC55xx and MPC56xx 2.10>\PowerPC_EABI_Support\MSL\MSL_C\PPC_EABI\Lib\MSL_C.PPCEABI.bare.VS.UC.a"

These libraries are part of the CodeWarrior Wizard generated project by default.

I'd also suggest you to update your .lcf file and include .init and .init_vle sections to avoid a linker error. These sections are used by the runtime lib and linker so they should be defined in .lcf file:

   GROUP : {          __argv=.;

        __env=.;                 .init  : {}         .init_vle (VLECODE) : {         *(.init)         *(.init_vle)         }

        .text_vle (VLECODE): {             *(.text_vle)             *(.text)          }         .text : {  }         .rodata (CONST): { *(.rodata) }         .sdata2 : {  }         .sbss2 : {  }         __DATA_ROM=.; } >int_sram

Hope it helps.

Stan

0 Kudos
621 Views
henriquemescuan
Contributor I

Thanks!

0 Kudos