芯片引导启动

结合使用过的几款MCU与DSP芯片开发经验,对芯片启动引导过程简单整理

1 引导流程

嵌入式芯片引导启动基本流程如图1所示,不同芯片启动流程会存在差异,但一般都包含下面这些基本要素:
1. 步骤一,在芯片上电后,首先是确定器件当前所使用的启动方式。支持多种启动方式的器件需要对某些硬件状态(比如某几个管脚)采样,来决定后续引导流程;
2. 步骤二,确定了具体的启动方式后,芯片出厂前固化在片内ROM中的程序会对当前启动模式所需的内部模块与外设接口进行初始化。这里注意步骤一与步骤二对应的软件一般都是出厂前就固化在芯片内ROM中,对应图中红色虚线部分;
3. 步骤三,判断启动过程中是否配置了bootloader功能,若关闭bootloader,则直接执行步骤五,该模式下需要存储代码的器件支持XIP功能。否则执行步骤四;
4. 步骤四,执行bootloader操作。Bootloader主要功能就是将代码与数据从低速的ROM搬运到高速的RAM中。搬运程序可由用户编写,有些芯片内固化的程序也支持该功能。
5. 步骤五,程序跳转到MAIN入口处,控制权交给用户代码;
这里写图片描述


2 XIP

execute in place即芯片内执行,指应用程序可以直接在flash闪存内运行,不必再把代码读到系统RAM中。flash内执行是指nor flash 不需要初始化,可以直接在flash内执行代码。但往往只执行部分代码,比如初始化RAM。下面是wiki上对XIP的解释:
In computer science, execute in place (XIP) is a method of executing programs directly from long term storage rather than copying it into RAM. It is an extension of using shared memory to reduce the total amount of memory required. Its general effect is that the program text consumes no writable memory, saving it for dynamic data, and that all instances of the program are run from a single copy. For this to work, several criteria have to be met:
1. The storage must provide a similar interface to the CPU as regular memory (or an adaptive layer must be present),
2. This interface must provide sufficiently fast read operations with a random access pattern,
3. The file system, if one is used, needs to expose appropriate mapping functions,
4. The program must either be linked to be aware of the address the storage appears at in the system, or must be position-independent,
5. The program must not modify data within the loaded image.
The storage requirements are usually met by using NOR flash memory, which can be addressed as individual words for read operations, although it is a bit slower than normal system RAM in most setups.


3 存储映射

参见博文:TI CMD文件作用

  • 2
    点赞
  • 17
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值