Beware that this post is related to an SDK in maintenance mode
More Info: Consider nRF Connect SDK for new designs
This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

system crash while calling sd_ble_gap_tx_power_set() from ble_radio_notification interrupt handler.

Problem Statement: For one of our requirement we have to switch tx power in steps in ascending order continuously.

We are using ble_radio_notification feature to achieve this which we have used with nrf51 and SdK 8 effactivaly in past.

We are enabling radio notification interrupt for radio inactive condition and within the interrupt handler ble_radio_notification() we try to change tx power for next advertise event.

We are observing if we call sd_ble_gap_tx_power_set() from  ble_radio_notification() system crashes at same instance.

 

 

Attached is the code snippet to try it out with IAR and nrf52840 preview kit. The base example used for the purpose is.

nRF5_SDK_14.0.0_3bcc1f7\examples\ble_peripheral\ble_app_blinky

 

Is there any alternate way to achieve the primary problem statement.

Cheers,

Shishir

Parents
  • Hi Shishir,

     

    Did you forget an attachment?

    The "normal" reason why you get a system crash (or a fault condition) when calling a SVC-function from an interrupt is if the interrupt has higher priority than the SVC-function that you're calling.

    Since you're taking a long leap, from nRF51+SDK8 to nRF52840+SDK14, are there any hard-coded interrupt level values that are still in place in your firmware? This is one of the changes that you'll need to be aware of when going from nRF51->nRF52, as the Cortex M4 has 8 interrupt levels and the Cortex M0 has 4. Thus the softdevice for each device utilizes the levels a bit differently.

     

    Cheers,

    Håkon

Reply
  • Hi Shishir,

     

    Did you forget an attachment?

    The "normal" reason why you get a system crash (or a fault condition) when calling a SVC-function from an interrupt is if the interrupt has higher priority than the SVC-function that you're calling.

    Since you're taking a long leap, from nRF51+SDK8 to nRF52840+SDK14, are there any hard-coded interrupt level values that are still in place in your firmware? This is one of the changes that you'll need to be aware of when going from nRF51->nRF52, as the Cortex M4 has 8 interrupt levels and the Cortex M0 has 4. Thus the softdevice for each device utilizes the levels a bit differently.

     

    Cheers,

    Håkon

Children
Related