简体   繁体   中英

How to enable ARMv6 unaligned access on WinMobile6?

ARMv6 introduce a great feature - unaligned memory access , which make some things in code much more simplier and faster. But microsoft gives API for it only in winCE6. And most PDAs now based on WinMobile6 (which is on CE 5.x). And unaligned access is disabled by default :(

I've try to set unaligned flag in CP15 register, but this doesn't work - I have a crash on read unaligned data.

Is it possible to enable unaligned access on WinMobile6?


Edit: I've found the tool, which can enable unaligned access, but I want to on/off it from my code. It's nueAdvancedProcessor .

There is an unaligned access flag (the U bit in CP15 control register) and also an alignment fault checker (the A bit). Make sure you have the right combination for what you want to do. In particular, if the A bit is set, all of your unaligned accesses will cause a data abort exception, even if you have the U bit on. Check out the ARM docs on that - all available at http://www.arm.com .

In particular, you want Section A2.8.2 "Unaligned data access in ARMv6 systems" in the ARM Architecture Reference Manual. Document number ARM DDI 0100I. It's titled "ARMv5 Architecture Reference Manual", but contains the initial ARMv6 information. I hope this link works: http://infocenter.arm.com/help/topic/com.arm.doc.ddi0100i/index.html

If you are getting Hardfault due to unaligned memory access on STM32F7 or Cortex-ARMv6, ARMv7 or ARVv8 then please refer the following link for an application note form IAR for this. https://www.iar.com/support/tech-notes/general/unexpected-usagefault-or-hardfault-exceptions/

Please refer this for details. https://stackoverflow.com/a/63000125/13735764

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM