cancel
Showing results for 
Search instead for 
Did you mean: 

STM32L4 DSP Instructions

dhaval
Associate II
Posted on March 08, 2016 at 12:23

Hi,

I am new to Cortex M4 based STM32L4 series MCU. I got to know that Cortex M4 supports FPU and DSP instructions. I want to use both of them in my project.

Currently I am working with STM32L4 Discovery Kit and Keil uVision 5. To enable support of Floating Point Operation I need to select the Floating Point Hardware from the 'Target' tab of Project Options. But I don't know how to enable/use the DSP instructions. Do I need to enable it explicitly?

I need to perform FFT using this MCU and DSP Instructions will help to improve the performance for the same. Can someone please help me on this?

Thanks,

Dhaval

#fpu #dspinstruction #stm32l4
1 REPLY 1
Nesrine M_O
Lead II
Posted on March 08, 2016 at 14:22

Hi dhavalv,

•To add DSP library under Keil uVision 5 go to Project>Manage>Run-Time Environment>CMSIS>>select DSP to add the CMSIS DSP software library into your project . Then add this define “ ARM_MATH_CM4�? to your Preprocessor Symbols to specify your Cortex (M4 for example). •To enable support for FPU you need to add this define into your main: #define __FPU_PRESENT 1, in fact in the SystemInit function we have this code for FPU settings:

#if (__FPU_PRESENT == 1) && (__FPU_USED == 1)
SCB->CPACR |= ((3UL << 10*2)|(3UL << 11*2)); 
/* set CP10 and CP11 Full Access */
#endif

For more details recommend you to have a look to the

http://www.st.com/web/en/resource/technical/document/programming_manual/DM000469pdf

Programming manual -Syrine-