'Usage Fault' 또는 'Hard Fault' 예외 발생시 처리

기술노트 58203

아키텍처:

ARM

컴포넌트:

general

업데이트:

2018-02-28 오전 2:30

Introduction

This technical note describes actions to take when an unaligned access leads to a ‘Usage Fault’ or ‘Hard Fault’ exception.

This technical note applies to devices based on the ARMv6 (excluding ARMv6-M), ARMv7-M, and ARMv8-M architectures. For other architectures, especially the ARMv6-M, see the heading ‘Other architectures’ below.

Discussion

These are two different suggestions for avoiding exceptions:

  • Let the application clear the 'UNALIGN_TRP' bit (or avoid setting the bit), in the Configuration and Control register.

This makes the device accept unaligned accesses. When the device is set up in this manner, the IAR C/C++ Compiler™ can generate more efficient code. The runtime library is built to take advantage of this.

  • Compile the application with the option --no_unaligned_access.

The first suggestion makes the device accept unaligned accesses. When the device is set up in this manner, the IAR C/C++ Compiler™ can generate more efficient code. The runtime library is built to take advantage of this.

This suggestion is applicable when the 'UNALIGN_TRP' bit is set by the application. In this situation, the linker will redirect affected library functions to function variants that handle the unaligned accesses. These variants are less efficient.

Other architectures

This technical note isn’t applicable to devices based on the ARMv4, ARMv5, and ARMv6-M architectures.

  • Examples of the ARMv6-M architecture are Cortex-M0, Cortex-M0+ and Cortex-M1.
  • Examples of the ARMv4 and ARMv5 architectures are ARM7TDMI and ARM926S.

Conclusion

Devices based on the ARMv6, ARMv7-M, and ARMv8-M architectures can take advantage of this technical note. (Examples of ARMv7-M architectures are Cortex-M3, Cortex-M4 and Cortex-M7)
More information can be found in your hardware documentation, for example, ‘4.3.9. System Handler Control and State Register’ in ‘Cortex-M3 Devices Generic User Guide’ and ‘4.3.6. Configuration and Control Register’ in ‘Cortex-M0 Devices Generic User Guide’.

All product names are trademarks or registered trademarks of their respective owners.

죄송하지만, 당사 사이트에서는 Internet Explorer를 지원하지 않습니다.보다 편안한 사이트를 위해 Chrome, Edge, Firefox 등과 같은 최신 브라우저를 사용해 주시길 부탁드립니다.