So managed to grab a bit of time to play with my new STM32 Nucleo development board yesterday. Just as everyone does when they get a new development board I started with the obligatory “Hello World” application. Now because these boards have mbed support and because I had never used mbed before I decided to give it a try.
For those people who have no idea what mbed is. The mbed platform is a free on-line development environment for the 32 bit ARM Cortex-M range of microcontrollers. Code is written and compiled in this web based IDE. The IDE provides a private workspace with the ability to quickly import and share code with other mbed users. The mbed SDK provides a C/C++ software platform for creating firmware to run on your device. The SDK also provides a library of components that may be used in your own developments.
For anyone who’s interested I’ll quickly go through the steps I took to get the board up and running. Before getting started its probably a good idea to install the ST-Link USB drivers because these will be needed when you first plug in the board.
OK so you have the drivers installed lets get started :-
- Firstly you will need to create yourself an mbed developer account at developer.mbed.org/.
- Once registered and logged in click on the “Platform” button at the top of the developer page. Select your board, in my case the ST Nucleo F401RE. After selecting the board a detailed description page will open. Simply click “Add to your Compiler” to add this platform to your dashboard.
- Next click the “Open mbed Compiler” button to open the online compiler.
- Click “Import” to import an example project into your dashboard.
- Enter “nucleo” into the search box and click the search button. This should return a number of results.
- Highlight the “Nucleo_blink_led” program and click “Import!”. The import dialogue window will open. Leave these settings and press “Import” to continue importing the example program into “My programs”.
- To view the code click “main.cpp” to show it in the editor. So as you can see this is pretty noddy stuff. All the program does is turn the LED on for 200 ms and then off for a further second before repeating the process indefinitely.
- Click the “Compile” button to build the example program.
- The resulting binary image can now be downloaded directly to your device. The program will begin executing immediately.
So even from this basic example its clear to see mbed offers an extremely fast development path. Design concepts can be realised with minimal effort in next to no time. This example may only flash an LED but the principles are the same.