嵌入式系统编程随笔

Chapter 1, Introduction Explains the field of embedded programming and lays out the parameters of the book, including the reference hardware used for examples

Chapter 2, Getting to Know the Hardware Shows how to explore the documentation for your hardware and represent the components you need to interact with in C

Chapter 3, Your First Embedded Program Creates a simple blinking light application that illustrates basic principles of embedded programming

Chapter 4, Compiling, Linking, and Locating Goes over the ways that embedded systems differ from conventional computer systems during program building steps, covering such issues as cross-compilers

Chapter 5, Downloading and Debugging Introduces the tools you’ll need in order to iron out problems in both hardware and software

Chapter 6, Memory Describes the different types of memory that developers choose for embedded systems and the issues involved in using each type

Chapter 7, Peripherals Introduces the notion of a device driver, along with other coding techniques for working with devices

Chapter 8, Interrupts Covers this central area of working with peripherals

Chapter 9, Putting It All Together Combines the concepts and code from the previous chapter with convenience functions and a main program, to create a loadable, testable application

Chapter 10, Operating Systems Introduces common operating system concepts, including tasks (or threads) and synchronization mechanisms, along with the reasons for adding a real-time operating system

Chapter 11, eCos Examples Shows how to use some features of the eCos real-time operating system

Chapter 12, Embedded Linux Examples Accomplishes the same task as the previous chapter, but for the embedded Linux operating system

Chapter 13, Extending Functionality Describes options for adding buses, networking, and other communication features to a system

Chapter 14, Optimization Techniques Describes ways to decrease code size, reduce memory use, and conserve power

Appendix A, The Arcom VIPER-Lite Development Kit Describes the board used for the examples in this book and how to order one for yourself

Appendix B, Setting Up Your Software Development Environment Gives instructions for loading the software described in this book on your host Windows or Linux computer

Appendix C, Building the GNU Software Tools Shows you how to compile the GNU development tools

Appendix D, Setting Up the eCos Development Environment Shows you how to build an eCos library appropriate for your embedded system so you can compile programs to run on your system

Appendix E, Setting Up the Embedded Linux Development Environment Describes how to install the embedded Linux tools for your Arcom system and build and run a program on it

第1章,简要介绍嵌入式编程领域,并列出本书的参数,包括用于示例的参考硬件

第2章,了解硬件介绍如何浏览硬件文档并表示在C中与之交互所需的组件

第3章,您的第一个嵌入式程序创建一个简单的闪烁灯应用程序,说明嵌入式编程的基本原理

第4章,编译,链接和定位在程序构建步骤中讨论嵌入式系统与传统计算机系统的不同之处,包括交叉编译器等问题

第5章,下载和调试介绍了解决硬件和软件问题所需的工具

第6章,内存描述开发人员为嵌入式系统选择的不同类型的内存以及使用每种类型所涉及的问题

第7章,外围设备介绍设备驱动程序的概念,以及使用设备的其他编码技术

第8章,中断涵盖了与外围设备一起工作的中心区域

第9章,全部放在一起将前一章中的概念和代码与便捷功能和主程序相结合,创建可加载,可测试的应用程序

第10章,操作系统介绍常见的操作系统概念,包括任务(或线程)和同步机制,以及添加实时操作系统的原因

第11章,eCos示例演示如何使用eCos实时操作系统的某些功能

第12章,嵌入式Linux示例完成与前一章相同的任务,但是对于嵌入式Linux操作系统

第13章,扩展功能介绍向系统添加总线,网络和其他通信功能的选项

第14章,优化技术介绍减少代码大小,减少内存使用和节省电量的方法

附录A,Arcom VIPER-Lite开发套件描述了本书中示例所使用的板以及如何为自己订购一块板

附录B,设置软件开发环境提供有关在主机Windows或Linux计算机上加载本书中描述的软件的说明

附录C,构建GNU软件工具向您展示如何编译GNU开发工具

附录D,设置eCos开发环境演示如何构建适合嵌入式系统的eCos库,以便编译程序以在系统上运行

附录E,设置嵌入式Linux开发环境介绍如何为Arcom系统安装嵌入式Linux工具,并在其上构建和运行程序

实时系统

 

软件设计的关键问题包括:访问是否足以满足要求还是应该使用中断处理,同时应为不同的任务和中断赋予什么样的优先级。另外,必须事先了解特定系统的最坏性能要求。

 

 

处理能力

储存器

批量

耗电量

开发成本

生命周期

可靠性

 

 

硬件知识

高效率代码

外围接口

健壮代码

最小的资源

可重用的软件

开发工具

 

 

• What is the overall purpose of the board?

• How does data flow through it?

电路板的整体目的是什么

数据是怎恶通过它传输的

 

数据结构流程图

 

 

Hardware Basics

 

 

Resistor

Capacitor

Diode

Crystal 晶振

Inductor

Power

Ground

 

The processor’s pins and their associated pin numbers run along the sides of the symbol. For example, bit 0 of the data bus is named D0 and is located on pin number 5 of the processor.

 

You will also notice that some pins, such as P1.1/RTS0 pin number 102, have a bar over the pin name. This indicates that the signal is active low. This means a logic level of 0 will activate the funtionality of this signal, whereas a logic level of 1 will deactivate the function. The opposite type of operation is active high.

 

Active low functionality can also be indicated by a forward slash (/) or tilde (~) placed either before or after the signal name. The signal is then typically pronounced “not RTS0” or “RTS0 bar.” Some component manufacturers represent an active-low signal with the prefix “n” in front of the signal name, such as nRESET.

 

 

无限循环的作用

在为嵌入式系统和其他计算机平台写程序时有一个最基本的区别, 就是嵌人式程序总是以一个无限循环作为结束。

 

 

编译、链接和定址

把你的嵌入式软件的源代码表述转换为可执行的二进制映像的过程, 包括三个截然不同的步骤。首先,每一个源文件都必须被编译或汇编到一个目标文件(object file)。然后.第一步产生的所有目标文件要被链接成一个目标文件,它叫做可重定位程序(relocatable program)。 最后, 在一个称为重定址(relocation)的过程中,要把物理存储器地址指定给可重定位程序里的每个相对偏移处。第三步的结果就是一个可以运行在嵌入式系统上的包含可执行二进制映像的文件。

 

 

 

 

编译

编译器的工作主要是把用人可读的语言所书写的程序, 翻译为特定的处理器上等效的一系列操作码。

通常在目标文件里还有一个符号表, 记录了源文件引用的所有变量和函数的名字和位置。

 

链接器的工作就是把这些目标文件组合到一起,同时解决所有未解决的符号问题

 

C/C++程序的启动代码通常包含以下行为,并且按照所列的次序执行:

1、禁止所有中断。

2、从 ROM 里复制所有初始化数据到 RAM 里。

3、把未初始化数据区清零。

4、未堆栈分配空间并初始化。

5、初始化处理器堆栈指针。

6、创建并初始化堆。

7、(只对 C++有效)对所有全局变量执行构造函数和初始化函数。

8、允许中断。

9、调用 main。

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值