Lab Notes 8/28/12

Today I played around a little with the STM32F0Discovery board. I wrote a quick program with Atollic True Studio Lite to echo the system clock (SYSCLK) out the microcontroller clock output (MCO) pin. I had some bizarre results so I posted a question about it in the ST online forums.

I used my Saleae Logic Analyzer to view the waveform on the MCO pin. I had some problems getting the Logic program to run after installing it and called their tech support line. I'm happy to report that I got quick, knowledgeable support in a timely fashion and was up and running again quickly.

I'm finding that the STM32F0xx Standard Peripherals Library has a lot of useful stuff in it. Too bad there's no user manual; only an automatically generated .chm help file. I've been able to find what I need so far by searching and by relying on the organization of the functions.

I ordered some RC servos today that I want to drive with the STM32F0, and I ordered a clone FTDI serial cable to debug with. Both are coming from China so it'll probably be a few weeks before they get here.

Next, I'm going to continue looking at clocking various parts of the STM32F0, and use that knowledge to drive servos with the microcontroller.

Lab Notes 8/26/12

Today I started investigating how to program the STM32F0DISCOVERY development board.

While I do have ATOLLIC True Studio Lite installed on my dev machine (Windows XP), I want to get to the point where I can develop on this board using only FOSS software without the limitations present in the trial versions of commercial development tools. (For instance, True Studio Lite imposes a code size limitation on Cortex-M0 parts, and disables the use of C++.)

I followed the tutorial presented here by Dr. Hussam Al-Hertani. Dr. Hertani's tutorials lead his visitors through installing ARM-GCC and Eclipse and compiling projects using a makefile. While this tutorial does work, I don't like the idea of manually managing my makefile, and I don't like the fact that his tutorial doesn't include steps to make the GUI aware of include files and paths, which causes the GUI to flag numerous errors that aren't really errors because the makefile-driven build process knows more about the build than the GUI does.

I was able to create a new project from scratch and get .c files to compile. I'm having difficulty getting the startup_stm32f0xx.s file to assemble. Apparently the GCC assembler doesn't handle the C-style comments in the .s file; to get these files to compile it appears that the GCC preprocessor must run first. I'm tweaking the command for the assembler in the toolchain to try to resolve this.

My goal is to have Eclipse automatically manage the build process so that I don't have to manage my own makefile, and be able to leverage the code analysis tools in the GUI. Ultimately I want to build a toolchain that relies only on free, open source software. Dr. Hertani's tutorials have provided an excellent starting point and I hope to be able to write STM32 code, have it compile, and download my code to the board soon.

I do recommend Dr. Hertani's tutorials. They're well written and they work. (His tutorials are based on an older version of Eclipse, but the changes between his tutorial and the current version are minimal.)