Skip to content
This repository was archived by the owner on Sep 30, 2024. It is now read-only.

Commit 92e03f7

Browse files
committed
Add pre-compiled pico-sdk-tools package
1 parent e3d424c commit 92e03f7

7 files changed

+89
-85
lines changed

build-openocd.sh

+3-3
Original file line numberDiff line numberDiff line change
@@ -4,18 +4,18 @@ set -euo pipefail
44

55
BITNESS=$1
66
ARCH=$2
7-
OPENOCD_BRANCH="picoprobe"
7+
OPENOCD_BRANCH="master"
88

99
if [ ! -d openocd ]; then
10-
git clone "https://github.com/raspberrypi/openocd.git" -b $OPENOCD_BRANCH --depth=1
10+
git clone "https://github.com/openocd-org/openocd.git" -b $OPENOCD_BRANCH --depth=1
1111
else
1212
git -C openocd checkout -B $OPENOCD_BRANCH
1313
git -C openocd pull --ff-only
1414
fi
1515

1616
cd openocd
1717
./bootstrap
18-
./configure --enable-picoprobe
18+
./configure --enable-picoprobe --enable-cmsis-dap
1919
make clean
2020
make -j4
2121
DESTDIR="$PWD/../openocd-install" make install

build.ps1

+49-21
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,8 @@ $version = (Get-Content "$PSScriptRoot\version.txt").Trim()
3030
$suffix = [io.path]::GetFileNameWithoutExtension($ConfigFile)
3131
$outfile = "bin\$basename-$version-$suffix.exe"
3232

33+
$programGroupName = '$SMPROGRAMS\Raspberry Pi Pico SDK 1.4'
34+
3335
$tools = (Get-Content '.\tools.json' | ConvertFrom-Json).tools
3436
$config = Get-Content $ConfigFile | ConvertFrom-Json
3537
$bitness = $config.bitness
@@ -99,23 +101,24 @@ $env:CHERE_INVOKING = 'yes'
99101
# Start MINGW32/64 environment
100102
$env:MSYSTEM = "MINGW$bitness"
101103

102-
if (-not (Test-Path ".\build\openocd-install\mingw$bitness")) {
103-
# First run setup
104-
msys 'uname -a'
105-
# Core update
106-
msys 'pacman --noconfirm -Syuu'
107-
# Normal update
108-
msys 'pacman --noconfirm -Suu'
104+
# Disable openocd build for now (using a manually built copy instead)
105+
# if (-not (Test-Path ".\build\openocd-install\mingw$bitness")) {
106+
# # First run setup
107+
# msys 'uname -a'
108+
# # Core update
109+
# msys 'pacman --noconfirm -Syuu'
110+
# # Normal update
111+
# msys 'pacman --noconfirm -Suu'
109112

110-
msys "pacman -S --noconfirm --needed autoconf automake git libtool make mingw-w64-${mingw_arch}-toolchain mingw-w64-${mingw_arch}-libusb p7zip pkg-config wget"
113+
# msys "pacman -S --noconfirm --needed autoconf automake git libtool make mingw-w64-${mingw_arch}-toolchain mingw-w64-${mingw_arch}-libusb mingw-w64-${mingw_arch}-hidapi p7zip pkg-config wget"
111114

112-
# Keep it clean
113-
if (Test-Path .\build\openocd) {
114-
Remove-Item .\build\openocd -Recurse -Force
115-
}
115+
# # Keep it clean
116+
# if (Test-Path .\build\openocd) {
117+
# Remove-Item .\build\openocd -Recurse -Force
118+
# }
116119

117-
msys "cd build && ../build-openocd.sh $bitness $mingw_arch"
118-
}
120+
# msys "cd build && ../build-openocd.sh $bitness $mingw_arch"
121+
# }
119122

