An STM32 arrives in the workshop
While browsing around ebay one day I stumbled across some very reasonably priced STM32 development boards from Chinese sellers. These boards came with all the usual stuff that you’d expect, i.e. serial, USB, SDIO and a ton of GPIOs.
What really got my attention was that some of them came with a small 2.4″ touch-screen TFT designed to mate with the board via a 2.54mm pin header. I’ve always wanted to tinker with these cute little TFTs so I was sold. No matter that I’d never even touched an STM32 before, I just had to have one. Several weeks later it arrived.
The above image is a stock shot that came with the board documentation. Mine is identical except the LCD did not come with that silly line of icons across the bottom that look like they were designed by someone who didn’t like their employer very much.
About the board
The STM32 is family of 32-bit MCUs based on the ARM Cortex M3. They come in a range of speed grades from 24 to 72Mhz and in flash memory sizes up to 512Kb with 64Kb of SRAM.
The STM32 on this board is the STM32F103VET6 with 512Kb of flash and 64Kb of RAM running at the top speed of 72Mhz. This little ARM packs a very large punch for a very low price. Unusually for Chinese exports this device comes with great documentation including a full schematic and some sample C projects to get you started.
What I really like about the ARM architecture is that the 32-bit memory address is not banked, you can address it through one unified memory map. Flash is mapped in at address 0x0800000 and on-board SRAM at 0x2000000 with other ranges reserved for peripherals. In particular there are ranges reserved for DMA access to external banks of memory or peripherals such as LCD controllers.
This board comes configured with the STM32’s Flexible Static Memory Controller (FSMC) hooked up to the LCD interface header. This means that with the appropriate code I can write to and read from the ILI9325 LCD controller registers by simply writing 16-bit words into a memory address and the STM32 will take care of the timing and transfer of the data. This just gets better and better!
Now it’s time for me to go off and see if I can put together a free toolchain based around the Eclipse IDE, GCC compiler and GDB debugger with a yet-to-be-identified hardware JTAG dongle. Some preliminary research indicates that this might not be straightforward. Good. if it were easy what would I learn?