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

Problems Instrumenting Code

Hello All,

 

We are attempting to instrument our software and yours. The desired output is data for a call-graph list and time stamps for each entry and exit into a function. We are currently starting by attempting to instrument one source file – main.c.

 

We are using:

  • Nordic nRF5 SDK v15.2.0
  • SoftDevices S140 v6.1.0
  • SEGGER Embedded Studio for ARM 4.12.

 

The following was added to ‘common’ compiler options for main.c:

 

-finstrument-functions

-fprofile-arcs

-ftest-coverage

 

The following was added to our main.c

 

/* Function prototypes with attributes */

void main_constructor(void)

    __attribute__ ((no_instrument_function, constructor));

 

void main_destructor(void)

    __attribute__ ((no_instrument_function, destructor));

 

void __cyg_profile_func_enter(void *, void *)

    __attribute__ ((no_instrument_function));

 

void __cyg_profile_func_exit(void *, void *)

    __attribute__ ((no_instrument_function));

 

The following was added to the project’s linker options:

 

-shared

-fprofile-arcs

 

The program compiles successfully. There are linker errors:

 

C:/Program Files/SEGGER/SEGGER Embedded Studio for ARM 4.12/lib/libc_v7em_fpv4_sp_d16_hard_t_le_eabi.a(libc_asm.o): relocation R_ARM_THM_MOVW_ABS_NC against `__RAL_uidiv_inverse_lut' can not be used when making a shared object; recompile with -fPIC

 

Questions:

  • Can you provide us with the source code for the above referenced program?
  • Or do we have to contact Segger regarding this?
  • Do you have an alternative strategy for obtaining the coverage data?
  • Is the source for the Nordic libraries available? (we are under NDA).

 

Thanks in advance.

Parents Reply Children
No Data
Related