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

nrf52 disable interrupt below a certain level

My goal is that disabling the interrupts other than soft device interrupt.

I think that this is achieved by disabling interrupts below a certain level (in this case, 2?), is this possible?

Or I suppose that to set the current interrupt priority state high is another solution, but I couldn't find the method to realize this, either.

Please tell me sample codes to realize those. 

 

Parents Reply Children
  • I found that the error handler is from `sd_softdevice_enable` (the second argument callback function is called). If CRITICAL_REGION_ENTER/EXIT is used and after a certain period of time in this region, the error handler is called.

    I thought that the cause of the error handler  is called is that some of the important interrupts of softdevice or anything else modules are disabled for a long time, is it correct?

    If so, I thought that disabling interrupts below a certain level is one of the best solution, but I couldn't find the corresponding API.

  • The problem has solved, the cause is our software bug (SOFTDEVICE_PRESENT definition is disabled.).

    Thanks to your advice, I tried to watch inside the CRITICAL_REGION_ENTER function and could find this bug. Thank you so much.

    But I still want to know how to realize following 2 methods;

    1. change current interrupt level 
    2. disable interrupt below a certain level
  • Hi,

     

    Glad to hear that you found the source of the initial issue.

    k.k said:
    I thought that the cause of the error handler  is called is that some of the important interrupts of softdevice or anything else modules are disabled for a long time, is it correct?

    I know that you're already found this issue, but: this is a side-effect of when you're re-enabling interrupts again where you get many events triggered at the same time.

    The softdevice has a predictive order of events, and when things happen out-of-order, it detects and asserts.

     

    k.k said:

    If so, I thought that disabling interrupts below a certain level is one of the best solution, but I couldn't find the corresponding API.

    There is no API for this, you need to parse each interrupt and check manually.

     

    k.k said:
    change current interrupt level

     Do you mean exit the interrupt handler? I am not sure I understand really what you want to obtain here.

     

    Kind regards,

    Håkon

Related