This thread has been locked.
If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.
我要做升级功能,boot+APP模式。如果我想设置MCU的中断向量SCB->VTOR为10K地址,如果按照M0的资料(参考下图),应该是SCB->VTOR=0X2800<<7。但实际上我直接写SCB->VTOR=0X2800运行正常。这是为何?
https://www.cnblogs.com/henjay724/p/15312847.html
这个链接详细地解释了CM核上的这个问题。你可以参考一下。
简单来说,0-6位是被保留的,但并不意味着没有被用到。它们也属于中断向量表偏置地址的一部分,但是不能被修改,一直应该保持为0。按照这一点来说,中断向量表偏置地址应该保持128字节对齐(0x80,0b1000 0000)。
但实际上至少应该是0x100对齐,因为第7位的属性也决定了这一位是一直为0的:
[1]
[2]
--
参考链接:
https://developer.arm.com/documentation/dui0662/b/Cortex-M0--Peripherals/System-Control-Block
[2]https://developer.arm.com/documentation/ihi0048/a/Glossary