How memory type is decided when MMU is disabled ?

Hi, 

I got a 'data abort' exception from a LDR instruction LDR w0, [x8].  It's because the address contained in x8 is not 4-byte aligned.  I want to disable the aligment check so I did use '--nounaligment-access' '-mno-unalignement-access' when compiling, and set SCTLR_ELx.A to be 0. But I am not sure if the memory address I am accessing is from a 'Normal' memory or a 'Device' memory because I disabled the MMU in the bootcode. 

Any one has an idea how the memory type is decided when mmu is disabled ? 

Or any other thoughts why the LDR instruction triggers an 'data abort' exception ?

Thanks and best regards,

Xinwei

  • With the MMU disabled, all data accesses will be treated as Device_nGnRnE.  As all unaligned accesses to Device regions will be trigger an alignment fault, that would seem to explain what you are seeing.

    If you're interested in the full description of MMU disabled bebaviour see section D4.2.9 (The effects of disabling a stage of address translation) in Rev B.a of the ARMv8-A Architecture Reference Manual.

    I tried to reply yesterday, wonder why it didn't work..

More questions in this forum