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
Solved! Go to Solution.
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
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
Thanks!