Go Down

Topic: How much sram is still free? (Read 543 times) previous topic - next topic


Hi everyone,

I'm making sensor data-logger and I'm keeping the readings in ram in an array. Using atmega328 - which should have 2k of sram. However I'm unable to create array large enough to get even close to 1.5k (to leave 0.5k for other variables and stuff of which there isn't much). Once I create array of ~800 bytes the sketch starts to behave erratically (resets, corrupted data etc) so it seems like I'm overflowing the memory.

So my question is: how can I establish how much sram does my sketch take?

I found there is avr-size which when ran with .elf file of my sketch does produce some numbers.

My understanding is that 'data' + 'bss' is what goes to sram, is this correct?

These 2 are way below 2k for my sketch, so I'm a bit puzzled - perhaps memory is also used by something else?

Any help is appreciated.

Go Up