STM32F4 Discovery

I have a couple of the STM32F4 Discovery boards – they are cheap (£10 from Farnell) to the point of being free and pack an amazing amount of power into the demo board. It also comes with some useful peripherals like an accelerometer and audio CODEC. Possibly the most awesome thing about the F4 is the floating point unit (FPU). Being able to natively do floating point in the same amount of time it takes to do fixed point just moves these things from being pretty nice to rocket science. No more messing around with fixed point saturation and scaling issues…And algorithms can be seamlessly copied from desktop to DSP..

ARMs are quite a step up from the 8/16 bit microcontrollers that I have been using previously. Although ARMs are impressive, I don’t think they are going to entirely replace the lower end PIC and AVRs, mainly because of power consumption, which is a big deal for sensor networks. However, the whole power consumption thing is contentious, because it is not always easy to do a 1:1 comparison, and if you rely on vendor’s advertisements, you are going to be none the wiser.

Although the Discovery board comes with a lot of sample code, both for a demo application and also peripherals, the learning curve is just a lot steeper than other micros where you can just dive in and have something working quite quickly. There is a lot to do in terms of setting up registers and configuring pins/ports and clocks before it does anything useful. I have posted some short code snippets that illustrate some basic features of the device, such as PWM, USART and timers.

One gripe I have is the lack of decent tools for development in Ubuntu. I don’t see in this day and age of Android, iOS, linux etc, why tools should be constrained to Windows. Windows is just about the worst development environment I could think of. Nonetheless, for the sake of getting up and running with the STM32F4, I buckled and installed IAR kickstarter, which gives you 32kB free. I tried Atollic, but I didn’t like it so much. I also have an eclipse setup running on ubuntu – I can get it to debug and program, but its a bit flakey at the moment…

Anyway, enough talking, on to the content

4 Replies to “STM32F4 Discovery”

  1. Hi Andrew,

    Thanks very much for a really useful and clear set of STM32 articles.

    It is a shame that the learning curve to access the power of the STM32F4 chips is so steep, but the FP power on tap is certainly a great incentive for embedded signal processing applications!



  2. I always uses Windows like work environment for ARM based microcontrollers, PlayStation 2 and other cross-platform compiling without any problem.

    You can try Coocox IDE for STM32 based microcontrollers, and CoOS real-time kernel.

    If you know how to use Windows, and how to configure it directly using the register to improve its performance (enabling 48 bit addresable RAM memory on 32 bit machines for example) and disable useless stuff, you have no need to learn how to use any other OS, specially when you don´t have the required time like us.

    1. I use IAR in a windows 8 VM running on ubuntu now – happiness all round. But I still don’t see why some vendors don’t support linux – microchip for example has great tools which work seamlessly on ubuntu and windows. I think it is a legacy issue – IAR workbench for example looks like it is stuck in windows 95 with ugly icons. Just my 2c 🙂

  3. Thank you very much for the examples and discussion. I already successfully used PWM, INT Timers Quadrature Inputs / tracking etc. before finding your site. This processor is a beast. The learning curve is steep, but the rewards are steeper.

Leave a Reply