Embedded HandbookApps
All sections › VII. Documentation and its language
STM32F103, STM32F407 · level basic · 12 min read
Open in the interactive handbook

39. How to read ST documentation

Sooner or later every handbook runs out, while the question remains. Then you open the manufacturer's documentation, and it is all in English, about a thousand and a half pages long, and split into a dozen documents with opaque names. This section is about how to find your way in them and how to read their language.

The good news: the language of ST documentation is extremely uniform. Once you learn some forty phrases, you will understand any of its sections, even without speaking English fluently.

Terms used in the documentation

Term Meaning
datasheet (DS) the chip description: pins, electrical data, packages
reference manual (RM) the reference guide: peripherals and registers
errata sheet (ES) the list of known silicon bugs and workarounds
application note (AN) a note on use: how to solve a specific task
user manual (UM) the user guide of a board or a program
programming manual (PM) the guide to programming the core
reset value the register value after reset
reserved, must be kept at reset value reserved, keep the value it has after reset

39.1 What kinds of documents there are

Type What is inside When to open it
DS: Datasheet pinout, electrical characteristics, packages, contents of the chip "which pin", "how much current", "does it tolerate 5 V"
RM: Reference manual how the peripherals work and all their registers "which bit is responsible for this"
PM: Programming manual the Cortex-M core: instruction set, NVIC, SysTick, MPU "what does this instruction do", "how is the NVIC built"
ES: Errata sheet known silicon bugs and workarounds before development starts, not after
AN: Application note a ready solution of a specific task "how to do X properly"
UM: User manual evaluation boards and tools "what is soldered on the Discovery"

Which document to go to with which question: DS, RM, PM, ES, AN, UM

The main distinction, which saves hours of searching:

For our two platforms:

STM32F103 STM32F407
Reference manual RM0008 RM0090
Programming manual PM0056 (Cortex-M3) PM0214 (Cortex-M4)
Errata ES096 ES0182

39.2 What to look for where

Question Document Section (as named in the original)
Which pin goes where DS Pinouts and pin description
Which peripheral is on which pin DS Alternate function mapping
Does the pin tolerate 5 V DS same place, column I/O structure, mark FT
Limiting current and voltage DS Absolute maximum ratings
Real parameters in operation DS Electrical characteristics
How much it draws in each mode DS Supply current characteristics
How a peripheral and its registers work RM the section named after the block
Address map RM Memory map
Clock tree RM Reset and clock control (RCC)
Processor instructions PM The Cortex-M instruction set
What is broken in this silicon ES Description of device limitations
How to flash through the bootloader AN2606 Bootloader for your family

A practical trick. When you open a reference manual, do not leaf through it: use the PDF table of contents and search by register name. Search not for "GPIO output" but directly for GPIOx_ODR: register names are unique, and the search takes you straight to the bit description, to the register map, and to the places where it is mentioned.


39.3 How a register description is built

All register descriptions in a reference manual are built the same way. Once you work through one, you can read any. The example is from RM0008 (STM32F103):

GPIOx_ODR — Port output data register (x = A..G)

Address offset: 0x0C
Reset value: 0x0000 0000

31                            16 15                             0
├─────── Reserved ──────────────┤├──────── ODR15..ODR0 ─────────┤
                                        rw

Bits 31:16  Reserved, must be kept at reset value.
Bits 15:0   ODRy: Port output data (y = 0..15)
            These bits can be read and written by software.

What to read first:

Access notation

Notation In full What it means in practice
rw read/write an ordinary bit: you write and read it
r read-only writes are ignored
w write-only reading returns zeros: do not use \|=
rc_w1 read / clear by writing 1 cleared by writing a ONE
rc_w0 read / clear by writing 0 cleared by writing a zero
rc_r read / cleared by reading cleared by the read itself
rs read / set by software can only be set; the hardware clears it
t toggle writing a one toggles the bit
Res. reserved do not touch, keep the default value

Description of the EXTI_PR register with offset 0x14 and the rc_w1 line under the bit map, next to it eight access notations with examples: rw for ODR, w for BSRR where reading gives zeros, rc_w1 for EXTI_PR where writing a one clears it, rc_r for USART_SR where the read itself clears it

This explains things that otherwise look inexplicable:


39.4 The language of the documentation

About forty phrases cover almost all of the text. They repeat word for word from section to section.

About bits and registers

Term Meaning What to do
must be kept at reset value must keep its reset value do not touch
this bit is set by hardware the hardware sets the bit you only read it
cleared by software the program clears it clear it yourself
cleared by writing 1 cleared by writing a one a one, exactly
this bit is set and cleared by software the program sets and clears it an ordinary configuration bit
read as 0 reads as zero do not rely on the contents
write access is protected writing is protected an unlock sequence is needed
this bit can be written only when … is disabled writable only while … is off turn the block off first

About behavior

