Configure Cortex-M DWT Data Comparator on Cortex-M
In this topic:
•Compare on Address on Data Access
•Compare on Address Range on Data Access
•Compare on Address and Data Value on Data Access
•Compare on Address Range and Data Value on Data Access
•Compare on Address 1 or Address 2 and Data Value
•Compare on Address 1 range or Address 2 range and Data value
Each comparator can be configured for a specific address or/and for an address range (Address comparators). All comparators have a LSB masking register which implements an ignore mask. The size of the ignore mask is 0-31 bits, applied to address range matching. The range can be specified via Ignore LSB bits drop-down menu.
Comparator 0 can compare against the clock cycle counter (CYCCNT).
Comparator 1 supports data comparison (Data comparator) and linking with another comparator. It can be set to two addresses or/and two ranges, and data value. In this case Comparator 3 and/or 2 are reserved.
A full DWT module contains four comparators that you can configure as:
•a hardware watchpoint
•an ETM trigger
•a PC sampler event trigger
•a data address sampler event trigger.
Note that a more simple configuration is possible via Analyzer Configuration / Profiler page dialog and Profiler Data Area dialog. Follow online tutorial Tracing with BlueBox tools which will guide you through basic configurations.
1.Open View / Analyzer / Analyzer Configuration button. 2.Check Profiler in the Analyzer Configuration / Hardware page. 3.Check Data in the Analyzer Configuration / Profiler page. 4.Click New / Trace in Data Areas section.
Refer to Data Profiling chapter for more information. |
For specific use cases and linking the Comparator 1 winIDEA offers manual configuration of the DWT module.
Use cases cover comparing values on Address or/and Data with an option Ignore LSB bits:
•Compare on Address on Data Access
•Compare on Address Range on Data Access
•Compare on Address and Data Value on Data Access
•Compare on Address Range and Data Value on Data Access
•Compare on Address 1 or Address 2 and Data value
•Compare on Address 1 range or Address 2 range and Data value
Open View / Analyzer and click the Analyzer Configuration button .
1.Enable Manual Trigger/Recorder configuration. 2.Make sure Processes, the application you wish to record (e.g. App/ CORE0) and Profiler are enabled. 3.Press Configure. |
To link Comparator 1 with Comparator 3 and/or Comparator 2, Comparator 0 has to be configured first.
Enable the DWT component and configure Comparator 01.Open the DWT CORE0 page. 2.Enable Comparator 0. 3.Select Write Access from the drop-down menu. 4.Select an address in the Address field. e.g. iDataTrace. 5.Select sample data value from the Action drop-down menu. |
Configure Comparator 11.Enable Comparator 1. 2.Select Write Access from the drop-down menu. 3.Enable Address 1 and select and address in the field. 4.Select sample data value from the Action drop-down menu. |
Configure Comparator 1 with option Ignore LSB bits1.Enable Comparator 1. 2.Select Write Access from the drop-down menu. 3.Enable Address 1 and select and address in the field. 4.Select sample data value from the Action drop-down menu. 5.Select a number from the Ignore LSB bits drop-down menu. |
Configure Comparator 11.Enable Comparator 1. 2.Select Write Access from the drop-down menu. 3.Enable Address 1 and select and address in the field. 4.Enable Data and select the HEX value. 5.Select data size from the Data Size drop-down menu.
Comparator 3 is reserved. |
Configure Comparator 1 with option Ignore LSB bits1.Enable Comparator 1. 2.Select Write Access from the drop-down menu. 3.Enable Address 1 and select and address in the field. 4.Enable Data and select the HEX value. 5.Select data size from the Data Size drop-down menu. 6.Select a number from the Ignore LSB bits drop-down menu.
Comparator 3 is reserved. |
Configure Comparator 11.Enable Comparator 1. 2.Select Write Address from the drop-down menu. 3.Enable Address 1 and select and address in the field. 4.Enable Data and select the HEX value. 5.Select data size from the Data Size drop-down menu. 6.Enable Address 2 and select and address in the field.
Comparator 2 and 3 are reserved. |
Configure Comparator 1 with Ignore LSB bits1.Enable Comparator 1. 2.Select Write Address from the drop-down menu. 3.Enable Address 1 and select and an address in the field. 4.Select a number from the Ignore LSB bits drop-down menu for Address 1. 5.Enable Data and select the HEX value. 6.Select data size from the Data Size drop-down menu. 7.Enable Address 2 and select and an address in the field. 8.Select a number from the Ignore LSB bits drop-down menu for Address 2.
Comparator 2 and 3 are reserved. |