You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@nuttx.apache.org by GitBox <gi...@apache.org> on 2021/03/07 04:43:26 UTC

[GitHub] [incubator-nuttx] antmerlino opened a new pull request #2990: arch/armv7-m: Adds dwt helper functions for controlling watchpoints i…

antmerlino opened a new pull request #2990:
URL: https://github.com/apache/incubator-nuttx/pull/2990


   ## Summary
   
   This change adds a few macros and inline function to armv7m's dwt.h.  These functions can be used to programmatically setup data watchpoints and add "guards" around code that you don't want to trigger the watchpoint for that instance. 
   
   This was used in debugging an issue where it was suspected that something was touching a struct that shouldn't have been. By adding a data watchpoint and guarding the spots where we know we are supposed to be touching the data, we will only break if some unexpected manipulator is handling the struct. 
   
   ## Impact
   
   None. arch header file change only. Useful for debugging issues. Should not be used in any production or upstream code.
   
   ## Testing
   
   ```
     /* Setup the DWT Comparator to be a data watchpoint, write-only, for the full 32-bit word */
     dwt_comparator_setup(0, &priv->waitwdog.flags, 0, DWT_FUNCTION_WATCHPOINT_WO | DWT_DATAVSIZE_WORD);
   
     /* Don't trigger the watchdog when we are intentionally manipulating */
     uint32_t restore = dwt_comparator_block(0);
     ret = wd_start(wdog, delay, stm32_eventtimeout, arg);
     dwt_comparator_restore(0, restore);
     return ret;
   ```
   
   


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [incubator-nuttx] xiaoxiang781216 merged pull request #2990: arch/armv7-m: Adds dwt helper functions for controlling watchpoints i…

Posted by GitBox <gi...@apache.org>.
xiaoxiang781216 merged pull request #2990:
URL: https://github.com/apache/incubator-nuttx/pull/2990


   


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org