STRH instruction causing unaligned memory access fault on i.MXRT1062

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 

STRH instruction causing unaligned memory access fault on i.MXRT1062

4,163 次查看
odd_bikes
Contributor III

As per the title says, I have an IMXRT1060 and getting an unaligned access fault due to an STRH instruction. The odd thing is that the Cortex-M7 manual explicitly mentions that unaligned access are accepted for certain instructions, STRH being one of them.

strh r7, [r0, #4]

I've attached screenshots of the registers before this line (to see that R0 points to an unaligned address in RAM) and also with the state of the the fault system configuration (unaligned traps are disabled).

标签 (1)
0 项奖励
回复
4 回复数

4,069 次查看
gobbo
Contributor II

Strangely enough, I'm having the same issue... the memory region is set to 

    MPU->RBAR = ARM_MPU_RBAR(7, 0x20240000U);
    MPU->RASR = ARM_MPU_RASR(0, ARM_MPU_AP_FULL, 0, 0, 1, 0, 0, ARM_MPU_REGION_SIZE_1MB);

but my trap seem to happen at 0x2030_001D  -- the address is indeed unaligned, but i suppose that should be OK in this instance.

0 项奖励
回复

4,121 次查看
DanielRuvalcaba
NXP TechSupport
NXP TechSupport

Hi,

I’m sorry for the late response.

Did you modified any memory configuration?

Are you using a custom board?

Could you please share with me the code you execute to trigger this fault?

Best regards, Daniel.  

0 项奖励
回复

4,143 次查看
odd_bikes
Contributor III

Is there a chance that NXP didn't add support for unaligned memory access, as it is described in ARM's Cortex-M7 technical reference manual?

0 项奖励
回复

4,069 次查看
gobbo
Contributor II
You don't happen to be accessing OCRAM2 with this instruction?
0 项奖励
回复