Ctools Use Case Library
Memory Watch

The Advanced Event Triggering (AET) Hardware is setup to watch writes to a particular memory range. For every write to the memory range, the AET performs a store Program Address and captures the exact location in code, where the write happenned or the AET can be configured to generate an interrupt to the Core Interrupt Controller(Core INTC), which if required can be routed as an exception to the CPU. This is very useful to debug any memory corruption issues from unintended accesses. The idea here is to setup the memory watch job during the system startup and instrument the application to disable the memory watch during intended accesses and re-enable it after it is done with the intended accesses.

The sequence for configuring memory watch point is given below:

If ctools_memwatch_store_pc_setup () is used, the captured PC trace samples can be exported for analysis in 2 ways.