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

'NRF_SUCCESS' undeclared (first use in this function); did you mean 'EXIT_SUCCESS'?

Hello,

I merged the two projects usbd_cdc_acm_pca10056 (A) and ble_app_hids_mouse_pca10056_s140 (B) by copying all additional contents from A's flash_placement.xml into B's. Also, I added all .c files from A to B that were not present in B anyway.

I then merged A's sdk_config.h into B's and included all the additional user build paths from A into B that were not present in B's build paths (by removing duplicates).

I used the search function and my error seems not to be produced by including ../../../../../../components/drivers_nrf/nrf_soc_nosd as I removed that include already manually. The ../../../../../../components/softdevice/s140/headers include is still present.

When building, I get the following errors:


Building ‘ble_app_hids_mouse_pca10056_s140’ from solution ‘ble_app_hids_mouse_pca10056_s140’ in configuration ‘Release’
Compiling ‘nrfx_gpiote.c’
Compiling ‘nrfx_uart.c’
Compiling ‘nrfx_uarte.c’
Compiling ‘nrf_nvic.c’
'NRF_SUCCESS' undeclared (first use in this function); did you mean 'EXIT_SUCCESS'?
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_NULL' undeclared (first use in this function)
'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'?
'NRF_SUCCESS' undeclared (first use in this function); did you mean 'EXIT_SUCCESS'?
'NRF_ERROR_NULL' undeclared (first use in this function)
'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'?
Compiling ‘nrf_soc.c’
'NRF_SUCCESS' undeclared (first use in this function); did you mean 'EXIT_SUCCESS'?
each undeclared identifier is reported only once for each function it appears in
Compiling ‘nrfx_power.c’
Compiling ‘nrf_drv_power.c’
Compiling ‘nrfx_systick.c’
Build failed

I'm planning to run that on the nRF52840 DK and later port it to the nRF52840 Dongle.

Please help me Slight smile

Parents Reply Children
  • ny_quist said:
    Thank you!!!!

    No problem at all, I am happy to help!

    ny_quist said:
    In the options of the project I've chosen the "Common" configuration, then in Preprocessor tab I opened "User Include Directories" and removed the mentioned line....
    ny_quist said:
    ....In the same tab I made sure to have 

    Thank you for clarifying. Could you also tell me which IDE and SDK version you are using?
    Could you possibly send me a .zip file of your project, so I may take a look?
    If you are hesitant about sharing code publicly then let me know and I can convert he ticket to Private - so that it is only viewable by yourself and the support staff here at Nordic.

    ny_quist said:
    I've read that already earlier - I saw that I have to change some addresses, but nothing more important for me, right? However, that's future stuff anyway. I need to get it all running in the first place.

    Great! Yes, in essence that is what you will need to change. Of course, there are also some board functionality available on the DK that you do not have on the Dongle ( such as the added external memory, etc ), but for the nRF's part it is mainly the memory map that needs re-configuring.
    We can get back to this later, no problem.

    Best regards,
    Karl

  • I do not hesitate sharing my code. However, I did not change any code besides the includes and additions I described earlier. Im using the nRF5SDK1702d674dde folder (guess this is enough info on the SDK version). I'm using Segger Embedded Studio v 5.10b. The zip is attached own.zip

    We can get back to this later, no problem.

    Perfect, thanks!

    Thank you for taking a look into it.

  • ny_quist said:
    I do not hesitate sharing my code. However, I did not change any code besides the includes and additions I described earlier. Im using the nRF5SDK1702d674dde folder (guess this is enough info on the SDK version). I'm using Segger Embedded Studio v 5.10b. The zip is attached

    Thank you for sharing your code, this makes the debugging much easier on my part.

    The good news is that I am able to reproduce the error, and can clearly see that it is caused by the wrong include path - if you look at the nrf_error.h file included in the project, it is still the same as the "nosd" - which has its functionality undefined by the presence of the SoftDevice.
    Searching through the project source code ( without any IDE ) yields only two matches, which are the locations of the nrf_nvic and nrf_soc source files ( which you do not need, by the way - since they are meant to be used when a SoftDevice is not present ).

    Removing those two files should resolve your issue, and include the correct nrf_error.h.
    Could you try this, and let me know if it resolves your issue?

    Best regards,
    Karl

  • I can confirm that deleting those files solved the building failure. However, after that I've run into Linker errors like that:

    cyclic memory section dependency with section .cli_sorted_cmd_ptrs_run

    I was able to solve them by restoring the original state of the projects flash_placement.xml (of the project that was using softdevice).

    Thank you again Karl, you helped me alot.

  • ny_quist said:
    I can confirm that deleting those files solved the building failure.

     I am glad to hear that the issue is resolved on your end as well.

    ny_quist said:
    I was able to solve them by restoring the original state of the projects flash_placement.xml (of the project that was using softdevice).

    That's great, well done!
    When a SoftDevice is added/removed, the flash placements and memory_map have to be adjusted - fortunately, you may then often just look to similar examples from the SDK, to see how you may go about changing it - just like you did!

    ny_quist said:
    Thank you again Karl, you helped me alot.

    I am happy to hear that, ny_quist! :) 

    Please do not hesitate to open a new ticket if you should encounter any issues or questions in the future.

    Good luck with your development!

    Best regards,
    Karl

Related