1{ 2 "version": "0.2.0", 3 "configurations": [ 4 { 5 "name": "Launch PSoC6 CM4 (OpenOCD)", 6 "type": "cortex-debug", 7 "request": "launch", 8 "cwd": "${workspaceRoot}", 9 "executable": "&&DEBUGTARGET&&", 10 "servertype": "openocd", 11 "searchDir": [ 12 "${workspaceRoot}", 13 "&&MODUSOPENCOD&&/scripts/" 14 ], 15 "configFiles": [ 16 "openocd.tcl" 17 ], 18 "overrideLaunchCommands": [ 19 "set mem inaccessible-by-default off", 20 "-enable-pretty-printing", 21 "monitor reset init", 22 "-target-download", // Comment this out if you don't want to reload program 23 "monitor reset run", 24 "monitor sleep 200", 25 "monitor psoc6 reset_halt sysresetreq" 26 ], 27 "postStartSessionCommands": [ // Needed if runToMain is false 28 /* 29 // Following two commands are needed to get gdb and openocd and HW all in sync. 30 // Or, execution context (PC, stack, registers, etc.) look like they are from before reset. 31 // The stepi, is a pretend instruction that does not actually do a stepi, but MUST be done 32 // Its a documented workaround in openocd. Do a 'monitor help' to see more info 33 // 34 // An alternative command to use is "continue" instead of the following two 35 */ 36 "monitor gdb_sync", 37 "stepi" 38 ], 39 "overrideRestartCommands": [ 40 "monitor reset init", 41 "monitor reset run", 42 "monitor sleep 200", 43 "monitor psoc6 reset_halt sysresetreq" 44 ], 45 "postRestartSessionCommands": [ 46 "monitor gdb_sync", 47 "stepi" 48 ], 49 // svdFile is optional, it can be very large. 50 "svdFile": "&&SVDFILENAME&&", 51 "runToMain": true, // if true, program will halt at main. Not used for a restart 52 "preLaunchTask": "", // Set this to run a task from tasks.json before starting a debug session 53 "showDevDebugOutput": false,// Shows output of GDB, helpful when something is not working right 54 }, 55 // When using 'attach', make sure your program is running on the board and that your executable matches 56 // the image in the chip exactly, or else strange things can happen with breakpoint, variables, etc. 57 { 58 "name": "Attach PSoC6 CM4 (OpenOCD)", 59 "type": "cortex-debug", 60 "request": "attach", 61 "cwd": "${workspaceRoot}", 62 "executable": "&&DEBUGTARGET&&", 63 "servertype": "openocd", 64 "searchDir": [ 65 "${workspaceRoot}", 66 "&&MODUSOPENCOD&&/scripts/" 67 ], 68 "openOCDPreConfigLaunchCommands": [ 69 "set ENABLE_ACQUIRE 0" 70 ], 71 "configFiles": [ 72 "openocd.tcl" 73 ], 74 "overrideAttachCommands": [ 75 "set mem inaccessible-by-default off", 76 "-enable-pretty-printing", 77 "monitor halt" 78 ], 79 "overrideRestartCommands": [ 80 "monitor reset init", 81 "monitor reset run", 82 "monitor sleep 200", 83 "monitor psoc6 reset_halt sysresetreq" 84 ], 85 "postRestartSessionCommands": [ 86 "monitor gdb_sync", 87 "stepi" 88 ], 89 // svdFile is optional, it can be very large. 90 "svdFile": "&&SVDFILENAME&&", 91 "showDevDebugOutput": false,// Shows output of GDB, helpful when something is not working right 92 }, 93 { 94 "name": "Erase (OpenOCD)", 95 "type": "cortex-debug", 96 "request": "launch", 97 "cwd": "${workspaceRoot}", 98 "executable": "&&DEBUGTARGET&&", 99 "servertype": "openocd", 100 "searchDir": [ 101 "${workspaceRoot}", 102 "&&MODUSOPENCOD&&/scripts/" 103 ], 104 "configFiles": [ 105 "openocd.tcl" 106 ], 107 "overrideLaunchCommands": [ 108 "monitor reset init", 109 "monitor psoc6 sflash_restrictions 1", 110 "monitor erase_all", 111 "-gdb-exit" 112 ] 113 }, 114 { 115 "name": "Program (OpenOCD)", 116 "type": "cortex-debug", 117 "request": "launch", 118 "cwd": "${workspaceRoot}", 119 "executable": "&&DEBUGTARGET&&", 120 "servertype": "openocd", 121 "searchDir": [ 122 "${workspaceRoot}", 123 "&&MODUSOPENCOD&&/scripts/" 124 ], 125 "configFiles": [ 126 "openocd.tcl" 127 ], 128 "overrideLaunchCommands": [ 129 "monitor psoc6 sflash_restrictions 1", 130 "monitor program {&&DEBUGTARGET&&}", 131 "monitor reset_config srst_only", 132 "monitor reset run", 133 "monitor psoc6.dap dpreg 0x04 0x00", 134 "-gdb-exit" 135 ], 136 } 137 ] 138} 139