This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

Memory usage

I want to check memory usage for the consideration of a microcontroller to be used in an embedded system.
Is there a way to check this?

Development environment used: keil studio

Parents Reply Children
  • "The linker generated values should be output at the end of a build."
    does this mean the following that appears in Output?
    Flash: ** KB / ** KB
    Memory: ** KB / ** KB
    ROM: ** KB / ** KB

    On Nucleo-F302R8 the Memory value seems to be correct, but when I change from the complex code to the following simple code on Nucleo-G431RB, the Memory value does not change from 32 KB.

    ---
    #include "mbed.h"

    UnbufferedSerial pc(USBTX, USBRX, 115200);

    int main() {
        const char *message = "Hello, World!\n";
        pc.write(message, strlen(message));
    }
    ---
    (Output)
    Flash: 38 KB / unknown
    Memory: 32 KB / unknown
    ROM: 38 KB

    Note that when I tried the following on Nucleo-F302R8, Memory was 1KB.
    ---
    #include "mbed.h"

    Serial pc(USBTX, USBRX, 115200);

    int main() {
        const char *message = "Hello, World!\n";
        pc.printf("%s", message);
    }
    ---
    (Output)
    Flash: 24 KB / 64 KB
    Memory: 1 KB / 8 KB
    ROM: 24 KB

    What is the difference between the two?

    Also, is there any way to know the correct Memory value in Nucleo-G431RB?

  • Can you run "fromelf -z" on the generated ELF (not binary) image?

  • When I build with keil studio online, does it also generate an ELF file?
    It only generates a binary file.
    If I am wrong about how to generate ELF files, please let me know.

  • I may be wrong (I am not familiar with mbed), but the linker generates ELF images which are converted into binary, so there must be one?