MultipleMonomials
Active member
Hello! I'm Jamie, one of the developers of Mbed OS Community Edition. We are working on a port of Mbed OS for the Teensy 4.0 (and soon, Teensy 4.1) boards, and I need help from someone who owns a board to test our builds!
What is Mbed OS?
Mbed OS is an operating system created by ARM to aid development of code for its microprocessors, especially for networked and Internet of Things applications. Mbed OS provides a high-level C++ API that is concise and easy to use, but also provides access to many advanced features of ARM chips such as wireless communication and asynchronous operations. Thanks to its high-level API, Mbed helps you write code that can be used across of wide variety of processors without needing significant changes.
What does Mbed OS code look like?
- See a hello world example here
- See an I2C communication example here (scroll down a bit)
- See an Internet communication example here
What is Mbed CE?
Unfortunately, Mbed OS was put into maintenance mode in January 2022, after which development of new features and bugfixes by ARM stopped. Community bugfixes are still being accepted, but that's it.
To keep development on Mbed OS running, and to fix some of the idiosyncrasies created by years of ARM constantly changing direction on the project, I and several other community members created Mbed OS Community Edition (CE). To summarize, we are working on fixing longstanding bugs, improving the build system, creating better documentation, and expanding Mbed OS to support an even wider number of targets. Being blunt, we've still got a long way to go, but we are making good progress!
Why use Mbed over Arduino IDE / the Teensy Arduino core?
To be honest, if you are a casual Arduino user, and you have found everything you need in the Arduino ecosystem, Mbed may not be for you -- the Arduino ecosystem does an excellent job of making the basics well-documented and easy to use. Mbed does require some prerequisite knowledge -- you will need to be comfortable working with git, using the command line, and installing the ARM toolchain. We have a guide for this, but experience is recommended.
However, Mbed should be very useful to those of you who are working with more complex systems and are starting to push against the limits of the Arduino framework. Need to work with lots of SPI, I2C, and UART peripherals at the same time? We got you. Want an object-oriented, POSIX-like socket API that handles different transport layers, encryption, and arbitrary network interfaces? No problem. Need to create multiple threads that time-share the processor, and then exchange data between them? This is what Mbed's RTOS and EventQueue libraries are designed for. Basically, if you want to create more complex applications that squeeze all the features out of the MIMXRT1062 processor, Mbed may be what you need.
The other big benefit of Mbed OS is its build system. Gone is Mbed's obtuse and finicky build system of the past -- it has been replaced by a sleek, logically structured CMake-based build system. CMake is highly expandable, allowing you to structure your project any way that you wish. Want to create multiple executables and libraries in a single project and link them together? Have source files that are auto-generated by a script or external tool? Want to set up unit tests that run on real hardware and report results back to your computer? All of these, and more, are possible with Mbed's build system plus a little bit of CMake script written by you.
Furthermore, the build system has been optimized at every turn for rapid and convenient development. There will be no inefficiencies like waiting for full rebuilds or manually copying/flashing programs to your board. We have out-of-the-box support for two IDEs, CLion and VS Code. If you use either of these, IntelliSense works straightaway and you can build code with a single click (automatic flashing via Teensy Loader will hopefully be added soonish). [Command-line building](https://github.com/mbed-ce/mbed-os/wiki/Project-Setup:-Command-Line) is also straightforward. Since CMake is using its efficient Ninja backend, builds are multicore and code is only recompiled when strictly needed. And since the Mbed source gets added as a submodule, instead of an opaque binary, it's easy for you to view or debug the lower layers when needed.
Using Mbed on the Teensy 4.0
Mbed has been extensively tested on the MIMXRT105x line of processors, but until now, it didn't contain the correct low-level init code to boot up on the Teensy 4.0. My recent patch changes this, so it should now, theoretically, work out of the box. What I need is for someone to test this!
First of all, you may want to read the doc page I wrote that explains how this processor works with Mbed OS.
Next, you must install the toolchain per the guide here.
For starters, I'd like someone to try and build the hello world project for the Teensy 4.0 (-DMBED_TARGET=TEENSY_40). If you follow the instructions in the readme to build the project, you should see a hex file in the build directory. If you flash that hex file with Teensy Loader, you should see the board enumerate as a USB serial device which will print "Hello World" at 115200 baud. If not, something must have gone wrong, so let me know!
To sum up: I'm happy to be able to bring Mbed OS to the Teensy line, and really excited to provide another option for larger projects using these microcontrollers. But, I need support from some Teensy users to make it happen! So, please give this a shot if you're interested and able.
What is Mbed OS?
Mbed OS is an operating system created by ARM to aid development of code for its microprocessors, especially for networked and Internet of Things applications. Mbed OS provides a high-level C++ API that is concise and easy to use, but also provides access to many advanced features of ARM chips such as wireless communication and asynchronous operations. Thanks to its high-level API, Mbed helps you write code that can be used across of wide variety of processors without needing significant changes.
What does Mbed OS code look like?
- See a hello world example here
- See an I2C communication example here (scroll down a bit)
- See an Internet communication example here
What is Mbed CE?
Unfortunately, Mbed OS was put into maintenance mode in January 2022, after which development of new features and bugfixes by ARM stopped. Community bugfixes are still being accepted, but that's it.
To keep development on Mbed OS running, and to fix some of the idiosyncrasies created by years of ARM constantly changing direction on the project, I and several other community members created Mbed OS Community Edition (CE). To summarize, we are working on fixing longstanding bugs, improving the build system, creating better documentation, and expanding Mbed OS to support an even wider number of targets. Being blunt, we've still got a long way to go, but we are making good progress!
Why use Mbed over Arduino IDE / the Teensy Arduino core?
To be honest, if you are a casual Arduino user, and you have found everything you need in the Arduino ecosystem, Mbed may not be for you -- the Arduino ecosystem does an excellent job of making the basics well-documented and easy to use. Mbed does require some prerequisite knowledge -- you will need to be comfortable working with git, using the command line, and installing the ARM toolchain. We have a guide for this, but experience is recommended.
However, Mbed should be very useful to those of you who are working with more complex systems and are starting to push against the limits of the Arduino framework. Need to work with lots of SPI, I2C, and UART peripherals at the same time? We got you. Want an object-oriented, POSIX-like socket API that handles different transport layers, encryption, and arbitrary network interfaces? No problem. Need to create multiple threads that time-share the processor, and then exchange data between them? This is what Mbed's RTOS and EventQueue libraries are designed for. Basically, if you want to create more complex applications that squeeze all the features out of the MIMXRT1062 processor, Mbed may be what you need.
The other big benefit of Mbed OS is its build system. Gone is Mbed's obtuse and finicky build system of the past -- it has been replaced by a sleek, logically structured CMake-based build system. CMake is highly expandable, allowing you to structure your project any way that you wish. Want to create multiple executables and libraries in a single project and link them together? Have source files that are auto-generated by a script or external tool? Want to set up unit tests that run on real hardware and report results back to your computer? All of these, and more, are possible with Mbed's build system plus a little bit of CMake script written by you.
Furthermore, the build system has been optimized at every turn for rapid and convenient development. There will be no inefficiencies like waiting for full rebuilds or manually copying/flashing programs to your board. We have out-of-the-box support for two IDEs, CLion and VS Code. If you use either of these, IntelliSense works straightaway and you can build code with a single click (automatic flashing via Teensy Loader will hopefully be added soonish). [Command-line building](https://github.com/mbed-ce/mbed-os/wiki/Project-Setup:-Command-Line) is also straightforward. Since CMake is using its efficient Ninja backend, builds are multicore and code is only recompiled when strictly needed. And since the Mbed source gets added as a submodule, instead of an opaque binary, it's easy for you to view or debug the lower layers when needed.
Using Mbed on the Teensy 4.0
Mbed has been extensively tested on the MIMXRT105x line of processors, but until now, it didn't contain the correct low-level init code to boot up on the Teensy 4.0. My recent patch changes this, so it should now, theoretically, work out of the box. What I need is for someone to test this!
First of all, you may want to read the doc page I wrote that explains how this processor works with Mbed OS.
Next, you must install the toolchain per the guide here.
For starters, I'd like someone to try and build the hello world project for the Teensy 4.0 (-DMBED_TARGET=TEENSY_40). If you follow the instructions in the readme to build the project, you should see a hex file in the build directory. If you flash that hex file with Teensy Loader, you should see the board enumerate as a USB serial device which will print "Hello World" at 115200 baud. If not, something must have gone wrong, so let me know!
To sum up: I'm happy to be able to bring Mbed OS to the Teensy line, and really excited to provide another option for larger projects using these microcontrollers. But, I need support from some Teensy users to make it happen! So, please give this a shot if you're interested and able.