diff --git a/.vscode/launch.json b/.vscode/launch.json new file mode 100644 index 000000000..1a3a0fb92 --- /dev/null +++ b/.vscode/launch.json @@ -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}" + } + ] +} diff --git a/.vscode/tasks.json b/.vscode/tasks.json new file mode 100644 index 000000000..4fb48e401 --- /dev/null +++ b/.vscode/tasks.json @@ -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"] + } + ] +} diff --git a/DeviceCode/Targets/Native/STM32F4/DeviceCode/STM32F4_Power/STM32F4_Power_functions.cpp b/DeviceCode/Targets/Native/STM32F4/DeviceCode/STM32F4_Power/STM32F4_Power_functions.cpp index 143e7180d..afc0b2228 100644 --- a/DeviceCode/Targets/Native/STM32F4/DeviceCode/STM32F4_Power/STM32F4_Power_functions.cpp +++ b/DeviceCode/Targets/Native/STM32F4/DeviceCode/STM32F4_Power/STM32F4_Power_functions.cpp @@ -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; } diff --git a/Solutions/MCBSTM32F400/build_vscode.cmd b/Solutions/MCBSTM32F400/build_vscode.cmd new file mode 100644 index 000000000..ce389dadc --- /dev/null +++ b/Solutions/MCBSTM32F400/build_vscode.cmd @@ -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% diff --git a/Solutions/STM32F429IDISCOVERY/build_vscode.cmd b/Solutions/STM32F429IDISCOVERY/build_vscode.cmd new file mode 100644 index 000000000..59b32bcba --- /dev/null +++ b/Solutions/STM32F429IDISCOVERY/build_vscode.cmd @@ -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% diff --git a/Solutions/STM32F4DISCOVERY/build_vscode.cmd b/Solutions/STM32F4DISCOVERY/build_vscode.cmd new file mode 100644 index 000000000..768611c9e --- /dev/null +++ b/Solutions/STM32F4DISCOVERY/build_vscode.cmd @@ -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%