wake on PDM microphone

I see there is a way to set an audio event exceeding a set threshold.
https://infocenter.nordicsemi.com/index.jsp?topic=%2Fug_thingy53%2FUG%2Fthingy53%2Fhw_description%2Fmicrophone_buzzer.html

I found the nfc system_off sample and added button press to wake using:
nrf_gpio_cfg_sense_set(NRF_DT_GPIOS_TO_PSEL(DT_ALIAS(sw0), gpios), NRF_GPIO_PIN_SENSE_HIGH);
to wake the board when a button is pressed.  (this works for me, but doesn't call the button callback upon wake, so you have to press once to wake and another for button press)

I'd like for the device to wake on sound, light, and motion.  Based on the document referenced above it seems theres a way to wake on sound, haven't yet figured it out.

Is there a sample for waking the device for sound.  I'm still learning and any direction would be greatly appreciated.

Parents
  • The button callback will not be called when it is waking the chip from system off as the chip will be reset in this situation. If you were doing a system on idle sleep (WFE/WFI) and then try to wakeup from that, then your button callback handler will be called as you expected.

    So, in short, you need to implement your button callback handler after detecting that the wakeup (reset) reason is caused by the GPIO from system off 

    You need to look into POWER-RESETREAS register to see if this wakeup is caused by a GPIO and then (BITMASK F -> OFF = set) and then call your button handler manually if this bit is set. I am assuming that there are no other wakeup sources from systemoff apart from this, so no need to check the GPIO registers to validate that it was a button that caused the wakeup.

Reply
  • The button callback will not be called when it is waking the chip from system off as the chip will be reset in this situation. If you were doing a system on idle sleep (WFE/WFI) and then try to wakeup from that, then your button callback handler will be called as you expected.

    So, in short, you need to implement your button callback handler after detecting that the wakeup (reset) reason is caused by the GPIO from system off 

    You need to look into POWER-RESETREAS register to see if this wakeup is caused by a GPIO and then (BITMASK F -> OFF = set) and then call your button handler manually if this bit is set. I am assuming that there are no other wakeup sources from systemoff apart from this, so no need to check the GPIO registers to validate that it was a button that caused the wakeup.

Children
Related