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