一、工作模式
线程模式和手柄模式。

当处理器处在线程状态下时,既可以使用特权级,也可以使用用户级;另一方面, handler模式总是特权级的。在复位后,处理器进入线程模式+特权级。
二、异常和中断
Cortex-M3 支持大量异常,包括 16-4-1=11个系统异常,和最多 240 个外部中断——简称 IRQ。具体使用了这 240 个中断源中的多少个,则由芯片制造商决定。由外设产生的中断信号,除了 SysTick的之外,全都连接到 NVIC 的中断输入信号线。典型情况下,处理器一般支持 16 到 32 个中断。

类型编号为 1-15 的系统异常,从 16 开始是外部中断类型。
三、向量表

因为地址 0 处应该存储引导代码,所以它通常映射到 Flash或者是 ROM 器件,并且它们的值不得在运行时改变。然而,为了支持动态重分发中断, CM3 允许向量表重定位——从其它地址处开始定位各异常向量。这些地址对应的区域可以是代码区,但更多是在 RAM 区。在 RAM 区就可以修改向量的入口地址了。为了实现这个功能, NVIC中有一个寄存器,称为“向量表偏移量寄存器”(在地址 0xE000_ED08处),通过修改它的值就能重定位向量表。
向量表偏移量寄存器(VTOR)(地址:0xE000_ED08)

来源:嵌入式ARM



