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

Problem with nrf_error.h with and without SD

Hello,

I am trying to add SoftDevice to our project which was non-SD for a year now, but I'm stuck with a problem.

I know that there are separate files for nrf_error.h when the program is with or without SD.

I am using IAR and I removed the old included directories: from drivers_nrf/nrf_soc_nosd, and I included the new files from s140/headers.

I am receiving this error:  Error[Pe020]: identifier "NRF_SUCCESS" is undefined in the file nrf_nvic.c .  When I go to the definition of the NRF_SUCCESS it takes me to the file from the softdevice headers, but when I select the nrf_error.h and open the file, it opens the file from the nrf_soc_nosd directory. What can be the problem and how should I solve it?

Thanks in advance.

  • See if you have something like this in Project->Options->C/C++ Compiler->Preprocessor[Additioal Include]

    Blah-blah
    $PROJ_DIR$\..\..\..\..\..\..\components\drivers_nrf\nrf_soc_nosd
    Blah-blah
    $PROJ_DIR$\..\..\..\..\..\..\components\softdevice\common
    $PROJ_DIR$\..\..\..\..\..\..\components\softdevice\s132\headers
    $PROJ_DIR$\..\..\..\..\..\..\components\softdevice\s132\headers\nrf52
    Blah-blah

    The issue is the nosd path is eclipsing the sd path because it is parsed first, so simply remove it or push it to after the sd inclusions; ie just remove when using a softdevice. I had exactly the same issue just recently on both IAR and SES

    $PROJ_DIR$\..\..\..\..\..\..\components\drivers_nrf\nrf_soc_nosd

  • Hello,

    The answer that you probably don't want to hear is that you need to add all the files exactly like in the softdevice examples from the SDK you are using. 

    The easier way of doing this is probably to start off with one of the examples that use the softdevice, and then add your custom files to that projects. That may be many files, but it is probably more files if you want to do it the other way around.

    Best regards,

    Edvin

  • I get the same problem and I solved it by typing a specific derectory "D:\DeviceDownload_SDK17.2.0\nRF5SDK1702d674dde\nRF5_SDK_17.0.2_d674dde\components\softdevice\s132\headers\nrf_error.h" instead of "nrf_error.h" in those file inside the nrf_soc_nosd folder (which includes nvic.c and soc.c).

Related