2013-01-28 09:58 AM
Hello All,
I have recently started working with the STM32F0, and am trying to implement a PDM Microphone. In order to do this, I am using a library file provided by ST which has some functions for filtering PDM data. I am currently using IAR for development, and I have found that when I include the library and use one of the functions from it, when I go into debugging mode, the processor immediately goes into the HardFault_Handler. Normally, debugging would stop at the first instruction and you have to press play to start the program, but this jumps to the hardfault before ever reaching that first instruction. This occurs only when my program uses a function from the library; if I have the library added but no functions are called, it goes into debugging mode normally and runs fine. I have seen references to this maybe relating to the fact the library could be using ARM instructions. I am unsure if this is the issue, and if it is, I am unsure how to fix the problem, specifically in IAR. If anyone knows what might be going on, or how to fix this, any help would be appreciated. Thanks in advance. The library I am using is libPDMFilter_IAR.a, with pdm_filter.h, which are files provided directly from ST. Specs:Windows 7, 64 bit. IAR Embedded Workbench for ARM v6.40.4.4221 #stm32f0-pdm-filter-library2013-01-28 10:28 AM
One might assume it hard faults because you are trying to execute an instruction that is outside the subset supported by the Cortex-M0. You could examine the processor state and determine the instruction which is faulting.
But isn't the library you're trying to use for the Cortex-M4 with a FPU? That definitely isn't going to work on an M0.2013-01-29 07:31 AM