This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

CM4: Can processor halt itself by writing DHCSR

Hello,

As part of my diagnostic regime I wanted the diag to halt when completed.  It doesn't seem like it can.  It seems to keep running when I 

  CoreDebug->DHCSR = (0xA05FUL << CoreDebug_DHCSR_DBGKEY_Pos) |
                     CoreDebug_DHCSR_C_HALT_Msk |
                     CoreDebug_DHCSR_C_DEBUGEN_Msk;

Thanks, Tom

Parents
  • From the Cortex-M TRM (Chapter C1.6.2):

    "...• When C_DEBUGEN is set to 0, the processor ignores the values of all other bits in
    this register.
    • The DHCSR is typically accessed by a debugger, through the DAP. Software running
    on the processor can update all fields in this register, except C_DEBUGEN."

    So if  the debugger has set C_DEBUGEN, halting should be possible else not.

Reply
  • From the Cortex-M TRM (Chapter C1.6.2):

    "...• When C_DEBUGEN is set to 0, the processor ignores the values of all other bits in
    this register.
    • The DHCSR is typically accessed by a debugger, through the DAP. Software running
    on the processor can update all fields in this register, except C_DEBUGEN."

    So if  the debugger has set C_DEBUGEN, halting should be possible else not.

Children
No data