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

conflict of GPIOTE_IRQHandler and nrfx_gpiote_irq_handler

Hi,

In your Light switch example, there is a GPIOTE_IRQHandler() in simple_hal.c. Since I added the nrfx_gpiote module to the project, this is conflicting with the nrfx_gpiote_irq_handler() in nrfx_gpiote.c because of a define in nrfx_irqs_nrf52840.h:

#define nrfx_gpiote_irq_handler     GPIOTE_IRQHandler

I need both, the buttons of the example and the GPIOTE-Module for forwarding an input pin to a timer/counter.

How could this be solved in the application, without making changes to your SDK?

Using Mesh_SDK 2.0.1  and nRF5_SDK_15.0.0

Kind regards

  Gerry

Parents
  • Hello,

    It is correct as you say, that if you e.g. try to copy the main.c parts from the pin_int_change example in the "normal" SDK, using the nrfx_gpiote drivers, you will get a redefinition.

    You can only have one of these functions, because they use the same gpiote peripheral.

    It is not possible to add this without changing any files in the SDK. I think the easiest workaround is to implement your input pin in the simple_hal.c implementation, or to remove the GPIOTE_IRQHandler from this file, and use the other implementation. Then you have to forward the button presses handling for the lights to this.

    Best regards,

    Edvin

  • Hi Edvin,

    thanks for your reply. When I comment or remove the line:

    #define nrfx_gpiote_irq_handler     GPIOTE_IRQHandler

    in nrfx_irqs_nrf52840.h both, the buttons and the input pin for my counter both work properly.

    Is this also a safe way to solve this issue?

    Kind regards

    Gerry

  • Hello Gerry,

    Yes. If that works, it is fine. This line is only setting the nrfx' gpiote callback function to the GPIOTE_IRQHandler. If you don't need this, then you are fine, and as long as you get your interrupts from the pin that you are adding, it is fine.

    But how did you set up the nrfx handler? When you remove this line, the interrupt handler of the nrfx_gpiote will not be called. However, if it works, then you should be fine.

    Best regards,

    Edvin

Reply
  • Hello Gerry,

    Yes. If that works, it is fine. This line is only setting the nrfx' gpiote callback function to the GPIOTE_IRQHandler. If you don't need this, then you are fine, and as long as you get your interrupts from the pin that you are adding, it is fine.

    But how did you set up the nrfx handler? When you remove this line, the interrupt handler of the nrfx_gpiote will not be called. However, if it works, then you should be fine.

    Best regards,

    Edvin

Children
Related