Term Meaning
the following sequence must be applied you must perform the following sequence
it is mandatory to you are required to
it is recommended to it is advised to
shall / must is obliged to
should ought to, but not critical
may / can is allowed
refer to Section 9.2 for details details are in section 9.2
whichever comes first whichever happens earlier
unless otherwise specified unless stated otherwise
is not affected does not change
takes effect after … becomes effective after …
up to up to … inclusive
at least no less than
typical / min / max typical / minimum / maximum value

⚠️ The difference between must, should and may in technical documentation is not a matter of style. must: violating it makes the thing not work; should: violating it is allowed but risky; may: simply a possibility. Translations often erase this difference, and a recommendation turns into a requirement or the other way round.

Words that are translated wrongly

Original Wrong Right
to assert a signal "to claim" drive into the active state
to negate / deassert "to deny" remove the signal
sample "a specimen" a reading, a sample value
to latch "to snap a latch" capture and hold a value
granularity a borrowed word, "granularity" step, resolution
overrun "overflow" data received on top of unread data
underrun "underfill" data ran out before it was requested
idle "idling", as an engine inactivity, no activity
frame "a picture frame" a frame (a transmission unit)
word "a word" in the general sense exactly 32 bits
half-word "half of a word" of any size 16 bits
wait state "a state of waiting" a wait cycle
prescaler a borrowed word, "preskaler" a pre-divider
duty cycle "a working cycle" the fill factor D = τ/T, in percent
jitter a borrowed word, "dzhitter" edge trembling
glitch a borrowed word, "glitch" a short disturbance, a false pulse

The Russian term "skvazhnost" in the strict sense is the inverse quantity T/τ: at a 25 % fill factor it equals 4. In speech, and in this handbook too, "skvazhnost" often means the fill factor itself (section 82.2); keep them apart in calculations.


39.5 Errata: read before, not after

An errata sheet is the official list of what in the silicon works differently from what the reference manual says. The document is short, takes half an hour to read, and that half hour pays off many times over.

A typical entry looks like this:

2.1.5  I2C analog filter may provide wrong value, locking BUSY flag

Description: ...
Workaround:  ...

That is: what is broken, under which conditions it shows up, and how to work around it.

Classic examples that cost people days:

The list is split by silicon revision, and for many items it says in which revision they were fixed, so you first need to know yours. You find it from the revision letter in the package marking or from the REV_ID field, the upper 16 bits of DBGMCU_IDCODE at address 0xE0042000 (the address is the same on the F1 and the F4). Which code corresponds to which letter is given at the start of the list and in the description of DBGMCU_IDCODE in the reference manual: on the F405/F407 0x1000 is revision A, 0x1001 is Z. The F103 has a catch: without a debugger DBGMCU_IDCODE reads as zero, and the program cannot find out its own revision; this is also an item of the errata list (section 2а).

The symptom is always the same: the code is written strictly according to the documentation, but works differently. Before you spend a third hour looking for a bug of your own, open the errata.


39.6 Application notes

A genre of its own: not a description of the hardware but a complete solution of a task, with formulas, schematics and code. Often it is a ready answer to a question you would otherwise have to piece together from a dozen places.

Document What it is about
AN2606 the built-in bootloader: which interfaces, how to enter it, the protocol
AN2867 how to choose a crystal and lay it out properly; why it "does not start"
AN4013 timers: modes, synchronization, cascading
AN4776 general-purpose timers, practical calculations
AN2834 ADC: how to get the specified accuracy
AN3116 ADC: operating modes and where to use which
AN4031 DMA: techniques and pitfalls

If a task looks typical, there is almost certainly an application note about it. Search: STM32 <topic> application note or directly AN with the number on the ST site.


39.7 How to search

The right keywords save more time than fluent English.

What you need What to search for in the document
pin configuration port bit configuration, alternate function
pin current output driving current, I/O current injection
frequency and dividers clock tree, prescaler, PLL configuration
Flash wait states latency, wait states, prefetch buffer
interrupts interrupt and status register, vector table, NVIC
UART baud rate setup baud rate generation, USART_BRR, fractional baud
ADC modes conversion modes, sampling time, injected channels
PWM PWM mode, output compare, capture/compare
power saving low-power modes, Stop mode, Standby mode
boot boot configuration, system memory, option bytes

The register table trick. At the end of every reference manual section there is a summary table <block> register map and reset values: on one page, all the registers of the block with their offsets and reset values. Usually this is the only thing you need when the mechanism is already clear and you just have to check a bit.


39.8 Pitfalls

Done strictly according to the documentation, but it works differently. First of all, the errata list of the silicon: it may contain exactly this case (39.5).

A recommendation read as a requirement, or the other way round. must, should and may differ in meaning, and translations erase this difference (39.4).

The pinout is not in the reference manual. It is in the datasheet of the specific chip; registers are in the reference manual, the core is in the core programming manual (39.1–39.2).


39.9 Summary

Next: section 39а "Official documents: what to get and where".

Open in the interactive handbook