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