AnsweredAssumed Answered

Optimize Kinetis application size

Question asked by jose blanco on Sep 6, 2013
Latest reply on Sep 11, 2013 by jose blanco

Hi everybody!

 

I have deloped a bootloader for Kinetis K40 using CW 10.2. The application code has a size of 5 KB but when I check the MAP file I realize there are additional code whose size is up to 7KB more. I know it's neccesary additional functions, but, it's too much code, isn't it? I followed the steps in Optimizing the Kinetis gcc Startup | MCU on Eclipse and I saved about 2KB, but I really need to get rid of more code.

 

These are the additional functions I've found in the MAP file (some of them too big):

 

  00001558 00000030 .text   exit(libc_Thumb_LE_v7M.a abort_exit.o   )
  00001584 00000000 .text   $d(libc_Thumb_LE_v7M.a abort_exit.o   )
  00001588 00000000 .text   $t(libc_Thumb_LE_v7M.a signal.o       )
  00001588 00000054 .text   raise(libc_Thumb_LE_v7M.a signal.o       )
  000015D8 00000000 .text   $d(libc_Thumb_LE_v7M.a signal.o       )
  000015DC 000000AC .text   callHandler(libc_Thumb_LE_v7M.a float_exception)
  000015DC 00000000 .text   $t(libc_Thumb_LE_v7M.a float_exception)
  00001688 00000024 .text   __FSL__fp_handler_32_to_32(libc_Thumb_LE_v7M.a float_exception)
  00001688 00000000 .text   $t(libc_Thumb_LE_v7M.a float_exception)
  000016AC 00000024 .text   __FSL__fp_handler_64_to_32(libc_Thumb_LE_v7M.a float_exception)
  000016AC 00000000 .text   $t(libc_Thumb_LE_v7M.a float_exception)
  000016D0 00000026 .text   __FSL__fp_handler_64_to_64(libc_Thumb_LE_v7M.a float_exception)
  000016D0 00000000 .text   $t(libc_Thumb_LE_v7M.a float_exception)
  000016F8 0000002C .text   __FSL__fp_handler_binary_64_to_64(libc_Thumb_LE_v7M.a float_exception)
  000016F8 00000000 .text   $t(libc_Thumb_LE_v7M.a float_exception)
  00001724 00000000 .text   $t(librt_Thumb_LE_v7M.a staticinitializ)
  00001724 00000026 .text   __destroy_global_chain(librt_Thumb_LE_v7M.a staticinitializ)
  00001746 00000000 .text   $d(librt_Thumb_LE_v7M.a staticinitializ)
  0000174C 00000000 .text   $t(librt_Thumb_LE_v7M.a __arm_eabi_init)
  0000174C 0000000C .text   _ExitProcess(librt_Thumb_LE_v7M.a __arm_eabi_init)
  00001754 00000000 .text   $d(librt_Thumb_LE_v7M.a __arm_eabi_init)
  00001758 00000000 .text   $t(librt_Thumb_LE_v7M.a _rt_fp_env_addr)
  00001758 0000000C .text   __rt_fp_env_addr(librt_Thumb_LE_v7M.a _rt_fp_env_addr)
  00001760 00000000 .text   $d(librt_Thumb_LE_v7M.a _rt_fp_env_addr)
  00001764 00000000 .text   $t(librt_Thumb_LE_v7M.a _rt_fp_status_a)
  00001764 0000000C .text   __rt_fp_status_addr(librt_Thumb_LE_v7M.a _rt_fp_status_a)
  0000176C 00000000 .text   $d(librt_Thumb_LE_v7M.a _rt_fp_status_a)
  00001770 00000000 .text   $t(librt_Thumb_LE_v7M.a semihosted_cons)
  00001770 00000010 .text   sys_exit(librt_Thumb_LE_v7M.a semihosted_cons)
  0000177C 00000000 .text   $d(librt_Thumb_LE_v7M.a semihosted_cons)
  00001780 00000000 .text   $t(FP_fullI_Thumb_LE_v7M.a _d_add.o       )
  00001780 0000057A .text   .text(FP_fullI_Thumb_LE_v7M.a _d_add.o       )
  00001780 00000000 .text   __FSL_d_add(FP_fullI_Thumb_LE_v7M.a _d_add.o       )
  00001780 00000000 .text   __aeabi_dadd(FP_fullI_Thumb_LE_v7M.a _d_add.o       )
  00001792 00000000 .text   __FSL__dadd_start(FP_fullI_Thumb_LE_v7M.a _d_add.o       )
  00001CE6 00000000 .text   $d(FP_fullI_Thumb_LE_v7M.a _d_add.o       )
  00001CFC 00000000 .text   __aeabi_drsub(FP_fullI_Thumb_LE_v7M.a _d_sub.o       )
  00001CFC 000005F8 .text   .text(FP_fullI_Thumb_LE_v7M.a _d_sub.o       )
  00001CFC 00000000 .text   $t(FP_fullI_Thumb_LE_v7M.a _d_sub.o       )
  00001D14 00000000 .text   __aeabi_dsub(FP_fullI_Thumb_LE_v7M.a _d_sub.o       )
  00001D14 00000000 .text   __FSL_d_sub(FP_fullI_Thumb_LE_v7M.a _d_sub.o       )
  00001D26 00000000 .text   __FSL__dsub_start(FP_fullI_Thumb_LE_v7M.a _d_sub.o       )
  000022E8 00000000 .text   $d(FP_fullI_Thumb_LE_v7M.a _d_sub.o       )
  000022F4 00000000 .text   $t(FP_fullI_Thumb_LE_v7M.a _d_mul.o       )
  000022F4 00000734 .text   .text(FP_fullI_Thumb_LE_v7M.a _d_mul.o       )
  000022F4 00000000 .text   __FSL_d_mul(FP_fullI_Thumb_LE_v7M.a _d_mul.o       )
  000022F4 00000000 .text   __aeabi_dmul(FP_fullI_Thumb_LE_v7M.a _d_mul.o       )
  00002A14 00000000 .text   $d(FP_fullI_Thumb_LE_v7M.a _d_mul.o       )
  00002A28 00000000 .text   $t(FP_fullI_Thumb_LE_v7M.a _d_itod.o      )
  00002A28 00000000 .text   __aeabi_ui2d(FP_fullI_Thumb_LE_v7M.a _d_itod.o      )
  00002A28 00000000 .text   __FSL_dfltu(FP_fullI_Thumb_LE_v7M.a _d_itod.o      )
  00002A28 00000070 .text   .text(FP_fullI_Thumb_LE_v7M.a _d_itod.o      )
  00002A2A 00000000 .text   __FSL__d_utod_common(FP_fullI_Thumb_LE_v7M.a _d_itod.o      )
  00002A98 00000000 .text   __FSL_u32_div_f(FP_fullI_Thumb_LE_v7M.a _u32_div_f.o   )
  00002A98 00000000 .text   __aeabi_uidivmod(FP_fullI_Thumb_LE_v7M.a _u32_div_f.o   )
  00002A98 00000000 .text   $t(FP_fullI_Thumb_LE_v7M.a _u32_div_f.o   )
  00002A98 00000000 .text   __aeabi_uidiv(FP_fullI_Thumb_LE_v7M.a _u32_div_f.o   )
  00002A98 000001EC .text   .text(FP_fullI_Thumb_LE_v7M.a _u32_div_f.o   )
  00002A9E 00000000 .text   __FSL_u32_div_not_0_f(FP_fullI_Thumb_LE_v7M.a _u32_div_f.o   )
  00002C78 00000000 .text   __aeabi_ldiv0(FP_fullI_Thumb_LE_v7M.a _u32_div_f.o   )
  00002C82 00000000 .text   $d(FP_fullI_Thumb_LE_v7M.a _u32_div_f.o   )
  00002C84 00000000 .text   $t(FP_fullI_Thumb_LE_v7M.a _d_dtou.o      )
  00002C84 00000100 .text   .text(FP_fullI_Thumb_LE_v7M.a _d_dtou.o      )
  00002C84 00000000 .text   __aeabi_d2uiz(FP_fullI_Thumb_LE_v7M.a _d_dtou.o      )
  00002C84 00000000 .text   __FSL_dfixu(FP_fullI_Thumb_LE_v7M.a _d_dtou.o      )
  00002D76 00000000 .text   $d(FP_fullI_Thumb_LE_v7M.a _d_dtou.o      )
  00002D84 00000000 .text   $t(FP_fullI_Thumb_LE_v7M.a ieee_status.o  )
  00002D84 00000028 .text   .text(FP_fullI_Thumb_LE_v7M.a ieee_status.o  )
  00002D84 00000000 .text   __FSL__ieee_status(FP_fullI_Thumb_LE_v7M.a ieee_status.o  )
  00002DAA 00000000 .text   $d(FP_fullI_Thumb_LE_v7M.a ieee_status.o  )

#>00002DB0          ___ROM_AT (linker command file)

 

 

Any help? Thank you guys!

Outcomes