cancel
Showing results for 
Search instead for 
Did you mean: 

Need help with VScode + cmsis arm_math.h

Leon_D
Associate II

Hi Guys, I'm new about VScode. I try to use arm_math.h in my program. but after i set include path in json file, the vscode can't find the function. and give me the message <<Function definition for 'arm_mat_init_f32' not found.C/C++>> my board is nucleo -H723ZG

and i also try to connect the library in the st-project.cmake like below

target_link_libraries(
${TARGET_NAME} PRIVATE
"arm_cortexM7l_math"
)
target_link_directories(
${TARGET_NAME} PRIVATE
"${PROJECT_SOURCE_DIR}/Middlewares/ST/ARM/DSP/Lib/"
)
 
and set 
add_definitions(-DARM_MATH_CM7)
add_definitions(-D__FPU_PRESENT)
but it still doesn't work. anyone can give me some idea about it?
1 ACCEPTED SOLUTION

Accepted Solutions
Leon_D
Associate II

Hi Guys,

I'm not pretty sure the real reasion for this issure. but I have only modified 2 places.

A: I added 3 library in the st_project.cmake like below:

target_link_libraries(
${TARGET_NAME} PRIVATE
arm_cortexM7lfdp_math
arm_cortexM7lfsp_math
arm_cortexM7l_math
)
and i still have some issue when put arm_cortexM7l_math on top, I try to put it on the buttom, it works.
 
B: I put the arm_mat_init_f32() in a function in source file instead of put it on top of a .c file directly.
when I rebuild and debug, the alarm disappeared.
But i don't have enough time to test the math function works properly or not. So far, there is no any issue.

View solution in original post

5 REPLIES 5
Leon_D
Associate II

Thanks Guys, I fix it. but I do't know how to delete this post.

Don't delete the post!

Instead, add a reply describing what the problem was, and how you fixed it, and then mark that as The Solution - that way you will help future readers who may come along looking for help with the same problem.

Leon_D
Associate II

Hi Guys,

I'm not pretty sure the real reasion for this issure. but I have only modified 2 places.

A: I added 3 library in the st_project.cmake like below:

target_link_libraries(
${TARGET_NAME} PRIVATE
arm_cortexM7lfdp_math
arm_cortexM7lfsp_math
arm_cortexM7l_math
)
and i still have some issue when put arm_cortexM7l_math on top, I try to put it on the buttom, it works.
 
B: I put the arm_mat_init_f32() in a function in source file instead of put it on top of a .c file directly.
when I rebuild and debug, the alarm disappeared.
But i don't have enough time to test the math function works properly or not. So far, there is no any issue.

@Leon_D wrote:
i still have some issue when put arm_cortexM7l_math on top, I try to put it on the bottom, it works.

What happens if you just remove it completely?

 


@Leon_D wrote:

Hi Guys,

I put the arm_mat_init_f32() in a function in source file instead of put it on top of a .c file directly.

Not sure what you mean by that?

 

I got msitake from code below:
#include "arm_math.h"
float32_t pDataA[9] = {1.1f, 1.1f, 2.1f, 2.1f, 3.1f, 3.1f, 4.1f, 4.1f, 5.1f};
arm_matrix_instance_f32 SrcB;
 
So , I put it in a function as below, it works.
void abc(void)
{
arm_matrix_instance_f32 SrcA; 
arm_mat_init_f32(&SrcA, 3, 3, pDataA);
}