2022-11-25 07:31 AM
I was looking for using the Eigen library with stm32cubeide, but after adding the library, the compiler says it can not find cmath library. I tried to change the project to c++, but the error was persistent. Anyone has any sort of experience?
2022-11-26 09:28 AM
A detailed description of the original compiler/linker commands and errors could help to nail your issue down.
hth
KnarfB
2022-11-27 07:41 PM
@KnarfB The problem of adding the library is now solved by changing the main file .c to .cpp, since cmath is a cpp library, but it seems this library is not thread-safe. After doing the first time multiplication or other linear algebra algorithms, the specified task doesn't run for the second time.
2022-11-28 12:50 AM
Hello @Vahid Ajallooeian
Is your application single threaded or do you call the Eigen API from multiple RTOS tasks or both main application and interrupt context?
Trying to understand what you mean with thread safe issue.
Check this link describing the thread safety solution with STM32Cube tool.
To give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.
2022-12-22 09:17 PM
@Semer CHERNI Sorry for late reply. Iran internet is locked by mullas.
My program is multithreaded by using freeRTOS. Formerly I was able to do matrix multiplication in pure handy method, so I know that it is possible. Now when I want to use the Eigen library in the thread while other tasks are running, the task which should do the linear algebra algorithms run only once. It seems to me that the Eigen is not thread safe as if in the documentation three is "no" sort of declaring that "it is thread safe". so I rolled back into the hand made multiplication. Did I miss something to achieve running Eigen if it is threadsafe?
2024-02-15 09:24 PM - edited 2024-02-15 09:27 PM
I encountered the same problem in freertos as well, is there any solution for using eigen in multithreading? or any suggestion to use eigen in freertos?
2024-03-21 01:03 AM
Hi, I'm writing to you because you wrote recently.
I have exactly this problem, did you manage to solve it by chance?