wow, that’s quite an achievement, thanks for sharing your work! Good to hear you already have a working variant on top of which we might iterate to get the code work on slightly different hardware.
I will be happy to assist you by code-staring and educated guessing (or pretending to do so) in order to find out the reason for the MCU freeze. While I have wrestled with similar things in the past, I ask for your understanding that it might become difficult without having actual hardware on the workbench. However, I don’t hesitate to get into the details modulo some time other obligations might require my attention.
Private vs. public or not, I feel this thread might spiral out of control when we actually start a ping pong game about discussing possible reasons and solutions for this problem, so we really should start a different one like “Feather M0 freezes when recording from a ICS43432 using I2S” for specifically naming and nailing the problem scope.
While I am relatively new to this topic and recognize the code is already working flawlessly with different hardware (kudos!), I recognized some spots in the code which sparked my interest and also found some resources on the Internet which might be related or could lead to more robust code. Maybe we can go through them together?
In the same spirit, I tried to make a start of having isolated I2S testing code without any FFT and TTN, see Basic audio recorder for ARM Cortex-M0 and ICS43432 I2S microphone · GitHub.
While I don’t know whether you have something similar on your workbench already, I am humbly asking to check out the overall system behavior when reading I2S using this minimal sketch. Please note I didn’t compile it yet as it’s really just a stripped down version of your sketch. It could either work out of the box or it might need a few adjustments regarding things I have missed.
Thanks again and keep up the spirit!
With kind regards,