How to Suspend Peripheral devices
In this topic:
•Suspend peripherals while stopped
This chapter describes how to suspend peripheral devices. You can do this by using of:
•Suspend peripherals while stopped (recommended), or
•Initialization scripts.
Enable the Hardware | CPU Options | Reset | At Initialization | Suspend peripherals while stopped. |
Suspend all used peripherals via "..." button. |
When this option is checked, selected peripheral functions (e.g., timers) are stopped when the application is stopped. Peripheral functions can be selected via the button . It is generally recommended that this option is checked, as this results in more predictable behavior of the debugged application when using these peripheral functions.
Refer to the microcontroller and architecture reference manuals for details.
This option, including its peripherals list, is available for specific microcontrollers only. If not supported, the option is greyed out. |
If the option is not supported (greyed out), you can perform suspending peripheral devices by initialization scripts.
Use of initialization scripts for suspending peripheral devices is the alternative solution; if possible, use the first option. |
The initialization scripts for suspending peripheral devices are downloaded in the Examples directory. Note that the downloaded scripts are not available for all devices. Each initialization file contains specific microcontroller configuration, which directly affects the application behavior being debugged. Initialization file configures suspend control of the peripheral modules.
The script may have to enable access to the peripheral to configure it, which may result in misbehaving of the application. Inspect the script to be sure of what it does. |
Check the Synchronize selected cores (stop/run) when possible via Hardware | CPU Options | Debugging. |
Check Synchronize this core via Hardware | CPU Options | Cores . |
For all cores you want to be a part of synchronization.
Add an initialization script via Initialize | Initialization before Debug session | Custom | Add from workspace folder. |
The initialization file is being executed by the debugger after every debug reset respectively before the debug download takes place.
The peripheral modules can be suspended along with the cores. To suspend the peripheral modules on a suspend signal, you need to enable some of them before they can be configured. Some peripheral modules are enabled out of reset but not all.
To summarize, for a predictable application behavior (from user point of view) in conjunction with the connected debugger, certain microcontroller logic and modules have to be pre-configured before the application can be debugged.