Ways to reduce '.bss' bytes

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

Ways to reduce '.bss' bytes

2,311 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by userrr on Tue Oct 22 02:56:12 MST 2013
For start, I must say that i`m a beginner at LPCxpresso programming.

My problem is that i need to reduce data from .bss by almost 2100 bytes.
What ways of doing this are beside reduce data from buffers? Because if I do so, my soft integrity is ruined and the microcontroller won`t work anymore.
I think that there are some ways of increasing available data, but i didnt find any answers...

Thank you!
0 Kudos
5 Replies

1,554 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by lpcxpresso-support on Mon Nov 04 03:55:17 MST 2013
Have you actually activated your LPCXpresso installation? Please see the LPCXpresso 6 User Guide included within your installation for details.

Regards,
LPCXpresso Support


0 Kudos

1,555 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by userrr on Mon Nov 04 03:51:32 MST 2013
I`m sorry for my unexplicit question...

I must start to say that when i try to build the code it returns the error that my 'RamLoc32 region is overflowed by 2608 bytes'.
Everywhere i searched i found that i must reduce my bss. And i didn`t find ways to reduce .bss without ruin my code integrity cuz if i reduce data from buffers the soft won`t work anymore.

Could this be a problem with license? I try to build it on the non-licensed LPCXpresso and on another pc that has lpc license doesn`t has any bytes overflowed...

Thank you!
0 Kudos

1,555 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by mc on Sat Oct 26 08:38:49 MST 2013
Hi Rob65,
Yes you are correct. The question is not specific and clear.
0 Kudos

1,555 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by Rob65 on Sat Oct 26 06:16:28 MST 2013

Quote: mc
If you just want to place variables from .bss to .data or .rdata sections then try to initialize variables to preferably nonzero value(may be default).



That sound like the proper way to start using even more memory  :O
The .bss segment contains all (global) data that is defined in a program. This data is per default initialized to 0 using a small loop in the startup code.
As soon as you initialize these variables to a non-zero value, these variables are placed in the .data segment. This segment is stored both in Flash and in RAM: the Flash contains all initial values and the RAM contains the actual variable that is using during execution. During startup, the data is copied from Flash into RAM.

So, initializing data to another value than 0 will result in using more memory (increased Flash size) and slower startup due to the fact that the data is copied from Flash into RAM during startup.

But then, this is the kind of answers you'll get on a question that is not specific enough. You should really explain what the real problem is. If the problem is memory use, you have to reduce the amount of (global) data being used. There is only a certain amount of RAM memory available so you must always make sure you data is not growing beyond these bounds.

Rob
0 Kudos

1,555 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by mc on Tue Oct 22 07:25:00 MST 2013
Hi userrr,
I believe you want to save RAM space. One way to do it is to use more local variables,however it will require you to change code. If you just want to place variables from .bss to .data or .rdata sections then try to initialize variables to preferably nonzero value(may be default).
You may want to clarify your question.
0 Kudos