Appendix C NoSleep Utility
QT
RACE
-
U
SER
M
ANUAL
© 2018 PDQLogic Ltd.
QTrace User Manual Rev 1.01
Page 66
Appendix C NoSleep Utility
The ARM Cortex-M instruction set contains WFE/WFI sleep instructions which are used to conserve
energy by placing the CPU in a low power state until an event or interrupt occurs. The downside to this
while tracing a program is that it also puts the ETM trace module into a halt state which can cause
synchronisation problems with the QTrace probe.
If the source code is available for the WFE/WFI sleep instruction implementations then the appropriate
lines should be commented out. If the source is unavailable e.g. part of a library file, then a command
line utility called
NoSleep.exe
supplied with the QTrace Analyser can be used to replace WFE/WFI
instructions in an ELF file with NOP instructions.
To use the utility, add the following command line to the IDE post-build script:
C:\Program Files\PDQLogic\Trace Analyser\NoSleep <ELF file> <addr1> <addr2> …
Where:
<ELF file> is the full path of your ELF file
<AddrX> are addresses of WFE/WFI instructions which will be replaced by NOP instructions
When WFE/WFI instructions are detected by the QTrace Analyser, their details, including their
addresses, are displayed in the Bookmark view as shown below (see section 3.2.9 for details of
Bookmarks).
Figure 74 Example of WFE/WFI sleep instructions
Click the highlighted button to copy the WFE/WFI instruction addresses to the Clipboard. These
addresses can then be pasted into the post-build script command line shown above.
Note
1) To avoid the WFE/WFI instruction addresses changing between builds, it is advisable to arrange the
linker script so that the library file(s) containing WFE/WFI instructions are placed before user code or
any other code that is likely to change during a debugging session.
2) The ELF file for final release build should not have the WFE/WFI instructions replaced.