Important changes to forums and questions
All forums and questions are now archived. To start a new conversation or read the latest updates go to forums.mbed.com.
6 years, 7 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,