捣腾很长时间了,用vscode编译、调试stm32F4系列mcu的程序。记录下。
launch.json @TOC
// AUTOMATICALLY GENERATED FILE. PLEASE DO NOT MODIFY IT MANUALLY
// PIO Unified Debugger
//
// Documentation: https://docs.platformio.org/page/plus/debugging.html
// Configuration: https://docs.platformio.org/page/projectconf/section_env_debug.html
{
“version”: “0.2.0”,
“configurations”: [
{
“cwd”: “
w
o
r
k
s
p
a
c
e
R
o
o
t
"
,
"
e
x
e
c
u
t
a
b
l
e
"
:
"
C
:
/
U
s
e
r
s
/
h
r
s
t
e
k
/
D
o
c
u
m
e
n
t
s
/
P
l
a
t
f
o
r
m
I
O
/
P
r
o
j
e
c
t
s
/
s
t
m
405
c
u
b
e
m
x
t
e
s
t
/
.
p
i
o
/
b
u
i
l
d
/
g
e
n
e
r
i
c
S
T
M
32
F
407
V
E
T
6
/
f
i
r
m
w
a
r
e
.
e
l
f
"
,
"
n
a
m
e
"
:
"
D
e
b
u
g
M
i
c
r
o
c
o
n
t
r
o
l
l
e
r
"
,
"
r
e
q
u
e
s
t
"
:
"
l
a
u
n
c
h
"
,
"
t
y
p
e
"
:
"
c
o
r
t
e
x
−
d
e
b
u
g
"
,
"
s
e
r
v
e
r
t
y
p
e
"
:
"
j
l
i
n
k
"
,
"
s
e
r
v
e
r
p
a
t
h
"
:
"
C
:
/
P
r
o
g
r
a
m
F
i
l
e
s
(
x
86
)
/
S
E
G
G
E
R
/
J
L
i
n
k
V
634
b
/
J
L
i
n
k
G
D
B
S
e
r
v
e
r
C
L
.
e
x
e
"
,
"
d
e
v
i
c
e
"
:
"
S
T
M
32
F
407
V
E
"
,
"
i
n
t
e
r
f
a
c
e
"
:
"
s
w
d
"
,
"
s
e
r
i
a
l
N
u
m
b
e
r
"
:
"
"
,
/
/
i
f
y
o
u
h
a
v
e
m
o
r
e
t
h
a
n
o
n
e
J
−
L
i
n
k
p
r
o
b
e
a
d
d
t
h
e
s
e
r
i
a
l
n
u
m
b
e
r
h
e
r
e
"
s
v
d
F
i
l
e
"
:
"
D
:
K
e
i
l
v
5
A
R
M
P
A
C
K
K
e
i
l
S
T
M
32
F
4
x
x
D
F
P
2.13.0
C
M
S
I
S
S
V
D
S
T
M
32
F
40
x
.
s
v
d
"
,
/
/
"
j
l
i
n
k
s
c
r
i
p
t
"
:
"
{workspaceRoot}", "executable": "C:/Users/hrstek/Documents/PlatformIO/Projects/stm405cubemxtest/.pio/build/genericSTM32F407VET6/firmware.elf", "name": "Debug Microcontroller", "request": "launch", "type": "cortex-debug", "servertype": "jlink", "serverpath": "C:/Program Files (x86)/SEGGER/JLink_V634b/JLinkGDBServerCL.exe", "device": "STM32F407VE", "interface": "swd", "serialNumber": "", //if you have more than one J-Link probe add the serial number here "svdFile": "D:\\Keil_v5\\ARM\\PACK\\Keil\\STM32F4xx_DFP\\2.13.0\\CMSIS\\SVD\\STM32F40x.svd", //"jlinkscript":"
workspaceRoot","executable":"C:/Users/hrstek/Documents/PlatformIO/Projects/stm405cubemxtest/.pio/build/genericSTM32F407VET6/firmware.elf","name":"DebugMicrocontroller","request":"launch","type":"cortex−debug","servertype":"jlink","serverpath":"C:/ProgramFiles(x86)/SEGGER/JLinkV634b/JLinkGDBServerCL.exe","device":"STM32F407VE","interface":"swd","serialNumber":"",//ifyouhavemorethanoneJ−Linkprobeaddtheserialnumberhere"svdFile":"D:Keilv5ARMPACKKeilSTM32F4xxDFP2.13.0CMSISSVDSTM32F40x.svd",//"jlinkscript":"{workspaceRoot}/BSP/SEGGER/K66FN2M0_emPower/Setup/Kinetis_K66_Target.js”,
“runToMain”: true,
}// ,
// {
// “type”: “platformio-debug”,
// “request”: “launch”,
// “name”: “PIO Debug”,
// “executable”: “c:/Users/hrstek/Documents/PlatformIO/Projects/stm405cubemxtest/.pio/build/genericSTM32F407VET6/firmware.elf”,
// “toolchainBinDir”: “C:/Users/hrstek/.platformio/packages/toolchain-gccarmnoneeabi/bin”,
// “svdPath”: “C:/Users/hrstek/.platformio/platforms/ststm32/misc/svd/STM32F40x.svd”,
// “internalConsoleOptions”: “openOnSessionStart”
// }
]
}
setting.json
{
“remote.SSH.configFile”: “C:\Users\hrstek\.ssh\config”,
“remote.SSH.showLoginTerminal”: true,
“remote.SSH.defaultForwardedPorts”: [
],
“remote.SSH.path”: “C:\Program Files\OpenSSH”,
“remote.SSH.remotePlatform”: {
“Raspberry”: “linux”
},
“editor.suggestSelection”: “first”,
“vsintellicode.modify.editor.suggestSelection”: “automaticallyOverrodeDefaultValue”,
“cortex-debug.JLinkGDBServerPath”: “C:\Program Files (x86)\SEGGER\JLink_V634b”,
“cortex-debug.openocdPath”: “D:\OpenOCD-20200530-0.10.0\bin”,
“cortex-debug.armToolchainPath”: “D:\arm-none-eabi\bin”
/* "remote.SSH.remotePlatform": {
"linux"
} */
// “code-runner.runInTerminal”: true,
// “code-runner.saveAllFilesBeforeRun”: true
}