/var/www/restricted/ssh/stm32/www/stm32circle/ STM CircleOS forum / Library

Username:     
Password:     
             

Forum

# 1   2009-04-25 10:34:46 Library

repzak
Member
Registered: 2008-03-05
Posts: 170

Library

Hello,

I have made a project to circle_os there uses more than one c file, i have added them in a lib and everythings seems ok.

I just wonder howcome the circle_mgr only writes the application is 8Kb, when i know it atleast 3 times the size??

Kasper

Offline

 

# 2   2009-04-25 13:15:40 Library

Francis
Administrator
From: France-Grenoble
Registered: 2007-07-09
Posts: 890

Re: Library

Kasper,
Sorry but I don't understand the question. Circle_mgr find the first available address and link then program the object files at this address (circle_mgr calls the LD linker).
Francis

Offline

 

# 3   2009-04-25 13:25:07 Library

repzak
Member
Registered: 2008-03-05
Posts: 170

Re: Library

Connecting to RLink... OK
Connecting to target... OK
          Silicon Revision Id: 0x10016414.
          Option bytes: RDP=0xA5, USER=0xFF, WRP=0xFFFFFFFF
OK
Reading FAT table...
App0: Name=Test,  Addr=0x08006000, Size=8KB.... OK

Larger free block= 318KB
Closing com with RLink... OK

O know the size is much bigger???

Kasper

Offline

 

# 4   2009-04-27 06:28:30 Library

Francis
Administrator
From: France-Grenoble
Registered: 2007-07-09
Posts: 890

Re: Library

If you check the contents of the FLASH (RFlasher), do you find any code after the address 0x08008000 ?

Offline

 

# 5   2009-04-27 09:21:47 Library

repzak
Member
Registered: 2008-03-05
Posts: 170

Re: Library

I will have to check.

But i am pretty sure the total code size in the lib is more than 20KB, i remember that some of the files are 6-9KB by them self.

The files in the picture are all in the LIB.

It is not very urgent for me now, but could give problems when adding app2?

Kasper

http://www.ptp-images.com/mini/rhprc0e6b4.jpg

Last edited by repzak (2009-04-27 09:25:56)

Offline

 

# 6   2009-04-27 10:25:02 Library

Francis
Administrator
From: France-Grenoble
Registered: 2007-07-09
Posts: 890

Re: Library

It is supposed to work, and it would be nice to confirm whether the FLASH above the address 0x08008000 is programmed or not. Sometimes, most of the functions of the libraries are removed by the linker (because they are uncalled).

Offline

 

# 7   2009-04-27 10:29:51 Library

repzak
Member
Registered: 2008-03-05
Posts: 170

Re: Library

Oki, i have to check when i come home...

Kasper

Offline

 

# 8   2009-04-27 12:28:31 Library

VincentC
Administrator
Registered: 2007-11-08
Posts: 149

Re: Library

Hi,

During the link, if you have activated the "Per Function Sections" compiler option and "Remove Unused Sections" linker option, or if you are using libraries, then the linker will only take the code that is really called. This is a standard optimization that most compile chains are able to perform. That explains why most final applications are much smaller than the sum of the sizes of the object codes they are made from.

Considering that you are using a library and Circle_Mgr (which links using the "Remove Unused Sections" option), my guess is it's the explanation in your case.

Please refer to the GettingStartedARM (Raisonance), gcc and lc (GNU) documentations for more informations on the way the linker uses libraries, and on the two options mentionned above.

I hope it helps.

Best Regards,

Vincent

Offline

 

# 9   2009-04-27 18:35:40 Library

repzak
Member
Registered: 2008-03-05
Posts: 170

Re: Library

Hey,

Maybe it is because i checked in cirkle_mgr with the fat.elf file from debugging...

sad

Kasper

Last edited by repzak (2009-04-27 18:35:53)

Offline

 

Board footer