Skip to content
This repository has been archived by the owner on Jun 5, 2019. It is now read-only.

Add files to support build and debug from within VS Code #524

Open
wants to merge 1 commit into
base: dev
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
179 changes: 179 additions & 0 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,179 @@
{
"version": "0.2.0",
"configurations": [
{
"name": "STM32F4DISCOVERY TinyCLR",
"type": "cppdbg",
"request": "launch",
"miDebuggerPath": "E:/GNU_Tools_ARM_Embedded/5_4_2016q3/bin/arm-none-eabi-gdb.exe",
"targetArchitecture": "ARM",
"program": "E:/GitHub/netmf-interpreter/BuildOutput/THUMB2FP/GCC5.4/le/FLASH/release/STM32F4DISCOVERY/bin/tinyclr.axf",

"setupCommands": [
{"text": "target extended-remote localhost:3333"},
{"text": "monitor reset halt"},
{"text": "monitor flash write_image erase \"E:/GitHub/netmf-interpreter/BuildOutput/THUMB2FP/GCC5.4/le/FLASH/release/STM32F4DISCOVERY/bin/tinyclr.hex/ER_FLASH.hex\" "},
{"text": "file E:/GitHub/netmf-interpreter/BuildOutput/THUMB2FP/GCC5.4/le/FLASH/release/STM32F4DISCOVERY/bin/tinyclr.axf"},
{"text": "monitor reset halt"}
],

"customLaunchSetupCommands": [
{"text": "monitor reset halt"}
],

"launchCompleteCommand": "exec-continue",
"debugServerPath": "C:/Program Files (x86)/openocd-0.10.0/bin/openocd.exe",
"debugServerArgs": "-s \"C:/Program Files (x86)/openocd-0.10.0/bin/scripts/\" -f interface/stlink-v2-1.cfg -f board/stm32f4discovery.cfg",
"serverStarted": "Info\\ :\\ [\\w\\d\\.]*:\\ hardware",
"filterStderr": true,
"externalConsole": true,
"cwd": "${cwd}"
},
{
"name": "STM32F4DISCOVERY TinyBooter",
"type": "cppdbg",
"request": "launch",
"miDebuggerPath": "E:/GNU_Tools_ARM_Embedded/5_4_2016q3/bin/arm-none-eabi-gdb.exe",
"targetArchitecture": "ARM",
"program": "E:/GitHub/netmf-interpreter/BuildOutput/THUMB2FP/GCC5.4/le/FLASH/release/STM32F4DISCOVERY/bin/tinybooter.axf",

"setupCommands": [
{"text": "target extended-remote localhost:3333"},
{"text": "monitor reset halt"},
{"text": "monitor flash write_image erase \"E:/GitHub/netmf-interpreter/BuildOutput/THUMB2FP/GCC5.4/le/FLASH/release/STM32F4DISCOVERY/bin/tinybooter.hex\" "},
{"text": "file E:/GitHub/netmf-interpreter/BuildOutput/THUMB2FP/GCC5.4/le/FLASH/release/STM32F4DISCOVERY/bin/tinybooter.axf"},
{"text": "monitor reset halt"}
],

"customLaunchSetupCommands": [
{"text": "monitor reset halt"}
],

"launchCompleteCommand": "exec-continue",
"debugServerPath": "C:/Program Files (x86)/openocd-0.10.0/bin/openocd.exe",
"debugServerArgs": "-s \"C:/Program Files (x86)/openocd-0.10.0/bin/scripts/\" -f interface/stlink-v2-1.cfg -f board/stm32f4discovery.cfg",
"serverStarted": "Info\\ :\\ [\\w\\d\\.]*:\\ hardware",
"filterStderr": true,
"externalConsole": true,
"cwd": "${cwd}"
},
{
"name": "STM32F429IDISCOVERY TinyCLR",
"type": "cppdbg",
"request": "launch",
"miDebuggerPath": "E:/GNU_Tools_ARM_Embedded/5_4_2016q3/bin/arm-none-eabi-gdb.exe",
"targetArchitecture": "ARM",
"program": "E:/GitHub/netmf-interpreter/BuildOutput/THUMB2FP/GCC5.4/le/FLASH/release/STM32F429IDISCOVERY/bin/tinyclr.axf",

"setupCommands": [
{"text": "target extended-remote localhost:3333"},
{"text": "monitor reset halt"},
{"text": "monitor flash write_image erase \"E:/GitHub/netmf-interpreter/BuildOutput/THUMB2FP/GCC5.4/le/FLASH/release/STM32F429IDISCOVERY/bin/tinyclr.hex/ER_FLASH.hex\" "},
{"text": "file E:/GitHub/netmf-interpreter/BuildOutput/THUMB2FP/GCC5.4/le/FLASH/release/STM32F429IDISCOVERY/bin/tinyclr.axf"},
{"text": "monitor reset halt"}
],

"customLaunchSetupCommands": [
{"text": "monitor reset init"}
],

"launchCompleteCommand": "exec-continue",
"debugServerPath": "C:/Program Files (x86)/openocd-0.10.0/bin/openocd.exe",
"debugServerArgs": "-s \"C:/Program Files (x86)/openocd-0.10.0/bin/scripts/\" -f interface/stlink-v2-1.cfg -f board/stm32f429discovery.cfg",
"serverStarted": "Info\\ :\\ [\\w\\d\\.]*:\\ hardware",
"filterStderr": true,
"externalConsole": true,
"cwd": "${cwd}"
},
{
"name": "STM32F429IDISCOVERY TinyBooter",
"type": "cppdbg",
"request": "launch",
"miDebuggerPath": "E:/GNU_Tools_ARM_Embedded/5_4_2016q3/bin/arm-none-eabi-gdb.exe",
"targetArchitecture": "ARM",
"program": "E:/GitHub/netmf-interpreter/BuildOutput/THUMB2FP/GCC5.4/le/FLASH/release/STM32F429IDISCOVERY/bin/tinybooter.axf",

"setupCommands": [
{"text": "target extended-remote localhost:3333"},
{"text": "monitor reset halt"},
{"text": "monitor flash write_image erase \"E:/GitHub/netmf-interpreter/BuildOutput/THUMB2FP/GCC5.4/le/FLASH/release/STM32F429IDISCOVERY/bin/tinybooter.hex\" "},
{"text": "file E:/GitHub/netmf-interpreter/BuildOutput/THUMB2FP/GCC5.4/le/FLASH/release/STM32F429IDISCOVERY/bin/tinybooter.axf"},
{"text": "monitor reset halt"}
],

"customLaunchSetupCommands": [
{"text": "monitor reset init"}
],

"launchCompleteCommand": "exec-continue",
"debugServerPath": "C:/Program Files (x86)/openocd-0.10.0/bin/openocd.exe",
"debugServerArgs": "-s \"C:/Program Files (x86)/openocd-0.10.0/bin/scripts/\" -f interface/stlink-v2-1.cfg -f board/stm32f429discovery.cfg",
"serverStarted": "Info\\ :\\ [\\w\\d\\.]*:\\ hardware",
"filterStderr": true,
"externalConsole": true,
"cwd": "${cwd}"
},
{
"name": "MCBSTM32F400 TinyCLR",
"type": "cppdbg",
"request": "launch",
"miDebuggerPath": "E:/GNU_Tools_ARM_Embedded/5_4_2016q3/bin/arm-none-eabi-gdb.exe",
"targetArchitecture": "ARM",
"program": "E:/GitHub/netmf-interpreter/BuildOutput/THUMB2FP/GCC5.4/le/FLASH/release/MCBSTM32F400/bin/tinyclr.axf",

"setupCommands": [
{"text": "target extended-remote localhost:3333"},
{"text": "monitor reset halt"},
{"text": "monitor flash write_image erase \"E:/GitHub/netmf-interpreter/BuildOutput/THUMB2FP/GCC5.4/le/FLASH/release/MCBSTM32F400/bin/tinyclr.hex/ER_FLASH.hex\" "},
{"text": "file E:/GitHub/netmf-interpreter/BuildOutput/THUMB2FP/GCC5.4/le/FLASH/release/MCBSTM32F400/bin/tinyclr.axf"},
{"text": "monitor reset halt"}
],

"customLaunchSetupCommands": [
{"text": "monitor reset init"}
],

"launchCompleteCommand": "exec-continue",
"debugServerPath": "C:/Program Files (x86)/openocd-0.10.0/bin/openocd.exe",
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
//REPLACE interface & board support configuration files bellow
"debugServerArgs": "-s \"C:/Program Files (x86)/openocd-0.10.0/bin/scripts/\" -f interface/stlink-v2-1.cfg -f board/stm32f429discovery.cfg",
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
"serverStarted": "Info\\ :\\ [\\w\\d\\.]*:\\ hardware",
"filterStderr": true,
"externalConsole": true,
"cwd": "${cwd}"
},
{
"name": "MCBSTM32F400 TinyBooter",
"type": "cppdbg",
"request": "launch",
"miDebuggerPath": "E:/GNU_Tools_ARM_Embedded/5_4_2016q3/bin/arm-none-eabi-gdb.exe",
"targetArchitecture": "ARM",
"program": "E:/GitHub/netmf-interpreter/BuildOutput/THUMB2FP/GCC5.4/le/FLASH/release/MCBSTM32F400/bin/tinybooter.axf",

"setupCommands": [
{"text": "target extended-remote localhost:3333"},
{"text": "monitor reset halt"},
{"text": "monitor flash write_image erase \"E:/GitHub/netmf-interpreter/BuildOutput/THUMB2FP/GCC5.4/le/FLASH/release/MCBSTM32F400/bin/tinybooter.hex\" "},
{"text": "file E:/GitHub/netmf-interpreter/BuildOutput/THUMB2FP/GCC5.4/le/FLASH/release/MCBSTM32F400/bin/tinybooter.axf"},
{"text": "monitor reset halt"}
],

"customLaunchSetupCommands": [
{"text": "monitor reset init"}
],

"launchCompleteCommand": "exec-continue",
"debugServerPath": "C:/Program Files (x86)/openocd-0.10.0/bin/openocd.exe",
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
//REPLACE INTERFACE AND BOARD SUPPORT CONFIGURATION FILES BELLOW
"debugServerArgs": "-s \"C:/Program Files (x86)/openocd-0.10.0/bin/scripts/\" -f interface/stlink-v2-1.cfg -f board/stm32f429discovery.cfg",
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
"serverStarted": "Info\\ :\\ [\\w\\d\\.]*:\\ hardware",
"filterStderr": true,
"externalConsole": true,
"cwd": "${cwd}"
}
]
}
29 changes: 29 additions & 0 deletions .vscode/tasks.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
{
// See https://go.microsoft.com/fwlink/?LinkId=733558
// for the documentation about the tasks.json format
"version": "0.1.0",
"command": "cmd",
"args": ["/C"],
"isShellCommand": true,
"showOutput": "always",
"tasks": [
{
"taskName": "Build STM32F4DISCOVERY",
"suppressTaskName": true,
"isBuildCommand": true,
"args": ["${workspaceRoot}\\Solutions\\STM32F4DISCOVERY\\build_vscode.cmd"]
},
{
"taskName": "Build STM32F429IDISCOVERY",
"suppressTaskName": true,
"isBuildCommand": true,
"args": ["${workspaceRoot}\\Solutions\\STM32F429IDISCOVERY\\build_vscode.cmd"]
},
{
"taskName": "Build MCBSTM32F400",
"suppressTaskName": true,
"isBuildCommand": true,
"args": ["${workspaceRoot}\\Solutions\\MCBSTM32F400\\build_vscode.cmd"]
}
]
}
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,12 @@ BOOL CPU_Initialize()
{
NATIVE_PROFILE_HAL_PROCESSOR_POWER();
CPU_INTC_Initialize();

#if !defined(BUILD_RTM)
// enable debug on any low power mode
DBGMCU->CR |= DBGMCU_CR_DBG_SLEEP + DBGMCU_CR_DBG_STOP + DBGMCU_CR_DBG_STANDBY;
#endif

return TRUE;
}

