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

nrfx_gpiote_in_init and logging within its event handler

Hi there. When nrfx_gpiote_in_init's event handler is called, is it being called as an interrupt? I note that if I use NRF_LOG_INFO within the body of the event handler, then my device will reboot on occasion. What I think I must do is to enqueue an event for processing outside of being an interrupt, but I've not yet confirmed that I should need to, or how. Any pointers here are appreciated. Thanks.

Parents
  • Hello Christopher,

    When nrfx_gpiote_in_init's event handler is called, is it being called as an interrupt?

    Yes, this is correct. You assign the interrupts priority during initialization of the peripheral.

    I note that if I use NRF_LOG_INFO within the body of the event handler, then my device will reboot on occasion.

    Are you seeing any error messages printed to your logger output when the resets occurs?
    Could you also verify that you have defined DEBUG in your preprocessor definitions, like shown in the included image?

    With DEBUG defined you should see a full length error message printed to your logger output if an error code != NRF_SUCCESS is passed to an APP_ERROR_CHECK.

    The default behavior of the peripheral ble_template example in the SDK is to advertise for 180 seconds ( as defined at the top of the main.c file - ADV_DURATION ) before entering sleep mode. Could this be what you are interpreting as a sudden reset / shutdown ?

    Best regards,
    Karl

Reply
  • Hello Christopher,

    When nrfx_gpiote_in_init's event handler is called, is it being called as an interrupt?

    Yes, this is correct. You assign the interrupts priority during initialization of the peripheral.

    I note that if I use NRF_LOG_INFO within the body of the event handler, then my device will reboot on occasion.

    Are you seeing any error messages printed to your logger output when the resets occurs?
    Could you also verify that you have defined DEBUG in your preprocessor definitions, like shown in the included image?

    With DEBUG defined you should see a full length error message printed to your logger output if an error code != NRF_SUCCESS is passed to an APP_ERROR_CHECK.

    The default behavior of the peripheral ble_template example in the SDK is to advertise for 180 seconds ( as defined at the top of the main.c file - ADV_DURATION ) before entering sleep mode. Could this be what you are interpreting as a sudden reset / shutdown ?

    Best regards,
    Karl

Children
No Data
Related