Hi,
I’ve struggeled for a while with my code.
I’m working on a windows laptop using visual studio code.
Whenever I try flashing a simple program, like a script that prints hi with 1000ms delay, VSCode works.
But if I try to flash more complicated projects, with several .h files, .cpp files, and an ino file, the vscode fails, and it spits out this error:
make[1]: Leaving directory '/firmware/modules/argon/user-part'
make[1]: *** [target/workspace.elf] Error 1
../build/recurse.mk:11: recipe for target 'modules/argon/user-part' failed
make: *** [modules/argon/user-part] Error 2
Flash device failed: Compiler encountered an error
at makeError (C:\Users\Uzair\.vscode\extensions\particle.particle-vscode-core-1.4.6\node_modules\execa\index.js:174:9)
at module.exports.Promise.all.then.arr (C:\Users\Uzair\.vscode\extensions\particle.particle-vscode-core-1.4.6\node_modules\execa\index.js:278:16)
- - - -
Anyone here who could help me?
My launch.json file looks like this:
{
"version": "0.1.0",
"configurations": [
{
"type": "cortex-debug",
"request": "attach",
"name": "Particle Debugger (photon, p1, electron)",
"servertype": "openocd",
"interface": "swd",
"device": "STM32F205RG",
"cwd": "${workspaceRoot}",
"executable": "${command:particle.getDebuggerExecutable}",
"preLaunchTask": "Particle: Flash application for debug (local)",
"armToolchainPath": "${command:particle.getDebuggerCompilerDir}",
"svdFile": "${command:particle.getDebuggerSVDFile}",
"searchDir": [
"${command:particle.getDebuggerSearchDir}"
],
"configFiles": [
"interface/cmsis-dap.cfg",
"target/stm32f2x.cfg"
],
"postAttachCommands": [
"monitor reset halt"
],
"windows": {
"configFiles": [
"interface\\cmsis-dap.cfg",
"target\\stm32f2x.cfg"
]
}
},
{
"type": "cortex-debug",
"request": "attach",
"name": "Particle Debugger (argon, boron / bsom, xenon)",
"servertype": "openocd",
"interface": "swd",
"device": "nRF52840_xxAA",
"cwd": "${workspaceRoot}",
"executable": "${command:particle.getDebuggerExecutable}",
"preLaunchTask": "Particle: Flash application for debug (local)",
"armToolchainPath": "${command:particle.getDebuggerCompilerDir}",
"svdFile": "${command:particle.getDebuggerSVDFile}",
"searchDir": [
"${command:particle.getDebuggerSearchDir}"
],
"configFiles": [
"interface/cmsis-dap.cfg",
"target/nrf52-particle.cfg"
],
"windows": {
"configFiles": [
"interface\\cmsis-dap.cfg",
"target\\nrf52-particle.cfg"
]
}
},
{
"type": "cortex-debug",
"request": "attach",
"name": "Particle Programmer Shield v1.0 (photon, p1, electron)",
"servertype": "openocd",
"interface": "swd",
"device": "STM32F205RG",
"cwd": "${workspaceRoot}",
"executable": "${command:particle.getDebuggerExecutable}",
"preLaunchTask": "Particle: Flash application for debug (local)",
"armToolchainPath": "${command:particle.getDebuggerCompilerDir}",
"svdFile": "${command:particle.getDebuggerSVDFile}",
"searchDir": [
"${command:particle.getDebuggerSearchDir}"
],
"configFiles": [
"interface/particle-ftdi.cfg",
"target/stm32f2x.cfg"
],
"postAttachCommands": [
"monitor reset halt"
],
"windows": {
"configFiles": [
"interface\\particle-ftdi.cfg",
"target\\stm32f2x.cfg"
]
}
}
]
}
And this is my settings.json file:
{
"extensions.ignoreRecommendations": true,
"C_Cpp.default.configurationProvider": "particle.particle-vscode-core",
"files.associations": {
"*.ino": "cpp"
},
"particle.firmwareVersion": "1.1.0",
"cortex-debug.openocdPath": "C:\\Users\\Uzair\\.particle\\toolchains\\openocd\\0.10.0-particle.1\\bin\\openocd.exe",
"particle.targetPlatform": "argon",
"particle.targetDevice": "e00fce68e5dc15d28594f686"
}