Expand Down
10 changes: 10 additions & 0 deletions Solutions/MCBSTM32F400/build_vscode.cmd
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
setlocal
call setenv_gcc 5.4.1 "E:\GNU_Tools_ARM_Embedded\5_4_2016q3"
cd Solutions\MCBSTM32F400
msbuild dotnetmf.proj /t:build /p:flavor=release;memory=flash /filelogger /flp:ErrorsOnly /clp:verbosity=minimal /maxcpucount /v:m
@REM must rename the image file to include the HEX extension
cd..
cd..
cd BuildOutput\THUMB2FP\GCC5.4\le\FLASH\release\MCBSTM32F400\bin\tinyclr.hex
rename ER_FLASH ER_FLASH.hex
endlocal&&exit /B %ERRORLEVEL%
10 changes: 10 additions & 0 deletions Solutions/STM32F429IDISCOVERY/build_vscode.cmd
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
setlocal
call setenv_gcc 5.4.1 "E:\GNU_Tools_ARM_Embedded\5_4_2016q3"
cd Solutions\STM32F429IDISCOVERY
msbuild dotnetmf.proj /t:build /p:flavor=release;memory=flash /filelogger /flp:ErrorsOnly /clp:verbosity=minimal /maxcpucount /v:m
@REM must rename the image file to include the HEX extension
cd..
cd..
cd BuildOutput\THUMB2FP\GCC5.4\le\FLASH\release\STM32F429IDISCOVERY\bin\tinyclr.hex
rename ER_FLASH ER_FLASH.hex
endlocal&&exit /B %ERRORLEVEL%
10 changes: 10 additions & 0 deletions Solutions/STM32F4DISCOVERY/build_vscode.cmd
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
setlocal
call setenv_gcc 5.4.1 "E:\GNU_Tools_ARM_Embedded\5_4_2016q3"
cd Solutions\STM32F4DISCOVERY
msbuild dotnetmf.proj /t:build /p:flavor=release;memory=flash /filelogger /flp:ErrorsOnly /clp:verbosity=minimal /maxcpucount /v:m
@REM must rename the image file to include the HEX extension
cd..
cd..
cd BuildOutput\THUMB2FP\GCC5.4\le\FLASH\release\STM32F4DISCOVERY\bin\tinyclr.hex
rename ER_FLASH ER_FLASH.hex
endlocal&&exit /B %ERRORLEVEL%