2212 views|5 replies

1237

Posts

66

Resources
The OP
 

【NUCLEO-L552ZE Review】+FFT Test [Copy link]

This post was last edited by dql2016 on 2021-1-16 16:59

The MCU used in the NUCLEO-L552ZE board is STM32L552ZET6. The STM32L552xx is based on the Cortex-M33 core , the Armv8-M with Mainline extension instruction set , and has a single-precision floating-point unit (FPU) . All data types support ARM single-precision data processing instructions and complete DSP instructions . It has excellent digital signal processing performance.

The firmware package STM32CubeL5 officially provided by ST contains a project for generating a DSP library, and users can use it to generate the lib library themselves.

STM32Cube_FW_L5_V1.3.0\Drivers\CMSIS\DSP\Projects\ARM\arm_cortexM_math.uvprojx
") rgba(220, 220, 220, 0.5); top: -15px; left: 0px; display: block;">

Generate the library file arm_ARMv8MMLldfsp_math.lib .

Or use the ST official generated

STM32Cube_FW_L5_V1.3.0\Drivers\CMSIS\DSP\Lib\ARM\arm_ARMv8MMLldfsp_math.lib
") rgba(220, 220, 220, 0.5); top: -15px; left: 0px; display: block;">
ProjectName\Drivers\CMSIS\DSP\Lib\ARM\arm_ARMv8MMLldfsp_math.lib
") rgba(220, 220, 220, 0.5); top: -15px; left: 0px; display: block;">

The file name means: Armv8-M Mainline, Little endian, DSP instructions, Single Precision Floating Point Unit

Use stm32cubemx to create a blank project, add the lib library file arm_ARMv8MMLldfsp_math.lib and the include path ProjectName\Drivers\CMSIS\DSP\Include (the path where arm_math.h is located) to the project.

Use AC6 compiler, hardware single precision floating point.

Add USE_HAL_DRIVER,STM32L552xx,ARM_MATH_CM33,_FPU_USED=1U to Define

Also add -fshort-enums -fshort-wchar in Misc Controls

Otherwise, compilation fails.

The FFT calculation test code based on the official one is as follows:

#include "arm_math.h"
#include "arm_const_structs.h"

#include "main.h"

#define TEST_LENGTH_SAMPLES 2048

/* -------------------------------------------------------------------
* External Input and Output buffer Declarations for FFT Bin Example
* ------------------------------------------------------------------- */
extern float32_t testInput_f32_10khz[TEST_LENGTH_SAMPLES];
static float32_t testOutput[TEST_LENGTH_SAMPLES/2];

/* ------------------------------------------------------------------
* Global variables for FFT Bin Example
* ------------------------------------------------------------------- */
uint32_t fftSize = 1024;
uint32_t ifftFlag = 0;
uint32_t doBitReverse = 1;

/* Reference index at which max energy of bin ocuurs */
uint32_t refIndex = 213, testIndex = 0;

/* ----------------------------------------------------------------------
* Max magnitude FFT Bin test
* ------------------------------------------------------------------- */

arm_status status;
float32_t maxValue;
uint32_t time1;
uint32_t time2;
	
int32_t test(void)
{

  status = ARM_MATH_SUCCESS;
	
	time1=HAL_GetTick();
	
  /* Process the data through the CFFT/CIFFT module */
  arm_cfft_f32(&arm_cfft_sR_f32_len1024, testInput_f32_10khz, ifftFlag, doBitReverse);

  /* Process the data through the Complex Magnitude Module for
  calculating the magnitude at each bin */
  arm_cmplx_mag_f32(testInput_f32_10khz, testOutput, fftSize);

  /* Calculates maxValue and returns corresponding BIN value */
  arm_max_f32(testOutput, fftSize, &maxValue, &testIndex);
	
	time2=HAL_GetTick();

  if (testIndex !=  refIndex)
  {
    status = ARM_MATH_TEST_FAILURE;
  }

  /* ----------------------------------------------------------------------
  ** Loop here if the signals fail the PASS check.
  ** This denotes a test failure
  ** ------------------------------------------------------------------- */

  if ( status != ARM_MATH_SUCCESS)
  {
    while (1);
  }

	printf("test ok,time=%dms\r\n",time2-time1);
	
  while (1);                             /* main function does not return */
}
") rgba(220, 220, 220, 0.5); top: -15px; left: 0px; display: block;">

From the test results, it can be seen that it only takes 1 millisecond to complete the 1024-point FFT calculation, and the DSP performance is greatly improved compared to the M7 core.

Test Engineering:

stm32l552zet6qu_test.7z (5.98 MB, downloads: 2)

This post is from stm32/stm8

Latest reply

From the test results, it only takes 1 millisecond to complete the 1024-point FFT calculation, and the DSP performance is greatly improved compared to the M7 core. ? Is the M33 not as awesome as the M7?   Details Published on 2021-1-25 21:40

赞赏

1

查看全部赞赏

 

1237

Posts

66

Resources
2
 

The insertion code is a bit difficult to use. I don’t know why the display is a bit problematic.

This post is from stm32/stm8
 
 

1942

Posts

2

Resources
3
 

The layout in the front is a bit confusing to me! Haha, but thanks for sharing!!!

This post is from stm32/stm8

Comments

I don't know why the inserted code is like this, and re-editing doesn't work  Details Published on 2021-1-18 18:25
 
 

1237

Posts

66

Resources
4
 
w494143467 posted on 2021-1-18 14:57 The layout of the previous article made me a little dazzled! Haha, but thanks for sharing!!!

I don't know why the inserted code is like this, and re-editing doesn't work

This post is from stm32/stm8

Comments

There may be some minor bugs  Details Published on 2021-1-19 11:50
 
 
 

1942

Posts

2

Resources
5
 
dql2016 posted on 2021-1-18 18:25 I don't know why the inserted code is like this, and re-editing doesn't work

There may be some minor bugs

This post is from stm32/stm8
 
 
 

266

Posts

0

Resources
6
 

From the test results, it only takes 1 millisecond to complete the 1024-point FFT calculation, and the DSP performance is greatly improved compared to the M7 core. ?
Is the M33 not as awesome as the M7?

This post is from stm32/stm8
 
Personal signature

gitee/casy

 
 

Just looking around
Find a datasheet?

EEWorld Datasheet Technical Support

EEWorld
subscription
account

EEWorld
service
account

Automotive
development
circle

Copyright © 2005-2024 EEWORLD.com.cn, Inc. All rights reserved 京B2-20211791 京ICP备10001474号-1 电信业务审批[2006]字第258号函 京公网安备 11010802033920号
快速回复 返回顶部 Return list