2022-09-01 05:28 AM
Hello, I'm working on a project involving voice recognition. So, I used the stm32 sensory library to complete this project and the MP23DB02MM digital MEMS PDM microphone. However, I only found one example that used STM32H747I-DISCO, so I ported it to Nulceo-F746ZG and it works fine(meaning that I could receive data and convert them to PCM and pass them to the sensory library). However, the library did not respond in any way. Because I am using an SAI peripheral, I followed the AN5027 documentation step by step.
I'll insert some photos from my code; perhaps you can help me.
the first photo is showing that I want 16K audio frequency and I managed to have it with no error.
the second one is the SAI settings.
As I mentioned before, I used this AN5027 documentation, but when it comes to the DMA setting, I put them just as they did but I get hardfault every time. the error was, as I guessed, in DMA_PDATAALIGN_HALFWORD, and DMA_MDATAALIGN_HALFWORD so I changed them to BYTES instead of HALFWORD, I know that it is not correct, but I could receive data with nay hardfault.
2022-09-01 01:15 PM
In HalfWord mode the DMA Length / Count is in 16-bit words, not 8-bit bytes
For the Hard Fault the salient code would be that initializing the actual transfer.
For Hard Faults identify what is actually faulting.