Advertisement
Guest User

Vectorcatch.ini keil vector catch

a guest
Sep 14th, 2017
483
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.85 KB | None | 0 0
  1. /******************************************************************************/
  2. /* VectorCatch.ini: VectorCatch Debugger Initialization File */
  3. /******************************************************************************/
  4. // <<< Use Configuration Wizard in Context Menu >>> //
  5. /******************************************************************************/
  6. /* This file is part of the uVision/ARM development tools. */
  7. /* This software may only be used under the terms of a valid, current, */
  8. /* end user licence from KEIL for a compatible version of KEIL software */
  9. /* development tools. Nothing else gives you the right to use this software. */
  10. /* */
  11. /* This software is supplied "AS IS" without warranties of any kind. */
  12. /* */
  13. /* Copyright (c) 2015 Keil Software. All rights reserved. */
  14. /******************************************************************************/
  15.  
  16.  
  17.  
  18. FUNC void VectorCatchSetup (void) {
  19. unsigned int val;
  20.  
  21. // <h> Debug Exception and Monitor Control Register
  22. // <i> This register manages exception behavior under debug.
  23. // <i> Vector catching is only available to halting debug. The upper halfword is for monitor controls and the lower halfword is for halting exception support.This register is not reset on a system reset.
  24. // <o2. 0> VC_CORERESET <i> Reset Vector Catch. Halt running system if Core reset occurs.
  25. // <o2. 4> VC_MMERR <i> Debug trap on Memory Management faults.
  26. // <o2. 5> VC_NOCPERR <i> Debug trap on Usage Fault access to Coprocessor which is not present or marked as not present in CAR register.
  27. // <o2. 6> VC_CHKERR <i> Debug trap on Usage Fault enabled checking errors.
  28. // <o2. 7> VC_STATERR <i> Debug trap on Usage Fault state errors.
  29. // <o2. 8> VC_BUSERR <i> Debug Trap on normal Bus error.
  30. // <o2. 9> VC_INTERR <i> Debug Trap on interrupt/exception service errors. These are a subset of other faults and catches before BUSERR or HARDERR.
  31. // <o2.10> VC_HARDERR <i> Debug trap on Hard Fault.
  32. // </h>
  33.  
  34. val = _RDWORD(0xE000EDFC);
  35. val &= ~(0x07F1);
  36. val |= (0x0400);
  37.  
  38. printf("Vector Catch enabled: ");
  39. if(val & (1<< 0)) printf("VC_CORERESET, ");
  40. if(val & (1<< 4)) printf("VC_MMERR, ");
  41. if(val & (1<< 5)) printf("VC_NOCPERR, ");
  42. if(val & (1<< 6)) printf("VC_CHKERR, ");
  43. if(val & (1<< 7)) printf("VC_STATERR, ");
  44. if(val & (1<< 8)) printf("VC_BUSERR, ");
  45. if(val & (1<< 9)) printf("VC_INTERR, ");
  46. if(val & (1<<10)) printf("VC_HARDERR, ");
  47. printf("\n");
  48.  
  49. _WDWORD(0xE000EDFC, val);
  50. }
  51.  
  52.  
  53. FUNC void OnResetExec(void){
  54. VectorCatchSetup();
  55. }
  56.  
  57. VectorCatchSetup();
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement