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

__enable_irq reset the device in SDK12.0.0.

Hi I am using SDK 12.0.0.0 in nRF52832 in this code when I am using __enable_irq(); function for enable the interrupt then controller is getting reset can anyone help me regarding this.

Parents
  • FormerMember
    0 FormerMember

    What is your application? Do you use the softdevice? Is there a BLE connection?

    Update 10.02.2017: The reason for the reset when calling __enable_irq() is that there are too many interrupt that has happened and the softdevice doesn't know handle that situation.

    Instead of using __disable_irq() and __enable_irq(), I would recommend you to use CRITICAL_REGION_ENTER() and CRITICAL_REGION_EXIT(). CRITICAL_REGION_ENTER/EXIT call sd_nvic_critical_region_enter/exit. sd_nvic_critical_region_enter disables all application interrupts, but handle the radio interrupts, so that the BLE link is kept.

Reply
  • FormerMember
    0 FormerMember

    What is your application? Do you use the softdevice? Is there a BLE connection?

    Update 10.02.2017: The reason for the reset when calling __enable_irq() is that there are too many interrupt that has happened and the softdevice doesn't know handle that situation.

    Instead of using __disable_irq() and __enable_irq(), I would recommend you to use CRITICAL_REGION_ENTER() and CRITICAL_REGION_EXIT(). CRITICAL_REGION_ENTER/EXIT call sd_nvic_critical_region_enter/exit. sd_nvic_critical_region_enter disables all application interrupts, but handle the radio interrupts, so that the BLE link is kept.

Children
Related