Hi there,
I've got an nRF5340 DK that is connected to a MEMS microphone. The pin assignments are correct and I've verified good clock and data signals (all 2ms of it) to the MEMS mic, all within the spec of the mic's datasheet.
When my application runs, I issue the trigger dmic_trigger(mic, DMIC_TRIGGER_START) and immediately try to pull data from the kernel's memory slab, however it's failing and giving the reason that the buffer is bad. Here's the example code snippet:
dmic_trigger(mic, DMIC_TRIGGER_START); void* mem_block; size_t size; int read_rc = dmic_read(mic, 0, &mem_block, &size, 10); LOG_INF("dmic_read: %d, bytes: %zu\n", read_rc, size); dmic_trigger(mic, DMIC_TRIGGER_STOP);
[00:00:00.424,957] <inf> dmic_nrfx_pdm: PDM clock frequency: 1032258, actual PCM rate: 16129 [00:00:01.486,114] <err> dmic_nrfx_pdm: No room in RX queue (-35) 0x20008548, 0x20008558 [00:00:01.494,873] <err> dmic_nrfx_pdm: Failed to set buffer: 0x0bad000b (sz: 0) [00:00:01.502,929] <inf> mic_thread: dmic_read: 0, bytes: 0
The memory slab is initialized as so:
K_MEM_SLAB_DEFINE(mem_slab, 328, 256, 4);
What could be going on with this? is it an allocation issue?