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

'NRF_EVT_FLASH_OPERATION_SUCCESS' undeclared (first use in this function)

I am trying to Compiling ‘ble_advertising.c’ and get 'NRF_EVT_FLASH_OPERATION_SUCCESS' undeclared (first use in this function).

This declaretion is already in the nrf_soc.h and i have set system include directories with path of the nrf_soc.h but still getting this error. Thank you.

  • Hi

    Usually, "undecleared" errors are due to the limited path length in Windows (if that's the OS you're using). Please try moving the SDK folder to a shorter path, for instance C:\SDK_FOLDER\.

    Please provide some more information on your application. Is this one of the default SDK examples or a project you have modified/created yourself?Do you see any errors if you try compiling the main.c file or build and run the application as a whole?

    Best regards,

    Simon

  • I saw that anwser in the forum but my path is already short "C:\nRF5_SDK_14.2.0_17b948a\components\softdevice\s132\headers"

    Actually i have created this project without ble using. I was using nrf52832 as ordinary mcu but now i need to use dfu with ble so i started to merge my project with buttonless dfu example. Main.c is ok. I am just getting errors at multiple nrf ble libraries because of the nrf_soc.h

    • implicit declaration of function 'sd_flash_page_erase' [-Wimplicit-function-declaration]
    • 'NRF_EVT_FLASH_OPERATION_SUCCESS' undeclared (first use in this function)
    • 'NRF_EVT_FLASH_OPERATION_ERROR' undeclared (first use in this function)
    • Output/nrf52832_xxaa/Obj/DWM1001_Tag/nrf_sdh_soc.o: in function `nrf_sdh_soc_evts_poll':
    • implicit declaration of function 'sd_evt_get' [-Wimplicit-function-declaration]
  • Hi

    How is the SoftDevice enabled in your application? Is sd_evt_get() pulled from somewhere else in the application? Usually, these events are pulled from a software interrupt and passed to the event handler. This will occur before you're able to pull events in the application, as the interrupt has higher priority.

    Also, is there a reason you're using SDK v14.2.0 and not a more recent SDK?

    Best regards,

    Simon

  • Because of the sdk version of my main project i want to use this version. If it is not needed i want to stick with this version. Maybe i skip something during the merge ? Where should be "sd_evt_get()" called from ? I can compile ble_app_buttonless_dfu_pca10040_s132 example and "nrf_soc.h" contains SVCALL(SD_EVT_GET, uint32_t, sd_evt_get(uint32_t * p_evt_id));

  • Hi

    I see, you probably don't have to move to another SDK version, but if you had no reason to stay on the older version, I would suggest moving to a more recent one. 

    But is the sd_evt_get() anywhere else in your application? It should only be called from the interrupt. Please also include a snippet showing how you enable the SoftDevice.

    Can you provide the full log of when you try building the application? Also, what IDE are you using to compile and build this solution?

    Best regards,

    Simon

Related