-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathlaunch.json
64 lines (59 loc) · 2.49 KB
/
launch.json
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
{
"version": "0.2.0",
"configurations": [
{
"name": "Debug UTP TM4C",
"cwd": "${workspaceFolder}",
"executable": "./target/thumbv7em-none-eabihf/release/utp-tm4c",
"request": "launch",
"type": "cortex-debug",
"runToEntryPoint": "main",
"internalConsoleOptions": "openOnFirstSessionStart",
"servertype": "openocd",
// The default OpenOCD flash procedures yield errors when
// flashing ("Error erasing flash with vFlashErase packet (from target-download)"),
// especially on older boards (LM4F).
//
// We don't really have a good understanding of why this happens but
// we have, over the years, built up a battle tested sequence of OpenOCD
// commands that generally works and keeps the board from getting into
// bad states.
//
// See: https://github.com/ut-ras/Rasware/blob/e5bc8748db8931f742421b1d742d0c330b66d7b6/RASLib/Makefile#L80-L88
// And: https://github.com/rrbutani/tm4c-llvm-toolchain/blob/bb36dba9d52a9b51350ff8c035fdc91e87cc8b90/common.ninja#L346-L355
//
// So, we direct `cortex-m-debug` to feed these commands to the
// openocd server instead of the default ones on startup, launch,
// and restart:
"openOCDLaunchCommands": [
// "init",
// "halt",
// "reset init",
// "sleep 100",
// "flash probe 0",
],
"overrideLaunchCommands": [
// "monitor halt",
// "monitor reset init",
// "monitor flash write_image erase target/thumbv7em-none-eabihf/release/utp-tm4c",
// "monitor sleep 100",
// "monitor flash verify_image target/thumbv7em-none-eabihf/release/utp-tm4c",
// "monitor reset init"
"load"
],
"overrideRestartCommands": [
"monitor reset init",
],
"preLaunchCommands": ["source .gdbinit"],
"showDevDebugOutput": "none",
// Build before launching!
"preLaunchTask": "Build UTP TM4C",
// TM4C stuff:
"configFiles": [
"board/ti_ek-tm4c123gxl.cfg"
],
"device": "TM4C123GXL",
"svdFile": ".vscode/TM4C123GH6PM.svd",
}
]
}