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

SOFTDEVICE_HANDLER_APPSH_INIT + pstorage

ble_senso4s_v_0_7_poenostavljena4_1 power_manager.rarHi

I read a lot about p_storage library and I tested it and works great if I use SOFTDEVICE_HANDLER_INIT(NRF_CLOCK_LFCLKSRC_XTAL_20_PPM, NULL). On the other hand, If SOFTDEVICE_HANDLER_APPSH_INIT function is used for starting softdevice then the program stucks in while loop where the power_manage() function is located. I will be appreciated for any kind of information why this event happened and what is the reason for this.

best regards

Mike

Parents
  • I agree with your conclusion if I use app_timer without a scheduler. If you will look carefully at my code you will see that app_timer uses a scheduler and thus app_timer is not executed in interrupt context. If I know correctly the problem with interrupt context can arise only if the app_timer does not use a scheduler. The attached code is the simplified version of the original code in which the pstorage functions are called a few times. Due to this fact, it is good to track a flag.

Reply
  • I agree with your conclusion if I use app_timer without a scheduler. If you will look carefully at my code you will see that app_timer uses a scheduler and thus app_timer is not executed in interrupt context. If I know correctly the problem with interrupt context can arise only if the app_timer does not use a scheduler. The attached code is the simplified version of the original code in which the pstorage functions are called a few times. Due to this fact, it is good to track a flag.

Children
No Data
Related