Dave's STM32 Page
Adventures with ARM Cortex M3 processors
Including the STM32 Design
Challenge Project: Multi-Zone Stereo System
The
Blog for this project
I haven't done much work with microprocessors in a few years. At work we use Atmel ARM9, but my associate does most of the microprocessor hardware work. We have software professionals and tight FDA approved design control for the embedded code. My last home project was a simple RS485 network based on AVR. In the past few years I have messed a bit with Arduino, NetBurner, ExpandIO, AVR32, and others. My home projects have been mostly one-off instruments run by a PC and a USB DAQ. It is time to dig in and do some 32 bit microprocessor work with USB, modern LCDs, a real network, SD cards.
The past year (2009-10) I looked at the Atmel XMEGA. Faster, more memory, better peripherals, DMA. But the I/O structure is different enough from AVR that code rewrite of the low level stuff is needed. It's new enough that there aren't many good hardware and code examples out there. I wasn't able to find the right combination of board, debug tool, compiler and demos or examples to get me started fast. The best I came up with is AVR Dragon ($60) JTAG debugger and programmer, and Atmel Xplain ($40). IMHO, the Xplain has a bizarre combination of peripherals including audio and a 4 bit SDRAM(?!). It only brings out a few of the I/Os to connectors, and the other peripherals tie up many of the I/O pins I needed. I looked for other Xmega boards and considered laying out an ExpressPCB myself. After all this, XMEGA is still an 8 bit processor.
I suspect that Atmel is spread a bit thin with too many processor families: AVR, XMEGA, AVR32, Arm 7, 9 and M3. A bunch of other vendors have their own 32 bit solutions, but they seem to be scattered and either fully or semi proprietary. Other architectures out there: Microchip MIPS, Coldfire, lots of older ARM7 and ARM9, TI's OMAP (high end).
Recently eight or more IC vendors have adopted ARM Cortex M3: NXP, Atmel, ST, TI, Toshiba and others. The architecture has caught on for good reason. It is open, the variable-width Thumb instruction set is efficient, processors exceed one instruction per clock cycle. Fast, hardware multiply and divide, low power, low cost, open tools, a wide range of devices, lots of nice peripherals including DMA, high-everything-good, low-everything-bad.... ARM Cortex M3 looks like the best upgrade for an 8 bit architecture.
A friend returned from the 2010 Boston Embedded Systems Conference with a couple of STM32 Discovery modules (photo thanks to ST). Originally I used Atollic TrueStudio software (lite version, nearly full functionality) and tried a few of the examples. Atollic is gcc and Eclipse based (good and good), and supports full source level debug (nice). But Atollic is now code-size limited to 32K for the free version. I have since switched to CooCox development environment. Like Atollic, it uses gcc and Eclipse, but unlike Atollic it is free and not limited in any way. Also CooCox supports hundreds of ARM CPU variants from nine different manufacturers and with many different debug interfaces.
I looked at the Discovery hardware: STM32F100RB processor, 24MHz ARM Cortex M3, 128K Flash, 8K RAM, gobs of I/O including 12 bit ADC and DACs. It has a 2-wire debug (SWD) to save pins (vs. 4+ wires for JTAG). The Discovery module is a decent form factor that brings out every processor I/O on a convenient DIP format. Then I looked up the Discovery module price: $10! OK, now I'm very interested.
This is an amazing deal compared even to the low-priced Arduino ($30) or anything that Atmel or Microchip offer. It beats mBed and other CortexM3's for cost of entry. I suspect the modules are built at a loss by ST, but we might as well enjoy them while they last. In fact, ST doesn't allow you to use the Discovery modules as part of a commercial product, you can use it only for development and one-offs.
The core processor consists of only an STM32F100RB plus 2 crystals. The only on-board I/O is 2 LEDs and a push button. Perfect: their stuff won't get in the way of your application. The current Digikey price for the processor IC is $3.50, qty100. The board also contains another smaller STM32 with USB, factory programmed as the debug interface. The two-wire SWD debug interface is brought out to a 4 pin connector, allowing a Discovery to be used as a debug interface for other STM32 designs.
If that isn't enough, just for signing up for the new STM32 design contest, I received a Discovery module with the STM32F103 chip for free. Same board, but the processor has 1MB of flash, 96K RAM, 72MHz and even more I/O. There are STM Discovery modules for the F0, F100, F200, F300 and F400 families. All for under $15. Modules for the larger pin devices use dual row headers.