We have been working on creating an easier way for the mbed community to use the pyOCD library for programming and debugging the ARM® Cortex®-M microcontrollers using CMSIS-DAP. Here is an update on our work.
Driving force for this project:
The pyOCD library provided by mbed is quite powerful. However, installing it manually on an OS can be very time consuming and error prone. Multiple Python libraries need to be configured and the mixture of 32-bit and 64-bit Python libraries can be troublesome for those who are not very familiar with Python.
So the above circumstances have been the driving force for our embedded toolchain group to start such a binary release project. Our aim is to provide a stable and standalone gdb server based on pyOCD, which can be used directly along with our toolchain without any installation and configure.
Current development status:
We are now posting a weekly release on Launchpad. We have also established a daily test routine based on Jenkins to test the binary releases against NXP’s LPC1768 and Freescale’s FRDM-KL46Z platforms on Windows 7 32-bit/64-bit and Ubuntu 10.04 LTS.
Up till now, we have only supported Windows 7 and Linux because Mac OS has not been formally supported by pyOCD trunk. For the Linux release, we have only tested the pyOCD binary on debian based Linux distributions. We are looking for help to test on other Linux distributions and would greatly appreciate your feedback and help us out by reporting bugs to us. In addition, the build document to generate such a binary release has also been merged into pyOCD trunk on github, developers are welcomed to have a try by themselves and improve this document.
How to use it:
If you have never used pyOCD to debug your project before, this part will teach you how to use this binary version to accelerate your development.
Step 1: Preparing your project
- mbed already provides quite a few example projects based on different toolchains. Let’s export the blinky example using the ARM gnu embedded toolchain http://mbed.org/teams/mbed/code/mbed_blinky/export
- You can download the toolchain at https://launchpad.net/gcc-arm-embedded.
Step 2: Downloading your debug tool
- Download the correct variant of our binary release at https://launchpad.net/gcc-arm-embedded-misc/pyocd-binary/.
- Install gcc-arm-embedded, pyOCD binary and then unzip the example program
Step 3: Enjoying your debugging now!
- Run pyocd_win.exe/pyocd_linux [options]
We have already provided some flexible options like the server port number and board id to control the pyOCD, and feel free to add more useful options on the pyOCD trunk at /test/gdb_server.py!
Build your project with the arm gnu embedded toolchain, and launch the pyOCD and gdb at the cmd line:
make clean all arm-none-eabi-gdb *.elf <gdb> target remote localhost:3333 <gdb> load <gdb> continue
Advantages of the new pyOCD binary version:
- Ready to use: The binary release will save developers quite a bit of time when configuring the development environment. For a developer working with the mbed platform, using ARM gnu embedded toolchain along with the pyOCD binary release that are both hosted on Launchpad can help a developer to start their work at any time and with any PC with USB interface. This is currently the most powerful combination of open source tools.
- More powerful and flexible: Before this project, pyOCD only had a simple test case named ‘gdb_test.py’ to show the user how to use pyOCD as a gdb server, but actually the library provides more powerful function than the original test case presented. So a more powerful test case named ‘gdb_server.py’ was introduced to the pyOCD trunk; the binary release is also based on this test case. Although it is still under development, it has already begun to provide users with additional accessible options to control the behavior of the pyOCD.
- Brings more contributors to the pyOCD and mbed community: A bonus of this type of binary release is that it can help to increase the number of pyOCD users. With the now easier to use pyOCD binary release, more developers should have a try on this cool gdb server, which will also bring about more user demands, such as wanting a faster pyOCD or providing more functions. This kind of user number increase will definitely bring about more developer contributions on pyOCD and hopefully the whole mbed community.
Look into the future:
From my perspective pyOCD is still very young, but as it is newly designed based on python, it will have some unique advantages over other older debugging tools. Such a binary release project would be a good chance to see how pyOCD can step forward as a standalone debugging tool. As mbed is building its own ecosystem, it has already established its own cloud IDE, embedded OS, software framework, and also the debugging environment: CMSIS DAP + pyOCD. Therefore, a binary release project of pyOCD would also be a good starting point and chance for mbed to generalize the debugging interface of the entire ARM embedded target.
April of this year the FRDM-K64F development platform was released with mbed support and we were pretty excited to welcome the platform into the community. It has tons of connectivity options including Ethernet and expansion headers for a 2.4GHz RF module and Bluetooth. There has been some great work being done with this platform, so Freescale wanted to give you all a chance to win a Garmin Forerunner 10 watch for your work!
The contest guidelines are pretty simple. Just join the mbed team “FRDM-K64F Code Share” and contribute your cool code to the team for automatic entry into the drawing. Two lucky participants will receive a Garmin Forerunner 10 watch that tells you how far and how fast you have run. Entries will be accepted for the contest from July 24, 2014 through to August 8, 2014. The rest of the community will benefit from seeing what you’ve been working on! Your submission may even end up as a getting started example for this platform and possibly future Freescale Freedom platforms as well.
More information on the FRDM-K64F, check out their platform page here.
Best of luck!
P.S. Freescale is also offering another chance to win a prize by completing their FRDM-K64F survey. Just share your feedback regarding your experiences with the FRDM-K64F platform and get automatically entered for a chance to win a Withings Pulse Monitor. Click here to complete the survey.
Have you seen the recent Kickstarter, MicroNFCBoard? Well the creator is one of mbed’s very own, Donatien Garnier. Donatien is a former mbed intern (from about 4 years back) and active mbed community member. I got a chance to met him at our team bbq in Cambridge just a few weeks ago and got a close up look at his new Kickstarter project!
MicroNFCBoard is an mbed-enabled board with Near Field Communication (NFC) functionality and it makes it really easy to use all three NFC modes (tag reading/write, tag emulation and Android Beam/P2P). It contains a NFC transceiver, a microcontroller and all the software you need to use NFC. The board features a NXP LPC11U34 microcontroller based on an ARM Cortex-M0 and a bunch of peripherals.
Donatien said, most people only think of NFC technology for payment applications, but in reality it has the potential for many more functionalities and applications. He saw an opportunity to create an NFC-enabled developer board that integrates a simple user interface, so that it is easier for developers to use this ultra low-power technology. To improve the use interface, he created the AppNearMe mode, so that you can view your device’s inputs and control its outputs through the NFC-enabled Android app.
The MicroNFCBoard will be supported on mbed after its official release, so lets make sure Donatien hits his funding goal. Show them your support by signing up to get your own MicroNFCBoard. They are about £40 currently, but I am sure that price range won’t last long.
If you have been working with the Nordic nRF51822 platform or mbed's Bluetooth Low Energy (LE) API, then you probably have come across some of Kevin Townsend's work on the mbed community. Recently I got a chance to catch up with him to find out more about the book he recently co-authored and published, ‘Getting Started with Bluetooth Low Energy,’ with Carles Cufi, Robert Davidson and Akiba. This book does a good job of explaining the basic concepts of Bluetooth Low Energy (LE), its history and it simplifies the concepts and vocabulary used around Bluetooth LE for all developers wanting to get started with this new ultra low power wireless technology.
Kevin said, one of the reasons he decided to contribute to this book, is that he finds the Internet of Things (IoT) and the Bluetooth LE technology trend to be particularly interesting; in that it has never been easier for small companies and hobbyist engineers to successfully make innovative products without large financial backing and lots of development resources. This is in part due to Bluetooth SIG's decision to add Bluetooth LE to the standard (BT 4.0 onwards), allowing many of the barriers to developing with this technology to be removed for hardware and software developers. This is also, one of the reasons why he chose to identify the mbed platform as a useful tool to create customized firmware for Bluetooth LE peripherals within Chapter 10 of the book. As much of the mbed community knows well, “many of the messy firmware implementation issues and setup problems are conveniently buried in the easy-to-use online tools and high-level APIs,” not requiring familiarity with configuring an embedded toolchain or prior knowledge of working with embedded hardware.
Additionally the book describes a sample project with the mbed-enabled Nordic nRF51822 platform to show you how to apply the concepts learned within the book in the real world.
This book is now on sale and can be ordered on Amazon, here.
Following the success of the mbed application board, the mbed application shield is now available!
The first stockists to go live is Cool Components in the UK, with others set to follow suit.
Cool Components wrote:
This is a peripherals shield - principally designed for mbed development boards with an Arduino form factor, it can actually be used with *any* development board with an Arduino form factor! The shield includes an Xbee socket, a small speaker, a 3 axis accelerometer, a joystick, and LCD display and other stuff! Because the shield has a good range of input / output devices on it, it's great for an educational environment Code to use the shield with mbed devices is available at mbed.org.
The shield is supported by various example programs that can be used straight out the box, all published on its Component Database page, as with the application board interesting new applications will soon start appearing!