Skip to main content
Topic: Finding how much RAM you are using (Read 3956 times) previous topic - next topic

Finding how much RAM you are using

Hi folks,
I just wrote up a nice little tip I learned while debugging the bootdrive. You can get all the background at my blog:
http://baldwisdom.com/precious-memory/
But if you want just the meat (Though it is useful to read some of the background, useful links etc...):

First find your build directory. On Windows 7 this is users<youruser>AppDataTempbuild<a bunch of numbers>.tmp

Now, assuming you have the avrdude files somewhere in your path, use the command:

avr-size -C --mcu=atmega328p <yourelf-file.elf>
For example, the current version of Bootdrive gives me:

avr-size -C --mcu=atmega328p BootDrive.cpp.elf
AVR Memory Usage
----------------
Device: atmega328p
Program: 19272 bytes (58.8% Full)
(.text + .data + .bootloader)
Data: 1340 bytes (65.4% Full)
(.data + .bss + .noinit)

Re: Finding how much RAM you are using

Reply #1
The information is ALREADY showed in the build window in PN while building the file. What's the need of digging the TEMP folder?
Just click Build Clean then click Build All to rebuild the files and it will show the information.
Still learning
-Arup

Re: Finding how much RAM you are using

Reply #2
Whats bootdrive?

but ArupBsk; this is an arduino user;  guess the arduino IDE (sketch?) must not utilize that command during the compilation; although I have to believe it shows you somewhere what your size information is in that IDE. I dont use Arduino myself; I prefer AVR-GCC by itself; and like ArupBsk said its extremely common to include the avr-size app in your makefile to see it during a build.

Re: Finding how much RAM you are using

Reply #3
[quote author="BrentBXR"]Whats bootdrive?
[/quote]
I guess he's referring to the system drive (C:) of a Windows box.
Still learning
-Arup


Re: Finding how much RAM you are using

Reply #5
http://baldwisdom.com/bootdrive/ <- Long version description with diagrams
"* Read hex file from sd/micro-sd card and program another arduino via ttl serial." <- short version description lifted from source code header

Kinda like pk2go but way cooler.

Re: Finding how much RAM you are using

Reply #6
I did a similure project (just to for fun; never made it past the breadboard) but using 3 spi eeproms. It was a neat idea; you could either send the hex via terminal; or you could rip it off another AVR. Then essentially hit one button and program an avr, over and over. I stored the length of the hex on the main avr's eeprom (along with the target's size; page size; so on...); then it would read up to that point off the dedicated eeprom's.

I only did it because at that moment i felt like learning how to program AVR's myself; which I already knew would be simple as its just SPI. but learning the paging and stuff like that. and that actually got me into a phase of having an AVR generate the hex and upload it to anouther avr without my interaction; on the fly. Its plausible to have one main AVR; program a secondary AVR to suite new needs or scenario's... its just its instruction set.

it worked really well; but I had no real need for it; so like with most of my projects I made it as perfect as I could, wrote the schematics, then tore it apart and started a new project :3