Skip to main content
ADani.2
Associate III
Nov 4, 2021 7:38 PM UTC
Solved

In STM32CubeMX, What is thread-safe-settings

..

This topic has been closed for replies.
KnarfB
KnarfBBest answer
Super User
Nov 4, 2021 9:25 PM UTC

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

6 replies

KnarfB
KnarfBBest answer
Super User
Nov 4, 2021 9:25 PM UTC

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
Nov 9, 2021 7:17 PM UTC

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
ST Technical Moderator
Nov 10, 2021 7:12 AM UTC

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
ST Technical Moderator
Dec 10, 2021 10:10 AM UTC

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
Dec 13, 2021 10:57 AM UTC
Very helpful. Thank you *Avinoam Danieli * Senior Electrical Engineer P:0722793123 m: +972-54-4629386 w: *getfabric**.com* <>