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

GPIO with beacon DFU not working

Hi,

I am trying to turn on p0.03 when it goes in dfu mode but it not turning on

    err_code = nrf_drv_gpiote_init();

    APP_ERROR_CHECK(err_code);

    nrf_drv_gpiote_out_config_t out_config = GPIOTE_CONFIG_OUT_SIMPLE(false);

    err_code = nrf_drv_gpiote_out_init(3, &out_config);
    APP_ERROR_CHECK(err_code);

    nrf_drv_gpiote_out_clear(3);

It turn on led and then turn off it self

I figure out that the issue is with

    err_code = app_timer_create(&nrf_dfu_inactivity_timeout_timer_id,
                                APP_TIMER_MODE_SINGLE_SHOT,
                                nrf_dfu_reset_timeout_handler);

is it possible to use  app_timer_create after gpio_init?

Thanks

Parents
  • Hi ,

    If you put an infinite loop after you call nrf_drv_gpiote_out_clear(3); would it turn on the LED ? 

    I suspect maybe something inside the app timer that clear the LED ? Could you try with another GPIO pin? 

    Why would you need to use GPIOTE task to turn on an LED, could you just use nrf_gpio_pin_clear() to turn the pin on ? 

  • Thanks for your reply
    I have tried with nrf_gpio_pin_clear() also

    but app_timer_create turnning off led and after that i have tried to turn on but it also not turning on led

  • using 

       bsp_board_leds_init();
       bsp_board_led_on(BSP_BOARD_LED_2);

    is working fine but i want use p0.03 and that cannot be used by bsp_board module

  • Please step into the code and check what switches the P0.03 off. You may need to change the optimization level to 0

Reply Children