2014-01-22 01:08 AM
Hi, can someone help me solve a problem on PDM Filter Init function:
PDM_Filter_Init() cannot return from it in second invoke.How can we reset the function and call it again?Thanks! .......... RCC->AHB1ENR |= RCC_AHB1ENR_CRCEN; Filter.LP_HZ = 8000; Filter.HP_HZ = 10; Filter.Fs = 16000; Filter.Out_MicChannels = 1; Filter.In_MicChannels = 1; PDM_Filter_Init((PDMFilter_InitStruct *)&Filter); ........... RCC->AHB1ENR |= RCC_AHB1ENR_CRCEN; Filter.LP_HZ = 8000; Filter.HP_HZ = 10; Filter.Fs = 32000; Filter.Out_MicChannels = 1; Filter.In_MicChannels = 1; PDM_Filter_Init((PDMFilter_InitStruct *)&Filter);//will dead loop here .................2014-01-22 07:09 AM
I don't see the value of enabling the CRC unit the second time around.
I'm not familiar with the code in question. So does the second invocation crash into a Hard Fault or something, or is it getting stuck in a loop internally.2014-01-23 01:08 AM
It is getting stuck in a loop internally.
I found the solution: Add reset CRC DR ,it work well. .......... CRC->CR = CRC_CR_RESET;//Reset CRC DR RCC->AHB1ENR |= RCC_AHB1ENR_CRCEN; Filter.LP_HZ = 8000; Filter.HP_HZ = 10; Filter.Fs = 16000; Filter.Out_MicChannels = 1; Filter.In_MicChannels = 1; PDM_Filter_Init((PDMFilter_InitStruct *)&Filter); ........... CRC->CR = CRC_CR_RESET;//Reset CRC DR RCC->AHB1ENR |= RCC_AHB1ENR_CRCEN; Filter.LP_HZ = 8000; Filter.HP_HZ = 10; Filter.Fs = 32000; Filter.Out_MicChannels = 1; Filter.In_MicChannels = 1; PDM_Filter_Init((PDMFilter_InitStruct *)&Filter);//will dead loop here .................