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
  • Hi Martin,

    I think that I found out the problem. I will be really appreciated if you can confirm my assumption. In my code, the times are executed in the main loop because I am using the scheduler. The softdevice is also executed in the main loop which means that BLE event does not have higher priority compared to the application timers (where pstorage_update function and subsequently power_manage() function are called). Both of them are loaded in the queue according to schedule rule. Because BLE event and timers are executed with the same priority, the code waits for a p_storage flag longer than the critical interval for execution of BLE event. Due to this fact, I guess that BLE event cannot be executed just in time. I use SDK 10. If my assumption is not true then I will upload the code.

Reply
  • Hi Martin,

    I think that I found out the problem. I will be really appreciated if you can confirm my assumption. In my code, the times are executed in the main loop because I am using the scheduler. The softdevice is also executed in the main loop which means that BLE event does not have higher priority compared to the application timers (where pstorage_update function and subsequently power_manage() function are called). Both of them are loaded in the queue according to schedule rule. Because BLE event and timers are executed with the same priority, the code waits for a p_storage flag longer than the critical interval for execution of BLE event. Due to this fact, I guess that BLE event cannot be executed just in time. I use SDK 10. If my assumption is not true then I will upload the code.

Children
No Data
Related