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

ERROR 4097 [Unknown error code] at nrf_sdh_enable_request

I am receiving "ERROR 4097 [Unknown error code]" returned upon calling nrf_sdh_enable_request. I found that ERROR 4097 corresponds to NRF_ERROR_SVC_HANDLER_MISSING from some other posts. I also found that this means that I'm using the wrong SoftDevice version. I'm using SDK v15.3.0 which has s132 6.1.1 to program an nRF521832. If this is not the right SoftDevice version, what is?

Also, why is my error handling not returning NRF_ERROR_SVC_HANDLER_MISSING directly? Why is it returning "ERROR 4097 [Unknown error code]" instead?

Some clarification: BLE was working well and this error was not showing until I integrated the GPIOTE example to my code to toggle a gpio at 2 MHz.

Thanks

Parents
  • I'm programming the nRF52 to interface with an AFE chip (that acquires sensor readings) through SPI and send the acquired sensor readings using BLE to an Android tablet. The AFE chip requires a 1 MHz clock. We decided to provide that using a GPIO pin toggled at 2 MHz. 


    The project was started off from the GPIOTE example where the 1 MHz clock was implemented then the SPI communication with the AFE chip and every thing was working well at that point. Lastly I developed the BLE feature using the template example and then tried to import the code into the main project. I later realized that it was a better idea to start with the BLE template example and import other features into that as it took some effort and time to setup the project for BLE. When I integrated the BLE code from the template example to the GPIOTE example I disabled the 1 MHz clock and SPI parts of the code - isolating problems. Now I'm at the point of adding back those features to the code, and starting with the 1MHz I'm getting the error I mentioned in my original post.

  • Kenan said:
    Now I'm at the point of adding back those features to the code, and starting with the 1MHz I'm getting the error I mentioned in my original post.

    As the previous post indicated,  the issue may be caused by your interrupt configuration.  Make sure that your interrupt priority is not using interrupt priority configured for SoftDevice; "The nRF52 SoC has eight configurable interrupt priorities ranging from 0 to 7 (with 0 being the highest priority)". 

    The SoftDevice reserves and uses the following priority levels, which must remain unused by the application programmer:

    • Level 0 is used for the SoftDevice's timing critical processing.
    • Level 1 is used for handling the memory isolation and run time protection, see Memory isolation and runtime protection.
    • Level 4 is used by higher-level deferrable tasks and the API functions executed as SVC interrupts.

    More information on the SoftDevice Interrupt model can be found here and have a look at the SoftDevice NVIC API. A similar case can be found here, although using S140.  

    Kind regards,
    Øyvind

Reply
  • Kenan said:
    Now I'm at the point of adding back those features to the code, and starting with the 1MHz I'm getting the error I mentioned in my original post.

    As the previous post indicated,  the issue may be caused by your interrupt configuration.  Make sure that your interrupt priority is not using interrupt priority configured for SoftDevice; "The nRF52 SoC has eight configurable interrupt priorities ranging from 0 to 7 (with 0 being the highest priority)". 

    The SoftDevice reserves and uses the following priority levels, which must remain unused by the application programmer:

    • Level 0 is used for the SoftDevice's timing critical processing.
    • Level 1 is used for handling the memory isolation and run time protection, see Memory isolation and runtime protection.
    • Level 4 is used by higher-level deferrable tasks and the API functions executed as SVC interrupts.

    More information on the SoftDevice Interrupt model can be found here and have a look at the SoftDevice NVIC API. A similar case can be found here, although using S140.  

    Kind regards,
    Øyvind

Children
Related