-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Fortinbra
committed
May 25, 2024
1 parent
cdc233f
commit a3425d6
Showing
21 changed files
with
1,119 additions
and
228 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
{ | ||
"cmake.sourceDirectory": "/home/fortinbra/GP2040-RE/src", | ||
"cortex-debug.variableUseNaturalFormat": true | ||
"cortex-debug.variableUseNaturalFormat": true, | ||
"cmake.sourceDirectory": "C:/ws/GP2040-RE/src" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,73 @@ | ||
# This is a copy of <PICO_SDK_PATH>/external/pico_sdk_import.cmake | ||
|
||
# This can be dropped into an external project to help locate this SDK | ||
# It should be include()ed prior to project() | ||
|
||
if (DEFINED ENV{PICO_SDK_PATH} AND (NOT PICO_SDK_PATH)) | ||
set(PICO_SDK_PATH $ENV{PICO_SDK_PATH}) | ||
message("Using PICO_SDK_PATH from environment ('${PICO_SDK_PATH}')") | ||
endif () | ||
|
||
if (DEFINED ENV{PICO_SDK_FETCH_FROM_GIT} AND (NOT PICO_SDK_FETCH_FROM_GIT)) | ||
set(PICO_SDK_FETCH_FROM_GIT $ENV{PICO_SDK_FETCH_FROM_GIT}) | ||
message("Using PICO_SDK_FETCH_FROM_GIT from environment ('${PICO_SDK_FETCH_FROM_GIT}')") | ||
endif () | ||
|
||
if (DEFINED ENV{PICO_SDK_FETCH_FROM_GIT_PATH} AND (NOT PICO_SDK_FETCH_FROM_GIT_PATH)) | ||
set(PICO_SDK_FETCH_FROM_GIT_PATH $ENV{PICO_SDK_FETCH_FROM_GIT_PATH}) | ||
message("Using PICO_SDK_FETCH_FROM_GIT_PATH from environment ('${PICO_SDK_FETCH_FROM_GIT_PATH}')") | ||
endif () | ||
|
||
set(PICO_SDK_PATH "${PICO_SDK_PATH}" CACHE PATH "Path to the Raspberry Pi Pico SDK") | ||
set(PICO_SDK_FETCH_FROM_GIT "${PICO_SDK_FETCH_FROM_GIT}" CACHE BOOL "Set to ON to fetch copy of SDK from git if not otherwise locatable") | ||
set(PICO_SDK_FETCH_FROM_GIT_PATH "${PICO_SDK_FETCH_FROM_GIT_PATH}" CACHE FILEPATH "location to download SDK") | ||
|
||
if (NOT PICO_SDK_PATH) | ||
if (PICO_SDK_FETCH_FROM_GIT) | ||
include(FetchContent) | ||
set(FETCHCONTENT_BASE_DIR_SAVE ${FETCHCONTENT_BASE_DIR}) | ||
if (PICO_SDK_FETCH_FROM_GIT_PATH) | ||
get_filename_component(FETCHCONTENT_BASE_DIR "${PICO_SDK_FETCH_FROM_GIT_PATH}" REALPATH BASE_DIR "${CMAKE_SOURCE_DIR}") | ||
endif () | ||
# GIT_SUBMODULES_RECURSE was added in 3.17 | ||
if (${CMAKE_VERSION} VERSION_GREATER_EQUAL "3.17.0") | ||
FetchContent_Declare( | ||
pico_sdk | ||
GIT_REPOSITORY https://github.com/raspberrypi/pico-sdk | ||
GIT_TAG master | ||
GIT_SUBMODULES_RECURSE FALSE | ||
) | ||
else () | ||
FetchContent_Declare( | ||
pico_sdk | ||
GIT_REPOSITORY https://github.com/raspberrypi/pico-sdk | ||
GIT_TAG master | ||
) | ||
endif () | ||
|
||
if (NOT pico_sdk) | ||
message("Downloading Raspberry Pi Pico SDK") | ||
FetchContent_Populate(pico_sdk) | ||
set(PICO_SDK_PATH ${pico_sdk_SOURCE_DIR}) | ||
endif () | ||
set(FETCHCONTENT_BASE_DIR ${FETCHCONTENT_BASE_DIR_SAVE}) | ||
else () | ||
message(FATAL_ERROR | ||
"SDK location was not specified. Please set PICO_SDK_PATH or set PICO_SDK_FETCH_FROM_GIT to on to fetch from git." | ||
) | ||
endif () | ||
endif () | ||
|
||
get_filename_component(PICO_SDK_PATH "${PICO_SDK_PATH}" REALPATH BASE_DIR "${CMAKE_BINARY_DIR}") | ||
if (NOT EXISTS ${PICO_SDK_PATH}) | ||
message(FATAL_ERROR "Directory '${PICO_SDK_PATH}' not found") | ||
endif () | ||
|
||
set(PICO_SDK_INIT_CMAKE_FILE ${PICO_SDK_PATH}/pico_sdk_init.cmake) | ||
if (NOT EXISTS ${PICO_SDK_INIT_CMAKE_FILE}) | ||
message(FATAL_ERROR "Directory '${PICO_SDK_PATH}' does not appear to contain the Raspberry Pi Pico SDK") | ||
endif () | ||
|
||
set(PICO_SDK_PATH ${PICO_SDK_PATH} CACHE PATH "Path to the Raspberry Pi Pico SDK" FORCE) | ||
|
||
include(${PICO_SDK_INIT_CMAKE_FILE}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
{ | ||
"configurations": [ | ||
{ | ||
"name": "Pico", | ||
"includePath": [ | ||
"${workspaceFolder}/**", | ||
"${env:USERPROFILE}/.pico-sdk/sdk/1.5.1/**" | ||
], | ||
"forcedInclude": [ | ||
"${env:USERPROFILE}/.pico-sdk/sdk/1.5.1/src/common/pico_base/include/pico.h", | ||
"${workspaceFolder}/build/generated/pico_base/pico/config_autogen.h" | ||
], | ||
"defines": [], | ||
"compilerPath": "${env:USERPROFILE}/.pico-sdk/toolchain/13_2_Rel1/bin/arm-none-eabi-gcc.exe", | ||
"compileCommands": "${workspaceFolder}/build/compile_commands.json", | ||
"cStandard": "c17", | ||
"cppStandard": "c++14", | ||
"intelliSenseMode": "linux-gcc-arm" | ||
} | ||
], | ||
"version": 4 | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
[ | ||
{ | ||
"name": "Pico", | ||
"compilers": { | ||
"C": "${env:USERPROFILE}/.pico-sdk/toolchain/13_2_Rel1/bin/arm-none-eabi-gcc.exe", | ||
"CXX": "${env:USERPROFILE}/.pico-sdk/toolchain/13_2_Rel1/bin/arm-none-eabi-gcc.exe" | ||
}, | ||
"toolchainFile": "${env:USERPROFILE}/.pico-sdk/sdk/1.5.1/cmake/preload/toolchains/pico_arm_gcc.cmake", | ||
"environmentVariables": { | ||
"PATH": "${command:raspberry-pi-pico.getEnvPath};${env:PATH}" | ||
}, | ||
"cmakeSettings": { | ||
"Python3_EXECUTABLE": "${command:raspberry-pi-pico.getPythonPath}" | ||
} | ||
} | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
{ | ||
"recommendations": [ | ||
"marus25.cortex-debug", | ||
"ms-vscode.cpptools", | ||
"ms-vscode.cpptools-extension-pack", | ||
"ms-vscode.vscode-serial-monitor", | ||
"raspberry-pi.raspberry-pi-pico", | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,68 @@ | ||
{ | ||
"version": "0.2.0", | ||
"configurations": [ | ||
{ | ||
"name": "Pico Debug (Cortex-Debug)", | ||
"cwd": "${userHome}/.pico-sdk/openocd/v0.12.0-2/openocd/scripts", | ||
"executable": "${command:raspberry-pi-pico.launchTargetPath}", | ||
"request": "launch", | ||
"type": "cortex-debug", | ||
"servertype": "openocd", | ||
"serverpath": "${userHome}/.pico-sdk/openocd/v0.12.0-2/bin/openocd.exe", | ||
"gdbPath": "${userHome}/.pico-sdk/toolchain/13_2_Rel1/bin/arm-none-eabi-gdb", | ||
"device": "RP2040", | ||
"configFiles": [ | ||
"interface/cmsis-dap.cfg", | ||
"target/rp2040.cfg" | ||
], | ||
"svdFile": "${userHome}/.pico-sdk/sdk/1.5.1/src/rp2040/hardware_regs/rp2040.svd", | ||
"runToEntryPoint": "main", | ||
// Give restart the same functionality as runToEntryPoint - main | ||
"postRestartCommands": [ | ||
"break main", | ||
"continue" | ||
], | ||
"openOCDLaunchCommands": [ | ||
"adapter speed 5000" | ||
] | ||
}, | ||
{ | ||
"name": "Pico Debug (Cortex-Debug with external OpenOCD)", | ||
"cwd": "${workspaceRoot}", | ||
"executable": "${command:raspberry-pi-pico.launchTargetPath}", | ||
"request": "launch", | ||
"type": "cortex-debug", | ||
"servertype": "external", | ||
"gdbTarget": "localhost:3333", | ||
"gdbPath": "${userHome}/.pico-sdk/toolchain/13_2_Rel1/bin/arm-none-eabi-gdb", | ||
"device": "RP2040", | ||
"svdFile": "${userHome}/.pico-sdk/sdk/1.5.1/src/rp2040/hardware_regs/rp2040.svd", | ||
"runToEntryPoint": "main", | ||
// Give restart the same functionality as runToEntryPoint - main | ||
"postRestartCommands": [ | ||
"break main", | ||
"continue" | ||
] | ||
}, | ||
{ | ||
"name": "Pico Debug (C++ Debugger)", | ||
"type": "cppdbg", | ||
"request": "launch", | ||
"cwd": "${workspaceRoot}", | ||
"program": "${command:raspberry-pi-pico.launchTargetPath}", | ||
"MIMode": "gdb", | ||
"miDebuggerPath": "${userHome}/.pico-sdk/toolchain/13_2_Rel1/bin/arm-none-eabi-gdb", | ||
"miDebuggerServerAddress": "localhost:3333", | ||
"debugServerPath": "${userHome}/.pico-sdk/openocd/v0.12.0-2/bin/openocd.exe", | ||
"debugServerArgs": "-f interface/cmsis-dap.cfg -f target/rp2040.cfg -c \"adapter speed 5000\"", | ||
"serverStarted": "Listening on port .* for gdb connections", | ||
"filterStderr": true, | ||
"hardwareBreakpoints": { | ||
"require": true, | ||
"limit": 4 | ||
}, | ||
"preLaunchTask": "Flash", | ||
"svdPath": "${userHome}/.pico-sdk/sdk/1.5.1/src/rp2040/hardware_regs/rp2040.svd" | ||
}, | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
{ | ||
"cmake.options.statusBarVisibility": "hidden", | ||
"cmake.options.advanced": { | ||
"build": { | ||
"statusBarVisibility": "hidden" | ||
}, | ||
"launch": { | ||
"statusBarVisibility": "hidden" | ||
}, | ||
"debug": { | ||
"statusBarVisibility": "hidden" | ||
} | ||
}, | ||
"cmake.configureOnEdit": false, | ||
"cmake.automaticReconfigure": false, | ||
"cmake.configureOnOpen": false, | ||
"cmake.generator": "Ninja", | ||
"cmake.cmakePath": "${userHome}/.pico-sdk/cmake/v3.28.0-rc6/bin/cmake", | ||
"C_Cpp.debugShortcut": false, | ||
"terminal.integrated.env.windows": { | ||
"PICO_SDK_PATH": "${env:USERPROFILE}/.pico-sdk/sdk/1.5.1", | ||
"PICO_TOOLCHAIN_PATH": "${env:USERPROFILE}/.pico-sdk/toolchain/13_2_Rel1", | ||
"Path": "${env:USERPROFILE}/.pico-sdk/toolchain/13_2_Rel1/bin;${env:USERPROFILE}/.pico-sdk/cmake/v3.28.0-rc6/bin;${env:USERPROFILE}/.pico-sdk/ninja/v1.11.1;${env:PATH}" | ||
}, | ||
"terminal.integrated.env.osx": { | ||
"PICO_SDK_PATH": "${env:HOME}/.pico-sdk/sdk/1.5.1", | ||
"PICO_TOOLCHAIN_PATH": "${env:HOME}/.pico-sdk/toolchain/13_2_Rel1", | ||
"PATH": "${env:HOME}/.pico-sdk/toolchain/13_2_Rel1/bin:${env:HOME}/.pico-sdk/cmake/v3.28.0-rc6/bin:${env:HOME}/.pico-sdk/ninja/v1.11.1:${env:PATH}" | ||
}, | ||
"terminal.integrated.env.linux": { | ||
"PICO_SDK_PATH": "${env:HOME}/.pico-sdk/sdk/1.5.1", | ||
"PICO_TOOLCHAIN_PATH": "${env:HOME}/.pico-sdk/toolchain/13_2_Rel1", | ||
"PATH": "${env:HOME}/.pico-sdk/toolchain/13_2_Rel1/bin:${env:HOME}/.pico-sdk/cmake/v3.28.0-rc6/bin:${env:HOME}/.pico-sdk/ninja/v1.11.1:${env:PATH}" | ||
}, | ||
"raspberry-pi-pico.cmakeAutoConfigure": true, | ||
"raspberry-pi-pico.useCmakeTools": false, | ||
"raspberry-pi-pico.cmakePath": "${HOME}/.pico-sdk/cmake/v3.28.0-rc6/bin/cmake", | ||
"raspberry-pi-pico.ninjaPath": "${HOME}/.pico-sdk/ninja/v1.11.1/ninja", | ||
"raspberry-pi-pico.python3Path": "${HOME}/.pico-sdk/python/3.12.1/python.exe" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
{ | ||
"version": "2.0.0", | ||
"tasks": [ | ||
{ | ||
"label": "Compile Project", | ||
"type": "process", | ||
"isBuildCommand": true, | ||
"command": "${userHome}/.pico-sdk/ninja/v1.11.1/ninja", | ||
"args": ["-C", "${workspaceFolder}/build"], | ||
"group": "build", | ||
"presentation": { | ||
"reveal": "always", | ||
"panel": "dedicated" | ||
}, | ||
"problemMatcher": "$gcc", | ||
"windows": { | ||
"command": "${env:USERPROFILE}/.pico-sdk/ninja/v1.11.1/ninja.exe" | ||
} | ||
}, | ||
{ | ||
"label": "Flash", | ||
"type": "process", | ||
"command": "${userHome}/.pico-sdk/openocd/v0.12.0-2/bin/openocd.exe", | ||
"args": [ | ||
"-f", | ||
"interface/cmsis-dap.cfg", | ||
"-f", | ||
"target/rp2040.cfg", | ||
"-c", | ||
"adapter speed 5000; program \"${command:raspberry-pi-pico.launchTargetPath}\" verify reset exit" | ||
], | ||
"problemMatcher": [], | ||
"windows": { | ||
"command": "${env:USERPROFILE}/.pico-sdk/openocd/v0.12.0-2/bin/openocd.exe", | ||
} | ||
} | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.