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

SoftDevice with Timer peripherals goes to app_error_weak.c

I am trying to measure frequency of a gpio pin.

I am using the code from the below thread -

https://devzone.nordicsemi.com/f/nordic-q-a/9036/measuring-input-gpio-pin-frequency-with-soft-device-running

I did modify it to be suitable with the new SDK V17.

//The  mode 1 was depcrecated so I am using the below modes.
NRF_TIMER1->MODE = 0; // Timer mode

NRF_TIMER2->MODE = 2; // Low power counter mode


I have added the custom ble service / characteristic tutorial code along with this.

When I run the code on debug mode, it goes to app_error_weak.c

I am not sure why this is happening. I tried to create break points but I am unsure from where this is being triggered.

However, the BLE service runs fine. It does not stop or create issues.

I am a bit new to SoftDevice. May I know where am I going wrong?

Parents Reply
  • Hello Simon,

    I got the following:



    It reaches here. (void) sd_nvic_critical_region_exit(nested);

    Could you please let me know what does this mean and how can I get rid of this error?

    __STATIC_INLINE uint32_t sd_nvic_critical_region_exit(uint8_t is_nested_critical_region)
    {
      if (nrf_nvic_state.__cr_flag && (is_nested_critical_region == 0))
      {
        int was_masked = __sd_nvic_irq_disable();
        NVIC->ISER[0] = nrf_nvic_state.__irq_masks[0];
        NVIC->ISER[1] = nrf_nvic_state.__irq_masks[1];
        nrf_nvic_state.__cr_flag = 0;
        if (!was_masked)
        {
          __sd_nvic_irq_enable();
        }
      }
    
      return NRF_SUCCESS;
    }
    

Children
No Data
Related