为什么 Cortex-A 的重置处理程序位于 0x0 而不是 Cortex-M3 [英] Why is the reset handler located at 0x0 for Cortex-A but not for Cortex-M3

查看:35
本文介绍了为什么 Cortex-A 的重置处理程序位于 0x0 而不是 Cortex-M3的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

Cortex-M3 的初始堆栈指针值位于 0x0,重置处理程序位于 0x4 的原因是什么?这样做的设计理由是什么?

What is the reason Cortex-M3 has the initial stack pointer value located at 0x0, and reset handler located at 0x4? What is the design justification for this?

为什么 ARM 人员不能像他们为 Cortex-A 所做的那样将 0x0 留给重置处理程序,然后在重置处理程序中初始化 SP?

Why couldn't the ARM guys leave 0x0 to the reset handler like they do for Cortex-A, then initialize SP inside the reset handler?

推荐答案

我认为这个方案属于这不是一个错误,它是一个功能"的旗帜.

I think this one falls under the "it's not a bug, it's a feature" banner.

ARM 架构 M(微控制器)配置文件与 A 和 R 配置文件具有完全不同的异常模型.A 配置文件(如 R 配置文件)保留与以前的 ARM 处理器的向后兼容性.M-profile 被允许偏离这一点,因此被设计为更容易完全从 C/C++ 编程(没有 asm).

The ARM architecture M (microcontroller) profile has a completely different exception model to the A and the R profiles. The A-profile (like the R-profile) retain backwards compatibility with previous ARM processors. The M-profile was permitted to deviate from this, and so was designed to be easier to program completely from C/C++ (without asm).

因此向量条目包含地址而不是指令,一旦你这样做了,为什么不以同样的方式设置 SP?它还对异常条目进行自动状态保存.

Thus vector entries containing addresses rather than instructions, and once you've done that, why not set the SP in the same way? It also does automatic state saving on exception entry.

这篇关于为什么 Cortex-A 的重置处理程序位于 0x0 而不是 Cortex-M3的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