This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

Zephyr RAM, FLASH, CPU usage

Hi,

Currently our team would like to start using Zephyr for our development, but some colleagues fear that it will use too many resources.
They saw that our first test project is including a lot of Projects/Libraries in the Solution. (Shown in Segger)

How can we accurately measure RAM and FLASH usage? And perhaps CPU usage?

Thank you

Parents
  • Hi,

    As the screen-dump below shows, SES should give you a graphical display of the memory usage once the project is built.

    Peripheral LBS example built for nrf52840dk_nrf52840:

    CPU usage for NCS samples should be about the same for comparable nRF5 SDK examples. But if you wish to do actual profiling of the CPU usage you can enable CONFIG_CPU_LOAD option as explained below.

    Enable periodic logging of CPU usage

    1. Add the following config options to your prj.conf file:

    # Enable CPU tracing
    CONFIG_CPU_LOAD=y
    CONFIG_CPU_LOAD_LOG_INTERVAL=2000
    CONFIG_CPU_LOAD_LOG_PERIODIC=y

    2. Add "#include <debug/cpu_load.h>" and call cpu_load_init() in your startup code (e.g. at the beginning of main())

    3. Re-build the application and verify that the CPU load in percent is logged every 2 seconds.

Reply
  • Hi,

    As the screen-dump below shows, SES should give you a graphical display of the memory usage once the project is built.

    Peripheral LBS example built for nrf52840dk_nrf52840:

    CPU usage for NCS samples should be about the same for comparable nRF5 SDK examples. But if you wish to do actual profiling of the CPU usage you can enable CONFIG_CPU_LOAD option as explained below.

    Enable periodic logging of CPU usage

    1. Add the following config options to your prj.conf file:

    # Enable CPU tracing
    CONFIG_CPU_LOAD=y
    CONFIG_CPU_LOAD_LOG_INTERVAL=2000
    CONFIG_CPU_LOAD_LOG_PERIODIC=y

    2. Add "#include <debug/cpu_load.h>" and call cpu_load_init() in your startup code (e.g. at the beginning of main())

    3. Re-build the application and verify that the CPU load in percent is logged every 2 seconds.

Children
Related