Transcription of UM2298 User manual - STMicroelectronics
1 June 2019UM2298 Rev 21/1601 UM2298 User manualSTM32 Cube BSP drivers development guidelines IntroductionSTM32 Cube is an STMicroelectronics original initiative to significantly improve designer's productivity by reducing development effort, time and cost. STM32 Cube covers the whole STM32 includes: A set of user-friendly software development tools to cover project development from the conception to the realization, among which STM32 CubeMX, a graphical software configuration tool, STM32 CubeIDE, an all-in-one development tool, STM32 CubeProgrammer (STM32 CubeProg), a programming tool, and STM32 CubeMonitor-Power (STM32 CubeMonPwr) monitoring tool. STM32 Cube MCU and MPU Packages, comprehensive embedded-software platforms specific to each microcontroller and microprocessor series (such as STM32 CubeL4 for the STM32L4 Series), which include STM32 Cube hardware abstraction layer (HAL), STM32 Cube low-layer APIs, a consistent set of middleware components, and all embedded software utilities.
2 STM32 Cube Expansion Packages, which contain embedded software components that complement the functionalities of the STM32 Cube MCU and MPU Packages with middleware extensions and applicative layers, and a complete description of STM32 Cube, refer to Chapter BSP (board support package) drivers are part of the STM32 Cube MCU and MPU Packages based on the HAL drivers, and provide a set of high-level APIs relative to the hardware components and features on the Evaluation boards, Discovery kits and Nucleo boards delivered with the STM32 Cube MCU and MPU Packages for a given STM32 microcontroller BSP drivers allow quick access to the board services using high-level APIs, without any specific configuration as the link with the HAL and the external components is made intrinsically within the drivers.
3 From the project-setting point of view, the user has only to add the necessary driver files in the workspace and call the functions needed from the examples in Level0, Level1 or Level2 in Figure 2. However, some low-level configuration functions may be overridden by the applications if the user wants to change the default behavior of the BSP purpose of this document is to provide the user with guidance for the development of BSP gives an overview of the architecture of BSP drivers ( class , component, common and bus) and implementation Rev 2 Contents1 Documentation conventions .. this document .. and definitions .. 82 What is STM32 Cube? .. 103 BSP driver architecture.
4 Drivers features .. configuration .. driver repository .. based project repository .. inclusion model .. 194 BSP naming rules .. rules .. naming rules .. 215 BSP common driver .. common driver functions .. common functions implementation .. 41UM2298 Rev 23 .. IO expander .. 486 BSP bus driver .. bus driver APIs .. bus APIs implementation .. bus MSP default functions .. {16} .. {16} .. {16} .. bus services .. SPI bus specific services .. I2C bus specific services .. bus multi configuration .. bus customization .. 797 BSP component driver .. component register file .. register header file.
5 Register source file .. component core drivers .. core header file .. core source file .. components .. 93 ContentsUM22984/160UM2298 Rev component class drivers .. memory component drivers .. component upgrade .. 1018 BSP class driver .. common functions .. example .. functions .. functions .. classes .. AUDIO OUT class APIs .. AUDIO IN class APIs .. TS class APIs .. SD class APIs .. SDRAM class APIs .. SRAM class APIs .. NOR class APIs .. QSPI class APIs .. IO expander class APIs .. LCD class APIs .. camera class APIs .. EEPROM class APIs .. motion class APIs .. environmental class APIs.
6 OSPI class APIs .. class driver context .. class driver inter dependency .. driver structure .. 1509 BSP IRQ handlers .. rules .. 152UM2298 Rev 25 IRQ Handlers implementation .. 15410 BSP error management .. drivers .. common drivers .. class drivers .. bus drivers .. 158 Revision history .. 159 List of tablesUM22986/160UM2298 Rev 2 List of tablesTable and definitions .. 8 Table naming rules .. 20 Table naming rules.. 21 Table common driver functions .. 23 Table bus driver APIs .. 52 Table common communication services .. 63 Table component drivers: object structure .. 86 Table component drivers: IO structure.
7 88 Table class drivers: generic common functions .. 103 Table class drivers: Specific functions .. 117 Table class drivers: Extended functions .. 117 Table AUDIO OUT class APIs .. 118 Table AUDIO IN class APIs .. 121 Table APIs for recording .. 123 Table TS class APIs .. 123 Table SD class APIs .. 125 Table SDRAM class APIs .. 127 Table SRAM class APIs .. 128 Table NOR class APIs .. 129 Table QSPI class APIs .. 130 Table IOExpander class APIs.. 133 Table LCD class APIs.. 134 Table camera class APIs .. 136 Table EEPROM class APIs .. 139 Table motion class APIs .. 139 Table environmental class APIs .. 141 Table OSPI NOR class APIs.
8 143 Table APIS for OSPI support additional features .. 145 Table OSPI RAM class APIs .. 146 Table of symbols .. 152 Table revision history .. 159UM2298 Rev 27/160UM2298 List of figures7 List of figuresFigure MCU and MPU Packages architecture .. 11 Figure MCU and MPU Packages detailed architecture .. 11 Figure drivers overview .. 12 Figure driver repository: single board .. 13 Figure driver repository: multi-boards .. 14 Figure driver repository: overview .. 15 Figure driver repository: common class headers .. 16 Figure driver repository: configuration files .. 18 Figure inclusion model .. 19 Figure driver repository: common drivers.
9 22 Figure driver repository: bus drivers .. 51 Figure driver repository: component drivers .. 81 Figure driver architecture .. 82 Figure driver repository: memory component drivers .. 97 Figure driver architecture: memory calling model .. 98 Figure component folder example .. 101 Figure driver repository: function drivers .. 102 Figure error management .. 156 Documentation conventionsUM22988/160UM2298 Rev 21 Documentation conventionsSTM32 Cube BSP drivers support Arm (a)-based About this documentThis document mainly focuses on the BSP architecture, which is designed to be more generic by addressing multi instance components and multi buses and changing the initialization process to be based on the code generated by STM32 CubeMX details the architecture of BSP drivers ( class , component, common and bus)
10 And gives examples of implementation to guide the user developing BSP drivers on a given user of this document must be familiar with the STM32 Cube MCU and MPU Acronyms and definitions a. Arm is a registered trademark of Arm Limited (or its subsidiaries) in the US and/or 1. Acronyms and definitions AcronymDefinitionAPIapplication programming interfaceBSPboard support packageCMSISC ortex microcontroller software interface standardCPUcentral processing unitDMAdirect memory accessFMCflexible memory controllerGPIO general purpose IOHAL hardware abstraction layerI2 CInter-integrated circuitLTDCLCD TFT display controllerMSPMCU specific packageSAIserial audio interfaceSDsecure digitalSDRAMSDRAM external memorySRAMSRAM external memorySMARTCARD smartcard ICSPI serial peripheral interfaceUM2298 Rev 29/160UM2298 Documentation conventions159 SysTickSystem tick timer PPPG eneric STM32 peripheral or block class /FunctionA common