如何在基于 cortex m3 的微控制器中生成内存管理故障
How to generate memory management fault in cortex m3 based microcontroller
我是一名工科学生,目前正在研究 cortex m3 处理器及其异常处理模型。
我已经使用相应的故障处理程序生成并测试了使用故障、总线故障、硬故障。
但是我不知道怎么产生内存管理错误
(不考虑 MPU 的上下文)
有没有其他方法可以产生内存管理错误?
提前致谢
引用Architecture Reference Manual(强调我的):
The MemManage fault handles memory protection faults that are determined by the Memory Protection Unit or by fixed memory protection constraints, for both instruction and data memory transactions.
换句话说,如果您不想对 MPU 进行编程,您将不得不寻找这些固定约束之一,而开始寻找的明显位置是 the memory map。 Execute Never 对我来说听起来像是一个约束,果然,虽然 Cortex-M3 TRM 有点含糊 ("a fault exception"),架构说:
XN indicates an Execute Never region. Any attempt to execute code from an XN region faults, generating a MemManage exception.
好了。看起来最简单的方法是简单地分支到系统区域 (0xE0000000 - 0xFFFFFFFF),因为无论 MPU 配置如何,它总是 XN。
我是一名工科学生,目前正在研究 cortex m3 处理器及其异常处理模型。 我已经使用相应的故障处理程序生成并测试了使用故障、总线故障、硬故障。
但是我不知道怎么产生内存管理错误 (不考虑 MPU 的上下文)
有没有其他方法可以产生内存管理错误?
提前致谢
引用Architecture Reference Manual(强调我的):
The MemManage fault handles memory protection faults that are determined by the Memory Protection Unit or by fixed memory protection constraints, for both instruction and data memory transactions.
换句话说,如果您不想对 MPU 进行编程,您将不得不寻找这些固定约束之一,而开始寻找的明显位置是 the memory map。 Execute Never 对我来说听起来像是一个约束,果然,虽然 Cortex-M3 TRM 有点含糊 ("a fault exception"),架构说:
XN indicates an Execute Never region. Any attempt to execute code from an XN region faults, generating a MemManage exception.
好了。看起来最简单的方法是简单地分支到系统区域 (0xE0000000 - 0xFFFFFFFF),因为无论 MPU 配置如何,它总是 XN。