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 Reply Children
  • I decided against the additional commit with the code I attempted to resolve this issue.  None of those attempts worked.

  • Thank you for the patience.

    I reproduced your observation. I suspect that the issue lies with MCUboot processing the button but not 100% sure yet. 

    I will keep working on it and come back to you soon.

    In case you want to try, a simple test would be overlaying the MCUboot child image to use a different GPIO as the button instead of where the button really is.

  • Thank you for the response and glad to hear you were able to reproduce.  Your thoughts that it had to do with mcuboot is correct.  I was able to disable the mcuboot via CONFIG_BOOTLOADER_MCUBOOT=n in the sample I provided.

     Disable MCUBoot on start-up 

    I'm not yet educated enough to know how to overlay the mcuboot child image to use a different GPIO. The device no longer locks up.  I would like to keep mcuboot for future upgrades so knowing how to resolve this another way aside disabling mcuboot would be nice.  This is progress though; 

    I will try this in my other code and see if this resolves the lockups.
    >> I tried in my other project; the code no longer runs at all, no button presses wake the device and reset also doesn't show a lit led as it normally would.  disabling mcuboot in my other project is not a general solution it appears.

    Thanks again. 

  • Tried setting mcuboot-button0; it looked like it was working for a while but still found myself with a locked up device.

       aliases {
            mcuboot-button0 = &button0;
        };
    I haven't found any information on how to get my project working while disabling the mcuboot.  I can't use the RTC module when this occurs and switching the device is no fun.

    I hope you have success in finding a solution.
  • My apology for the long absence. 

    I just want to let you know that I am still working on this case. 

    I have thought that the issue is with the Serial Recovery feature, where MCUboot would enter recovery mode and await a new application image. CONFIG_BOOT_SERIAL_ENTRANCE_GPIO enabled this feature, and it is on by default.

    However, further testing show that it might not be the case. The device remains stuck even after I disabled Serial Recovery completely, not just the button entrance method.
    (I also ran into the observation that button0 somehow cannot be used instead)

    At the moment, I have found that if we disable the GPIO driver completely by setting CONFIG_GPIO=n for MCUboot, then the device works as expect.

    However, I don't know if this state is acceptable for you. I know you plan to use MCUboot, but do you plan to use the Serial Recovery feature?

    Considering that you want the device to work with the scenario where an end-user would repeatedly press the button, you will not be able to use the button to enter the Serial Recovery mode, regardless of configs.

    Please let me know what you think. I have a few more things I will try tomorrow, but I don't have high hope it will bring any difference.

    Once again, I am very sorry for the long wait.

Related