《STM32全系列闪存编程V4【英文】》由会员分享,可在线阅读,更多相关《STM32全系列闪存编程V4【英文】(155页珍藏版)》请在金锄头文库上搜索。
1、 March 2011Doc ID 15491 Rev 41/155PM0056 Programming manual STM32F10xxx/20xxx/21xxx/L1xxxx Cortex-M3 programming manualThis programming manual provides information for application and system-level software developers. It gives a full description of the STM32F10xxx/20xxx/21xxx/L1xxxx Cortex- M3 proce
2、ssor programming model, instruction set and core peripherals. The STM32F10xxx/20xxx/21xxx/L1xxxx Cortex-M3 processor is a high performance 32-bit processor designed for the microcontroller market. It offers significant benefits to developers, including:Outstanding processing performance combined wit
3、h fast interrupt handlingEnhanced system debug with extensive breakpoint and trace capabilitiesEfficient processor core, system and memoriesUltra-low power consumption with integrated sleep modesPlatform ContentsPM00562/155 Doc ID 15491 Rev 4Contents1About this document . . . . . . . . . . . . . . .
4、 . . . . . . . . . . . . . . . . . . . . . . . . 101.1Typographical conventions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 101.2List of abbreviations for registers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 101.3About the STM32 Cortex-M3 processor and
5、core peripherals . . . . . . . . . 101.3.1System level interface . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 111.3.2Integrated configurable debug . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 111.3.3Cortex-M3 processor features and benefits summary .
6、 . . . . . . . . . . . . . 121.3.4Cortex-M3 core peripherals . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 132The Cortex-M3 processor . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 142.1Programmers model . . . . . . . . . . . . . . . . . . . . . . . . .
7、 . . . . . . . . . . . . . . . . 142.1.1Processor mode and privilege levels for software execution . . . . . . . . . 142.1.2Stacks . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 142.1.3Core registers . . . . . . . . . . . . . . . . . . . . . . . .
8、 . . . . . . . . . . . . . . . . . . . . 152.1.4Exceptions and interrupts . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 232.1.5Data types . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 232.1.6The Cortex microcontroller software i
9、nterface standard (CMSIS) . . . . . 242.2Memory model . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 252.2.1Memory regions, types and attributes . . . . . . . . . . . . . . . . . . . . . . . . . . 262.2.2Memory system ordering of memory accesses . . . . . .
10、 . . . . . . . . . . . . . 272.2.3Behavior of memory accesses . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 272.2.4Software ordering of memory accesses . . . . . . . . . . . . . . . . . . . . . . . . 282.2.5Bit-banding . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
11、 . . . . . . . . . . . . . . . 292.2.6Memory endianness . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 312.2.7Synchronization primitives . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 322.2.8Programming hints for the synchronization primitives .
12、. . . . . . . . . . . . . 332.3Exception model . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 342.3.1Exception states . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 342.3.2Exception types . . . . . . . . . . . . . . . . .
13、. . . . . . . . . . . . . . . . . . . . . . . . . . 342.3.3Exception handlers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 362.3.4Vector table . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 372.3.5Exception priorities .
14、. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 372.3.6Interrupt priority grouping . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 382.3.7Exception entry and return . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 38PM0056Conte
15、ntsDoc ID 15491 Rev 43/1552.4Fault handling . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 412.4.1Fault types . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 412.4.2Fault escalation and hard faults . . . . . .
16、 . . . . . . . . . . . . . . . . . . . . . . . . . 422.4.3Fault status registers and fault address registers . . . . . . . . . . . . . . . . . 432.4.4Lockup . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 432.5Power management . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 432.5.1Entering sleep mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .