views:

215

answers:

3

I work for a company that created firmware for several device using FreeRTOS. Lately our request for new features has surpassed how much work our firmware engineers are capable of, but we can't afford to hire anyone new right now either. Making even tiny changes requires firmware people to go in and modify things at a very low level.

I've been looking for some sort of interpreted language project for FreeRTOS that would let us implement new features at a higher level. Ideally I would like to get things eventually so the devices become closer to generic computers with us writing drivers, rather than us having to implement every feature ourselves.

Are there any FreeRTOS projects that interpret java, python or similar bytecode?

I've looked on google, but since I'm not a firmware engineer myself I'm not sure if I'm looking for the right keywords.

Thanks everyone

+5  A: 

I don't think the RTOS, or even the OS, matters too much here if the code is portable. Depending on your input & output scheme, you'll probably need to do a little porting.

Regarding embeddable scripting languages, the 2 I'm familiar with are LUA and PAWN.

I think there are versions of Python & other such languages ported to embedded systems, but they tend to be the embedded Linux variety. Depending on your platform (no idea if it's a little MCU with 8K ROM or an embedded PC) that might be an option.

Dan
+1 for Lua; it's worth investigating.
Peter K.
Agreed. I have used Python 1.x on a 1mb RAM 32bit embedded system and it was tight then. Python 2.6 on a 1mb ram 32 bit embedded system would probably be nearly impossible.
Warren P
A: 

I guess your question boils down ultimately to finding ways of increasing the level of abstraction above the low-level RTOS mechanisms. While it is perhaps true that interpreted languages work at somewhat higher level of abstraction than C, you can do much better than that by applying methods based on event-driven frameworks and state machines. Such event-driven frameworks have been around for decades and have been proven in countless embedded systems in all sorts of domains. Today, virtually every modeling tool for embedded systems capable of code-generation (e.g., Rational-Rose RT, Rhapsody, etc.) contains a variant of such a state-machine framework.

But event-driven, state-machine frameworks can be used also without big tools. The QP state machine frameworks (state-machine.com), for example, do everything that a conventional RTOS can do, only more efficiently, plus many things that an RTOS can't.

When you start using modern event-driven programming paradigm with state machines, your problems will change. You will no longer struggle with 15 levels of convoluted if-else statements, and you will stop worrying about semaphores or other such low-level RTOS mechanisms. Instead, you'll start thinking at a higher level of abstraction about state machines and events exchanged among them. After you experience this quantum leap, you will never want to go back to the raw RTOS and the spaghetti code.

Miro Samek, state-machine.com

Miro
No I think he asked about scripting languages and you have given him a lecture on the benefits of state machines. State machines are wonderful. But they are not a scripting language, which is what the OP asked about.
Warren P
+1  A: 

There are no interpreted languages out there that are "made" to use FreeRTOS, or any other microcontroller threading library (loosely called an 'RTOS' within the e2e community).

However, languages which I have first hand experience using in embedded systems that are (a) written in C, and (b) small enough to embedded in a microcontroller include:

  • LUA (suitable for almost anything, even some PICs)
  • Python (suitable for most ARM architectures, anyways, with more than 1mb ram)

I do not have first-hand experience with it, but Ruby may be as easy to embed as Python.

Warren P