120123
if (-not (Test-Path ".\build\libusb")) {
121124
msys '7z x -obuild/libusb ./installers/libusb.7z'
@@ -255,15 +258,36 @@ LangString DESC_SecCodeExts `${LANG_ENGLISH} "Recommended extensions for Visual
255258
256259
Section "OpenOCD" SecOpenOCD
257260
258-
SetOutPath "`$INSTDIR\tools\openocd-picoprobe"
259-
File "build\openocd-install\mingw$bitness\bin\*.*"
260-
File "build\libusb\mingw$bitness\dll\libusb-1.0.dll"
261+
SetOutPath "`$INSTDIR\tools\openocd"
262+
File "build\openocd-package\*.*"
261263
SetOutPath "`$INSTDIR\tools\openocd-picoprobe\scripts"
262264
File /r "build\openocd-install\mingw$bitness\share\openocd\scripts\*.*"
263265
264266
SectionEnd
265267
266-
LangString DESC_SecOpenOCD `${LANG_ENGLISH} "Open On-Chip Debugger with picoprobe support"
268+
LangString DESC_SecOpenOCD `${LANG_ENGLISH} "Open On-Chip Debugger"
269+
270+
Section "Pico SDK" SecPicoSDK
271+
272+
SetOutPath "`$INSTDIR\pico-sdk"
273+
File /r "build\pico-sdk\*.*"
274+
275+
SetOutPath "`$INSTDIR\pico-sdk-tools"
276+
File "build\pico-sdk-tools\*.*"
277+
WriteRegStr HKCU "Software\Kitware\CMake\Packages\pico-sdk-tools" "v$version" "`$INSTDIR\pico-sdk-tools"
278+
279+
SectionEnd
280+
281+
LangString DESC_SecPicoSDK `${LANG_ENGLISH} "Pico SDK and pre-compiled tools"
282+
283+
Section "Ninja" SecNinja
284+
285+
SetOutPath "`$INSTDIR\tools"
286+
File "installers\ninja.exe"
287+
288+
SectionEnd
289+
290+
LangString DESC_SecNinja `${LANG_ENGLISH} "Ninja"
267291
268292
Section /o "Zadig" SecZadig
269293
@@ -281,15 +305,17 @@ Section "Pico environment" SecPico
281305
File "pico-setup.cmd"
282306
File "docs\ReadMe.txt"
283307
284-
CreateShortcut "`$INSTDIR\Developer Command Prompt for Pico.lnk" "cmd.exe" '/k "`$INSTDIR\pico-env.cmd"'
308+
CreateDirectory "$programGroupName"
309+
310+
CreateShortcut "$programGroupName\Developer Command Prompt for Pico.lnk" "cmd.exe" '/k "`$INSTDIR\pico-env.cmd"'
285311
286312
; Unconditionally create a shortcut for VS Code -- in case the user had it
287313
; installed already, or if they install it later
288-
CreateShortcut "`$INSTDIR\Visual Studio Code for Pico.lnk" "cmd.exe" '/c (call "`$INSTDIR\pico-env.cmd" && code) || pause'
314+
CreateShortcut "$programGroupName\Visual Studio Code for Pico.lnk" "cmd.exe" '/c (call "`$INSTDIR\pico-env.cmd" && code) || pause'
289315
290316
; SetOutPath is needed here to set the working directory for the shortcut
291317
SetOutPath "`$INSTDIR\pico-project-generator"
292-
CreateShortcut "`$INSTDIR\Pico Project Generator.lnk" "cmd.exe" '/c (call "`$INSTDIR\pico-env.cmd" && python "`$INSTDIR\pico-project-generator\pico_project.py" --gui) || pause'
318+
CreateShortcut "$programGroupName\Pico Project Generator.lnk" "cmd.exe" '/c (call "`$INSTDIR\pico-env.cmd" && python "`$INSTDIR\pico-project-generator\pico_project.py" --gui) || pause'
293319
294320
; Reset working dir for pico-setup.cmd launched from the finish page
295321
SetOutPath "`$INSTDIR"
@@ -318,6 +344,8 @@ LangString DESC_SecDocs `${LANG_ENGLISH} "Adds a script to download the latest P
318344
!insertmacro MUI_FUNCTION_DESCRIPTION_BEGIN
319345
!insertmacro MUI_DESCRIPTION_TEXT `${SecCodeExts} `$(DESC_SecCodeExts)
320346
!insertmacro MUI_DESCRIPTION_TEXT `${SecOpenOCD} `$(DESC_SecOpenOCD)
347+
!insertmacro MUI_DESCRIPTION_TEXT `${SecPicoSDK} `$(DESC_SecPicoSDK)
348+
!insertmacro MUI_DESCRIPTION_TEXT `${SecNinja} `$(DESC_SecNinja)
321349
!insertmacro MUI_DESCRIPTION_TEXT `${SecZadig} `$(DESC_SecZadig)
322350
!insertmacro MUI_DESCRIPTION_TEXT `${SecPico} `$(DESC_SecPico)
323351
!insertmacro MUI_DESCRIPTION_TEXT `${SecDocs} `$(DESC_SecDocs)

pico-env.cmd

+7-16
Original file line numberDiff line numberDiff line change
@@ -33,10 +33,12 @@ for %%i in (sdk examples extras playground) do (
3333
)
3434
)
3535

36-
if exist "%~dp0tools\openocd-picoprobe" (
37-
echo OPENOCD_SCRIPTS=%~dp0tools\openocd-picoprobe\scripts
38-
set "OPENOCD_SCRIPTS=%~dp0tools\openocd-picoprobe\scripts"
39-
set "PATH=%~dp0tools\openocd-picoprobe;%PATH%"
36+
call :AddToPath "%~dp0tools"
37+
38+
if exist "%~dp0tools\openocd" (
39+
echo OPENOCD_SCRIPTS=%~dp0tools\openocd\scripts
40+
set "OPENOCD_SCRIPTS=%~dp0tools\openocd\scripts"
41+
set "PATH=%~dp0tools\openocd;%PATH%"
4042
)
4143

4244
call :AddToPath "%ProgramFiles(x86)%\doxygen\bin"
@@ -47,20 +49,9 @@ call :AddToPath "%ProgramFiles(x86)%\Graphviz\bin"
4749
call :AddToPath "%ProgramFiles%\Graphviz\bin"
4850
call :AddToPath "%ProgramW6432%\Graphviz\bin"
4951

50-
call :AddToPath "%ProgramFiles(x86)%\Microsoft Visual Studio\Installer"
51-
call :AddToPath "%ProgramFiles%\Microsoft Visual Studio\Installer"
52-
53-
rem https://github.com/microsoft/vswhere/wiki/Start-Developer-Command-Prompt
54-
55-
for /f "usebackq delims=" %%i in (`vswhere.exe -products * -requires "Microsoft.VisualStudio.Component.VC.Tools.x86.x64" -latest -property installationPath`) do (
56-
if exist "%%i\Common7\Tools\vsdevcmd.bat" (
57-
call "%%i\Common7\Tools\vsdevcmd.bat"
58-
)
59-
)
60-
6152
call :VerifyExe "GNU Arm Embedded Toolchain" "arm-none-eabi-gcc --version"
6253
call :VerifyExe "CMake" "cmake --version"
63-
call :VerifyExe "Visual Studio" "cl"
54+
call :VerifyExe "Ninja" "ninja --version"
6455
call :VerifyExe "Python 3" "python --version"
6556
call :VerifyExe "Git" "git --version"
6657

pico-setup.cmd

+6-8
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ set "SDK_BRANCH=master"
1212

1313
pushd "%~dp0"
1414

15-
for %%i in (sdk examples extras playground project-generator) do (
15+
for %%i in (examples extras playground project-generator) do (
1616
set "DEST=%~dp0pico-%%i"
1717

1818
if exist "!DEST!\.git" (
@@ -34,13 +34,11 @@ for %%i in (sdk examples extras playground project-generator) do (
3434
rem Build a couple of examples
3535
mkdir "%~dp0pico-examples\build"
3636
pushd "%~dp0pico-examples\build"
37-
cmake -G "NMake Makefiles" .. -DCMAKE_BUILD_TYPE=Debug || exit /b 1
37+
cmake -G Ninja .. -DCMAKE_BUILD_TYPE=Debug || exit /b 1
3838

39-
for %%i in (blink hello_world) do (
39+
for %%i in (blink "hello_world/all") do (
4040
echo Building %%i
41-
pushd %%i
42-
nmake || exit /b 1
43-
popd
41+
ninja "%%i" || exit /b 1
4442
)
4543

4644
popd
@@ -63,8 +61,8 @@ for %%i in (picoprobe) do (
6361
mkdir %%i\build
6462
pushd %%i\build
6563

66-
cmake -G "NMake Makefiles" .. || exit /b 1
67-
nmake || exit /b 1
64+
cmake -G "Ninja" .. || exit /b 1
65+
ninja || exit /b 1
6866

6967
popd
7068
)

tools.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
{
1414
"name": "MSYS2",
1515
"file": "msys2.exe",
16-
"href": "https://github.com/msys2/msys2-installer/releases/download/2021-07-25/msys2-base-x86_64-20210725.sfx.exe"
16+
"href": "https://github.com/msys2/msys2-installer/releases/download/2022-09-04/msys2-base-x86_64-20220904.sfx.exe"
1717
},
1818
{
1919
"name": "Zadig",
@@ -28,7 +28,7 @@
2828
{
2929
"name": "vswhere",
3030
"file": "vswhere.exe",
31-
"href": "https://github.com/microsoft/vswhere/releases/download/2.8.4/vswhere.exe"
31+
"href": "https://github.com/microsoft/vswhere/releases/download/3.0.3/vswhere.exe"
3232
}
3333
]
3434
}

x64.json

+11-24
Original file line numberDiff line numberDiff line change
@@ -6,38 +6,25 @@
66
"name": "GNU Arm Embedded Toolchain",
77
"file": "gcc-arm-none-eabi-10.3-2021.10-win32.exe",
88
"exec": "\"$0\" /S /P /R",
9-
"href": "https://developer.arm.com/-/media/Files/downloads/gnu-rm/10.3-2021.10/gcc-arm-none-eabi-10.3-2021.10-win32.exe"
9+
"href": "https://developer.arm.com/-/media/Files/downloads/gnu-rm/10.3-2021.10/gcc-arm-none-eabi-10.3-2021.10-win32.exe?rev=29bb46cfa0434fbda93abb33c1d480e6&hash=3C58D05EA5D32EF127B9E4D13B3244D26188713C"
1010
},
1111
{
1212
"name": "CMake",
13-
"file": "cmake-3.20.6-windows-x86_64.msi",
13+
"file": "cmake-3.23.4-windows-x86_64.msi",
1414
"exec": "msiexec /i \"$0\" /qn /norestart ADD_CMAKE_TO_PATH=System",
15-
"href": "https://github.com/Kitware/CMake/releases/download/v3.20.6/cmake-3.20.6-windows-x86_64.msi"
16-
},
17-
{
18-
"name": "Build Tools for Visual Studio 2019",
19-
"file": "vs_BuildTools.exe",
20-
"exec": "powershell -NoProfile -ExecutionPolicy Bypass -WindowStyle Minimized -File \"$PLUGINSDIR\\vssetup.ps1\" -VSInstallerPath \"$0\" -VSWherePath \"$PLUGINSDIR\\vswhere.exe\"",
21-
"href": "https://aka.ms/vs/16/release/vs_buildtools.exe",
22-
"additionalFiles": [
23-
"installers\\vswhere.exe",
24-
"vssetup.ps1"
25-
],
26-
"rebootExitCodes": [
27-
3010
28-
]
15+
"href": "https://github.com/Kitware/CMake/releases/download/v3.23.4/cmake-3.23.4-windows-x86_64.msi"
2916
},
3017
{
3118
"name": "Python 3.9",
32-
"file": "python-3.9.8-amd64.exe",
19+
"file": "python-3.9.13-amd64.exe",
3320
"exec": "\"$0\" /quiet InstallAllUsers=1 PrependPath=1",
34-
"href": "https://www.python.org/ftp/python/3.9.8/python-3.9.8-amd64.exe"
21+
"href": "https://www.python.org/ftp/python/3.9.13/python-3.9.13-amd64.exe"
3522
},
3623
{
3724
"name": "Git for Windows",
38-
"file": "Git-2.33.1-64-bit.exe",
25+
"file": "Git-2.38.1-64-bit.exe",
3926
"exec": "\"$0\" /VERYSILENT /NORESTART /NOCANCEL /SP- /CLOSEAPPLICATIONS /RESTARTAPPLICATIONS /SKIPDOWNGRADE=1 \"/LOADINF=$PLUGINSDIR\\git.inf\"",
40-
"href": "https://github.com/git-for-windows/git/releases/download/v2.33.1.windows.1/Git-2.33.1-64-bit.exe",
27+
"href": "https://github.com/git-for-windows/git/releases/download/v2.38.1.windows.1/Git-2.38.1-64-bit.exe",
4128
"additionalFiles": [
4229
"git.inf"
4330
]
@@ -50,15 +37,15 @@
5037
},
5138
{
5239
"name": "Doxygen",
53-
"file": "doxygen-1.9.2-setup.exe",
40+
"file": "doxygen-1.9.5-setup.exe",
5441
"exec": "\"$0\" /VERYSILENT /NORESTART /NOCANCEL /SP- /CLOSEAPPLICATIONS /RESTARTAPPLICATIONS",
55-
"href": "https://www.doxygen.nl/files/doxygen-1.9.2-setup.exe"
42+
"href": "https://www.doxygen.nl/files/doxygen-1.9.5-setup.exe"
5643
},
5744
{
5845
"name": "Graphviz",
59-
"file": "stable_windows_10_cmake_Release_x64_graphviz-install-2.49.3-win64.exe",
46+
"file": "windows_10_cmake_Release_graphviz-install-6.0.2-win64.exe",
6047
"exec": "\"$0\" /S",
61-
"href": "https://gitlab.com/api/v4/projects/4207231/packages/generic/graphviz-releases/2.49.3/stable_windows_10_cmake_Release_x64_graphviz-install-2.49.3-win64.exe"
48+
"href": "https://gitlab.com/api/v4/projects/4207231/packages/generic/graphviz-releases/6.0.2/windows_10_cmake_Release_graphviz-install-6.0.2-win64.exe"
6249
}
6350
]
6451
}

x86.json

+11-11
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,13 @@
66
"name": "GNU Arm Embedded Toolchain",
77
"file": "gcc-arm-none-eabi-10.3-2021.10-win32.exe",
88
"exec": "\"$0\" /S /P /R",
9-
"href": "https://developer.arm.com/-/media/Files/downloads/gnu-rm/10.3-2021.10/gcc-arm-none-eabi-10.3-2021.10-win32.exe"
9+
"href": "https://developer.arm.com/-/media/Files/downloads/gnu-rm/10.3-2021.10/gcc-arm-none-eabi-10.3-2021.10-win32.exe?rev=29bb46cfa0434fbda93abb33c1d480e6&hash=3C58D05EA5D32EF127B9E4D13B3244D26188713C"
1010
},
1111
{
1212
"name": "CMake",
13-
"file": "cmake-3.20.6-windows-i386.msi",
13+
"file": "cmake-3.23.4-windows-i386.msi",
1414
"exec": "msiexec /i \"$0\" /qn /norestart ADD_CMAKE_TO_PATH=System",
15-
"href": "https://github.com/Kitware/CMake/releases/download/v3.20.6/cmake-3.20.6-windows-i386.msi"
15+
"href": "https://github.com/Kitware/CMake/releases/download/v3.23.4/cmake-3.23.4-windows-i386.msi"
1616
},
1717
{
1818
"name": "Build Tools for Visual Studio 2019",
@@ -29,15 +29,15 @@
2929
},
3030
{
3131
"name": "Python 3.9",
32-
"file": "python-3.9.8.exe",
32+
"file": "python-3.9.13.exe",
3333
"exec": "\"$0\" /quiet InstallAllUsers=1 PrependPath=1",
34-
"href": "https://www.python.org/ftp/python/3.9.8/python-3.9.8.exe"
34+
"href": "https://www.python.org/ftp/python/3.9.13/python-3.9.13.exe"
3535
},
3636
{
3737
"name": "Git for Windows",
38-
"file": "Git-2.33.1-32-bit.exe",
38+
"file": "Git-2.38.1-32-bit.exe",
3939
"exec": "\"$0\" /VERYSILENT /NORESTART /NOCANCEL /SP- /CLOSEAPPLICATIONS /RESTARTAPPLICATIONS /SKIPDOWNGRADE=1 \"/LOADINF=$PLUGINSDIR\\git.inf\"",
40-
"href": "https://github.com/git-for-windows/git/releases/download/v2.33.1.windows.1/Git-2.33.1-32-bit.exe",
40+
"href": "https://github.com/git-for-windows/git/releases/download/v2.38.1.windows.1/Git-2.38.1-32-bit.exe",
4141
"additionalFiles": [
4242
"git.inf"
4343
]
@@ -50,15 +50,15 @@
5050
},
5151
{
5252
"name": "Doxygen",
53-
"file": "doxygen-1.9.2-setup.exe",
53+
"file": "doxygen-1.9.5-setup.exe",
5454
"exec": "\"$0\" /VERYSILENT /NORESTART /NOCANCEL /SP- /CLOSEAPPLICATIONS /RESTARTAPPLICATIONS",
55-
"href": "https://www.doxygen.nl/files/doxygen-1.9.2-setup.exe"
55+
"href": "https://www.doxygen.nl/files/doxygen-1.9.5-setup.exe"
5656
},
5757
{
5858
"name": "Graphviz",
59-
"file": "stable_windows_10_cmake_Release_Win32_graphviz-install-2.49.3-win32.exe",
59+
"file": "windows_10_cmake_Release_graphviz-install-6.0.2-win32.exe",
6060
"exec": "\"$0\" /S",
61-
"href": "https://gitlab.com/api/v4/projects/4207231/packages/generic/graphviz-releases/2.49.3/stable_windows_10_cmake_Release_Win32_graphviz-install-2.49.3-win32.exe"
61+
"href": "https://gitlab.com/api/v4/projects/4207231/packages/generic/graphviz-releases/6.0.2/windows_10_cmake_Release_graphviz-install-6.0.2-win32.exe"
6262
}
6363
]
6464
}

0 commit comments

Comments
 (0)