ARMmbed

Free multi-threaded applications with mbed-os-5 and nucleo_f411re

Sorry if this is a dumb question but I am new to this whole mbed thing. I downloaded and installed mbed-cli. I then did a mbed new . This created (according to my understanding) a new project with mbed-os-5 already embedded in the project. If I then do a “mbed detect” with my nucleo_f411re connected I get:

±--------------±----------±----------±----------±----------±----------±----------+
| Target | mbed OS 2 | mbed OS 5 | ARM | GCC_ARM | IAR | ARMC6 |
±--------------±----------±----------±----------±----------±----------±----------+
| NUCLEO_F411RE | Supported | Supported | Supported | Supported | Supported | Supported |
±--------------±----------±----------±----------±----------±----------±----------+

Now, ARM (ARM Compiler 5), IAR and ARMC6 (ARM Compiler 6) all require licenses so GCC_ARM is the only free toolchain I can use with my board (are there other board that does support GCC Newlib?). But according to:

https://docs.mbed.com/docs/mbed-os-handbook/en/5.1/concepts/thread_safety/

GCC_ARM only support single thread applications. So my question is this: If I am not willing to buy a license, will I only be able to write single-threaded applications? Or will I be able to write multi-threaded applications but I will need to ensure thread safety myself (none of the built-in thread safety of mbed-os-5 will work so I need to ensure it myself)? Or is this an error in the documentation? What am I missing?

I realize that I should rather post this question at https://os.mbed.com/questions/create but for some reason there is no captcha for me to fil in but the site keeps telling me “Captcha incorrect”

Hi,
I think the source of confusion here is the inter-changeable use of “GCC” and “GCC_ARM” in the mbed documentation. The GCC toolchain available for download at this url uses Newlib and the MbedOS 5 implementation is thread safe:
https://developer.arm.com/open-source/gnu-toolchain/gnu-rm/downloads

So to answer your question, you would be able to use the free GCC toolchain and create multi-threaded applications using mbedOS 5 based on you current installation of mbedCLI and the GCC toolchain that ships with it (if you install from the windows installer)

https://os.mbed.com/docs/v5.6/tools/setup.html#choosing-your-environment

-mbed Support

As Senthil said, GCC_ARM is thread-safe when using with newlib (the default). If you’re using nanolib (via a linker flag) it’s not thread safe.