cancel
Showing results for 
Search instead for 
Did you mean: 

Query on PDM filter coming with STM32F4-Discovery firmware package (stsw-stm32068.zip)

raghavendra23
Associate II
Posted on July 30, 2013 at 11:05

I am working on developing audio blocks for STM32F4-Discovery board.  In my application I am using CMSIS (Version: 3.20) math library CMSIS\Lib\GCC\libarm_cortexM4lf_math.a.  To compile my application i am using compiler flag -mfloat-abi=hard with GNU toolchain.

Due to this, i am unable to link my application with ''STM32F4-Discovery_FW_V1.1.0\Utilities\STM32F4-Discovery\libPDMFilter_GCC.a''. The following error is occuring when trying to link

error: ../audio_example.elf uses VFP register arguments, STM32F4-Discovery_FW_V1.1.0/Utilities/STM32F4-Discovery/libPDMFilter_GCC.a(pdm_filter.o) does not

I need

libPDMFilter_GCC.a

library built with -mfloat-abi=hard.  Please let me know, how to get this library.

#stm32f4-discovery-pdm-filter
13 REPLIES 13
Posted on December 06, 2016 at 14:50

Hello,

In the cube package is present a libPDMFilter_CM4F_GCC.a version compiled for hardware floating point. 

As addition to use the hardware floating point the floating point co-processor must be enabled in CortexM4 core register CPACR(disabled by default). It will cause hardfault error, when the floating point instruction is executed.

Last part is related to the PDM library, where the library is checking if is on STM32 hardware by using CRC periphery. For this purpose the CRC clocks must be enabled before the PDM library is used. 

Best regards

Radek

Posted on December 06, 2016 at 16:15

Hi radek.

You are talking about fp coprocessor. I believe it is enabled by CubeMX by default. Is that correct? Because when i used the old PDM lib in my current project (created by cubeMX, my IDE throw an error on me saying that my project is using hardware float and the lib is compiled with soft fp option ...

Thanks for clarification.

Jan 
Posted on December 06, 2016 at 16:28

The FPU is typically enabled in the SystemInit() code called prior to main() in the CMSIS model. I've also seen it done in startup code.

Are we sure the library was built with the Hard ABI or the Soft?

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..
Posted on December 07, 2016 at 09:49

The 'new library' proided by STOne-32 upper in this thread is definitely build with hardware fp option - so it seems to be working for me. The 'old one' i found for example in fw example package for stm32f4 discovery is build with software fp.