I am trying to read watchpoint register values at runtime in SAML11(cortex-M23). I added the below code snippet to my C program. I am getting zero as output though the datasheet mentions 2. I can see value 2 in the I/O dialog box of atmel studio in debugging. Not sure, if we can read these values at runtime like in cortex M4.
#define ARM_DWT_CTRL (*(uint32_t *)0xE0001000) const size_t num_comparators = (ARM_DWT_CTRL>>28) & 0xF; printf("\n\rNumber of watchpoint comparators supported =%d\n\r", num_comparators);
Register values can be found from the manual