Search icon CANCEL
Subscription
0
Cart icon
Your Cart (0 item)
Close icon
You have no products in your basket yet
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Free Learning
Arrow right icon
Arrow up icon
GO TO TOP
Bare-Metal Embedded C Programming

You're reading from   Bare-Metal Embedded C Programming Develop high-performance embedded systems with C for Arm microcontrollers

Arrow left icon
Product type Paperback
Published in Sep 2024
Publisher Packt
ISBN-13 9781835460818
Length 438 pages
Edition 1st Edition
Languages
Arrow right icon
Author (1):
Arrow left icon
Israel Gbati Israel Gbati
Author Profile Icon Israel Gbati
Israel Gbati
Arrow right icon
View More author details
Toc

Table of Contents (21) Chapters Close

Preface 1. Chapter 1: Setting Up the Tools of the Trade FREE CHAPTER 2. Chapter 2: Constructing Peripheral Registers from Memory Addresses 3. Chapter 3: Understanding the Build Process and Exploring the GNU Toolchain 4. Chapter 4: Developing the Linker Script and Startup File 5. Chapter 5: The “Make” Build System 6. Chapter 6: The Common Microcontroller Software Interface Standard (CMSIS) 7. Chapter 7: The General-Purpose Input/Output (GPIO) Peripheral 8. Chapter 8: System Tick (SysTick) Timer 9. Chapter 9: General-Purpose Timers (TIM) 10. Chapter 10: The Universal Asynchronous Receiver/Transmitter Protocol 11. Chapter 11: Analog-to-Digital Converter (ADC) 12. Chapter 12: Serial Peripheral Interface (SPI) 13. Chapter 13: Inter-Integrated Circuit (I2C) 14. Chapter 14: External Interrupts and Events (EXTI) 15. Chapter 15: The Real-Time Clock (RTC) 16. Chapter 16: Independent Watchdog (IWDG) 17. Chapter 17: Direct Memory Access (DMA) 18. Chapter 18: Power Management and Energy Efficiency in Embedded Systems 19. Index 20. Other Books You May Enjoy

What This Book Covers

Chapter 1, Setting Up the Tools of the Trade

This chapter introduces the essential tools you’ll need for development. From navigating datasheets to setting up your Integrated Development Environment (IDE), this chapter lays the groundwork for everything that follows.

Chapter 2, Constructing Peripheral Registers from Memory Addresses

In this chapter, we dive into the core of bare-metal programming. You’ll learn how to define and access peripheral registers directly from memory addresses, using the official microcontroller documentation as your guide.

Chapter 3, Understanding the Build Process and Exploring the GNU Toolchain

In this chapter, we take a closer look at the embedded C build process. You’ll explore how to compile and link code manually using the GNU Toolchain, gaining complete control over how your firmware is created.

Chapter 4, Developing the Linker Script and Startup File

In this chapter, you will learn how to write a custom linker script to define how your firmware is placed in the microcontroller’s memory, including allocating sections like code, data, and stack. Additionally, you’ll develop a startup file that configures the microcontroller’s initial state, sets up the stack, initializes memory, and jumps to your main code.

Chapter 5, The “Make” Build System

Automating the build process is a critical part of embedded development. This chapter teaches you how to use the Make build system to streamline your workflow by creating custom Makefiles that automate repetitive tasks.

Chapter 6, The Common Microcontroller Software Interface Standard (CMSIS)

CMSIS simplifies development on ARM Cortex microcontrollers. In this chapter, you’ll learn how to leverage CMSIS to write efficient code that takes advantage of the microcontroller’s features while maintaining simplicity.

Chapter 7, The General-Purpose Input/Output (GPIO) Peripheral

GPIO allows your microcontroller to interact with external devices. This chapter guides you through developing both input and output drivers for GPIO, one of the most frequently used peripherals in embedded systems.

Chapter 8, System Tick (SysTick) Timer

Timing is essential in embedded systems, and the SysTick timer provides an easy way to generate precise time delays and system ticks. This chapter walks you through developing SysTick drivers for use in your embedded applications.

Chapter 9, General-Purpose Timers (TIM)

This chapter introduces you to the general-purpose timers (TIM) in STM32 microcontrollers, teaching you how to develop timer drivers for tasks that require precise timing.

Chapter 10, The Universal Asynchronous Receiver/Transmitter Protocol

Communication is a key aspect of embedded systems. This chapter focuses on the UART protocol, one of the most widely used communication protocols. You’ll learn how to develop UART drivers, enabling your microcontroller to send and receive data from external devices.

Chapter 11, Analog-to-Digital Converter (ADC)

Many embedded applications require converting analog signals into digital data that your microcontroller can process. This chapter covers how to configure the ADC peripheral, allowing you to read and convert analog inputs into meaningful digital values.

Chapter 12, Serial Peripheral Interface (SPI)

SPI is a high-speed communication protocol commonly used in embedded systems. This chapter guides you through developing SPI drivers, enabling efficient communication between your microcontroller and other peripherals, such as sensors or memory devices.

Chapter 13, Inter-Integrated Circuit (I2C)

I2C is another popular communication protocol for connecting devices, it is often used for short-distance communication in embedded systems. This chapter covers the development of I2C drivers, allowing your microcontroller to communicate with multiple devices over a shared bus.

Chapter 14, External Interrupts and Events (EXTI)

Responsiveness is critical in embedded systems, and external interrupts allow your system to react to changes in its environment. This chapter covers how to configure and manage external interrupts and events (EXTI) for timely and efficient responses to external stimuli.

Chapter 15, The Real-Time Clock (RTC)

For systems that require accurate timekeeping, the RTC peripheral is indispensable. In this chapter, you’ll learn how to set up and use the RTC to track time in low-power systems, even when the microcontroller is in sleep mode.

Chapter 16, Independent Watchdog (IWDG)

Stability is crucial for embedded systems, and the Independent Watchdog Timer (IWDG) ensures that your system can recover from unexpected malfunctions. This chapter teaches you how to configure the IWDG to automatically reset your microcontroller if it stops responding, ensuring reliable operation.

Chapter 17, Direct Memory Access (DMA)

Direct Memory Access (DMA) allows data transfers to occur independently of the CPU, significantly improving system efficiency. This chapter covers how to configure and use DMA for memory-to-memory transfers, as well as for peripherals like ADC and UART, offloading the work from the CPU.

Chapter 18, Power Management and Energy Efficiency in Embedded Systems

Power management is essential for energy-efficient systems, especially in battery-powered devices. In this final chapter, you’ll learn techniques for reducing power consumption, including how to use sleep modes, wake-up sources, and optimize firmware to achieve the best balance between performance and energy efficiency.

lock icon The rest of the chapter is locked
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at $19.99/month. Cancel anytime
Banner background image