This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

CAF buttons module - need to define which button should be configured for wakeup after system off

4743.caf.zip

I am using the following CAF modules on nRF52840DK, ncs 1.9.1: Buttons, LEDs and Power manager (see attached project caf.zip)

Button 1 is used for ON/OFF fuctionality. When pressed (in a modified led_state.c module), I call force_power_down().

The problem is that wakeup from system off is then configured for all defined buttons (probably in the Buttons module).

Is there a way to define which buttons that should be configured for wakeup from system off (and not being overridden by the Buttons module)? 

*** Booting Zephyr OS build v2.7.99-ncs1-1  ***
[00:00:00.254,852] <inf> event_manager: e:module_state_event module:main state:READY
[00:00:00.255,004] <inf> power_manager: Activate power manager
[00:00:00.255,065] <inf> event_manager: e:module_state_event module:buttons state:READY
[00:00:00.255,065] <inf> event_manager: e:module_state_event module:leds state:READY
[00:00:00.255,126] <inf> event_manager: e:led_event led_id:0 effect:0xbc64
[00:00:00.255,218] <inf> event_manager: e:led_ready_event led_id:0 effect:0xbc64
[00:00:03.439,788] <inf> event_manager: e:button_event key_id=0x0 pressed
[00:00:03.439,849] <inf> event_manager: e: force_power_down_event
[00:00:03.439,880] <inf> power_manager: Force power down processing 
[00:00:03.439,880] <inf> event_manager: e: keep_alive_event
[00:00:03.439,910] <inf> event_manager: e: power_down_event
[00:00:04.324,218] <inf> event_manager: e:button_event key_id=0x0 released
[00:00:04.324,249] <inf> event_manager: e:module_state_event module:buttons state:STANDBY
[00:00:04.324,279] <inf> event_manager: e: power_down_event
[00:00:04.324,432] <inf> power_manager: Power down the board
[00:00:04.324,432] <wrn> power_manager: System turned off
[00:00:05.097,930] <inf> event_manager: e:module_state_event module:leds state:OFF

After the above, The wakeup can also happen using Button 2, 3, and 4 (in addition to Button 1)

Parents
  • Hi 

    The CAF button module doesn't allow you to select which of the buttons should act as wakeup sources unfortunately. 

    I would recommend simply going back to sleep if the wrong button is pressed while you are supposed to be in sleep mode. 

    Best regards
    Torbjørn

Reply
  • Hi 

    The CAF button module doesn't allow you to select which of the buttons should act as wakeup sources unfortunately. 

    I would recommend simply going back to sleep if the wrong button is pressed while you are supposed to be in sleep mode. 

    Best regards
    Torbjørn

Children
Related