I am developing an embedded application in LM3S6965 evaluation board using Keil C compiler. Is there any option for creating multithreaded embedded application?
-
2Are you using any operating system? There are many small multi-tasking operating systems for embedded platforms. – Some programmer dude Oct 08 '12 at 06:36
-
2To clarify my previous comment... The language itself doesn't really have "threads", it's just using the underlying operating systems functionality for threads. Even in the case of C11 which might have threads, it's still using the underlying OS to provide the actual threads. C11 just standardizes the API so it's common between different C11 compliant compilers. – Some programmer dude Oct 08 '12 at 06:44
-
I don't believe Keil supports C++11 anyway, so Shihab's going to need a multithreading OS. – Martin Oct 08 '12 at 06:49
-
3@Martin C11 is not C++11. Upgrading a C compiler to C11 should be much simpler than to upgrade C++ to C++11. – Jens Gustedt Oct 08 '12 at 07:00
-
Ahh, I wasn't aware of C11 :). – Martin Oct 08 '12 at 07:05
-
Exactly what tool do you have? I am not aware that Keil sell the stand-alone compiler but rather the MDK-ARM suite (which inclused an RTOS kernel library). The compiler itself is ARM's rather than Keil's since Keil's acquisition by ARM. If you have Keil's legacy C compiler I would be surprised if it supported Cortex-M devices. – Clifford Oct 08 '12 at 19:06
2 Answers
You might want to check out FreeRTOS. It's a pretty simple and light-weight OS that will give you multithreading.
There are lots of other light-weight OSes too.

- 3,703
- 2
- 21
- 43
-
FreeRTOS is the only free OS I have first hand experience with on ARM. ucos is also great, but is not free. – Martin Oct 08 '12 at 09:40
-
vxworks is also paid OS. some flavour of minimal Linux os also use in embedded application right? – Jeegar Patel Oct 08 '12 at 09:49
-
Yep. I've also used ucLinux (albeit not on ARM), but it's much heavier weight than a microkernels. – Martin Oct 08 '12 at 09:54
-
I assume by "Keil C compiler" he means Keil MDK-ARM, which already includes an RTOS kernel library. – Clifford Oct 08 '12 at 19:10
-
-
1Other random options for you... http://chibios.org, Keil RTX (probably already in your compiler as Clifford describes), http://ecos.sourceware.org/, http://www.avix-rt.com/ – Ross Oct 08 '12 at 21:31
-
@Clifford i have successfully ported minimal Linux on omap4 and then run my application on that..! yea for smaller processor i dont think linux will work succesfully.. – Jeegar Patel Oct 09 '12 at 04:10
-
@Mr.32: Indeed; LM3S6965 is a 50MHz Cortex-M3 with 64KB SRAM and 256KB of Flash, and has no MMU. Not a platform for Linux. – Clifford Oct 09 '12 at 18:44
Multi-threading is not an intrinsic part of C, so is not provided by the compiler at all, but rather by libraries. In that respect, multi-threading can be implemented using any C compiler; it is more a case of choosing (or writing) a suitable library.
Many RTOS kernels exist for ARM Cortex-M, but the the Keil MDK-ARM includes the RTX real-time OS library which supports multi-threading.
The uVision IDE explicitly has an option to include the RTX library, and the debugger has a rudimentary level of kernel awareness. RTX itself is fairly primitive, but suited to small projects, and all of Keil's other middle-ware such as TCP/IP, USB, CAN and filesystem work with it directly.

- 88,407
- 13
- 85
- 165