Bit Banding in the STM32

Wondrous though the STM32 (ARM Cortex M3) might be, it makes something of a meal of atomic access to individual bits in memory. The technique used is called bit-banding. Although it is simple enough in concept and pretty friendly to the assembly language programmer, it is easy enough to get lost in C. Or should that be at C?
(more…)

Continue ReadingBit Banding in the STM32

ARM Cortex text book

The Definitive Guide to the ARM Cortex-M3
Joseph Yiu
This is one of a very small number of books about the relatively new ARM processor, the Cortex-M3. Now in a second edition, the book covers all the essential information required to get to grips with this elegant and powerful core and concentrates mostly on the core itself. While several manufacturers, such as ST, Luminary, Atmel and Philips among others, implement Cortex-M3 based processors, they differ in the range of peripherals connected to the core. At its heart, each uses the same logic, registers and instruction set to get the job done.

(more…)

Continue ReadingARM Cortex text book

STM32 USART basics

A USART is a universal synchronous asynchronous receiver transmitter. A serial port if you like. On the STM32 however, it really is universal. This peripheral has a raft of features for a huge range of serial protocols including all the usual asynchronous modes plus IrDA, LIN, Smartcard Emulation and the ability to function as an SPI port…

(more…)

Continue ReadingSTM32 USART basics

ARM STM32 JTAG

JTAG is a common standard for communicating with modern electronic devices like FPGAs and microcontrollers. A JTAG connection will allow you to do in-circuit debugging in a bewildering variety of ways and will generally allow you to program your device. The standard, apparently, defines five connections for this purpose. Add in power and ground and you have a minimum of 7 connections needed to implement JTAG. The trick is getting them delivered to your board or device…

(more…)

Continue ReadingARM STM32 JTAG

Crossworks projects startup and debugging

Crossworks or, more accurately, CrossStudio for the Arm, running on a mac is probably one of the better development environments. It has its quirky side but, so far, I am really happy with it. Now might be a good time to look at how projects are organised, how the code gets onto the target and how it is started up…

(more…)

Continue ReadingCrossworks projects startup and debugging

Crossworks Blinky Project 3 – PLL and HSE

Last time, the STM32 was set up to use the Internal RC oscillator, HSI. This runs at 8MHz. The PLL multiplier was told to use the HSI/2 as its input and the multiplier value was set to x 5. The result being a 20MHz system clock. Now, what happens if the PLL multiplier is increased to make the system run faster…

(more…)

Continue ReadingCrossworks Blinky Project 3 – PLL and HSE

Crossworks Blinky Project 2 – RCC and Systick

In the previous post, the STM32 development board was turning a LED on and off in response to a button press. Not very exciting but satisfying anyway. Next, I want to have a look at setting up the system oscillator and the systick timer…

(more…)

Continue ReadingCrossworks Blinky Project 2 – RCC and Systick

Crossworks Blinky Project 1

With the Rowley Crossworks software set up, it is time to make some code. As usual, it is easiest to start out with a simple LED flasher. Why break with tradition. The target board for this project is the IAR STM32-SK because I happen to have one after winning it in a contest…

(more…)

Continue ReadingCrossworks Blinky Project 1

Crossworks for the ARM on a mac

After much messing about, I finally decided how to do my STM32 ARM development. While there is a certain amount of appeal in the DIY approach, in the end I just want to write code for my processor and not battle to make sure the tools are properly configured. To this end, I have now paid for a personal licence for Rowley Crossworks for the ARM. This cross-platform toolset and IDE will run pretty much identically on Windows, Linux, Solaris and the mac. The compiler is one of the GCC releases and you get almost everything you need in one hit…

(more…)

Continue ReadingCrossworks for the ARM on a mac

Another STM32 Project Template

Earlier this year, I wrote about the fun I had setting up the GCC ARM compiler to run under MAC OS X. This kept me occupied for a few days and, eventually, I got it all working. Francois Gervais read the post and kindly offered to share his recipe for building ARM Cortex M3 projects using the GCC compiler. Read on for his notes about the project template…

(more…)

Continue ReadingAnother STM32 Project Template