Skip to Content
嵌入式 Android
book

嵌入式 Android

by Karim Yaghmour
July 2025
Intermediate to advanced
412 pages
6h 9m
Chinese
O'Reilly Media, Inc.
Content preview from 嵌入式 Android

第 5 章 硬件入门硬件入门

本作品已使用人工智能进行翻译。欢迎您提供反馈和意见:translation-feedback@oreilly.com

既然已经掌握了 Android 的构建系统,下一步就是逐步探索如何在目标机上使用构建的映像。为了更好地实现这一目标,我们必须回过头来看看 Android 通常在哪些硬件配置上运行。事实上,虽然 Android 可以在各种嵌入式系统上运行,但它仍然深深扎根于消费电子产品领域,尤其是手机。

我们将首先介绍运行 Android 的硬件平台的典型系统架构。然后,我们将讨论典型 SoC 的架构,并概述一些用于运行 Android 的著名 SoC。我们还将介绍虚拟地址空间和物理地址空间的区别、典型的主机-目标调试设置,并在本章最后提供一份评估板清单,您可以用它来制作嵌入式 Android 系统原型和/或学习相关知识。

典型系统架构

正如我们在第 1 章中所讨论的,Android 可以在任何运行 Linux 的硬件上运行。然而,Android 并不是在真空中构建的,它最初是为手机设计的,其当前的架构也反映了这一点。图 5-1展示了运行 Android 的原型嵌入式系统的架构框图。您的实际目标很可能与我的示意图不同,甚至大相径庭。但为了便于讨论,这张图就足够了。

Typical system architecture block diagram
图 5-1.典型系统架构框图

最重要的一点是,这个系统的中心是 SoC。我们将在下一节更详细地讨论 SoC。现在只需说明 SoC 包含一个 CPU 和一堆外设控制器,它们都在同一个集成电路 (IC) 芯片上。目标电路板上的所有其他组件通常都以这样或那样的方式与 SoC 相连。安卓基本上是在 SoC 上运行,因此可以从这个有利位置控制和/或访问电路板上的一切。

基带处理器

下一个需要注意的组件是基带处理器。市场上大多数手机都有独立的处理单元,用于运行面向用户的软件和管理无线电功能。它们通常分别称为应用处理器 (AP) 和基带处理器 (BP)。

你可能会问,为什么有两个独立的处理器,而不是只有一个。这既有法律方面的原因,也有技术方面的原因。首先,在美国,法律要求软件定义无线电(SDR)设备必须通过联邦通信委员会(FCC)的认证。该认证要求控制无线电的软件未经授权不得修改。从本质上讲,这意味着在任何情况下,设备的最终用户都不得改变无线电的运行方式或使用的频率。此外,无线电功能的操作也有硬性的实时限制。因此,从运行面向用户操作系统的 CPU 控制无线电是不可行的。在 BP 继续运行时,让 AP 进入休眠状态也有好处。

当然,这只是一个小结,关于这个话题还有很多要说的。不过,就我们目前的讨论而言,假设没有办法让单个处理器同时运行 Android 和控制无线电的软件。显然,如果您的嵌入式系统不是手机,或者不具备无线电功能,那么只需假设图中没有 BP 或与之相连的任何组件即可。

尽管如此,我们还是应该了解 BP 及其与 AP 的交互,因为 Android 的 RIL 架构与底层硬件紧密相连。简单来说,BP 和 AP 通过某种形式的串行总线使用 AT 命令相互通信。请注意,BP 有自己的闪存和 RAM。这就保证了 BP 上运行的认证软件与 AP 上运行的软件是隔离的,而且 BP 上运行的实时操作系统(RTOS)只专注于运行一件事:无线电的运行。例如,BP 运行的是实现 GSM 协议栈的软件。还要注意的是,SIM ...

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.

Read now

Unlock full access

More than 5,000 organizations count on O’Reilly

AirBnbBlueOriginElectronic ArtsHomeDepotNasdaqRakutenTata Consultancy Services

QuotationMarkO’Reilly covers everything we've got, with content to help us build a world-class technology community, upgrade the capabilities and competencies of our teams, and improve overall team performance as well as their engagement.
Julian F.
Head of Cybersecurity
QuotationMarkI wanted to learn C and C++, but it didn't click for me until I picked up an O'Reilly book. When I went on the O’Reilly platform, I was astonished to find all the books there, plus live events and sandboxes so you could play around with the technology.
Addison B.
Field Engineer
QuotationMarkI’ve been on the O’Reilly platform for more than eight years. I use a couple of learning platforms, but I'm on O'Reilly more than anybody else. When you're there, you start learning. I'm never disappointed.
Amir M.
Data Platform Tech Lead
QuotationMarkI'm always learning. So when I got on to O'Reilly, I was like a kid in a candy store. There are playlists. There are answers. There's on-demand training. It's worth its weight in gold, in terms of what it allows me to do.
Mark W.
Embedded Software Engineer

You might also like

Practical Android Projects

Practical Android Projects

Lucas Jordan, Pieter Greyling
GPU Pro 5

GPU Pro 5

Wolfgang Engel

Publisher Resources

ISBN: 9798341663206