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

Errors while building project in segger embedded studio

HI, I have following errors while building a project in segger embedded studio: 

1. 'TIMER1_INSTANCE_INDEX' undeclared here (not in a function)

2. 'TIMER2_INSTANCE_INDEX' undeclared here (not in a function)

3.nrf.h: No such file or directory

The error log is attached for reference.

Please help in this regard.

4.compiler_abstraction.h: No such file or directory

Parents
  • Hello,

    Are you trying to compile an unmodified example from the SDK? If so, which one?

    If this is a custom example, then you are probably missing some header files.

    If this is one of the examples from the SDK, I suspect that the path to your SDK is too long. Compilers struggle to handle files with an absolute path of more than 250 something characters.

    Try to unzip the SDK closer to your C: drive, e.g.:

    C:\Nordic\SDKs\SDK16

    Let me know if that doesn't work.

    Best regards,

    Edvin

Reply
  • Hello,

    Are you trying to compile an unmodified example from the SDK? If so, which one?

    If this is a custom example, then you are probably missing some header files.

    If this is one of the examples from the SDK, I suspect that the path to your SDK is too long. Compilers struggle to handle files with an absolute path of more than 250 something characters.

    Try to unzip the SDK closer to your C: drive, e.g.:

    C:\Nordic\SDKs\SDK16

    Let me know if that doesn't work.

    Best regards,

    Edvin

Children
  • Hi,

    This is a example of sdk modified a bit. I have the sdk folder closer to c drive as suggested by you. But, i have all the above mentioned errors still there. 

    I have sdk 11.0, in which the keil version 5 project is imported to segger embedded studio project.

    Please help me eliminate these errors.

  • Akkamahadevi said:
    This is a example of sdk modified a bit.

     Ok. Did it compile before you modified it a bit?

    SDK 11 is quite old. Is there a reason why you are still using that? I would suggest checking out SDK16, as they are a bit more user friendly lately. If you are using the nRF51, I suggest you use SDK12.3.0, which is the last one that supports nRF51. In my opinion it is a bit better than SDK11.

    It is complaining that e.g. TIMER1_INSTANCE_INDEX is not defined. If you open your nrf_drv_config.h file (included from nrf_drv_timer.h), you should see something like:

    #define TIMER1_ENABLED 0
    
    #if (TIMER1_ENABLED == 1)
    #define TIMER1_CONFIG_FREQUENCY    NRF_TIMER_FREQ_16MHz
    #define TIMER1_CONFIG_MODE         TIMER_MODE_MODE_Timer
    #define TIMER1_CONFIG_BIT_WIDTH    TIMER_BITMODE_BITMODE_16Bit
    #define TIMER1_CONFIG_IRQ_PRIORITY APP_IRQ_PRIORITY_LOW
    
    #define TIMER1_INSTANCE_INDEX      (TIMER0_ENABLED)
    #endif

    Try to change the line:

    #define TIMER1_ENABLED 0
    to
    #define TIMER1_ENABLED 1

    After that the TIMER1_INSTANCE_INDEX should be defined.

    The same applies for TIMER2.

    As for the missing nrf.h file. Is the path to this file included in your project? Was it included before you modified the example?

    I am not entirely sure where it should be. It You are using SES with SDK11. SDK11 didn't come with SES project files. How did you port it?

    Best regards,

    Edvin

Related