Important changes to forums and questions
All forums and questions are now archived. To start a new conversation or read the latest updates go to forums.mbed.com.
8 years ago.
What is inside mbed?
Dear All,
I am a newcomer in the world of mbed with lots of enthusiasm to learn more on mbed.
I wold like to know few things
1. mbed is a compiler or interpreter ? I saw somewhere inside documentation that mbed interprets, But there is online compiler as well. Confused !!
2. is there any bootloader inside mbed boards ? How the hardware is showing as an sd card and running the binary files we copied into that ? But the mbed wiki tells there is no bootloader !
3. is there any way to add mbed feature to our custom PCBs with ARM controller ?
thank in adcvance
3 Answers
8 years ago.
Hi Sanu,
1. mbed is a compiler or interpreter ?
mbed provides an online compiler which produces binaries. There have been some projects to allow interpreted languages such as python and javascript to run on mbed platforms but the majority of mbed users are writing C++ which is compiled.
2. is there any bootloader inside mbed boards ?
Most mbed boards have 2 microcontrollers, one is the target where your code will run and the other is referred to as the interface chip. The interface chip provides the USB drive based programmer and will write that program to the target microcontroller.
There are a few exceptions to this where the target microcontroller has this capability built in. The NXP LPC11U24 based Seeeduino Arch, LPC11U35 Quick Start Board from Embedded Artists are a couple that don't have a separate microcontroller for the interface.
3. is there any way to add mbed feature to our custom PCBs with ARM controller ?
Absolutely.
You can find some information and examples for doing that here.
8 years ago.
The mbed online version uses a browser based development environment with editor, C++ compiler etc running on cloud based servers. The resulting binary code is downloaded to your local PC and mbed hardware platform. This code is compatible with any hardware that uses the same processor as the one your source code was compiled for in the mbed online environment. There is also an offline development option that requires locally installed editors, compilers etc. So mbed C++ code is compiled, not interpreted. I do think some people have worked on C++ based interpreters for other languages (eg Basic..) that allow you to run some code in that language on an mbed platform that runs the interpreter.
Many ARM processors do have bootloader code inside the device to allow programming using a serial port or even a USB port. However, the mbed supported hardware platforms typically have a separate interface device on the circuit board. This separate device is usually also an ARM processors that appears as USB memory stick when connected to your host PC. This interface device will flash the target processor with your binary code when you drag & drop that code to the emulated USB memory stick. The mbed interface also supports a virtual serial port that allows you to debug the target processor using printf messages.
You can find the hardware schematic and software for the mbed interface device on this website. Note however that not all platforms are supported by the provided reference hardware design and software. Basically you are limited to the NXP and Freescale devices. The mbed interface software for ST and other platforms are not open source. You can however use the STLink interface hardware from ST nucleo's to program your own devices on custom PCBs, you can also use generic flash programmers like Segger JLink to flash your targets. In case you really need your own interface hardware on significant numbers of custom PCBs you should get in touch with mbed and/or the processor vendor to discuss options.
8 years ago.
I'll try to answer your questions as posted: 1. mbed is a compiler or interpreter ? I saw somewhere inside documentation that mbed interprets, But there is online compiler as well. Confused !! No interpreter. The code is c/c++ code compiled to binary by the web-based compiler.
2. is there any bootloader inside mbed boards ? How the hardware is showing as an sd card and running the binary files we copied into that ? But the mbed wiki tells there is no bootloader ! The secondary processor appears as a virtual drive to the PC. No bootloader in the main processor used by mbed.
3. is there any way to add mbed feature to our custom PCBs with ARM controller ? Absolutely. We only do custom versions of mbed-boards based on vendor mbed boards. No issues at all. However you might need to get specialized support if you want to use the 2nd processor for debug/com/download. This can be tricky especially if using ST. If you are just using the basic processor then you can customize mbed by adding "mbed-dev" to your project and change the unique target settings. The online compiler can be used for this and will generate a "bin" file. If you need other formats then you might want to explore how to build mbed offline.