Porting FRDM KL46 examples form CW to KDS

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

Porting FRDM KL46 examples form CW to KDS

Jump to solution
1,000 Views
piergiovannigor
Contributor II

I have tried to import to the work space the project FRDM_KL46Z_PEx_helloworld and FRDM_KL46Z_PEx_sLCD from the folder KL46_SC_rev1.

I have imported and compiled the library kdsk_platform_lib\kds\KL46Z4; all ok.

I have converted the file for KDS.

I have add the refernce to the variable MCUToolBaseDir.

If I compile the projects I have the followings errors:

 

arm-none-eabi-gcc -mthumb -O0 -fmessage-length=0 -fsigned-char -ffunction-sections -fdata-sections -Wall  -g3 -gstrict-dwarf -T C:/Users/Tecla/workspace.kds/FRDM-KL46z-PEx-sLCD/Project_Settings/Linker_Files/ProcessorExpert.ld -Xlinker --gc-sections -L"c:\Freescale\CW MCU v10.6\MCU/ARM_GCC_Support/ewl/lib/armv6-m" -Wl,-Map,"FRDM-KL46z-PEx-sLCD.map" -n -o "FRDM-KL46z-PEx-sLCD.elf"  ./Sources/LCD/LCD.o ./Sources/LCD/s401.o  ./Sources/Events.o ./Sources/ProcessorExpert.o ./Sources/sa_mtb.o  ./Project_Settings/Startup_Code/__arm_end.o ./Project_Settings/Startup_Code/__arm_start.o  ./Generated_Code/BitIoLdd1.o ./Generated_Code/BitIoLdd2.o ./Generated_Code/Cpu.o ./Generated_Code/CsIO1.o ./Generated_Code/IO1.o ./Generated_Code/LED_GREEN.o ./Generated_Code/LED_RED.o ./Generated_Code/PE_LDD.o ./Generated_Code/SegLCD1.o ./Generated_Code/Vectors.o  

./Project_Settings/Startup_Code/__arm_start.o: In function `__thumb_startup':

C:\Users\Tecla\workspace.kds\FRDM-KL46z-PEx-sLCD\FLASH/../Project_Settings/Startup_Code/__arm_start.c:179: undefined reference to `__init_registers'

C:\Users\Tecla\workspace.kds\FRDM-KL46z-PEx-sLCD\FLASH/../Project_Settings/Startup_Code/__arm_start.c:231: undefined reference to `__copy_rom_sections_to_ram'

C:\Users\Tecla\workspace.kds\FRDM-KL46z-PEx-sLCD\FLASH/../Project_Settings/Startup_Code/__arm_start.c:251: undefined reference to `__init_cpp'

C:\Users\Tecla\workspace.kds\FRDM-KL46z-PEx-sLCD\FLASH/../Project_Settings/Startup_Code/__arm_start.c:257: undefined reference to `__init_user'

collect2.exe: error: ld returned 1 exit status

make: *** [FRDM-KL46z-PEx-sLCD.elf] Error 1

 

Why the "undefined reference" ?

 

Best Regards,

PierGiovanni

Labels (1)
Tags (1)
0 Kudos
1 Solution
526 Views
Alice_Yang
NXP TechSupport
NXP TechSupport

Hello PierGiovanni ,

Please add library librt :

  • Open Properties and go to Cross ARM C Linker > Libraries
  • Add rt in Libraries (-l)

pastedImage_2.png

Best Regards,

Alice

------------------------------------------------------------------------------------------

If this post answers your question, please click the Correct Answer button.

-----------------------------------------------------------------------------------

If this post help your question, please click the helpful Answer button.

View solution in original post

0 Kudos
3 Replies
526 Views
ivadorazinova
NXP Employee
NXP Employee

Hi PierGiovanni Gordini,


as Alice said, it could be problem with the missing library "rt".


I recommend you check it at KDS Porting Guide http://cache.freescale.com/files/microcontrollers/doc/user_guide/KDS200PUG.pdf?fpsp=1&WT_TYPE=Users%...

page 2, there is chapter Common build errors after migration.


Please, check the settings written here.


Best Regards,

Iva


0 Kudos
526 Views
piergiovannigor
Contributor II

HI  Iva,

        sorry I have read only half the page.

Best Regards,

PierGiovanni

0 Kudos
527 Views
Alice_Yang
NXP TechSupport
NXP TechSupport

Hello PierGiovanni ,

Please add library librt :

  • Open Properties and go to Cross ARM C Linker > Libraries
  • Add rt in Libraries (-l)

pastedImage_2.png

Best Regards,

Alice

------------------------------------------------------------------------------------------

If this post answers your question, please click the Correct Answer button.

-----------------------------------------------------------------------------------

If this post help your question, please click the helpful Answer button.

0 Kudos