Unable to disable GPIOTE for nRF Connect SDK 2.6.1

Hi, 

Recently I upgraded to nRF Connect SDK 2.6.1 and I was required to enable the GPIOTE in order to build properly. Doing this has significantly increased (nearly doubled) the total current consumption at runtime. How can I disable this peripheral now? I am unable to do so now using the overlay file.

Old: 

&gpiote {
    status = "disabled";
};
New:
&gpiote {
    status = "okay";
};

Thank you,

Parents
  • Sorry, I would like to disable the GPIOTE peripheral. I am unable to build the code unless it is enabled, but that is not what we desire. 

    Thank you 

  • It should have been disabled when you disable here. Can you check in your build\zephyr\zephyr.dts file to see if this is disabled or if something else kept it enabled? If you can post your zephyr.dts file here, I can take a look.

  • When I build with it set to "disabled", I get the following error. The zephyr.dts has this also for the two GPIOS. How can I remove the need for the <&gpiote> in the definition for the gpios?

    C:/ncs/v2.7.0/zephyr/include/zephyr/toolchain/gcc.h:87:36: error: static assertion failed: "Please enable GPIOTE instance for used GPIO port!"

    			gpio0: gpio@842500 {
    				compatible = "nordic,nrf-gpio";
    				gpio-controller;
    				reg = < 0x842500 0x300 >;
    				#gpio-cells = < 0x2 >;
    				status = "okay";
    				port = < 0x0 >;
    				gpiote-instance = < &gpiote >;
    				phandle = < 0x6 >;
    			};
    			gpio1: gpio@842800 {
    				compatible = "nordic,nrf-gpio";
    				gpio-controller;
    				reg = < 0x842800 0x300 >;
    				#gpio-cells = < 0x2 >;
    				ngpios = < 0x10 >;
    				status = "okay";
    				port = < 0x1 >;
    				gpiote-instance = < &gpiote >;
    				phandle = < 0x9 >;
    			};

Reply
  • When I build with it set to "disabled", I get the following error. The zephyr.dts has this also for the two GPIOS. How can I remove the need for the <&gpiote> in the definition for the gpios?

    C:/ncs/v2.7.0/zephyr/include/zephyr/toolchain/gcc.h:87:36: error: static assertion failed: "Please enable GPIOTE instance for used GPIO port!"

    			gpio0: gpio@842500 {
    				compatible = "nordic,nrf-gpio";
    				gpio-controller;
    				reg = < 0x842500 0x300 >;
    				#gpio-cells = < 0x2 >;
    				status = "okay";
    				port = < 0x0 >;
    				gpiote-instance = < &gpiote >;
    				phandle = < 0x6 >;
    			};
    			gpio1: gpio@842800 {
    				compatible = "nordic,nrf-gpio";
    				gpio-controller;
    				reg = < 0x842800 0x300 >;
    				#gpio-cells = < 0x2 >;
    				ngpios = < 0x10 >;
    				status = "okay";
    				port = < 0x1 >;
    				gpiote-instance = < &gpiote >;
    				phandle = < 0x9 >;
    			};

Children
  • I added this to my overlay file and it appears to work now. I am going to check the power output to be sure.

    &gpio0 {
    	/delete-property/ gpiote-instance;
    };
    
    &gpio1 {
    	/delete-property/ gpiote-instance;
    };

  • My above approach works to compile the code, but now the interrupt pin does not get configured when running the following function.

    gpio_pin_interrupt_configure_dt(&int_pin, (GPIO_INT_EDGE_TO_ACTIVE));

    It fails because internally it is looking for GPIOTE to be enabled. This worked without an issue on v2.4.2. 

  • I do not get it. You would like to disable gpiote peripheral but still want to configure interrupt pin on GPIO. GPIO peripheral do not have interrupts, look at the registers for GPIO peripheral. All the GPIO interrupts are handled by GPIOTE peripheral. 

    If you want interrupts on GPIO, you need to enable the GPIOTE. If you want to use GPIOTE and have lower power consumption, you need to make sure that you are using PORT events with lower accuracy sampling not using the HFCLK. 

    Susheel Nuguru said:
    You need to use PORT events instead of high precision events when using GPIOTE with lower power consumption. Can you try if the suggestion mentioned here works with nRF53 aswell?

    If you still want interrupts on GPIO, then please try this as power consumption was your initial issue that made you think that you can disable GPIOTE.

  • I think the confusion was around me using the nRF Connect SDK 2.4.2. It allowed me to disable the GPIOTE peripheral in the overlay file, but still have access to GPIO interrupts. I thought the GPIOTE was used for the PPI interfaces only. 

    I will try your suggestion and get back to you. Thank you.

  • I added the following to my .overlay file. I see it represented in the zephyr.dts, but I am still drawing a lot more current (396uA vs. 199uA).

    &gpio0 {
    	compatible = "nordic,nrf-gpio";
    	sense-edge-mask = <0xffffffff>;
    };
    
    &gpio1 {
    	compatible = "nordic,nrf-gpio";
    	sense-edge-mask = <0xffffffff>;
    };

    I also added this to try and set the latency to be low-power.

        // Low-power mode for GPIOTE
        NRF_GPIOTE->LATENCY = 0;

    All other firmware is the same as it was in v2.4.2. Am I missing something else?

Related