i2s peripheral not generating pointer update events when MCUBoot enabled on nrf5340 device

Hello,

As soon as we enable CONFIG_BOOTLOADER_MCUBOOT and have an operational MCUBoot image, we noticed that our audio pipeline is no longer working for our i2s omni-microphone. Specifically we fail to allocate buffers. When we pull out the bootloader configuration it works again. This is on 2.6.1 of the SDK / toolchain. After days of debugging this is what we found:

The reason for the audio errors is that the I2S peripheral is not generating pointer update events, so the ISR is not refreshing buffers and our audio thread times out after 2 seconds. We have some PDM mics as well which do not have an issue on a similar audio processing stack; it's limited to I2S. And we don't suspect anything with the I2S mic itself, as the nRF I2S peripheral generates the clocks - even if there was no mic connected, things would still run. Looked extensively at the driver changes in 2.6.1 and nothing stood out. Copied over the 2.5.2 I2S drivers into 2.6.1 and that didn't help.

Also copied the nrfx drivers from 2.6.1 into 2.5.2, and used the pre-2.6.1 FW, and that still worked.
Messed around in the debugger on the working and non-working builds and we can reproduce the behavior by poking registers, so I'm not suspecting runtime issues (though could possibly be init). We backed out bootloader, staying with SDK 2.6.1, and things work again.
But we need to get MCUBoot and the audio pipeline working. Please we are so close. So here are some questions:
  • Could this be related to enabling the internal 32 khz clock RC for mcuboot? (ie CONFIG_CLOCK_CONTROL_NRF_K32SRC_RC and CONFIG_CLOCK_CONTROL_NRF_K32SRC_500PPM)
  • Are there any hardware inits in bootloader, specifically with clocks or voltage, that may affect the running image?

Here are some things we're thinking of trying next but its a bit of a rabbit hole:

  • I don't think the symptoms indicate any pin conflicts, but check if there are any leftover configs in bootloader.
  • Is it possible to enable bootloader in 2.5.2 with older FW, just for comparison?
  • Can you hack bootloader to skip most of its operations and just transfer to the main image?
  • Is NET processor being initialized, and causing some side effect?
  • Leftover flash, or some memory layout issue which is causing second-order effects?

For reference of our configuration files, you can see here:  nRF5340 Custom Board App not booting when enabling CONFIG_BOOTLOADER_MCUBOOT 

Related