Preface
- Who Is This Book For?
- What About Arduino?
- How to Integrate This Book?
- How Is the Book Organized?
- Differences With the First Edition
- About the Author
- Errata and Suggestions
- Book Support
- How to Help the Author
- Copyright Disclaimer
- Credits
Acknowledgments to the First Edition
- IIntroduction
1.Introduction to STM32 MCU Portfolio
- 1.1Introduction to ARM Based Processors
- 1.1.1Cortex and Cortex-M Based Processors
- 1.1.1.1Core Registers
- 1.1.1.2Memory Map
- 1.1.1.3Bit-Banding
- 1.1.1.4Thumb-2 and Memory Alignment
- 1.1.1.5Pipeline
- 1.1.1.6Interrupts and Exceptions Handling
- 1.1.1.7SysTimer
- 1.1.1.8Power Modes
- 1.1.1.9TrustZone™
- 1.1.1.10CMSIS
- 1.1.1.11Effective Implementation of Cortex-M Features in the STM32 Portfolio
- 1.2Introduction to STM32 Microcontrollers
- 1.2.1Advantages of the STM32 Portfolio….
- 1.2.2….And Its Drawbacks
- 1.3A Quick Look at the STM32 Subfamilies
- 1.3.1F0
- 1.3.2F1
- 1.3.3F2
- 1.3.4F3
- 1.3.5F4
- 1.3.6F7
- 1.3.7H7
- 1.3.8L0
- 1.3.9L1
- 1.3.10L4
- 1.3.11L4+
- 1.3.12L5
- 1.3.13U5
- 1.3.14G0
- 1.3.15G4
- 1.3.16STM32WB
- 1.3.17STM32WL
- 1.3.18How to Select the Right MCU for You?
- 1.4The Nucleo Development Board
- Why Use the Nucleo as Example Board for This Book?
2.Get In Touch With SM32CubeIDE
- 2.1Why Choose STM32CubeIDE as Tool-Chain for STM32
- 2.1.1Two Words About Eclipse…
- 2.1.2… and GCC
- What Is a Cross-Compiler?
- 2.2Downloading and Installing the STM32CubeIDE
- 2.2.1Windows - Installing the Tool-Chain
- 2.2.2Linux - Installing the Tool-Chain
- 2.2.3Mac - Installing the Tool-Chain
- Read Carefully!
- 2.3STM32CubeIDE overview
3.Hello, Nucleo!
- 3.1Create a Project
- 3.2Adding Something Useful to the Generated Code
- 3.3Connecting the Nucleo to the PC
- Read Carefully
- 3.3.1ST-LINK Firmware Upgrade
- Warning
- Error in upgrading the ST-LINK firmware
- 3.4Flashing the Nucleo using STM32CubeProgrammer
- Read Carefully
- Eclipse intermezzo
4.STM32CubeMX Tool
- 4.1Introduction to CubeMX Tool
- 4.1.1Target Selection Wizard
- 4.1.1.1MCU/MPU Selector
- 4.1.1.2Board Selector
- 4.1.1.3Example Selector
- 4.1.1.4Cross Selector
- 4.1.2MCU and Middleware Configuration
- 4.1.2.1Pinout View & Configuration
- 4.1.2.2Clock Configuration View
- Overclocking
- 4.1.3Project Manager
- What is the Cube Low-Layer API?
- 4.1.4Tools View
- 4.2Understanding Project Structure
- Peripheral Initialization and Deinitialization
- 4.3Downloading Book Source Code Examples
- 4.4Management of STM32Cube Packages
5.Introduction to Debugging
- 5.1What is Behind a Debug Session
- 5.2Debugging With STM32CubeIDE
- 5.2.1Views in the Debug Perspective
- 5.2.2Debug Configurations
- 5.3I/O Retargeting
printf()andfloatdatatypes.- IIDiving into the HAL
6.GPIO Management
- 6.1STM32 Peripherals Mapping and HAL Handlers
- 6.2GPIOs Configuration
- 6.2.1GPIO Mode
- 6.2.2GPIO Alternate Function
- 6.3Driving a GPIO
- 6.4De-initialize a GPIO
- Eclipse Intermezzo
7.Interrupts Management
- 7.1NVIC Controller
- 7.1.1Vector Table in STM32
- 7.2Enabling Interrupts
- 7.2.1External Lines and NVIC
- 7.2.2Enabling Interrupts with CubeMX
- What Belongs to What
- 7.3Interrupt Lifecycle
- 7.4Interrupt Priority Levels
- 7.4.1Cortex-M0/0+
- 7.4.2Cortex-M3/4/7/33
- 7.4.3Setting Interrupt Priority in CubeMX
- 7.5Interrupt Re-Entrancy
- 7.6Mask All Interrupts at Once or an a Priority Basis
- Eclipse Intermezzo
8.Universal Asynchronous Serial Communications
- 8.1Introduction to UARTs and USARTs
- 8.2UART Initialization
- Is It Mandatory to Define This Function?
- 8.2.1UART Configuration Using CubeMX
- 8.3UART Communication in Polling Mode
- Read Carefully
- 8.3.1Installing a Terminal Emulator in Eclipse
- 8.4UART Communication in Interrupt Mode
- 8.4.1UART Related Interrupts
- 8.5Error Management
- 8.6List of Available Callbacks in the
HAL_UARTModule - Differences Between HAL_PPP and HAL_PPPEx Modules
9.DMA Management
- 9.1Introduction to DMA
- 9.1.1The Importance of DMA and the Role of Internal Buses
- 9.1.2The DMA Controller
- 9.1.2.1The DMA Implementation in F0/F1/F3/L0/L1/L4 MCUs
- 9.1.2.2The DMA Implementation in F2/F4/F7 MCUs
- 9.1.2.3The DMA Implementation in G0/G4/L4+/L5/H7 MCUs
- 9.2
HAL_DMAModule - 9.2.1
DMA_HandleTypeDefin F0/F1/F3/L0/L1/L4 HALs - 9.2.2Detailed Fields of
DMA_InitTypeDef - 9.2.3DMA Configuration in G0/G4/L4+/L5/H7 HALs
- 9.2.4
DMA_HandleTypeDefin F2/F4/F7 HALs - 9.2.5How to Perform DMA Transfers in Polling Mode
- 9.2.6How to Perform DMA Transfers in Interrupt Mode
- 9.2.7Using the
HAL_UARTModule with DMA Mode Transfers - 9.2.8Programming the DMAMUX with the CubeHAL
- 9.2.9Miscellaneous Functions From
HAL_DMAandHAL_DMA_ExModules - 9.3Using CubeMX to Configure DMA Requests
- 9.4Correct Memory Allocation of DMA Buffers
- 9.5A Case Study: The DMA Memory-to-Memory Transfer Performance Analysis
10.Clock Tree
- 10.1Clock Distribution
- 10.1.1Overview of the STM32 Clock Tree
- Why So Many Intermediate PLL/Prescaler Stages?
- 10.1.1.1The Multispeed Internal RC Oscillator in STM32L/U Families
- 10.1.2Configuring Clock Tree Using CubeMX
- 10.1.3Clock Source Options in Nucleo Boards
- 10.1.3.1Clock Source in Nucleo-64 rev. MB1136 (older ones with ST-LINK V2.1)
- 10.1.3.1.1OSC Clock Supply
- Read Carefully
- 10.1.3.1.2OSC 32kHz Clock Supply
- Read Carefully
- 10.1.3.2Clock Source in Nucleo-64 rev. MB1367 (newer ones with ST-LINK v3)
- 10.1.3.2.1OSC Clock Supply
- 10.1.3.2.2OSC 32kHz Clock Supply
- 10.2Overview of the
HAL_RCCModule - 10.2.1Compute the Clock Frequency at Run-Time
- Read Carefully
- 10.2.2Enabling the Master Clock Output
- Read Carefully
- 10.2.3Enabling the Clock Security System
- 10.3HSI Calibration
11.Timers
- 11.1Introduction to Timers
- 11.1.1Timer Categories in an STM32 MCU
- 11.1.2Effective Availability of Timers in the STM32 Portfolio
- 11.2Basic Timers
- 11.2.1Using Timers in Interrupt Mode
- The Performance of the
HAL_TIM_IRQHandler()Routine - How to Choose the Values for
PrescalerandPeriodFields? - 11.2.1.1Time Base Generation in Advanced Timers
- 11.2.2Using Timers in Polling Mode
- 11.2.3Using Timers in DMA Mode
- Read Carefully
- 11.2.4Stopping a Timer
- 11.2.5Using CubeMX to Configure a Basic Timer
- 11.3General Purpose Timers
- 11.3.1Time Base Generator with External Clock Sources
- 11.3.1.1External Clock Mode 2
- Read Carefully
- 11.3.1.2External Clock Mode 1
- 11.3.1.3Using CubeMX to Configure the Source Clock of a General Purpose Timer
- 11.3.2Master/Slave Synchronization Modes
- 11.3.2.1Enable Trigger-Related Interrupts
- 11.3.2.2Using CubeMX to Configure the Master/Slave Synchronization
- 11.3.3Generate Timer-Related Events by Software
- 11.3.4Counting Modes
- 11.3.5Input Capture Mode
- 11.3.5.1Using CubeMX to Configure the Input Capture Mode
- 11.3.6Output Compare Mode
- 11.3.6.1Using CubeMX to Configure the Output Compare Mode
- 11.3.7Pulse-Width Generation
- 11.3.7.1Generating a Sinusoidal Wave Using PWM
- 11.3.7.2Using CubeMX to Configure the PWM Mode
- 11.3.8One Pulse Mode
- 11.3.8.1Using CubeMX to Configure the OPM Mode
- 11.3.9Encoder Mode
- 11.3.9.1Using CubeMX to Configure the Encoder Mode
- 11.3.10Other Features Available in General Purpose and Advanced Timers
- 11.3.10.1Hall Sensor Mode
- 11.3.10.2Combined Three-Phase PWM Mode and Other Motor-Control Related Features
- 11.3.10.3Break Input and Locking of Timer Registers
- 11.3.10.4Preloading of Auto-Reload Register
- 11.3.11Debugging and Timers
- 11.4SysTick Timer
- Read Carefully
- 11.4.1Use Another Timer as System Timebase Source
- 11.5A Case Study: How to Precisely Measure Microseconds with STM32 MCUs
12.Analog-To-Digital Conversion
- 12.1Introduction to SAR ADC
- 12.2
HAL_ADCModule - 12.2.1Conversion Modes
- 12.2.1.1Single-Channel, Single Conversion Mode
- 12.2.1.2Scan Single Conversion Mode
- 12.2.1.3Single-Channel, Continuous Conversion Mode
- 12.2.1.4Scan Continuous Conversion Mode
- 12.2.1.5Injected Conversion Mode
- 12.2.1.6Dual Modes
- 12.2.2Channel Selection
- The CubeHAL and its non-linear evolution
- 12.2.3ADC Resolution and Conversion Speed
- 12.2.4A/D Conversions in Polling Mode
- Read Carefully
- 12.2.5A/D Conversions in Interrupt Mode
- 12.2.6A/D Conversions in DMA Mode
- 12.2.6.1Convert Multiple Times the Same Channel in DMA Mode
- 12.2.6.2Multiple and not Continuous Conversions in DMA Mode
- 12.2.6.3Continuous Conversions in DMA Mode
- 12.2.7Errors Management
- 12.2.8Timer-Driven Conversions
- 12.2.9Conversions Driven by External Events
- 12.2.10ADC Calibration
- 12.3Using CubeMX to Configure ADC Peripheral
13.Digital-To-Analog Conversion
- 13.1Introduction to the DAC Peripheral
- 13.2
HAL_DACModule - 13.2.1Driving the DAC Manually
- 13.2.2Driving the DAC in DMA Mode Using a Timer
- Read Carefully
- 13.2.3Triangular Wave Generation
- 13.2.4Noise Wave Generation
14.I²C
- 14.1Introduction to the I²C specification
- Read Carefully
- 14.1.1The I²C Protocol
- 14.1.1.1START and STOP Condition
- 14.1.1.2Byte Format
- 14.1.1.3Address Frame
- 14.1.1.4Acknowledge (ACK) and Not Acknowledge (NACK)
- 14.1.1.5Data Frames
- 14.1.1.6Combined Transactions
- 14.1.1.7Clock Stretching
- 14.1.2Availability of I²C Peripherals in STM32 MCUs
- 14.2
HAL_I2CModule - 14.2.1Using the I²C Peripheral in Master Mode
- Read Carefully
- 14.2.1.1I/O MEM Operations
- 14.2.1.2Combined Transactions
- 14.2.1.3A Note About the Clock Configuration in STM32F0/L0/L4 families
- 14.2.2Using the I²C Peripheral in Slave Mode
- 14.3Using CubeMX to Configure the I²C Peripheral
- Read Carefully
15.SPI
- 15.1Introduction to the SPI Specification
- 15.1.1Clock Polarity and Phase
- 15.1.2Slave Select Signal Management
- 15.1.3SPI TI Mode
- 15.1.4Availability of SPI Peripherals in STM32 MCUs
- 15.2
HAL_SPIModule - 15.2.1Exchanging Messages Using SPI Peripheral
- 15.2.2Maximum Transmission Frequency Reachable using the CubeHAL
- 15.3Using CubeMX to Configure SPI Peripheral
16.Cyclic Redundancy Check
- 16.1Introduction to CRC Computing
- 16.1.1CRC Calculation in STM32F1/F2/F4/L1 MCUs
- 16.1.2CRC Peripheral in STM32F0/F3/F7/L0/L4/L5/G0/G4 MCUs
- 16.2
HAL_CRCModule
17.IWDG and WWDG Timers
- 17.1The Independent Watchdog Timer
- 17.1.1Using the CubeHAL to Program IWDG Timer
- 17.2The System Window Watchdog Timer
- 17.2.1Using the CubeHAL to Program WWDG Timer
- 17.3Detecting a System Reset Caused by a Watchdog Timer
- 17.4Freezing Watchdog Timers During a Debug Session
- 17.5Selecting the Right Watchdog Timer for Your Application
18.Real-Time Clock
- 18.1Introduction to the RTC Peripheral
- 18.2
HAL_RTCModule - 18.2.1Setting and Retrieving the Current Date/Time
- 18.2.1.1Correct Way to Read Date/Time Values
- 18.2.2Configuring Alarms
- 18.2.3Periodic Wakeup Unit
- 18.2.4Timestamp Generation and Tamper Detection
- 18.2.5RTC Calibration
- 18.2.5.1RTC Coarse Calibration
- 18.2.5.2RTC Smooth Calibration
- 18.2.5.3Reference Clock Detection
- 18.3Using the Backup SRAM
- IIIAdvanced topics
19.Power Management
- 19.1Power Management in Cortex-M Based MCUs
- 19.2How Cortex-M MCUs Handle Run and Sleep Modes
- 19.2.1Entering/exiting sleep modes
- 19.2.1.1Sleep-On-Exit
- 19.2.2Sleep Modes in Cortex-M Based MCUs
- 19.3Power Management in STM32F Microcontrollers
- 19.3.1Power Sources
- 19.3.2Power Modes
- 19.3.2.1Run Mode
- 19.3.2.1.1Dynamic Voltage Scaling in STM32F4/F7 MCUs
- 19.3.2.1.2Over/Under-Drive Mode in STM32F4/F7 MCUs
- 19.3.2.2Sleep Mode
- 19.3.2.3Stop Mode
- 19.3.2.4Standby Mode
- Read Carefully
- 19.3.2.5Low-Power Modes Example
- 19.3.3An Important Warning for STM32F1 Microcontrollers
- 19.4Power Management in STM32L/G Microcontrollers
- 19.4.1Power Sources
- 19.4.2Power Modes
- 19.4.2.1Run Modes
- 19.4.2.2Sleep Modes
- Read Carefully
- 19.4.2.2.1Batch Acquisition Mode
- 19.4.2.3Stop Modes
- 19.4.2.4Standby Modes
- 19.4.2.5Shutdown Mode
- 19.4.3Power Modes Transitions
- 19.4.4Low-Power Peripherals
- 19.4.4.1LPUART
- 19.4.4.2LPTIM
- 19.4.4.3LPGPIO
- 19.4.4.4LPDMA
- 19.5Power Supply Supervisors
- 19.6Debugging in Low-Power Modes
- 19.7Using the CubeMX Power Consumption Calculator
- 19.8A Case Study: Using Watchdog Timers With Low-Power Modes
20.Memory layout
- 20.1The STM32 Memory Layout Model
- 20.1.1Flash Memory Typical Organization
- 20.1.2SRAM Memory Typical Organization
- 20.1.3Understanding Compilation and Linking Processes
- 20.2The Really Minimal STM32 Application
- 20.2.1ELF Binary File Inspection
- STM32CubeIDE Build Analyzer
- 20.2.2
.dataand.bssSections Initialization - 20.2.2.1A Word About the
COMMONSection - 20.2.3
.rodataSection - Pointers to Const Data
- 20.2.4Stack and Heap Regions
- A Note About Linker Script Symbols
- 20.2.5Checking the Size of Heap and Stack at Compile-Time
- 20.2.6Differences With the Tool-Chain Script Files
- 20.3How to Use the CCM Memory
- Why Use CCM to Store Code Instead of Data?
- 20.3.1Relocating the vector table in CCM Memory
- 20.4How to Use the MPU in Cortex-M0+/3/4/7 Based STM32 MCUs
- 20.4.1Programming the MPU With the CubeHAL
21.Flash Memory Management
- 21.1Introduction to STM32 Flash Memory
- 21.2The
HAL_FLASHModule - 21.2.1Flash Memory Unlocking
- 21.2.2Flash Memory Erasing
- Read Carefully
- 21.2.3Flash Memory Programming
- 21.2.4Flash Read Access During Programming and Erasing
- 21.3Option Bytes
- 21.3.1Flash Memory Read Protection
- Read Carefully
- 21.4Optional OTP and True-EEPROM Memories
- 21.5Flash Read Latency and the ART™ Accelerator
- 21.5.1The Role of the TCM Memories in STM32F7/H7 MCUs
- 21.5.1.1How to Access Flash Memory Through the TCM Interface
- 21.5.1.2Using CubeMX to Configure Flash Memory Interface
22.Booting Process
- 22.1The Cortex-M Unified Memory Layout and the Booting Process
- 22.1.1Software Physical Remap
- 22.1.2Vector Table Relocation
- 22.1.3Running the Firmware From SRAM Using the STM32CubeIDE
- 22.2Integrated STM32 Bootloader
- 22.2.1Starting the STM32 Bootloader from the On-Board Firmware
- 22.2.2The Booting Sequence in the STM32CubeIDE Tool-chain
- 22.3Developing a Custom Bootloader
- Read Carefully
- Some Considerations on the Custom Bootloader
- 22.3.1Vector Table Relocation in STM32F0 Microcontrollers
- 22.3.2How to Use the
flasher.pyTool
23.Running FreeRTOS
- 23.1Understanding the Concepts Underlying an RTOS
- 23.2Configuring FreeRTOS and the CMSIS-RTOS v2 Wrapper
- 23.2.1The FreeRTOS Source Tree
- 23.2.1.1How to Configure FreeRTOS Using CubeMX
- 23.3Thread Management
- Read Carefully
- Read Carefully
- 23.3.1Thread States
- 23.3.2Thread Priorities and Scheduling Policies
- 23.3.3Voluntary Release of the Control
- 23.3.4The idle Thread
- A Word About Concurrent Programming
- 23.4Memory Allocation and Management
- 23.4.1Dynamic Memory Allocation Model
- 23.4.1.1
heap_1.c - 23.4.1.2
heap_2.c - 23.4.1.3
heap_3.c - 23.4.1.4
heap_4.c - 23.4.1.5
heap_5.c - 23.4.1.6FreeRTOS Heap Definition
- 23.4.2Static Memory Allocation Model
- Read Carefully
- 23.4.2.1idle Thread Allocation with Static Memory Allocation Model
- 23.4.3FreeRTOS and the C stdlib
- 23.4.3.1How to Configure
newlibto Handle Concurrency with FreeRTOS - 23.4.3.2How to Use
malloc()andmalloc()-dependantnewlibFunctions With FreeRTOS - Read Careflly
- 23.4.3.3STM32CubeMX Approach to Thread-Safety
- 23.4.4Memory Pools
- 23.4.5Stack Overflow Detection
- 23.5Synchronization Primitives
- 23.5.1Message Queues
- 23.5.2Semaphores
- 23.5.3Event and Thread Flags
- 23.6Resources Management and Mutual Exclusion
- 23.6.1Mutexes
- 23.6.1.1The Priority Inversion Problem
- 23.6.1.2Recursive Mutexes
- 23.6.2Critical Sections
- 23.6.3Interrupt Management With an RTOS
- 23.6.3.1FreeRTOS API and Interrupt Priorities
- 23.7Software Timers
- 23.7.1How FreeRTOS Manages Timers
- 23.8A Case Study: Low-Power Management With an RTOS
- 23.8.1The idle Thread Hook
- Which Sleep Instruction to Use?
- 23.8.2The Tickless Mode in FreeRTOS
- Why tick Count Accuracy Is So Relevant?
- 23.8.2.1A Schema for the tickless Mode
- Read Carefully
- Read Carefully
- 23.8.2.2A Custom tickless Mode Policy
- A Note About LPTIM Timers
- 23.9Debugging Features
- 23.9.1
configASSERT()Macro - 23.9.2Run-Time Statistics and Thread State Information
- 23.9.3FreeRTOS Debugging in STM32CubeIDE
- 23.9.4FreeRTOS Kernel-Aware Debugging in STM32CubeIDE
- 23.10Alternatives to FreeRTOS
- 23.10.1AzureRTOS
- 23.10.2ChibiOS
- 23.10.3Contiki OS
- 23.10.4OpenRTOS
24.Advanced Debugging Techniques
- 24.1Understanding Cortex-M Fault-Related Exceptions
- 24.1.1The Cortex-M Exception Entrance Sequence and the ARM Calling Convention
- 24.1.1.1How to Interpret the Content of the LR Register on Exception Entrance
- 24.1.2Fault Exceptions and Faults Analysis
- 24.1.2.1Memory Management Exception
- 24.1.2.2Bus Fault Exception
- 24.1.2.3Usage Fault Exception
- 24.1.2.4Hard Fault Exception
- 24.1.2.5Secure Fault Exception
- 24.1.2.6Enabling Optional Fault Handlers
- 24.1.2.7Fault Analysis in Cortex-M0/0+ Based Processors
- 24.2STM32CubeIDE Advanced Debugging Features
- 24.2.1Expressions and Live Expressions
- 24.2.1.1Memory Monitors
- 24.2.2Watchpoints
- 24.2.3Instruction Stepping Mode
- Read Carefully
- 24.2.4SFRs View
- 24.2.5Fault Analyzer
- 24.2.5.1Tracing Fault-Related Registers Without the IDE Support
- 24.2.6Build Analyzer
- 24.2.7Static Stack Analyzer
- 24.3Serial Wire Viewer Tracing
- Differences Between JTAG and SWD Interfaces
- 24.3.1Enabling SWV Debugging
- 24.3.2Configuring SWV
- 24.3.3SWV Views
- 24.3.3.1SWV Trace Log
- 24.3.3.2SWV Exception Trace Log
- 24.3.3.3SWV Data Trace
- 24.3.3.4SWV Data Trace Timeline Graph
- 24.3.3.5SWV ITM Data Console
- 24.3.3.6SWV Statistical Profiling
- 24.4Debugging Aids from the CubeHAL
- 24.5External Debuggers
- 24.6Debugging two Nucleo Boards Simultaneously
- 24.7ARM Semihosting
- 24.7.1Enable Semihosting on a Project
- Read Carefully
- 24.7.2Semihosting Drawbacks
- 24.7.3Understanding How Semihosting Works
25.FAT Filesystem
- 25.1Introduction to FatFs Library
- 25.1.1Adding FatFs Library in Your Projects
- 25.1.1.1The Generic Disk Interface API
- 25.1.1.2The Implementation of a Driver to Access SD Cards in SPI Mode
- 25.1.2Relevant FatFs Structures and Functions
- 25.1.2.1Mounting a Filesystem
- 25.1.2.2Opening a File
- 25.1.2.3Reading From/Writing into a File
- 25.1.2.4Creating and Opening a Directory
- 25.1.3How to Configure the FatFs Library
26.Develop IoT Applications
- 26.1Solutions Offered by STM to Develop IoT Applications
- 26.2The W5500 Ethernet Controller
- 26.2.1How to Use the W5500 Shield and the
ioLibrary_DriverModule - 26.2.1.1Configuring the SPI Interface
- 26.2.1.2Configuring the Socket Buffers and the Network Interface
- 26.2.2Socket APIs
- Read Carefully
- 26.2.2.1Handling Sockets in TCP Mode
- 26.2.2.2Handling Sockets in UDP Mode
- 26.2.3I/O Retargeting to a TCP/IP Socket
- 26.2.4Building up an HTTP Server
- 26.2.4.1A Web-Based Oscilloscope
27.Universal Serial Bus
- 27.1USB 2.0 Specification Overview
- 27.1.1The “Before-To-Die” Guide to USB
- 27.1.2USB Physical Architecture Overview
- 27.1.3USB Logical Architecture Overview
- 27.1.3.1Device States
- 27.1.3.2Communication Endpoints
- 27.1.4USB 2.0 Communication Protocol Overview
- 27.1.4.1Packet Types
- 27.1.4.2Transaction Types
- 27.1.4.2.1Control Transactions
- 27.1.4.2.2IN/OUT Transactions
- 27.1.4.3Device and Interface Descriptors
- 27.1.4.3.1Device Descriptors
- 27.1.4.3.2Configuration Descriptors
- 27.1.4.3.3Interface Descriptors
- 27.1.4.3.4Endpoint Descriptors
- 27.1.4.3.5String Descriptors
- 27.1.4.4USB Classes
- 27.2STM32 USB Device Library
- 27.2.1Understanding Generated Code
- 27.2.2USB Initialization Sequence
- 27.2.3USB Enumeration Sequence
- 27.2.4The USB CDC Class
- 27.2.4.1USB CDC Descriptors
- 27.2.4.2USB CDC Class Initialization
- 27.2.4.3USB CDC Class Operations
- 27.3Building Custom USB Devices
- 27.3.1The USB HID Class
- 27.3.1.1USB HID Descriptors
- 27.3.1.2Overview of the Report Descriptor
- 27.3.1.3USB HID Class-Specific Requests
- 27.3.2Building a Vendor-Specific USB HID Device
- Read Carefully
- 27.4Debugging USB Devices
- 27.4.1Software Sniffers and Analyzers
- 27.4.2USB Hardware Analyzers
- 27.5Optimizing the STM32 USB Device Library
- 27.6Going to the Market
28.Getting Started with a New Design
- 28.1Hardware Design
- 28.1.1PCB Layer Stack-Up
- 28.1.2MCU Package
- 28.1.3Decoupling of Power-Supply Pins
- 28.1.4Clocks
- 28.1.5Filtering of RESET Pin
- 28.1.6Debug Port
- Read Carefully
- 28.1.7Boot Mode
- 28.1.8Pay attention to “pin-to-pin” Compatibility…
- 28.1.9…And to Selecting the Right Peripherals
- 28.1.10The Role of CubeMX During the Board Design Stage
- Read Carefully
- 28.1.11Board Layout Strategies
- 28.2Software Design
- 28.2.1Generating the binary image for production
- Appendix
A. Miscellaneous HAL functions and STM32 features
- Force MCU reset from the firmware
- STM32 96-bit Unique CPU ID
B. Troubleshooting Guide
- STM32CubeIDE Issues
- Debugging Continuously Breaks at Every Instruction During a Debug Session
- The Step-by-Step Debugging is Really Slow
- The Firmware Works Only Under a Debug Session
- STM32 Related Issues
- The Microcontroller Does Not Boot Correctly
- It is Not Possible to Flash or to Debug the MCU
C. Nucleo pin-out
- Nucleo-G474RE
- Arduino compatible headers
- Morpho headers
- Nucleo-F446RE
- Arduino compatible headers
- Morpho headers
- Nucleo-F401RE
- Arduino compatible headers
- Morpho headers
- Nucleo-F303RE
- Arduino compatible headers
- Morpho headers
- Nucleo-F103RB
- Arduino compatible headers
- Morpho headers
- Nucleo-F072RB
- Arduino compatible headers
- Morpho headers
- Nucleo-L476RG
- Arduino compatible headers
- Morpho headers
- Nucleo-L152RE
- Arduino compatible headers
- Morpho headers
- Nucleo-L073R8
- Arduino compatible headers
- Morpho headers
D. Differences with the 1st edition
- Chapter 1
- Chapter 2
- Chapter 3 and 4
- Chapter 5
- Chapter 6
- Chapter 7
- Chapter 8
- Chapter 9
- Chapter 10
- Chapter 11
- Chapter 12-22
- Chapter 23
- Chapter 24
- Chapter 25-26
- Chapter 27
- Chapter 28