Evaluation Type: Development Board, ARM Cortex-M4
Application you used the part in: QuadCopter
Was everything in the box required?: The box only contains the board itself, nothing else
What were the biggest problems encountered?: It is hard to find a good but inexpensive or free compiler
Product Performed to Expectations: 10
Specifications were sufficient to design with: 10
Demo Software was of good quality: 8
Demo was easy to use: 7
Support materials were available: 6
The price to performance ratio was good: 10
Yet again STMicroelectronics has expanded their ARM Cortex STM32 processor family with the new F4 series. The new STM32F4 microprocessors contains the ARM Cortex-M4 core, capable of running up to 168MHz giving a total of up to 210DMIPS – and we are still talking about embedded microprocessors!
To help developers get started using the new family STMicroelectronics have decided to make a very inexpensive development board with a lot of on board peripherals and of course enabled to be integrated in your own system as all of the microprocessor pins are brought out to you.
In this review we are going to look at some of the details of the new processor family and especially this new inexpensive development board.
So to start with please have a look at the Video review where some of the available example projects (demonstration code) will be shown to you in action and the different compiler options will be discussed.
In the video I am talking about both F1, F2 and F3 series. In those cases I actually meant F0, F1 and F2 series, whereof the F0 is the entry-level series.
The STM32F4 series
As I said the new STM32F4 series of microprocessors contains the ARM Cortex-M4 core and they are able to run at up to 168MHz. With some tweaking and overclocking this might be increased even more. This maximum frequency is over doubled compared to the other Cortex-M3 devices in the STM32 family.
Currently the STM32F4 microprocessors come in two flash size variants, 512KB and 1MB. Only having these two large sized versions is also a big change compared to the other where the most standard where 128KB.
On the chart above you can see the overall difference of the different STM32 families.
Because of the change to the new ARM Cortex-M4 core it also becomes more standard to add a Floating Point Unit. So this has also been added to the new STM32F4 series which makes it much faster to do floating point calculations such as FFT analysis etc.
Therefor we also decided to use this board in our QuadCopter project as it performs a lot of floating point calculations in the sensor fusion and orientation algorithm.
For FFT analysis and other DSP related things another feature has been added to this family too – a real DSP core.
Besides of those extra neat new features some of the other peripherals the new microprocessor series has got is:
- 2x 12-bit DAC
- Over 24 12-bit ADC channels
- Up to 17 timers
- USB OTG = Host or Client
- 10/100 Ethernet MAC – Just requires external Phy
- And much more
The development board itself contains the STM32F407VG, the 100-pin device with 1MB of flash and 192KB or RAM. Besides of the processor in the center, the board also contains a number of different peripherals. In the image below the on board peripherals is listed.
The board is a 2-layer PCB and it is very well laid out with small ‘drops’ on the end of traces. By this look and by looking at the schematic “design” I guess the design has been done in Altium Designer.
The bit of the design that makes it a bit more complicated is that all the microprocessor pins has been brought out to two 2×25 male connectors. These connectors makes it much easier to use this new STM32F4 microprocessor in your own projects as you don’t have to make your own PCB and solder the TQFP chip to that.
You would actually be able to make a custom design with a simple thru hole prototyping board – similar to what we did with the STM32 STAMP board from Futurlec.
So to test some of the peripherals we decided to give the example projects a shoot. A brief description of the available example projects can be found below.
In the video review above some of these examples are being demonstrated. So to see the example projects in action please have a look at the video.
- Demonstration: This is the demonstration that is pre-programmed into the board when you get it. This example demonstrates the Accelerometer and LED functionality by indicating how much you tilt the board using timer outputs for the LEDs. This example also shows the USB OTG Client functionality as it will enumerate as a USB HID Mouse on your computer and the mouse will move according to the tilt of the board.
- Audio_playback_and_record: This demonstration is divided in two parts, an InFLASH and an USB_KEY. The example demonstrates how to use the Audio DAC to play sampled audio data, either pre-programmed into the flash or recorded to a USB Memory stick as a wave file. The recording is done using the on-board chip microphone, and the USB Host functionality of the USB OTG is used to connect to a USB Memory stick to save the wave file.
- FW_upgrade: The firmware upgrade example is actually a USB Memory stick bootloader, making it possible to program the device (upgrading the firmware) by putting the binary firmware file onto a USB Memory stick and pluggin it into the USB OTG connector. The bootloader will then program the binary file into the flash and reboot the device.
- Peripheral_Examples: The peripheral examples folder contains 19 different examples on how to use the different chip peripherals like ADC, IOs, DAC, Timers etc.
I think the biggest issues I had getting started using the board were actually finding the right compiler. The example projects provided by ST supports four different compilers out of the box: IAR EWARM, Keil MDK-ARM, Altium TASKING and Atollic TrueStudio. All these compilers are more or less expensive but you can actually find free alternatives.
On ST’s homepage they recommend their users to download and use the Atollic TrueStudio compiler. The Atollic TrueStudio relies on the GNU GCC and consists of an Eclipse based IDE with project generation feature, register view etc. At the time where we got the board a Lite, no-code-limited version, of the Atollic TrueStudio STM32 were available. The only limitation were in debugging where you could only have one breakpoint placed at a time. For us this wasn’t a problem and we really loved this free but very powerfull compiler.
Unfortunately Atollic have now decided to combine their other ARM compiler suite with the STM32 one, which means that the Lite versions has also been combined. The Lite version of the ARM compiler suite is limited to 32KB of flash but has no debugging/breakpoint limitations. I think this decision is very sad because the free IDE and compiler combination were great for hobbists who could develop as large applications as they want.
As an example you should be aware that you are not able to compile the Audio InFLASH example with the new Atollic TrueStudio for ARM, as it uses much more than 32KB of flash. Maybe you can still find the STM32 Lite version of Atollic TrueStudio out there, but I think the problem will be the licensing as it requires a web-license even for the Lite version.
Instead you could have a look at other alternatives. ST has made a list of some of the compilers you can chose from but I have limited this list to the following five:
- Atollic TrueStudio
- RKit-ARM with Ride7
- Rowley CrossWorks
- IAR Embedded Workbench for ARM
- Keil MDK-ARM with Keil uVision
- CooCox IDE
CooCox IDE – A free compiler alternative
I will briefly talk about the last one as this one is the free but promising alternative to the other more or less expensive compiler suites. The CooCox IDE also relies on the GNU GCC compiler which device support is constantly being updated. The IDE itself is also Eclipse based and it integrates nicely with many different programmer and debugger adapters, fx the ST-Link.
Today (1. April 2012) version 1.4.1 of the CooCox IDE were released, adding support for the STM32F4 family. This makes it a great compiler suite for use with the STM32F4-DISCOVERY board.
The IDE comes with a project generation feature too so it is very easy to get started making your own projects, as it can also include the necessary CMSIS and booting files for you if you like.
As for what the example projects regards you should actually make any changes to the code. To use them in CooCox you should simply create a new project with the booting files and then add all of the sources, including the libraries from lower level folders. Finally you should remember to add the include paths and symbols/definitions and you should be good to go.
The CooCox IDE requires the GNU GCC to be installed as a seperate package. On Linux this is a pretty easy task as GNU GCC is built for Linux. On Windows this is a bit more complicated, though GNU GCC has already been crosscompiled by many different people. On the CooCox homepage you can download their version of the crosscompiled GNU GCC, though this version is relatively old so it doesn’t support the new STM32F4 family.
Instead you should download the latest YAGARTO GNU ARM toolchain, install that and point CooCox IDE to that – then it will work.
Good to know
As a final note I will let you know that you should remember to change the automatically included “system_stm32f4xx.c” when generating new projects. In this file the different PLL settings are set, and as the standard settings are using a 25MHz HSE value (oscillator input) we have to change these. This is done in two simple steps.
1. In the “system_stm32f4xx.c” file you should change the following line
In the project Configuration dialog you should add the following symbol to the “Defined symbols” list
A sample project for the CooCox IDE, where one of the on-board LEDs blinks one time at a second, can be downloaded here: LED Blink example for CooCox
Pros and Cons
- Powerfull ARM Cortex-M4 processor with FPU
- On-board USB programmer and debugger
- Easy access to all I/Os
- Well documented examples
- Good peripheral libraries provided by ST
- Hard to find a good and reliable compiler/IDE
- The demonstrations can’t be used out of the box with any free compiler/IDE
So to sum up the STM32F4-DISCOVERY board is a high-quality but inexpensive development board featuring the latest STM32F4 microprocessor series from STMicroelectronics.
The board comes with a lot of on-board features which makes development much faster and easier. It makes it possible to try out some of the processor features without having to make your own processor board.
The board contains two large connectors for all of the microprocessor I/Os, which makes the board even more usable for your projects. You can make your own expansion boards without having to worry about laying out and soldering the TQFP package of the microprocessor itself.
In short the board and especially the microprocessor on it is working very nicely, and you will definitely see us using this board and microprocessor some more in the future.
- The Usermanual for the STM32F4-DISCOVERY board
- STM32F405xx and STM32F407xx Datasheet
- Guide to get started with the ST examples
- LED Blink example for CooCox