STM32F103C8T6 Manuals

September 26, 2016

You will need the datasheet (130+ pages) and the reference manual (1000+ pages).

You may as well give up on printed ARM programming manuals. There are so many variants that the thing to do is go to the ARM infocenter for the appropriate manual. And make no assumptions. You need the manual for the exact ARM variant you are working with.

Odds are that you are better off using the Cortex-M3 manual from ST, but who knows.

ARM lingo

You can get incredibly confused with all these ARM numbers, but here is the Rosetta stone that will dispell much of the confusion. There are cores and there are architectures.

As an example, an ARM7 core almost certainly uses the arm v4 instruction set (architecture). Do not confuse an ARM7 core (which is pretty much an antique) with the arm v7 instruction set (which is currently used in things like the ARM Cortex A8 in the Beaglebone Black). Note also that there is an arm v7r instruction set, an arm v7a instruction set, and an arm v7m instruction set. The Cortex A8 core uses the v7a instruction set. The Cortex M3 core uses the v7m instruction set.

So, the STM32F103 I am working with has an ARM Cortex M3 core and runs the arm v7m instructions.

Thumb instructions, and Thumb-2

Back in the days of ARM architecture v4 and v5 the Thumb instructions were all 16 bit. That day is long gone. The current thumb is a mix of 16 and 32 bit instructions. The way to think about thumb instructions is that the processor can switch between two decoders that feeds the pipeline. The T-bit in the PSR controls this and there are a variety of ways to clear or set this bit. Greater code density makes things run more efficiently on narrow buses (and may make better use of caches).

In general, thumb instructions have directly equivalant normal ARM instructions. Some exceptions are that only branches can be conditional, and thumb instructions can use only the first half of the general registers. Note that normal ARM instructions are always 32 bit and demand 4 byte alignment.

The term "Thumb-2" is claimed to be a confusing misnomer.

Processors with Cortex M cores support only thumb instructions. Note that with the advent of "Thumb-2", ARM introduced a unified assembler syntax so that code looks identical for thumb or normal ARM.


Feedback? Questions? Drop me a line!

Tom's Computer Info / tom@mmto.org