Coldfire: How to use MSL?

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

Coldfire: How to use MSL?

1,989 Views
rd
Contributor I
I'm quite new on embedded 32 bit programming and Freescale CW tools.
I'm using MCF52235 with onchip flash and ram.

Starting a project with "coldfire stationery" I can see a lot of wasted memory for MSL ".a" files
(even with "smaller code size" optimisation at maximum level).

Starting a new blank project (without all the "printf" of stationery), if I want to call the "malloc" function
I have to add "C_4i_CF_SZ_MSL.a" that waste about 28K of code and 7K of data.

1) Is it normal or am I making any mistake?
Should I avoid the ".a" file and manually include the source I need from "{Install}\E68K_Support\msl\MSL_C\MSL_Common\Src"?

2) Is there a list describing the functions included on each ".a" file?
Should I discover them opening the ".mcp" projects on "{Install}\E68K_Support\msl\MSL_C\MSL_E68k\Project" ?

Thank you in advance for your help.
Regards

Roberto

Message Edited by CrasyCat on 2007-04-13 02:29 PM

Labels (1)
0 Kudos
Reply
1 Reply

387 Views
mjbcswitzerland
Specialist V
Hi Roberto

The library is displayed as being 28k in size but if you only actually use malloc it will introduce only a small amount of code, as can be seen in the map file. Here I have also used only malloc and free and if you add up all the bits it probably comes to a couple of kBtyes.

The display in CW is therefore a maximum and not the really linked size (the IDE probably doesn't know the link size when displaying the library...)

  0000DDE8 00000078 .text   Block_construct    (C_TRK_4i_CF_SZ_MSL.a alloc.o        )
  0000DE60 000000AC .text   Block_subBlock    (C_TRK_4i_CF_SZ_MSL.a alloc.o        )
  0000DF0C 0000009C .text   Block_link    (C_TRK_4i_CF_SZ_MSL.a alloc.o        )
  0000DFA8 00000060 .text   Block_unlink    (C_TRK_4i_CF_SZ_MSL.a alloc.o        )
  0000E008 00000048 .text   SubBlock_construct    (C_TRK_4i_CF_SZ_MSL.a alloc.o        )
  0000E050 000000B0 .text   SubBlock_split    (C_TRK_4i_CF_SZ_MSL.a alloc.o        )
  0000E100 00000088 .text   SubBlock_merge_prev    (C_TRK_4i_CF_SZ_MSL.a alloc.o        )
  0000E188 0000009C .text   SubBlock_merge_next    (C_TRK_4i_CF_SZ_MSL.a alloc.o        )
  0000E224 00000034 .text   link    (C_TRK_4i_CF_SZ_MSL.a alloc.o        )
  0000E258 00000068 .text   link_new_block    (C_TRK_4i_CF_SZ_MSL.a alloc.o        )
  0000E2C0 000000B0 .text   allocate_from_var_pools    (C_TRK_4i_CF_SZ_MSL.a alloc.o        )
  0000E370 00000088 .text   soft_allocate_from_var_pools    (C_TRK_4i_CF_SZ_MSL.a alloc.o        )
  0000E3F8 00000020 .text   deallocate_from_var_pools    (C_TRK_4i_CF_SZ_MSL.a alloc.o        )
  0000E418 00000078 .text   FixBlock_construct    (C_TRK_4i_CF_SZ_MSL.a alloc.o        )
  0000E490 00000040 .text   get_malloc_pool    (C_TRK_4i_CF_SZ_MSL.a alloc.o        )
  0000E4D0 000001D4 .text   allocate_from_fixed_pools    (C_TRK_4i_CF_SZ_MSL.a alloc.o        )
  0000E6A4 00000104 .text   deallocate_from_fixed_pools    (C_TRK_4i_CF_SZ_MSL.a alloc.o        )
  0000E7A8 00000074 .text   __pool_allocate    (C_TRK_4i_CF_SZ_MSL.a alloc.o        )
  0000E81C 00000040 .text   __allocate    (C_TRK_4i_CF_SZ_MSL.a alloc.o        )
  0000E85C 0000005C .text   __pool_free    (C_TRK_4i_CF_SZ_MSL.a alloc.o        )
  0000E8B8 00000014 .text   malloc    (C_TRK_4i_CF_SZ_MSL.a alloc.o        )
  0000E8CC 00000020 .text   free    (C_TRK_4i_CF_SZ_MSL.a alloc.o        )
  0000E8EC 00000070 .text   init_alloc    (C_TRK_4i_CF_SZ_MSL.a alloc.o        )
  0000E95C 0000002C .text   init_default_heap    (C_TRK_4i_CF_SZ_MSL.a alloc.o        )
  0000E988 00000008 .text   __sys_alloc    (C_TRK_4i_CF_SZ_MSL.a alloc.o        )
  0000E990 00000028 .text   memset    (C_TRK_4i_CF_SZ_MSL.a mem.o          )
  0000E9B8 000000D4 .text   __fill_mem    (C_TRK_4i_CF_SZ_MSL.a mem_funcs.o    )

Regards

Mark

0 Kudos
Reply