Skip to main content
ADani.2
Associate III
November 4, 2021
Solved

In STM32CubeMX, What is thread-safe-settings

  • November 4, 2021
  • 2 replies
  • 3092 views

..

This topic has been closed for replies.
Best answer by KnarfB

For a long time, the standard library was not RTOS aware. I.e. functions like malloc behaved badly when a RTOS scheduler kicked in. This was fixed recently by the new dialog box. If you say yes, a thread-safe version of the library is used which induces some overhead. For non-RTOS code, answering no is fine.

disclaimer: did not test the new behaviour

hth

KnarfB

2 replies

KnarfB
KnarfBBest answer
Super User
November 4, 2021

For a long time, the standard library was not RTOS aware. I.e. functions like malloc behaved badly when a RTOS scheduler kicked in. This was fixed recently by the new dialog box. If you say yes, a thread-safe version of the library is used which induces some overhead. For non-RTOS code, answering no is fine.

disclaimer: did not test the new behaviour

hth

KnarfB

ADani.2
ADani.2Author
Associate III
November 9, 2021

There are 6 different options in this dialog box. What is the use of each option. Is there any documentation.

Thank you,

Sara BEN HADJ YAHYA
Technical Moderator
November 10, 2021

Hi @ADani.2​ ,

For now, there is no documentation on thread safe settings but the request of documentation is already reported internally.

I will keep you posted with the updates.

Regards,

Sara.

In order to give better visibility on the answered topics, please click on 'Best answer' on the reply which solved your issue or answered your question.
Sara BEN HADJ YAHYA
Technical Moderator
December 10, 2021

Hello,

Please check the AN5731 which is now available in https://www.st.com, it describes the thread-safe solution, implemented in STM32CubeMX and STM32CubeIDE.

Direct link: https://www.st.com/resource/en/application_note/an5731-stm32cubemx-and-stm32cubeide-threadsafe-solution-stmicroelectronics.pdf

Regards,

Sara.

In order to give better visibility on the answered topics, please click on 'Best answer' on the reply which solved your issue or answered your question.
ADani.2
ADani.2Author
Associate III
December 13, 2021
Very helpful. Thank you *Avinoam Danieli * Senior Electrical Engineer P:0722793123 m: +972-54-4629386 w: *getfabric**.com* <>