Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /******************************************************************************/
- /* VectorCatch.ini: VectorCatch Debugger Initialization File */
- /******************************************************************************/
- // <<< Use Configuration Wizard in Context Menu >>> //
- /******************************************************************************/
- /* This file is part of the uVision/ARM development tools. */
- /* This software may only be used under the terms of a valid, current, */
- /* end user licence from KEIL for a compatible version of KEIL software */
- /* development tools. Nothing else gives you the right to use this software. */
- /* */
- /* This software is supplied "AS IS" without warranties of any kind. */
- /* */
- /* Copyright (c) 2015 Keil Software. All rights reserved. */
- /******************************************************************************/
- FUNC void VectorCatchSetup (void) {
- unsigned int val;
- // <h> Debug Exception and Monitor Control Register
- // <i> This register manages exception behavior under debug.
- // <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.
- // <o2. 0> VC_CORERESET <i> Reset Vector Catch. Halt running system if Core reset occurs.
- // <o2. 4> VC_MMERR <i> Debug trap on Memory Management faults.
- // <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.
- // <o2. 6> VC_CHKERR <i> Debug trap on Usage Fault enabled checking errors.
- // <o2. 7> VC_STATERR <i> Debug trap on Usage Fault state errors.
- // <o2. 8> VC_BUSERR <i> Debug Trap on normal Bus error.
- // <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.
- // <o2.10> VC_HARDERR <i> Debug trap on Hard Fault.
- // </h>
- val = _RDWORD(0xE000EDFC);
- val &= ~(0x07F1);
- val |= (0x0400);
- printf("Vector Catch enabled: ");
- if(val & (1<< 0)) printf("VC_CORERESET, ");
- if(val & (1<< 4)) printf("VC_MMERR, ");
- if(val & (1<< 5)) printf("VC_NOCPERR, ");
- if(val & (1<< 6)) printf("VC_CHKERR, ");
- if(val & (1<< 7)) printf("VC_STATERR, ");
- if(val & (1<< 8)) printf("VC_BUSERR, ");
- if(val & (1<< 9)) printf("VC_INTERR, ");
- if(val & (1<<10)) printf("VC_HARDERR, ");
- printf("\n");
- _WDWORD(0xE000EDFC, val);
- }
- FUNC void OnResetExec(void){
- VectorCatchSetup();
- }
- VectorCatchSetup();
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement