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

sd_nvic_critical_region_enter/exit missing in s130 v2

Hi,

I am currently porting an application s110-based to s130v2.

Previously, I used to create critical sections using sd_nvic_critical_region_enter/exit.

Reading the s130v2 specification and nrf_soc.h, I noted that such APIs are missing.

How is possible to implement a critical section through the current available s130v2 APIs?

Thanks for your time, LM

  • Hi Lorenzo.

    The API's shouldn't be missing, it's just been made some changes to the sd_nvic_x API.

    From the S130 v2.0.1 Migration document:

    The sd_nvic_* API functions have changed from being SV calls into the SoftDevice to being static functions implemented in a new header file, nrf_nvic.h. This header file must be included in all source files that call any API function than begins with sd_nvic_. If a project includes nrf_nvic.h in any of its source files, one of them must declare and zero initialize a global instance of nrf_nvic_state_t in the form: nrf_nvic_state_t nrf_nvic_state = {0};

    So luckily you have just been looking in the wrong header file. If you take a look at the nrf_nvic.h header file instead, you should be able to find what you are looking for.
    Here's a link to the s130 v2.0.1 NVIC API in our infocenter.

    Best regards,
    Joakim.

Related