running multiple program/module in mbed

06 Jul 2011

Hi, I went through several coding samples to gain experience with mbed as beginner. So far, in all samples, 1) the sample is compiled into a bin file 2) loaded bin file into embed through usb 3) reset mbed and mbed will auto load and execute the bin

my questions are: a) if i have several bin files compiled from different code (each with its main()), and all of them are loaded into mbed, does mbed will load and execute them all?

b) if a) is true, what is sequence that mbed load these module? can i have any control of it?

c) if a) is false, how can I run multiple modules sametime, for example, some basic modules such as ethernet,serial communication module, I want to run them as basis services on mbed and many other application module can use these basic services or driver (or does mbed has OS, drive, device concept at all)

d) what are the mbed's general model to run multiple application processes/modules and communication with each other?

Thanks for being patient and helpful.

06 Jul 2011

a) No. It flashes the target device with teh most recent bin file. If the target device *is* the most recent bin file, no flash programming occurs and the latest bin file executes. If you upload a new (more recent) bin then that will cause a flash programming sequence and *that* bin file will be the one to execute.

b) no relevent.

c) You need an RTOS. There are ports of scmRTOS (google for it, "mbed scmRTOS") and a recent new lightweight one called mbos (again google "mbed mbos")

d) There's little for RTOS at the moment. But the folks over at Mbed are working on smething. But don't hold your breathe, there won't be anything in the near future afaik.

26 Jan 2012

Hi all,

I tested Andrew L's mbos. A really nice and dependable operating system. It runs on the testbench at this moment.

The current running tasks are:

1. Communicating with two LCD displays (2x16 and 4x20)

2. Interfacing two QEI encoders

3. Reading a 16-key keypad

4. Reading a "set-up" key and switching a "set-up mode" led

5. Updating an internal run-time counter

6. USB communications

So far everything runs smoothly and without any problems. The OS is stable and does a very nice job.

Regards, Willem Braat (Netherlands)