diff --git a/.vscode/launch.json b/.vscode/launch.json new file mode 100644 index 0000000..a527736 --- /dev/null +++ b/.vscode/launch.json @@ -0,0 +1,43 @@ +{ + "version": "0.2.0", + "configurations": [ + { + "name": "Microbit Debug", + "type": "cppdbg", + "request": "launch", + "program": "${workspaceRoot}\\build\\bbc-microbit-classic-gcc\\source\\microbit-samples-combined.hex", + "args": [], + "stopAtEntry": true, + "cwd": "${workspaceRoot}", + "environment": [], + "externalConsole": true, + "debugServerArgs": "--persist -t nrf51 -bh -r", + "serverLaunchTimeout": 20000, + "filterStderr": true, + "filterStdout": false, + "serverStarted": "GDB\\ server\\ started", + "logging": { + "moduleLoad": false, + "trace": true, + "engineLogging": true, + "programOutput": true, + "exceptions": false + }, + "windows": { + "MIMode": "gdb", + "MIDebuggerPath": "C:\\Program Files (x86)\\GNU Tools Arm Embedded\\4.9 2015q2\\bin\\arm-none-eabi-gdb.exe", + "debugServerPath": "C:\\yotta\\workspace\\Scripts\\pyocd-gdbserver.exe", + "debugServerArgs": "--persist -t nrf51 -bh -r", + "setupCommands": [ + { "text": "-environment-cd ${workspaceRoot}\\build\\bbc-microbit-classic-gcc\\source" }, + { "text": "-target-select remote localhost:3333", "description": "connect to target", "ignoreFailures": false }, + { "text": "-interpreter-exec console \"monitor reset\"", "ignoreFailures": false }, + { "text": "-interpreter-exec console \"monitor halt\"", "ignoreFailures": false }, + { "text": "-interpreter-exec console \"monitor soft_reset_halt\"", "ignoreFailures": false }, + { "text": "-file-exec-file ./microbit-samples-combined.hex", "description": "load file", "ignoreFailures": false}, + { "text": "-file-symbol-file ./microbit-samples", "description": "load synbol file", "ignoreFailures": false}, + ] + } + } + ] +} \ No newline at end of file diff --git a/README.md b/README.md index 7071e53..a72b24e 100644 --- a/README.md +++ b/README.md @@ -96,6 +96,17 @@ Here is an example of `config.json` with all available options configured: } } ``` +## Debug on Visual Studio Code (Windows) + +1. build sample. You can build "HELLO WORLD! :)" program. +2. Copy microbit-samples\build\bbc-microbit-classic-gcc\source\microbit-samples-combined.hex to micro:bit. +3. Launch the Visual Studio Code +4. File -> Open Folder... and select "microbit-samples" folder. +5. Set break point to "main()" function. +6. View -> Debug (Ctrl + Shift + D) +7. Debug -> Start Debugging (F5) + +![Debug on Visual Studio Code](/debugOnVisualStudioCode.gif) ## BBC Community Guidelines diff --git a/debugOnVisualStudioCode.gif b/debugOnVisualStudioCode.gif new file mode 100644 index 0000000..9f5ce36 Binary files /dev/null and b/debugOnVisualStudioCode.gif differ