Configuring Wakeup by a GPIO on nRF54L15

Hi, we want to evaluate the BLE ISP2454-LX chip.

To do this we bought from RUTRONIK FRANCE an ISP2454-LX-EB evaluation board with the ISP2454-LX-TB test board.

SDK : nRF Connect SDK Bare Metal v1.0.0

Tool Chain : nRF Connect SDK Toolchain v3.2.0

Softdevice : 

Application ble_nus works fine.

Now we want to test power down mode and wakeup by gpio function.

Application system_off gives us an example. But the application can not compile in Bare Metal environnement.

I don't know why.

The goal is to integrate power down mode and wakeup by gpio function in the ble_nus application.

So I added to the project configuration :

# Enable POWEROFF
CONFIG_PM_DEVICE=y
CONFIG_POWEROFF=y

# Enable HW INFO
CONFIG_HWINFO=y

# Enable GPIO
CONFIG_GPIO=y
This does not compile, because there is no gpio referenced in the Device Tree generated by the build.
So my question is : how can I activate gpios in the Device tree and why they are not activated with CONFIG_GPIO=y ?
Thanks.
Best Regards.
Andre MULLER
Parents
  • Hello,

    The CONFIG_GPIO is not used in the NCS Bare Metal SDK. Please see how the buttons are set up in the bare metal implementation. 

    There is a button sample found in NCS for Bare Metal\nrf-bm\samples\peripheral\buttons

    For actual buttons running in your application, you may want to use the button library, as this had a debounce implemented (software debounce), but if you want to use it for wakeup from system off mode, then look at how the bm_buttons_init() is implemented:

    int bm_buttons_init(struct bm_buttons_config const *configs, uint8_t num_configs,
    		    uint32_t detection_delay)
    {
        ...
    
    	const nrfx_gpiote_handler_config_t handler_config = {
    		.handler = gpiote_evt_handler,
    	};
    
    	for (int i = 0; i < num_configs; i++) {
    		const nrf_gpio_pin_pull_t pull_config = configs[i].pull_config;
    		const nrfx_gpiote_trigger_config_t trigger_config = {
    			.trigger = (configs[i].active_state == BM_BUTTONS_ACTIVE_HIGH)
    				? NRFX_GPIOTE_TRIGGER_LOTOHI
    				: NRFX_GPIOTE_TRIGGER_HITOLO
    		};
    		const nrfx_gpiote_input_pin_config_t input_config = {
    			.p_pull_config = &pull_config,
    			.p_trigger_config = &trigger_config,
    			.p_handler_config = &handler_config,
    		};
    
    		const uint32_t pin_number = configs[i].pin_number;
    
    		err = gpiote_input_configure(pin_number, &input_config);
    		if (err) {
    			return err;
    		}
    	}

    When this is set up as an input pin, it will wake up the device from system off mode.

    Best regards,

    Edvin

Reply
  • Hello,

    The CONFIG_GPIO is not used in the NCS Bare Metal SDK. Please see how the buttons are set up in the bare metal implementation. 

    There is a button sample found in NCS for Bare Metal\nrf-bm\samples\peripheral\buttons

    For actual buttons running in your application, you may want to use the button library, as this had a debounce implemented (software debounce), but if you want to use it for wakeup from system off mode, then look at how the bm_buttons_init() is implemented:

    int bm_buttons_init(struct bm_buttons_config const *configs, uint8_t num_configs,
    		    uint32_t detection_delay)
    {
        ...
    
    	const nrfx_gpiote_handler_config_t handler_config = {
    		.handler = gpiote_evt_handler,
    	};
    
    	for (int i = 0; i < num_configs; i++) {
    		const nrf_gpio_pin_pull_t pull_config = configs[i].pull_config;
    		const nrfx_gpiote_trigger_config_t trigger_config = {
    			.trigger = (configs[i].active_state == BM_BUTTONS_ACTIVE_HIGH)
    				? NRFX_GPIOTE_TRIGGER_LOTOHI
    				: NRFX_GPIOTE_TRIGGER_HITOLO
    		};
    		const nrfx_gpiote_input_pin_config_t input_config = {
    			.p_pull_config = &pull_config,
    			.p_trigger_config = &trigger_config,
    			.p_handler_config = &handler_config,
    		};
    
    		const uint32_t pin_number = configs[i].pin_number;
    
    		err = gpiote_input_configure(pin_number, &input_config);
    		if (err) {
    			return err;
    		}
    	}

    When this is set up as an input pin, it will wake up the device from system off mode.

    Best regards,

    Edvin

Children
No Data
Related