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
  • I understand the title of this help is now incorrect.

    I think I am experiencing something like:

    wake from GPIO using SENSE without a race condition - Nordic Q&A - Nordic DevZone - Nordic DevZone (nordicsemi.com)

    which ended with the developer saying it was related to pwm; which I am using.

    I can break up the sample into a smaller sample if need.
    The device works fine, except if you spam the button while it is shutting down and then it doesn't come back on a button press again without a reboot.  Worse still, it clears the i2c RTC time and ram when it happens.

    I have tried adding the code which turns off the PWM before shutdown.

    I can create another ticket that is more specifically named; but it would be named the same as the above ticket.  There's something wrong with the shutdown when the button is spamed.  I have added code that doesn't shut the device down when the button is HIGH;  It's like if the button is transitioning, the shutdown fails and the device becomes unresponsive.

  • Hi tldr,

    My apology for the long wait and thank you for your patience. 

    Which version of NCS are you using, and how are you shuting down the device?

    Could you be experiencing the issue discussed here:  CAF button wakeup does sometimes not happen in ncs 2.5.0, if pressed again while powering down

  • Thanks for the feedback, I appreciate the perspective on the DFU.

    The drivers I have found are here:
    https://github.com/edgeimpulse/firmware-nordic-thingy53/tree/main/drivers/vm3011
    vm3011_wos_dout_thresh_set might be something in there.
    Thats all the code I can find out there for the pdm microphone.

    Thanks for verifying on the color sensor.  That's too bad.

  • Just to be more clear about why I had to add CONFIG_MCUBOOT_SERIAL=n

    C:/ncs/v2.7.0/bootloader/mcuboot/boot/zephyr/io.c:48:2: error: #error "Serial recovery selected without an entrance mode set"
    48 | #error "Serial recovery selected without an entrance mode set"

    was the error you get with just the gpio off.

    With v2.7.0; I had to use sysbuild\mcuboot.conf and get rid of child_image\mcuboot\mcu_boot.conf

    I found this info from https://docs.zephyrproject.org/latest/samples/sysbuild/with_mcuboot/README.html

  • tldr said:
    In terms of waking on sound, it looks like theres a way to do it or that its supposed to.  I'm still looking at the drivers from edge impluse but I wonder if I even need that for threshold and sense wake.

    Let's first go back to this. I give the driver and the VM3011 datasheet a quick look. It seems the VM3011's DOUT output is supposed to be used as an alert for the system to start processing further data. The driver in the Edge Impulse repo you found works like that. Therefore, the function to set the threshold is static and isn't accessible from outside.

    I am not sure what kind of behavior you want for your device, but it looks certain that it is possible to implement waking up the system from System OFF sleep with the VM3011's DOUT output.

    I am a bit uncertain whether you need any particular help with this though.

    tldr said:
    Just to be more clear about why I had to add CONFIG_MCUBOOT_SERIAL=n

    C:/ncs/v2.7.0/bootloader/mcuboot/boot/zephyr/io.c:48:2: error: #error "Serial recovery selected without an entrance mode set"
    48 | #error "Serial recovery selected without an entrance mode set"

    was the error you get with just the gpio off.

    Ah yes, that makes sense. Thanks for revisiting this point.

    tldr said:

    With v2.7.0; I had to use sysbuild\mcuboot.conf and get rid of child_image\mcuboot\mcu_boot.conf

    I found this info from https://docs.zephyrproject.org/latest/samples/sysbuild/with_mcuboot/README.html

    Thanks for this too. I have not started with sysbuild myself Sweat smile

  • I've been busy with other complications; any help in terms of wake sense pin I should use or how to actually use the driver are appreciated.  the idea is just to see all the wake features of the device and i'd start with the static threshold they've defined to see it wake.  when i do revisit; i can comment here or add it to my sample.

    the nfc wake requires one scan to wake and another to actually read the tag.  if there were a way to get the data at wake and not have to double tap...that would be great.

  • tldr said:
    any help in terms of wake sense pin I should use or how to actually use the driver are appreciated.  the idea is just to see all the wake features of the device and i'd start with the static threshold they've defined to see it wake.  when i do revisit; i can comment here or add it to my sample.

    I am afraid I don't have enough proficiency on the VM3310 to write up anything that can help you better than the datasheet. I recommend understanding its state machine. It looks like the DOUT signal will trigger automatically when the device is in the right mode, so it shouldn't be difficult to setup.

    Regarding the driver in the Edge Impulse application, I don't think it can be used for your need out of the box. You are better off using I2C driver if you ever need to reconfigure the microphone wake threshold.

    tldr said:
    the nfc wake requires one scan to wake and another to actually read the tag.  if there were a way to get the data at wake and not have to double tap...that would be great.

    I can't verify this idea right now, but you can setup the application to check RESETREAS if it was reset due to NFC during initialization. If it was woken up by NFC, actively perform an NFC read.

Reply
  • tldr said:
    any help in terms of wake sense pin I should use or how to actually use the driver are appreciated.  the idea is just to see all the wake features of the device and i'd start with the static threshold they've defined to see it wake.  when i do revisit; i can comment here or add it to my sample.

    I am afraid I don't have enough proficiency on the VM3310 to write up anything that can help you better than the datasheet. I recommend understanding its state machine. It looks like the DOUT signal will trigger automatically when the device is in the right mode, so it shouldn't be difficult to setup.

    Regarding the driver in the Edge Impulse application, I don't think it can be used for your need out of the box. You are better off using I2C driver if you ever need to reconfigure the microphone wake threshold.

    tldr said:
    the nfc wake requires one scan to wake and another to actually read the tag.  if there were a way to get the data at wake and not have to double tap...that would be great.

    I can't verify this idea right now, but you can setup the application to check RESETREAS if it was reset due to NFC during initialization. If it was woken up by NFC, actively perform an NFC read.

Children
No Data
Related