Content originally posted in LPCWare by RA1981 on Tue Aug 23 09:33:14 MST 2011
Quote: CodeRedSupport
I'm afraid that there is no [B]currently[/B] of extending the map information generated in these ways with the LPCXpresso IDE.
'Currently' means that this might be the case in the (near) future? ;)
Quote:
With regards to stack space, then the "simple" way to check this is to use "memory painting" - which basically involves initialising memory to a known value then looking at how much of this has been overwritten after running your code for a period of time.
Okay, my question doesn't target the stack space initially because I thought the linker would give me a warning if there's not enough stack space. If this is not the case I'll use your suggested approach.
Quote:
NXP also have a stack usage monitor example in their code samples that you might want to check out.
I'll search for it, thank you for the hint :)
Quote:
With regards to checking for how much padding your structures are using, one possible way to doing this would be to do a build as normal, and record the size of your structures. Then rebuild with the "[FONT=Courier New][SIZE=1]-fpack-struct[/SIZE][/FONT]" compiler option and compare the size of the structures.
How to get the size? Use the C sizeof-Operator?
Quote:
Note that I would not recommend the use of the "[FONT=Courier New][SIZE=1]-fpack-struct[/SIZE][/FONT]" for general usage due to the code size and performance overheads this can cause. However there are some circumstances where you may need to make use of it - for example for accessing data coming in from peripherals. If you want to pack your structures, then you would also be better off using "[FONT=Courier New][SIZE=1]__attribute__((packed))[/SIZE][/FONT]" to more finally control what you are actually packing....
Okay, I understand why it's not a good idea to pack it, but most of my projects data are mostly 8-Bit variables, so it would be wasting memory without packing (especially when large arrays are used and in this case with caution to the stack).
Regards,
Ralf