cancel
Showing results for 
Search instead for 
Did you mean: 

Using std::mutex with STM32H7B3I

FMarr.2
Associate III

I got an error when try to use std::mutex, std::lock and similar.

There is a define _GLIBCXX_HAS_GTHREADS that prevents compiling of .

Is there a way to define it from compilation or an implementation of std::mutex in RTOS?

Best Regards

3 REPLIES 3
Amel NASRI
ST Employee

Hi @Community member​ ,

To allow the community to help you, you need to provide some more details:

  • are you using an example available in STM32CubeH7 package? If yes, which package version?
  • or may be you generate the code with STM32CubeMX? Please share the .ioc file in this case.
  • which IDE?

-Amel

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.

FMarr.2
Associate III

This is the full project:

STM32CubeIde 1.5

All necessary files are included.

Thank you very much

FMarr.2
Associate III

Hello Amel NASRI,

thanks for your interesting in the problem.

I think my problem is:

I would like to use some funtionality, for example std::mutex. From standard namespace.

A mutex depends on the O.S. Can be implemented by mean of a semaphore for example.

For RTOS, it seems this implementation is not available or at least is protected by a define not defined.

Is it possible somehow to enable the implementation?

Someone did this job, https://embeddedartistry.com/blog/2018/02/01/implementing-stdmutex-with-threadx/

but for me is not clear how to fit in STM32CubeIde.

Best Regards