diff --git a/.gitignore b/.gitignore index 081c0f8e8..1b27c52a3 100644 --- a/.gitignore +++ b/.gitignore @@ -108,3 +108,8 @@ fpga_version_info.c # .tmp files are created during compilation *.tmp + +#VSCode files +!.vscode/*.json +.vscode/launch.json +.vscode/tasks.json \ No newline at end of file diff --git a/.vscode/extensions.json b/.vscode/extensions.json new file mode 100644 index 000000000..85b3997e2 --- /dev/null +++ b/.vscode/extensions.json @@ -0,0 +1,10 @@ +{ + // See https://go.microsoft.com/fwlink/?LinkId=827846 + // for the documentation about the extensions.json format + "recommendations": [ + "ms-vscode.cpptools", + "austin.code-gnu-global", + "marus25.cortex-debug", + "augustocdias.tasks-shell-input" + ] +} diff --git a/.vscode/launch.json b/.vscode/launch.json deleted file mode 100644 index abd2cd775..000000000 --- a/.vscode/launch.json +++ /dev/null @@ -1,108 +0,0 @@ -{ - // Use IntelliSense to learn about possible attributes. - // Hover to view descriptions of existing attributes. - // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387 - "version": "0.2.0", - "configurations": [ - { - "name": "(gdb) Attach", - "type": "cppdbg", - "request": "attach", - "program": "${cwd}/client/proxmark3", - //"processId": "${command:pickProcess}", - "processId": "${input:ProcessID}", - "MIMode": "gdb", - "setupCommands": [ - { - "description": "Enable pretty-printing for gdb", - "text": "-enable-pretty-printing", - "ignoreFailures": true - } - ], - "windows": { - "processId": "${input:ProcessIDWindows}", - "miDebuggerPath": "${workspaceFolder}/../../msys2/mingw64/bin/gdb.exe", - "externalConsole": true,//for ProxSpace externalConsole=true is required, because the internal cosole stops updating after a while - "environment": [{ - "name": "PATH","value": "${workspaceFolder}/../../msys2/mingw64/bin;${workspaceFolder}/../../msys2/usr/local/bin;${workspaceFolder}/../../msys2/usr/bin;${workspaceFolder}/../../msys2/bin" - }] - } - },{ - "name": "(gdb) Build & Launch", - "type": "cppdbg", - "request": "launch", - "program": "${cwd}/client/proxmark3", - "args": ["/dev/ttyACM0"], - "stopAtEntry": false, - "cwd": "${workspaceFolder}", - "environment": [], - "externalConsole": false, - "MIMode": "gdb", - "setupCommands": [ - { - "description": "Enable pretty-printing for gdb", - "text": "-enable-pretty-printing", - "ignoreFailures": true - } - ], - "preLaunchTask": "client: Debug: clean & make", - "miDebuggerPath": "/usr/bin/gdb", - "windows": { - "args": ["COM5"], - "miDebuggerPath": "${workspaceFolder}/../../msys2/mingw64/bin/gdb.exe", - "externalConsole": true,//for ProxSpace externalConsole=true is required, because the internal cosole stops updating after a while - "environment": [{ - "name": "PATH","value": "${workspaceFolder}/../../msys2/mingw64/bin;${workspaceFolder}/../../msys2/usr/local/bin;${workspaceFolder}/../../msys2/usr/bin;${workspaceFolder}/../../msys2/bin" - }] - } - },{ - "type": "cortex-debug", - "request": "launch", - "name": "(Linux) Firmware debug", - "cwd": "${workspaceRoot}", - "preLaunchTask": "fullimage: clean & make", - "executable": "${workspaceRoot}/armsrc/obj/fullimage.elf", - "serverpath": "/opt/SEGGER/JLink/JLinkGDBServerCLExe", - "servertype": "jlink", - "device": "AT91SAM7S512", - "interface": "jtag", - "serialNumber": "", //If you have more than one J-Link probe, add the serial number here. - "runToMain": false, - "armToolchainPath": "/usr/bin/" - },{ - "type": "cortex-debug", - "request": "launch", - "name": "(WSL) Firmware debug", - "cwd": "${workspaceRoot}", - "preLaunchTask": "fullimage: clean & make", - "executable": "${workspaceRoot}/armsrc/obj/fullimage.elf", - "serverpath": "/mnt/c/Program Files (x86)/SEGGER/JLink/JLinkGDBServerCL.exe", - "servertype": "jlink", - "device": "AT91SAM7S512", - "interface": "jtag", - "serialNumber": "", //If you have more than one J-Link probe, add the serial number here. - "runToMain": false, - "armToolchainPath": "/usr/bin/" - } - ], - "inputs": [ - { - // Using Extension "Tasks Shell Input" https://marketplace.visualstudio.com/items?itemName=augustocdias.tasks-shell-input - "id": "ProcessID", - "type": "command", - "command": "shellCommand.execute", - "args": { - "command": "pgrep -n proxmark3", - } - - },{ - "id": "ProcessIDWindows", - "type": "command", - "command": "shellCommand.execute", - "args": { - "command": "${workspaceFolder}/../../runme64.bat -c \"cat /proc/$(pgrep -n proxmark3)/winpid\"", - } - - } - ] -} \ No newline at end of file diff --git a/.vscode/launch_linux.json b/.vscode/launch_linux.json new file mode 100644 index 000000000..0f60495a6 --- /dev/null +++ b/.vscode/launch_linux.json @@ -0,0 +1,70 @@ +{ + // Use IntelliSense to learn about possible attributes. + // Hover to view descriptions of existing attributes. + // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387 + "version": "0.2.0", + "configurations": [ + { + "name": "Client: (gdb) Build & Launch", + "type": "cppdbg", + "request": "launch", + "program": "${cwd}/client/proxmark3", + "args": ["${SerialPort}"], + "stopAtEntry": false, + "cwd": "${workspaceFolder}", + "environment": [], + "externalConsole": false, + "MIMode": "gdb", + "setupCommands": [ + { + "description": "Enable pretty-printing for gdb", + "text": "-enable-pretty-printing", + "ignoreFailures": true + } + ], + "preLaunchTask": "client: Debug: clean & make", + "miDebuggerPath": "${DebuggerPath}" + },{ + "name": "Client: (gdb) Attach", + "type": "cppdbg", + "request": "attach", + "program": "${cwd}/client/proxmark3", + //"processId": "${command:pickProcess}", + "processId": "${input:ProcessID}", + "MIMode": "gdb", + "setupCommands": [ + { + "description": "Enable pretty-printing for gdb", + "text": "-enable-pretty-printing", + "ignoreFailures": true + } + ] + },{ + "name": "Firmware: (J-Link) Build & Launch", + "type": "cortex-debug", + "request": "launch", + "cwd": "${workspaceRoot}", + "preLaunchTask": "fullimage: clean & make", + "executable": "${workspaceRoot}/armsrc/obj/fullimage.elf", + "serverpath": "${JLinkServerPath}", + "servertype": "jlink", + "device": "AT91SAM7S${DeviceMem}", + "interface": "jtag", + "serialNumber": "", //If you have more than one J-Link probe, add the serial number here. + "runToMain": false, + "armToolchainPath": "/usr/bin/" + } + ], + "inputs": [ + { + // Using Extension "Tasks Shell Input" https://marketplace.visualstudio.com/items?itemName=augustocdias.tasks-shell-input + "id": "ProcessID", + "type": "command", + "command": "shellCommand.execute", + "args": { + "command": "pgrep -n proxmark3", + } + + } + ] +} \ No newline at end of file diff --git a/.vscode/launch_ps.json b/.vscode/launch_ps.json new file mode 100644 index 000000000..8794ef76e --- /dev/null +++ b/.vscode/launch_ps.json @@ -0,0 +1,45 @@ +{ + // Use IntelliSense to learn about possible attributes. + // Hover to view descriptions of existing attributes. + // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387 + "version": "0.2.0", + "configurations": [ + { + "name": "Client: (gdb) Build & Launch", + "type": "cppdbg", + "request": "launch", + "program": "${cwd}/client/proxmark3", + "args": ["${SerialPort}"], + "stopAtEntry": false, + "cwd": "${workspaceFolder}", + "environment": [ + "name": "PATH","value": "${workspaceFolder}/../../msys2/mingw64/bin;${workspaceFolder}/../../msys2/usr/local/bin;${workspaceFolder}/../../msys2/usr/bin;${workspaceFolder}/../../msys2/bin" + ], + "externalConsole": true,//for ProxSpace externalConsole=true is required, because the internal cosole stops updating after a while + "MIMode": "gdb", + "setupCommands": [ + { + "description": "Enable pretty-printing for gdb", + "text": "-enable-pretty-printing", + "ignoreFailures": true + } + ], + "preLaunchTask": "client: Debug: clean & make", + "miDebuggerPath": "${DebuggerPath}" + },{ + "name": "Firmware: (J-Link) Build & Launch", + "type": "cortex-debug", + "request": "launch", + "cwd": "${workspaceRoot}", + "preLaunchTask": "fullimage: clean & make", + "executable": "${workspaceRoot}/armsrc/obj/fullimage.elf", + "serverpath": "${JLinkServerPath}", + "servertype": "jlink", + "device": "AT91SAM7S${DeviceMem}", + "interface": "jtag", + "serialNumber": "", //If you have more than one J-Link probe, add the serial number here. + "runToMain": false, + "armToolchainPath": "/usr/bin/" + } + ] +} \ No newline at end of file diff --git a/.vscode/launch_wsl.json b/.vscode/launch_wsl.json new file mode 100644 index 000000000..0f60495a6 --- /dev/null +++ b/.vscode/launch_wsl.json @@ -0,0 +1,70 @@ +{ + // Use IntelliSense to learn about possible attributes. + // Hover to view descriptions of existing attributes. + // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387 + "version": "0.2.0", + "configurations": [ + { + "name": "Client: (gdb) Build & Launch", + "type": "cppdbg", + "request": "launch", + "program": "${cwd}/client/proxmark3", + "args": ["${SerialPort}"], + "stopAtEntry": false, + "cwd": "${workspaceFolder}", + "environment": [], + "externalConsole": false, + "MIMode": "gdb", + "setupCommands": [ + { + "description": "Enable pretty-printing for gdb", + "text": "-enable-pretty-printing", + "ignoreFailures": true + } + ], + "preLaunchTask": "client: Debug: clean & make", + "miDebuggerPath": "${DebuggerPath}" + },{ + "name": "Client: (gdb) Attach", + "type": "cppdbg", + "request": "attach", + "program": "${cwd}/client/proxmark3", + //"processId": "${command:pickProcess}", + "processId": "${input:ProcessID}", + "MIMode": "gdb", + "setupCommands": [ + { + "description": "Enable pretty-printing for gdb", + "text": "-enable-pretty-printing", + "ignoreFailures": true + } + ] + },{ + "name": "Firmware: (J-Link) Build & Launch", + "type": "cortex-debug", + "request": "launch", + "cwd": "${workspaceRoot}", + "preLaunchTask": "fullimage: clean & make", + "executable": "${workspaceRoot}/armsrc/obj/fullimage.elf", + "serverpath": "${JLinkServerPath}", + "servertype": "jlink", + "device": "AT91SAM7S${DeviceMem}", + "interface": "jtag", + "serialNumber": "", //If you have more than one J-Link probe, add the serial number here. + "runToMain": false, + "armToolchainPath": "/usr/bin/" + } + ], + "inputs": [ + { + // Using Extension "Tasks Shell Input" https://marketplace.visualstudio.com/items?itemName=augustocdias.tasks-shell-input + "id": "ProcessID", + "type": "command", + "command": "shellCommand.execute", + "args": { + "command": "pgrep -n proxmark3", + } + + } + ] +} \ No newline at end of file diff --git a/.vscode/setup.sh b/.vscode/setup.sh new file mode 100644 index 000000000..b439f2cbd --- /dev/null +++ b/.vscode/setup.sh @@ -0,0 +1,4 @@ +export SerialPort="/dev/ttyACM0" +export DebuggerPath="/usr/bin/gdb" +export JLinkServerPath="/opt/SEGGER/JLink/JLinkGDBServerCLExe" +export DeviceMem="512" \ No newline at end of file diff --git a/.vscode/tasks.json b/.vscode/tasks_linux.json similarity index 100% rename from .vscode/tasks.json rename to .vscode/tasks_linux.json diff --git a/.vscode/tasks_ps.json b/.vscode/tasks_ps.json new file mode 100644 index 000000000..4cc21841d --- /dev/null +++ b/.vscode/tasks_ps.json @@ -0,0 +1,177 @@ +{ + // See https://go.microsoft.com/fwlink/?LinkId=733558 + // for the documentation about the tasks.json format + "version": "2.0.0", + "tasks": [ + { + "label": "all: Make & run", + "type": "shell", + "command": "make -j && ./pm3", + "windows": { + "options": { + "cwd": "${workspaceFolder}/../..", + "shell": { + "executable": "${workspaceFolder}/../../runme64.bat", + "args": [ + "-c \"cd ${workspaceFolderBasename} &&" + ], + + } + } + }, + "problemMatcher": [ + "$gcc" + ], + "group": { + "kind": "build", + "isDefault": true + } + }, + { + "label": "choose: Make", + "type": "shell", + "command": "make ${input:componentType} -j", + "windows": { + "options": { + "cwd": "${workspaceFolder}/../..", + "shell": { + "executable": "${workspaceFolder}/../../runme64.bat", + "args": [ + "-c \"cd ${workspaceFolderBasename} &&" + ], + + } + } + }, + "problemMatcher": [ + "$gcc" + ], + "group": "build", + }, + { + "label": "client: Debug: make", + "type": "shell", + "command": "make client -j DEBUG=1", + "windows": { + "options": { + "cwd": "${workspaceFolder}/../..", + "shell": { + "executable": "${workspaceFolder}/../../runme64.bat", + "args": [ + "-c \"cd ${workspaceFolderBasename} &&" + ], + + } + } + }, + "problemMatcher": [ + "$gcc" + ], + "group": "build", + }, + { + "label": "client: Debug: clean & make", + "type": "shell", + "command": "make client/clean && make client -j DEBUG=1", + "windows": { + "options": { + "cwd": "${workspaceFolder}/../..", + "shell": { + "executable": "${workspaceFolder}/../../runme64.bat", + "args": [ + "-c \"cd ${workspaceFolderBasename} &&" + ], + + } + } + }, + "problemMatcher": [ + "$gcc" + ], + "group": "build", + }, + { + "label": "fullimage: Make & Flash", + "type": "shell", + "command": "make fullimage && ./pm3-flash-fullimage", + "windows": { + "options": { + "cwd": "${workspaceFolder}/../..", + "shell": { + "executable": "${workspaceFolder}/../../runme64.bat", + "args": [ + "-c \"cd ${workspaceFolderBasename} &&" + ], + + } + } + }, + "problemMatcher": [] + }, + { + "label": "BOOTROM: Make & Flash", + "type": "shell", + "command": "make bootrom && ./pm3-flash-bootrom", + "windows": { + "options": { + "cwd": "${workspaceFolder}/../..", + "shell": { + "executable": "${workspaceFolder}/../../runme64.bat", + "args": [ + "-c \"cd ${workspaceFolderBasename} &&" + ], + + } + } + }, + "problemMatcher": [] + }, + { + "label": "Run client", + "type": "shell", + "command": "./pm3", + "windows": { + "options": { + "cwd": "${workspaceFolder}/../..", + "shell": { + "executable": "${workspaceFolder}/../../runme64.bat", + "args": [ + "-c \"cd ${workspaceFolderBasename} &&" + ], + + } + } + }, + "problemMatcher": [] + },{ + "label": "fullimage: clean & make", + "type": "shell", + "command": "make armsrc/clean && make armsrc/all SKIP_COMPRESSION=1 DEBUG=1", + "problemMatcher": [ + "$gcc" + ], + "group": "build", + } + ], + "inputs": [ + { + "type": "pickString", + "id": "componentType", + "description": "What Makefile target do you want to execute?", + "options": [ + "all", + "client", + "bootrom", + "fullimage", + "recovery", + "clean", + "install", + "uninstall", + "style", + "miscchecks", + "check", + ], + "default": "all" + } + ] +} \ No newline at end of file diff --git a/.vscode/tasks_wsl.json b/.vscode/tasks_wsl.json new file mode 100644 index 000000000..4cc21841d --- /dev/null +++ b/.vscode/tasks_wsl.json @@ -0,0 +1,177 @@ +{ + // See https://go.microsoft.com/fwlink/?LinkId=733558 + // for the documentation about the tasks.json format + "version": "2.0.0", + "tasks": [ + { + "label": "all: Make & run", + "type": "shell", + "command": "make -j && ./pm3", + "windows": { + "options": { + "cwd": "${workspaceFolder}/../..", + "shell": { + "executable": "${workspaceFolder}/../../runme64.bat", + "args": [ + "-c \"cd ${workspaceFolderBasename} &&" + ], + + } + } + }, + "problemMatcher": [ + "$gcc" + ], + "group": { + "kind": "build", + "isDefault": true + } + }, + { + "label": "choose: Make", + "type": "shell", + "command": "make ${input:componentType} -j", + "windows": { + "options": { + "cwd": "${workspaceFolder}/../..", + "shell": { + "executable": "${workspaceFolder}/../../runme64.bat", + "args": [ + "-c \"cd ${workspaceFolderBasename} &&" + ], + + } + } + }, + "problemMatcher": [ + "$gcc" + ], + "group": "build", + }, + { + "label": "client: Debug: make", + "type": "shell", + "command": "make client -j DEBUG=1", + "windows": { + "options": { + "cwd": "${workspaceFolder}/../..", + "shell": { + "executable": "${workspaceFolder}/../../runme64.bat", + "args": [ + "-c \"cd ${workspaceFolderBasename} &&" + ], + + } + } + }, + "problemMatcher": [ + "$gcc" + ], + "group": "build", + }, + { + "label": "client: Debug: clean & make", + "type": "shell", + "command": "make client/clean && make client -j DEBUG=1", + "windows": { + "options": { + "cwd": "${workspaceFolder}/../..", + "shell": { + "executable": "${workspaceFolder}/../../runme64.bat", + "args": [ + "-c \"cd ${workspaceFolderBasename} &&" + ], + + } + } + }, + "problemMatcher": [ + "$gcc" + ], + "group": "build", + }, + { + "label": "fullimage: Make & Flash", + "type": "shell", + "command": "make fullimage && ./pm3-flash-fullimage", + "windows": { + "options": { + "cwd": "${workspaceFolder}/../..", + "shell": { + "executable": "${workspaceFolder}/../../runme64.bat", + "args": [ + "-c \"cd ${workspaceFolderBasename} &&" + ], + + } + } + }, + "problemMatcher": [] + }, + { + "label": "BOOTROM: Make & Flash", + "type": "shell", + "command": "make bootrom && ./pm3-flash-bootrom", + "windows": { + "options": { + "cwd": "${workspaceFolder}/../..", + "shell": { + "executable": "${workspaceFolder}/../../runme64.bat", + "args": [ + "-c \"cd ${workspaceFolderBasename} &&" + ], + + } + } + }, + "problemMatcher": [] + }, + { + "label": "Run client", + "type": "shell", + "command": "./pm3", + "windows": { + "options": { + "cwd": "${workspaceFolder}/../..", + "shell": { + "executable": "${workspaceFolder}/../../runme64.bat", + "args": [ + "-c \"cd ${workspaceFolderBasename} &&" + ], + + } + } + }, + "problemMatcher": [] + },{ + "label": "fullimage: clean & make", + "type": "shell", + "command": "make armsrc/clean && make armsrc/all SKIP_COMPRESSION=1 DEBUG=1", + "problemMatcher": [ + "$gcc" + ], + "group": "build", + } + ], + "inputs": [ + { + "type": "pickString", + "id": "componentType", + "description": "What Makefile target do you want to execute?", + "options": [ + "all", + "client", + "bootrom", + "fullimage", + "recovery", + "clean", + "install", + "uninstall", + "style", + "miscchecks", + "check", + ], + "default": "all" + } + ] +} \ No newline at end of file