Beware that this post is related to an SDK in maintenance mode
More Info: Consider nRF Connect SDK for new designs
This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

Profiling NRF52832 with gprof flag -pg not possible due to SDK11

Hi,

I am using mbedos for a NRF42832 and am currently in the situation that I have to profile my code with gprof. Here comes the issue: the Nordic SDK uses explicit assembler code with register r7:

Hence, the compiler option needs -fno-omit-frame-pointer to compile, otherwise it results in the following error as r7 must be available for execution:

[ERROR] ./mbed-os/targets/TARGET_NORDIC/TARGET_NRF5/TARGET_SDK11/libraries/bootloader_dfu/bootloader_util.c: In function 'bootloader_util_reset': ./mbed-os/targets/TARGET_NORDIC/TARGET_NRF5/TARGET_SDK11/libraries/bootloader_dfu/bootloader_util.c:133:1: error: r7 cannot be used in asm here

For gprof obviously I need the flag -pg. Unfortunately, -pg and -fno-omit-frame-pointer are incompatible and therefore I cannot compile.

Does anyone have a suggestion how to profile the code still?

Best,

Parents Reply Children
No Data
Related