Bare-Metal Embedded C Programming Develop high-performance embedded systems with C for Arm microcontrollers

Become proficient in designing and developing embedded systems and reduce reliance on third-party libraries Key Features Learn to develop bare-metal firmware for Arm microcontrollers from scratchUnderstand hardware intricacies to minimize your dependency on third-party librariesNavigate microcontrol...

Celý popis

Uložené v:
Podrobná bibliografia
Hlavný autor: Gbati, Israel
Médium: E-kniha
Jazyk:English
Vydavateľské údaje: Birmingham Packt Publishing 2024
Packt Publishing, Limited
Packt Publishing Limited
Vydanie:1
Predmet:
ISBN:9781835460818, 183546081X
On-line prístup:Získať plný text
Tagy: Pridať tag
Žiadne tagy, Buďte prvý, kto otaguje tento záznam!
Obsah:
  • Table of Contents Setting Up the Tools of the TradeConstructing Peripheral Registers from Memory AddressesUnderstanding the Build Process and Exploring the GNU ToolchainDeveloping the Linker Script and Startup FileThe "Make" Build SystemThe Common Microcontroller Software Interface Standard (CMSIS)The General-Purpose Input/Output (GPIO) PeripheralSystem Tick (SysTick) TimerGeneral-Purpose Timers (TIM)The Universal Asynchronous Receiver/Transmitter ProtocolAnalog-to-Digital Converter (ADC)Serial Peripheral Interface (SPI)Inter-Integrated Circuit (I2C)External Interrupts and Events (EXTI)The Real-Time Clock (RTC)Independent Watchdog (IWDG)Direct Memory Access (DMA)Power Management and Energy Efficiency in Embedded Systems
  • Title Page Preface Table of Contents 1. Setting Up the Tools of the Trade 2. Constructing Peripheral Registers from Memory Addresses 3. Understanding the Build Process and Exploring the GNU Toolchain 4. Developing the Linker Script and Startup File 5. The "Make" Build System 6. The Common Microcontroller Software Interface Standard (CMSIS) 7. The General-Purpose Input/Output (GPIO) Peripheral 8. System Tick (SysTick) Timer 9. General-Purpose Timers (TIM) 10. The Universal Asynchronous Receiver/Transmitter Protocol 11. Analog-to-Digital Converter (ADC) 12. Serial Peripheral Interface (SPI) 13. Inter-Integrated Circuit (I2C) 14. External Interrupts and Events (EXTI) 15. The Real-Time Clock (RTC) 16. Independent Watchdog (IWDG) 17. Direct Memory Access (DMA) 18. Power Management and Energy Efficiency in Embedded Systems Index
  • Intro -- Preface -- Cover -- Title Page -- Copyright and credits -- Foreword -- Contributors -- Table of Contents -- Preface -- Chapter 1: Setting Up the Tools of the Trade -- Getting the most out of this book - get to know your free benefits -- Technical requirements -- Essential development tools for microcontrollers -- Setting up the STM32CubeIDE -- Setting up the GNU Arm Embedded Toolchain -- Setting up OpenOCD -- The development board -- Understanding the role of a development board -- An overview of the NUCLEO-F411 Development Board -- Datasheets and manuals - unraveling the details -- Understanding STMicroelectronics' documentation -- The generic user guide by ARM -- Getting the documents -- Navigating the STM32CubeIDE -- Understanding the control icons -- Summary -- Chapter 2: Constructing Peripheral Registers from Memory Addresses -- Technical requirements -- The different types of firmware development -- HAL -- LL -- Bare-Metal C -- Assembly language -- Locating and understanding the development board's components -- Locating the LED connection -- Locating the User Push button -- Locating the berg pins and Arduino-compatible headers -- Defining and creating registers through documentation insights -- Locating GPIO PORTA -- Clock gating -- The AHB1 ER -- Setting and clearing bits in registers -- The GPIO port mode register (GPIOx_MODER) -- GPIO Port Output Data Register (GPIOx_ODR) -- Register manipulation - from configuration to running your first firmware -- Register Definitions -- The UL suffix -- Main Function -- Summary -- Chapter 3: Understanding the Build Process and Exploring the GNU Toolchain -- Technical requirements -- The foundations - understanding the embedded build process -- The pre-processing stage -- The compilation stage -- The assembly stage -- The linking stage -- The locating stage
  • A tour of GNU binary tools for embedded systems -- arm-none-eabi-gcc -- Some common compiler flags -- Some architecture-specific flags -- Other commands in the GNU Toolchain for Arm -- From IDE to the command line - watching the build process unfold -- Observing the build process from the IDE's perspective -- Compilation of assembly and C files -- Working with the GNU bin tools -- Uploading firmware to the microcontroller using OpenOCD -- Summary -- Chapter 4: Developing the Linker Script and Startup File -- Technical requirements -- Understanding the STM32 memory model -- Flash memory -- SRAM -- Peripheral memory -- The linker script -- Understanding the linking process -- Key components of the linker script -- Linker script directives -- Understanding constants in linker scripts -- Linker script symbols -- Writing the linker script and startup file -- Understanding the load memory of different sections -- Interrupts and the vector table -- Writing the linker script -- Writing the startup file -- Testing our linker script and startup file -- Summary -- Chapter 5: The "Make" Build System -- Technical requirements -- An introduction to build systems -- Make -- Maven -- The Make build system -- The basics of Make -- Installing and configuring Make -- Writing Makefiles for firmware projects -- Testing our Makefile -- Applying special and user-defined variables -- Summary -- Chapter 6: The Common Microcontroller Software Interface Standard (CMSIS) -- Technical requirements -- Defining peripheral registers with C structures -- Getting the base address and offsets of registers -- Implementing the peripheral structures -- Evaluating the structure-based register access method -- Understanding CMSIS -- What is CMSIS? -- Key components of CMSIS -- The CMSIS coding rules -- The CMSIS-Core files -- Setting up the required CMSIS files
  • Getting the right header files -- Working with CMSIS files -- Summary -- Chapter 7: The General-Purpose Input/Output (GPIO) Peripheral -- Technical requirements -- Understanding the GPIO peripheral -- The STM32 GPIO registers -- The GPIO mode register (GPIOx_MODER) -- The GPIO output data register (GPIOx_ODR) and the GPIO input data register (GPIOx_IDR) -- The GPIO bit-set/reset register (GPIOx_BSRR) -- The GPIO alternate function registers (GPIOx_AFRL and GPIOx_AFRH) -- Developing input and output drivers -- The GPIO output driver using the BSRR -- The GPIO input driver -- Summary -- Chapter 8: System Tick (SysTick) Timer -- Technical requirements -- Introduction to the SysTick timer -- Overview of the SysTick timer -- SysTick timer registers -- Developing a driver for the SysTick timer -- Summary -- Chapter 9: General-Purpose Timers (TIM) -- Technical requirements -- Introduction to timers and their uses -- Common use cases of timers -- Time interval measurement -- Delay generation -- Event trigger -- STM32 timers -- Introduction to general-purpose timers and advanced timers -- How STM32 timers work -- Developing the timer driver -- Summary -- Chapter 10: The Universal Asynchronous Receiver/Transmitter Protocol -- Technical requirements -- Introduction to communication protocols -- What are communication protocols? -- Comparing UART, SPI, and I2C -- Common use cases for the UART, SPI, and I2C protocols -- Overview of the UART protocol -- What is UART? -- The interface -- How UART works -- The STM32F4 UART peripheral -- Developing the UART driver -- Summary -- Chapter 11: Analog-to-Digital Converter (ADC) -- Technical requirements -- Overview of analog-to-digital conversion -- What is analog-to-digital conversion? -- Key specifications of the ADC - resolution, step size, and VREF -- The STM32F4 ADC peripheral -- The ADC channels
  • Understanding regular channels versus injected channels in STM32F411 ADC -- The key ADC registers and flags -- ADC Control Register 1 (ADC_CR1) -- ADC Control Register 2 (ADC_CR2) -- ADC Regular Sequence Register (ADC_SQRx) -- ADC Data Register (ADC_DR) -- ADC Status Register (ADC_SR) -- The key ADC flags -- Developing the ADC driver -- Summary -- Chapter 12: Serial Peripheral Interface (SPI) -- Technical requirements -- Overview of the SPI protocol -- What is SPI? -- Key features of SPI -- The SPI interface -- How SPI works -- CPHA and CPOL -- Data modes -- SPI speed -- The STM32F4 SPI peripherals -- Key features -- Key SPI registers -- Developing the SPI driver -- Defined macros -- GPIO initialization for SPI -- SPI1 configuration -- Transmitting data with SPI -- SPI data reception -- CS management -- The header file -- Getting to know the ADXL345 accelerometer -- Understanding key concepts - static acceleration of gravity, tilt-sensing, and dynamic acceleration -- Developing the ADXL345 driver -- Summary -- Chapter 13: Inter-Integrated Circuit (I2C) -- Technical requirements -- An overview of the I2C protocol -- What is I2C? -- The STM32F4 I2C peripherals -- The key I2C registers -- Developing the I2C driver -- Summary -- Chapter 14: External Interrupts and Events (EXTI) -- Technical requirements -- Interrupts and their role in firmware -- What are interrupts? -- How do interrupts work? -- Importance of interrupts in firmware -- Interrupts versus exceptions -- Comparative analysis-interrupt-driven solutions versus polling-based solutions -- The STM32 EXTI controller -- Key features of the EXTI -- External interrupt/event line mapping -- Developing the EXTI driver -- EXTI_IMR -- EXTI_RTSR -- EXTI_FTSR -- Pending Register (EXTI_PR) -- The EXTI driver -- Summary -- Chapter 15: The Real-Time Clock (RTC) -- Technical requirements -- Understanding RTCs
  • How do RTCs work? -- Common use cases for RTCs -- The STM32 RTC module -- The main features of the STM32F4 RTC module -- The key components of the STM32F4 RTC module -- Some key RTC registers -- RTC Time Register (RTC_TR) -- RTC Date Register (RTC_DR) -- RTC Control Register (RTC_CR) -- RTC Initialization and Status Register (RTC_ISR) -- RTC Prescaler Register (RTC_PRER) -- RTC Alarm Registers (RTC_ALRMAR and RTC_ALRMBR) -- RTC Wakeup Timer Register (RTC_WUTR) -- Developing the RTC driver -- The RTC implementation file -- Understanding BCD format -- The header file -- The main file -- Summary -- Chapter 16: Independent Watchdog (IWDG) -- Technical requirements -- Understanding WDTs -- What are WDTs? -- How WDTs work -- Common use cases -- Types of WDTs -- The STM32 IWDG -- Key features of the IWDG -- How the IWDG works -- IWDG registers -- Developing the IWDG driver -- The IWDG implementation file -- The main file -- Testing the project -- Summary -- Chapter 17: Direct Memory Access (DMA) -- Technical requirements -- Understanding Direct Memory Access (DMA) -- How DMA works -- Key features -- Common use cases -- The DMA modules of the STM32F4 microcontroller -- The key features of the STM32F4 DMA controller -- Transfer modes -- DMA data modes -- The STM32F4 DMA block diagram -- The key STM32 DMA registers -- Developing the ADC DMA driver -- The ADC DMA driver -- Developing the UART DMA driver -- Developing the DMA memory-to-memory driver -- Summary -- Chapter 18: Power Management and Energy Efficiency in Embedded Systems -- Technical requirements -- An overview of power management techniques -- Dynamic Voltage and Frequency Scaling (DVFS) -- Clock gating -- Power gating -- Low-power modes -- Case study 1 - an energy-efficient smartwatch -- Case study 2 - a solar-powered environmental monitor -- Low-power modes in STM32F4
  • Wake-up sources and triggers from low-power modes in STM32F4
  • Bare-Metal Embedded C Programming: Develop high-performance embedded systems with C for Arm microcontrollers