• Tracing stack and heap overflow errors

    If you have ever seen the lights of dead on your development board, accompanied by an RTX error code: 0x00000001 or Operator new out of memory message on the serial port, you have hit a memory overflow bug. Memory management remains a difficult problem on microcontrollers. Not only is memory limited, but also microcontrollers do not have an MMU and therefore cannot move memory blocks around without changing addresses. This lack of virtual memory means you have to have fixed stack sizes, so you can run into a stack overflow error even when there is still RAM available.

    Continue reading »

  • Built with mbed - Snowmelt System Monitor

    Jogging through the city center in the middle of an intense snow storm, without the risk of slipping? No problem in Holland, Michigan, where they have deployed the Snowmelt system. An ingenious system of pipes has been installed under the downtown streets, pumping hot water that is created by recycling excess heat from the local power plant. Implemented in 1988, the system is now almost 5 miles long and covers an area of 600,000 square feet (5,500 m2). At the moment, the system sends out a constant flow of water, heated to about 90 degrees Fahrenheit (32°C) - but the engineers at the Holland Board of Public Works would prefer to make informed decisions when to operate the snowmelt system. If they could get temperature information from the field (sidewalk), they could adjust pumps and valves to more efficiently operate the system to save energy. And that kind of intelligent decision-making… starts with data.

    Continue reading »

  • Using HTTP, HTTPS, MQTT and CoAP from mbed OS

    One of the biggest changes in mbed OS 5 compared to mbed OS 2.0 was the unification of network interfaces. Every interface, whether it’s Ethernet, Wi-Fi, Cellular, 6LoWPAN or Thread mesh, implements the same NetworkInterface API. This makes it easier to write portable code that matches the available connectivity method. In addition this API is easy to implement on top of any library that supports socket primitives, so porting new targets is straightforward. Recently we also added the Easy Connect library, which allows users to switch between all supported connectivity methods through a config file - tremendously helpful for tutorials and workshops.

    Continue reading »

  • Simplify your codebase with mbed-events

    Alongside the release of mbed OS 5, we also introduced mbed-events, an event loop library that can run in an RTOS thread. Using an event loop is very useful to defer execution of code to a different context. An example would be to defer execution from an interrupt context (ISR) to the main loop, or to defer execution from the high-priority thread to a lower priority thread. Now that mbed-events is part of core mbed OS 5.2, we’d like to show how this library can simplify your code.

    Continue reading »

  • Why JavaScript on microcontrollers makes sense

    Three weeks ago, during JSConf.asia 2016, we announced JavaScript on mbed, which enables developers to write firmware for IoT devices in JavaScript. This is not done by transpiling JavaScript into C++ or Assembly, but rather by running the JerryScript VM directly on top of ARM’s mbed OS 5, which can be run on cost-effective microcontrollers. This announcement caused an interesting debate, including a heated thread on the Reddit Programming subreddit with 192 comments.

    Continue reading »

  • Reducing memory usage by tuning RTOS configuration

    Two weeks ago, we blogged about optimizing memory usage for mbed OS 5.2, and today we want to show how memory usage can be decreased even further. This can be accomplished by tuning the RTOS configuration to our specific needs, or even turning off mbed RTOS altogether. This allows us to fit mbed mbed OS 5.2 on the smallest targets, like the nRF51822 which has only 6K of RAM available for user-space applications.

    Continue reading »

  • Conference videos: JSConf.asia, GDG DevFest

    A relatively busy conference season this fall: speaking arrangements on three different continents, nine talks and four workshops. Here’s videos from two conferences.

    At JSConf.asia (Singapore) I presented the work we have done on running JavaScript on $2 microcontrollers:

    Continue reading »

  • Optimizing memory usage in mbed OS 5.2

    Three months ago we released mbed OS 5, the latest version of our operating system for microcontrollers. While we added a lot of new features - including an RTOS - we also saw a bigger than expected increase in flash and RAM usage, two things that are scarce on embedded devices. Reason for Vincent Coubard, Senior Software Engineer on the mbed team, to dig through the .map files and see how we can decrease memory usage in mbed OS.

    Continue reading »

  • Using Bluetooth Low Energy from JavaScript on mbed

    Some time ago we blogged about adding JavaScript support for mbed OS 5 through the JerryScript VM. In this blog post we’ll show how you can use the Bluetooth Low Energy API from a JavaScript application. Writing your BLE application in JavaScript on mbed means enjoying the flexibility of a dynamic language while leveraging the well tested, widely used and battery friendly mbed BLE API.

    In this article we’ll write a small program in JavaScript that allows us to control an LED on our development board from a smartphone.

    Continue reading »

  • Securing the IoT evolution

    While the Internet of Things (IoT) is well-accepted as a concept, there are issues to address for secure connectivity. A proven developer platform, supported by an ecosystem of partners can speed up the creation and deployment of IoT devices based on ARM® microcontrollers. Caroline Hayes talks to Jan Jongboom, Developer Evangelist IoT at ARM.

    Continue reading »