Accessing registers in an unclocked or powered-down peripheral

Technical Note 160909



9/21/2016 11:08 AM


Accessing registers in an unclocked or powered-down peripheral, via C-SPY, might give unexpected results.


Accessing registers in an unclocked or powered-down peripheral during debugging might cause unexpected behavior. Incorrect data can be read, writes might have unexpected results or no effect. In some cases writes or reads might cause the CPU to reset or the debug connection might be lost.

The exact behavior in such cases depends on the device implementation.

Just displaying the peripheral memory address range in the Memory window or displaying the peripheral registers in the Register window can be enough to cause these effects.


If accessing registers in an unclocked, powered-down or otherwise disabled peripheral leads to crashes or to a change in program behavior, steps should be taken to avoid this. Consider these alternatives:

  • Avoid accessing the registers.
  • Ensure that the peripheral is enabled when C-SPY accesses register contents, for example by enabling the peripheral via a C-SPY macro.

For information on C-SPY macros, choose Help > C-SPY Debugging guide.

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

Related tech notes

© IAR Systems 1995-2017 - All rights reserved.