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

Update SDK 15.2 to 15.3

Hi,

I have just updated my app from SDK 15.2 to 15.3 (and the softdevice from 6.1.0 to 6.1.1).

Now nothing is working... I initializes a button with NRFX_GPIOTE and now it stopped triggering interrupts.

In this changelog https://github.com/NordicSemiconductor/nrfx/blob/a0dcb1350f6798f12479921a0a376d00e2316fd4/CHANGELOG.md I can see that changes has been made to the GPIO module, but where can see what has actually changed and what I need to do to make it work with the new SDK?

I looked at the Pin_Change_INT example and that is exactly like the old example, so how can it be, that I suddenly doesn't get interrupts anymore?

Is there somewhere an upgrade guide, when it is only minor revision updates?

Parents
  • Just an update: I read this in the documentation...

    nrfx_err_t nrfx_gpiote_in_init ( nrfx_gpiote_pin_t  pin,
    nrfx_gpiote_in_config_t const *  p_config,
    nrfx_gpiote_evt_handler_t  evt_handler 
    )

    Function for initializing a GPIOTE input pin.

    The input pin can act in two ways:

    • lower accuracy but low power (high frequency clock not needed)
    • higher accuracy (high frequency clock required)

    The initial configuration specifies which mode is used. If high-accuracy mode is used, the driver attempts to allocate one of the available GPIOTE channels. If no channel is available, an error is returned. In low accuracy mode SENSE feature is used. In this case only one active pin can be detected at a time. It can be worked around by setting all of the used low accuracy pins to toggle mode. For more information about SENSE functionality, refer to Product Specification.

    Does that mean I can't configure 1 pin for sensing both edges and another pin to only sense HI-to-LO (even though they have different event handlers)?
Reply
  • Just an update: I read this in the documentation...

    nrfx_err_t nrfx_gpiote_in_init ( nrfx_gpiote_pin_t  pin,
    nrfx_gpiote_in_config_t const *  p_config,
    nrfx_gpiote_evt_handler_t  evt_handler 
    )

    Function for initializing a GPIOTE input pin.

    The input pin can act in two ways:

    • lower accuracy but low power (high frequency clock not needed)
    • higher accuracy (high frequency clock required)

    The initial configuration specifies which mode is used. If high-accuracy mode is used, the driver attempts to allocate one of the available GPIOTE channels. If no channel is available, an error is returned. In low accuracy mode SENSE feature is used. In this case only one active pin can be detected at a time. It can be worked around by setting all of the used low accuracy pins to toggle mode. For more information about SENSE functionality, refer to Product Specification.

    Does that mean I can't configure 1 pin for sensing both edges and another pin to only sense HI-to-LO (even though they have different event handlers)?
Children
  • Hey Morten,

    The GPIO/TE peripheral operates has two types of input events for each pin on PORT event and one IN event. 

    The PORT event is shared among all pins, whenever one input pin triggers the PORT event the driver has to read the IN register of both GPIO ports to determine what pin has changed state. The driver can only handle PORT events from pins that are set up to trigger a PORT event on a toggle. 

    The IN event is unique for each pin and has real-time accuracy. You can use the IN event to trigger tasks in other peripherals, as opposed to the PORT event who'll act sporadically as all enabled input pins will trigger it. The IN event uses ~20µA however. 


    "Does that mean I can't configure 1 pin for sensing both edges and another pin to only sense HI-to-LO (even though they have different event handlers)?"
    Yes, you can, but you need to use the IN event for any pin that does is not configured to trigger an event on a toggle. 

  • Thanks.

    I got it to work by changing the initialization order of two modules.

    For some reason the PWM had to be initialized before the GPIOTE.

Related