This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts
This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

SVCALL defining issue - ble_app_hrs with gcc and eclipse

Hi,

I'm using gcc with eclipse to compile ble_app_hrs and I get the following error for all the SVCalls like sd_softdevice_enable, etc...

The following error is flagged off - "Redefinition of sd_softdevice_enable" - as indicated below

uint32_t sd_softdevice_enable(nrf_clock_lfclksrc_t           clock_source,
                          softdevice_assertion_handler_t assertion_handler)

SVCALL(SD_SOFTDEVICE_ENABLE, uint32_t, sd_softdevice_enable(nrf_clock_lfclksrc_t clock_source, softdevice_assertion_handler_t assertion_handler));
  1. If SVCALL_AS_NORMAL_FUNCTION is defined then SVCALL is defined as follows

    #define SVCALL(number, return_type, signature) return_type signature

What is "SVCALL_AS_NORMAL_FUNCTION"?

  1. If the above is not defined, then as per the definition of GNUC, SVCALL is defined as follows

    #define SVCALL(number, return_type, signature)
    _Pragma("GCC diagnostic ignored "-Wreturn-type"")
    _Pragma("GCC diagnostic ignored "-Wunused-function"")
    attribute((naked)) static return_type signature
    {
    __asm(
    "svc %0\n"
    "bx r14" : : "I" ((uint16_t)number) : "r0"
    );
    }

Which definition should be used with the gcc compiler? What is the significance of SVCALL_AS_NORMAL_FUNCTION definition?

Regards, Indu

Parents
  • I'm not sure if I understand what your error is, except for the "Redefinition of sd_softdevice_enable". So, are you redefining it somewhere? Looks like it in the code below.

    The definition SVCALL_AS_NORMAL_FUNCTION is used by the serialization projects. So if you are not using serialization, you should not define this.

    Are you able to compile it with the makefile that is included in the armgcc folder?

Reply
  • I'm not sure if I understand what your error is, except for the "Redefinition of sd_softdevice_enable". So, are you redefining it somewhere? Looks like it in the code below.

    The definition SVCALL_AS_NORMAL_FUNCTION is used by the serialization projects. So if you are not using serialization, you should not define this.

    Are you able to compile it with the makefile that is included in the armgcc folder?

Children
No Data
Related