如何解决PIC24F系列的Address error问题?

2020-02-07 09:41发布

调试发现偶尔会重启,后来才搞清楚不用的中断和不可屏蔽陷阱默认都是执行reset指令,后来发现是“地址错误”,如何解决这种问题呢?
友情提示: 此问题已得到解决,问题已经关闭,关闭后问题禁止继续编辑,回答。
该问题目前已经被作者或者管理员关闭, 无法添加新回复
6条回答
zchong
1楼-- · 2020-02-07 09:47
Datasheet上有这么一段:
All word accesses must be aligned to an even address. Misaligned word data fetches are not supported, so care must be taken when mixing byte and word operations, or translating from 8-bit MCU code. If a misaligned read or write is attempted, an address error trap will be generated. If the error occurred on a read, the instruction underway is completed; if it occurred on a write, the instruction will be executed but the write will not occur. In either case, a trap is then executed, allowing the system and/or user to examine the machine state prior to execution of the address Fault.

请问什么是mixing byte and word operations?
zchong
2楼-- · 2020-02-07 14:33
基本找到原因了,进一步验证中
642142533
3楼-- · 2020-02-07 17:45
 精彩回答 2  元偷偷看……
zchong
4楼-- · 2020-02-07 21:13
642142533 发表于 2013-9-10 09:04
兄弟
   我的MCU:PIC24F
      也发生了Address Error

我的是字节对齐问题,你可以检查一下你的程序看是否是这个问题
642142533
5楼-- · 2020-02-07 21:43
zchong 发表于 2013-9-10 13:18
我的是字节对齐问题,你可以检查一下你的程序看是否是这个问题

找到问题了
   字节地址的问题
newselect
6楼-- · 2020-02-08 00:22
642142533 发表于 2013-10-8 09:59
找到问题了
   字节地址的问题

能详细描述下么,关于字节对齐

一周热门 更多>