ARM Technical Support Knowledge Articles

Why do "debug_tests" and "trace_tests" in CMSDK stall when using ARM GCC for compilation?

Applies to: Cortex-M System Design Kit (CMSDK), Cortex-M0, Cortex-M0Plus, Cortex-M3, Cortex-M4


This Knowledge Article applies to chip designers who are using ARM's Cortex-M System Design Kit (CMSDK) IP to design a chip containing a Cortex-M processor.

The debug_tests and trace_tests of the CMSDK go into unexpected HardFault and cannot finish if one of the following versions of ARM GCC has been used for compilation:

The problem does not occur if the following ARM GCC versions have been used:

Other ARM GCC versions have not been tested, but it is likely that versions after arm-none-eabi-gcc-4.8.4 will cause the same issue.


The problem is caused by null pointer dereferencing in debug_tests and trace_tests, which are undefined and lead the ARM GCC compiler to optimize them away and replace them with UDF (Undefined) instructions. The UDF instructions ultimately cause a HardFault in the simulation.


The workaround for the problem is to reduce the compiler's optimization by modifying the appropriate makefiles.

In case of Cortex-M3/M4

In case of Cortex-M0/M0+

Rate this article

Disagree? Move your mouse over the bar and click

Did you find this article helpful? Yes No

How can we improve this article?

Link to this article
Copyright © 2011 ARM Limited. All rights reserved. External (Open), Non-Confidential