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

nRF52840 GPIO EVENT

hi All!

I use WAKE UP event from G-SENSOR on some GPIO to wake up the MCU on motion detected.

But sometimes ( ~1% ) the event does not occur for unknown reason until RESET.

By oscilloscope, signal exist, but even doesn't sent.

the init code:

nrf_drv_gpiote_init();
nrf_drv_gpiote_in_config_t in_config = {.is_watcher = false, .hi_accuracy = false, .pull = NRF_GPIO_PIN_NOPULL, .sense = NRF_GPIOTE_POLARITY_LOTOHI};
err_code = nrf_drv_gpiote_in_init(33, &in_config, in_pin_handler);
nrf_drv_gpiote_in_event_enable(33, true);
    

any suggestion why ?

thanks.

Parents
  • Hello,

    Just to clarify:

    It happens 1% of times until RESET, so after about 100 times, the chip won't wake up anymore, or does it happen on 1% of the chips? (I assume the first)

     

    I see that you don't use any pull configuration. I also see that you trigger from LoToHi. Can you try to add: .pull = NRF_GPIO_PIN_PULLDOWN, and see if that helps?

     

    Other than might adding a pull, I can't see anything wrong with your setup. Are you sure that it is only the interrupt not working, or could it be that the entire application hangs? Can you please try to add "DEBUG"  to your preprocessor defines, and see if any of the APP_ERROR_CHECK(err_code); receives an err_code != NRF_SUCCESS? 
    Depending on the SDK version that you use, it depends a bit where to set the breakpoint. Just try to add:

    APP_ERROR_CHECK(1);

    somewhere in your main() function, and see where it stops.

     

    Best regards,

    Edvin

Reply
  • Hello,

    Just to clarify:

    It happens 1% of times until RESET, so after about 100 times, the chip won't wake up anymore, or does it happen on 1% of the chips? (I assume the first)

     

    I see that you don't use any pull configuration. I also see that you trigger from LoToHi. Can you try to add: .pull = NRF_GPIO_PIN_PULLDOWN, and see if that helps?

     

    Other than might adding a pull, I can't see anything wrong with your setup. Are you sure that it is only the interrupt not working, or could it be that the entire application hangs? Can you please try to add "DEBUG"  to your preprocessor defines, and see if any of the APP_ERROR_CHECK(err_code); receives an err_code != NRF_SUCCESS? 
    Depending on the SDK version that you use, it depends a bit where to set the breakpoint. Just try to add:

    APP_ERROR_CHECK(1);

    somewhere in your main() function, and see where it stops.

     

    Best regards,

    Edvin

Children
Related