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

APP_TIMER_APPSH_INIT cause system reset on nrf52832

hi all: Recently, I develop with nrf52832, the softdevice is nRF52_SDK_0.9.0_0c82e3e. We want modify the example \nRF52_SDK_0.9.0_0c82e3e\examples\ble_peripheral\ble_app_hrs. In my application, we want to add the scheduler to the example of ble_app_hrs, so we modify the the timers_init() with APP_TIMER_APPSH_INIT(APP_TIMER_PRESCALER, APP_TIMER_MAX_TIMERS, APP_TIMER_OP_QUEUE_SIZE, true), and add scheduler_init() and app_sched_execute() in the main() just like the example of ...\nRF52_SDK_0.9.0_0c82e3e\examples\ble_peripheral\ble_app_hids_mouse. As the result, the system reset again and again. Is there any error when we use APP_TIMER_APPSH_INIT()? We are so confused.

thanks a lot!

Parents
  • IF there is any APP_ERROR_CHECK failed the default behavior of this failure is call to app_error_handler. The weak implementation of it is in app_error.c and this will reset your chip (I am not a big fan of this chip reset when APP_ERROR_CHECK fails, hard to debug). If you want it to be different then you need to override this function in your application to handle your own error. You can implement app_error_handler in main.c to just do an infinite loop so that you can debug that it is a check failure instead of soft resetting the system.

Reply
  • IF there is any APP_ERROR_CHECK failed the default behavior of this failure is call to app_error_handler. The weak implementation of it is in app_error.c and this will reset your chip (I am not a big fan of this chip reset when APP_ERROR_CHECK fails, hard to debug). If you want it to be different then you need to override this function in your application to handle your own error. You can implement app_error_handler in main.c to just do an infinite loop so that you can debug that it is a check failure instead of soft resetting the system.

Children
Related