Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Flash and RAM (Compile Time)

compiler outputcompiled binary, GNU size, nm, analysing linker map files

...

Code Block
lakers-FORK $ size target/thumbv7em-none-eabihf/debug/lakers-no_std
   text    data     bss     dec     hex filename
  15840      56    1032   16928    4220 target/thumbv7em-none-eabihf/debug/lakers-no_std

Sometimes, we want to measure only the sizes for certain parts of our code. For example, in lakers, we normally want to measure how much memory is needed by the library itself, but want to discard things like the cryptographic backend, since it changes across platforms.

One way to do that is by analysing the memory map file generated by the compiler (one might need to enable that by passing a flag such as -Clink-args=-Map=/tmp/lakers.map to the linker). Different linkers generate slightly different memory map files, but in general they present the address, size, and location of every symbol in your program. For example, …

Another way is using the nm utility.

Stack and heap (RAM at Runtime)

...