为什么 Cortex

编程入门 行业动态 更新时间:2024-10-17 02:50:47
本文介绍了为什么 Cortex-A 的重置处理程序位于 0x0 而不是 Cortex-M3的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

限时送ChatGPT账号..

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屋!

更多推荐

[db:关键词]

本文发布于:2023-04-16 14:44:15,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/889165.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:Cortex

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!