I first learned of the STM32 Primer at a technical seminar presented by STMicroelectronics on 2 October 2007. They had two units at the seminar and gave them both away as door prizes.
Since I didn't win any of the door prizes, I had to wait a week for stock to show up in distribution. Digikey, Avnet and Mouser all listed the part number at various prices ($50.75, $35.00 and $36.95, respectively). As soon as I saw that Mouser had five units in stock, I ordered one and it arrived the next morning.
The STM32 Primer comes with a ad-chocked orange neck lanyard. It is somewhat lacking as a fashion accessory, although it does get attention from a certain quarter. I mention this item first as it is the first thing to come out of the box once you open it.
The first thing you have to do when you get your STM32 Primer is open it up and install the battery jumper (included). Opening the unit is simple as there are no screws or other fasterners. It just pops open. Next turn on your computer and plug it in via the included USB cable so that the internal battery can charge. You have to do this before you can play with your new toy. If you have one of those USB-chargers that plugs in the wall or your car, that will also do, but you're going to want to plug it in to your computer at some point.
The battery is initially disappointing for two reasons. The first is that it is a weensy pair of AAA NiMH cells, which means 2.4V at 400mAH. The second and more upsetting is the sadly-lacking "one resistor" charging circuit. It slow-charges when plugged in. That is the extent of its skills. It takes 16 hours to fully charge but has no cut-off mechanism, so one must be diligent in unplugging it, otherwise your battery cooks.
Another problem caused by the batteries occurs when the heat from the batteries causes the sticker that holds down the LCD to unstick. This causes the LCD to pop up on one end, as the flex connector is wrapped underneath it and wants to bend back outwards. This problem was documented on the STM32Circle forum. I will most likely apply a drop of CA (superglue) to each corner of the LCD to keep everything where it belongs.
After patiently waiting for the battery to charge up a little bit, you can then turn the the unit on by pressing the one big orange (of course) push button. The little screen should light up and display the hybrid ST/Raisonance logo, with butterflies. I'm still not exactly sure what the relationship between these two companies actually is. The display also shows the time and a battery gauge.
You may also notice a little blue dot floating around the screen. This dot uses the accelerometers as a tilt sensor and moves around in response to motion. With some practice, you can get the dot to move to the center of the screen or anywhere else. It seemed a little awkward to me at first. It was kind of jumpy and seemed to go backwards. I suppose I was thinking of it as a bubble under the glass, but that's not the way they decided to go with this. Pressing the button again pops up a menu that you navigate by tilting. You then select one of the options by pushing the button. This is also a bit awkward as the viewing angle of the LCD is quite limited and the display becomes unreadable at the extremes. Both the jerkiness and contrast problems have been somewhat reduced in the latest version of the firmware, which is available on the STM32Circle.com website.
The "Config" menu option lets you adjust the CPU frequency (from 18MHz to 72MHz in 5 steps), the LCD backlight brightness and the clock. There is also a "Test" option that exercises the hardware (LCD backlight, LEDs, speaker) and lets you run the little blue dot around inside a small box.
There are also two demo games installed. "Maze" looks almost like PacMan, although they go to some lengths to avoid calling it by that name. They seem to have no worries about using the title "Breakout" for the other game. Both games are scaled by the current CPU frequency, which can make them either easier or harder to play.
One very nice feature is that the display flips to be right-side-up as you turn the device around. Since the display is square (128 × 128 pixels) it really doesn't matter what angle you hold it.
The STM32 Primer comes with Raisonance's RIDE7 development suite, based on the GNU GCC C compiler. The "free" version, included with the STM32 Primer on a small CD-ROM, is limited to debugging 32K (of the 128K available in this part), although you can compile programs of any size. The upgrade to the unlimited debugger is available from Raisonance for €129.
My very initial impression of the RIDE 7 development software is that it's not quite ready for prime time.
I attempted to create a new project called "ride_blink".
Can you guess what it was going to do?
I created a new file to contain the skeletal main() function source code and called it "main.c".
I then told it to "Save All" and it did, although I did not tell it where exactly I wanted it.
It created a subdirectory called "ride_b" in my STM32 Primer folder.
It then proceeded to go completely south when I asked it to "make" the project, terminating with the polite, "Would you like to file a report, ma'am?" dialog.
Starting up the program again it asked me what went wrong and offered to send in its own error report.
I complied.
It then wrapped all the info up in a ZIP file and mailed it back home using my default email client.
The next attempt went better. I discovered that it does not automatically create a subdirectory for your new project, a behavior that I have become accustomed to in other products. No big deal, however, as it does allow you to create a new folder on the fly as you are browsing for a suitable location. I had saved my previously written main.c file and copied it into the newly created project folder. I then used the IDE to add this file to the project. This time the build succeeded when I pressed the "make" button. It did give me the expected warning message about "return type of main() is not int" because it's a weenie. I can't find any obvious method for specifying the additional command-line compiler options (i.e., "-ffreestanding") that would fix this problem. There's a property page under project options for "ARM specific" but there are no items there to edit and no mechanism for adding them.
Looking away from the screen and looking back again I see the project options already open in a window on the lower left side of the screen.
I'm not surprised that I didn't see it before as the screen is quite busy with every possible thing you'd ever want to look at simultaneously.
It's kind of crowded on my very spacious 'writing' computer and completely unusable on my laptop.
You can access the project options from two different menu items as well as a button and a context menu.
So getting there wasn't the problem.
The place to add any extra compiler options is under "GGG compiler/more/More linker options".
Now it compilers my embedded application like a real embedded application with no return value for main() expected.
Oddly enough, it didn't complain of "no return value for int function" when I simply changed the definiton to int main(void), but I think that's a warning-level thing.
I'm going to give up on the RIDE 7 system for now.
Going back to my old favorite method (doing it all myself) I find that I am now at the mercy of the ST documentation. It's just not very good. I'll go into more detail about its shortcomings when I've actually got something working and go back and retro-document everything.
The first thing you'll probably want to do is upgrade the "CircleOS" that comes installed. The STM32 Primer that I received still had the "1.0" revision. Version 1.5 is now available and includes the source files. CircleOS contains drivers for the on-board peripherals as well as a rudimentary flash file system for keeping multiple applications in memory as well as a menuing mechanism for running them. Upgrading is easy. They provide a batch file that will call a command-line programmer utility (Cortex_pgm.exe). Just click on the batch file and it will update the device for you. It does depend on the RIDE 7 software being installed, so don't give it the boot just yet.
The main thing that interested me about this device was the Cortex-M3 microcontroller. They chose the STM32F103RBT6 for this product. Breaking the part number down, it is of course in ST's STM32 product catalog (STM32...), with 128KB Flash memory (STM32F...), the "performance line" (vs. the "access line") (STM32F103...), and is housed in a 64 pin low-profile quad flat-pack (LQFP) surface mount chip (STM32F103RBT6 - whew!). The device itself is installed just above the LCD under the clear part of the front cover. Also visible in this window are the red & green LEDs and the 3 axis accelerometer.