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

NRF_success undeclared error

Hi,

I included pwm code in my code and its related libraries and drivers.I am getting errors like these :

  Compiling ‘nrf_log_frontend.c’
    'NRF_ERROR_INVALID_PARAM' undeclared (first use in this function); did you mean 'NRF_ERROR_IO_PENDING'?
    each undeclared identifier is reported only once for each function it appears in
    'NRF_SUCCESS' undeclared (first use in this function); did you mean 'EXIT_SUCCESS'?
    'NRF_SUCCESS' undeclared (first use in this function); did you mean 'EXIT_SUCCESS'?
    'NRF_ERROR_NOT_FOUND' undeclared (first use in this function); did you mean 'NRF_ERROR_IO_PENDING'?
    'NRF_SUCCESS' undeclared (first use in this function); did you mean 'EXIT_SUCCESS'?
    'NRF_SUCCESS' undeclared (first use in this function); did you mean 'EXIT_SUCCESS'?
    'NRF_SUCCESS' undeclared (first use in this function); did you mean 'EXIT_SUCCESS'?
  Output/ble_app_hrs_rscs_relay_pca10040_s132 Release/Obj/nrf_log_str_formatter.o does not exist.
  Compiling ‘nrf_log_str_formatter.c’
  Output/ble_app_hrs_rscs_relay_pca10040_s132 Release/Obj/app_button.o does not exist.
  Compiling ‘app_button.c’
    'NRF_SUCCESS' undeclared (first use in this function); did you mean 'NRFX_SUCCESS'?
    each undeclared identifier is reported only once for each function it appears in
    'NRF_ERROR_INVALID_PARAM' undeclared (first use in this function); did you mean 'NRFX_ERROR_INVALID_PARAM'?
    sdk_common.h
    app_button.c
    'NRF_SUCCESS' undeclared (first use in this function); did you mean 'NRFX_SUCCESS'?
    in expansion of macro 'VERIFY_SUCCESS'
    'NRF_SUCCESS' undeclared (first use in this function); did you mean 'NRFX_SUCCESS'?
  Output/ble_app_hrs_rscs_relay_pca10040_s132 Release/Obj/app_error.o does not exist.
  Compiling ‘app_error.c’
Build failed

I removed non-Softdevice paths from the user include directory and it looks like this:

Thank you

  • Hi,

    The missing defines are found in nrf_error.h, which can be found at <sdk root>/components/drivers_nrf/nrf_Soc_nosd/nrf_error.h, or at <sdk_root>/components/softdevice/s132/headers/nrf_error.h (for the s132 SoftDevice.)

    If the error is that the folder containing the nrf_error.h file is not among the include paths for the project I would have expected an error stating "nrf_error.h" is not found. Since that is not the case, it looks more like nrf_error.h is not included from nrf_log_frontend.c and the other c files being compiled. Which is strange, as nrf_log_frontend.c includes sdk_common.h, which includes sdk_errors.h, which includes nrf_error.h. (And sdk_errors.h seems to be included, ref. the suggestions such as "did you mean 'NRF_ERROR_IO_PENDING'".)

    Have you done any modification to sdk_errors.h, and/or does sdk_errors.h have a line ``#include "nrf_error.h"'' in it?

    Is components/libraries/util/ among the include directories? (With the correct amount of "../" in front.)

    Regards,
    Terje

  • Have you done any modification to sdk_errors.h, and/or does sdk_errors.h have a line ``#include "nrf_error.h"'' in it?

    No i haven't done any modifications to the sdk_errors.h file and the file has the line "#include"nrf_error.h"" in it.I just removed the " <sdk root>/components/drivers_nrf/nrf_Soc_nosd" path as i was having some errors.

    Is components/libraries/util/ among the include directories? (With the correct amount of "../" in front.)

    Yes this path is included in the directories .

  • Hi,

    What was that previous error, that you fixed by removing the nrf_soc_nosd folder from include directories?

    Can you try to do a clean build? (In the Build menu you will find "Clean Solution", which will clear all object files and intermediary files from the build process. Then if you build the project again it will not rely on previous partial builds. Sometimes with the kind of issue that you are seeing a full rebuild will make things work again.)

    Regards,
    Terje

  • Hello,

    I had also 158 errors after compiling, a lot of them with NRF_SUCCESS undefined, but also other itemsfrom the same library.

    The errors were found during compiling nrf_drv_clock.c...

    I removed the folder nrf_soc_nosd from include directories and then the compilation was successful.

  • I have the same error.

    I had a working non-BLE application (i.e. no SOFTDEVICE used) and decided to port across the BLE_UART example code.

    In new code application, I added in SOFTDEVICE_PRESENT within the preprocessor definitions which is used in the <sdk root>/components/drivers_nrf/nrf_Soc_nosd/nrf_error.h file as a check. So this definition triggers correctly.

    What I cannot work out is how does the BLE UART example point to the <sdk_root>/components/softdevice/s132/headers/nrf_error.h file as there is no explicit path reference to this nrf_error.h file.

Related