5 years, 10 months ago.

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

Hi,

I am using mbedos for a NRF52832 and am currently in the situation that I have to profile my code with gprof. Here comes the issue: the Nordic SDK11 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,

Be the first to answer this question.