anyone having problem with the APP_TIMER in SDK14

jseaman@coaxinc.com gravatar image

asked 2017-11-14 16:03:08 +0100

When using the APP_TIMER in SDK14 I am having a problem with the application stopping. I was using the APP_TIMER to flash LEDs and watch for timeouts in SDK13. when porting the code to SDK14 I am having a problem with the timer functions stopping. I have cut the functions down to the minimum for testing am still having the problem with both the APP_TIMER_MODE_REPEATED and APP_TIMER_MODE_SINGLE_SHOT.

I started with a repeated timer but changed to a single shot for testing. I increased the timer interval from 150 to 2000. I am also using the timer to trigger sensor a reading so the use of soft_led will not solve the issue.

I have been using the timer in SDK14 to watch for loss of signal while doing range testing and have had no problem using the timer in single mode and constantly resetting it, but there were very few timeout events.

on dev board: nrf52840-Preview-DK softdevice s140_nrf52840_6.0.0-6.alpha_softdevice.hex

setting up the timer

define LED_FLASH_TIME 2000

static void timers_init(void) {

ret_code_t err_code = app_timer_init();

APP_ERROR_CHECK(err_code);
err_code = app_timer_create(&low_gate_led_timer_id, APP_TIMER_MODE_SINGLE_SHOT,
        &low_led_timer);
APP_ERROR_CHECK(err_code);

}

and the timer service routine

void low_led_timer(void * p_context) {

UNUSED_PARAMETER(p_context);
nrf_gpio_pin_toggle(GATE_DOWN_LED);
ret_code_t err_code = app_timer_start(low_gate_led_timer_id,LED_FLASH_TIME,NULL);

}

edit retag flag offensive close delete report spam

Comments

Hi,

There was no changes in the app timer library between SDK 13 and SDK 14. So it could be something else that is causing the application to stop.

So if you are having trouble with the application stopping, you should debug and see if you maybe are running in the error-handler? See this post.

Sigurd ( 2017-11-16 17:13:42 +0100 )editconvert to answer