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

Performance analysis on nRF5340 PDK

1. We are measuring our component performance on nRF5340 PDK and getting pretty high CPU load values. We are suspecting that our code and tables are sitting in flash memory rather than RAM. Is there anyway we can put our whole code fully in RAM and measure performance ?

2. Also the online Documentation mentions there are two modes for nRF5340 PDK (MODE=Cache) and (MODE=RAM). Cache mode can be used for performance profiling of code running in the system. How should we configure, to run our component in cache mode.

  

Parents
  • Hi,

    Are you using the nRF Connect SDK? I will assume so for now.

    1. It should be possible to configure code execution from RAM by setting CONFIG_XIP=n in prj.conf.

    2. Cache mode is enabled by default by the soc.c implementation for nRF5340 in Zephyr (and thus nRF Connect SDK). If not using Zephyr, you can enable it yourself in the same way:

    	/* Enable the instruction & data cache */
    	NRF_CACHE->ENABLE = CACHE_ENABLE_ENABLE_Msk;

Reply
  • Hi,

    Are you using the nRF Connect SDK? I will assume so for now.

    1. It should be possible to configure code execution from RAM by setting CONFIG_XIP=n in prj.conf.

    2. Cache mode is enabled by default by the soc.c implementation for nRF5340 in Zephyr (and thus nRF Connect SDK). If not using Zephyr, you can enable it yourself in the same way:

    	/* Enable the instruction & data cache */
    	NRF_CACHE->ENABLE = CACHE_ENABLE_ENABLE_Msk;

Children
Related