Skip to content

Commit

Permalink
Update GCC, GDB, OpenOCD, Picotool (#29)
Browse files Browse the repository at this point in the history
  • Loading branch information
earlephilhower authored Aug 24, 2023
1 parent 9b09005 commit d3d2e6b
Show file tree
Hide file tree
Showing 18 changed files with 205 additions and 233 deletions.
91 changes: 91 additions & 0 deletions .github/workflows/build-macos.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,91 @@
# Manually started actino to build Picotool for Mac and upload to an artifact

name: Build MacOS
on: [workflow_dispatch]
jobs:
build:
runs-on: macos-latest
steps:
- uses: maxim-lobanov/setup-xcode@v1
with:
xcode-version: '13.1.0'

- name: Build Picotool
run: |
uname -a
brew update
brew install bash libtool automake libusb hidapi cmake
# Get the SDK ready
git clone https://github.com/raspberrypi/pico-sdk.git
cd pico-sdk
git checkout 1.5.1
git submodule update --init
cd ..
# Check out this branch
git clone https://github.com/raspberrypi/picotool.git
cd picotool
git checkout 1.1.2
# Build!
mkdir build
cd build
cmake -DPICO_SDK_PATH=../../pico-sdk -S .. -B .
make -j
strip picotool
# Package
mkdir /tmp/picotool
mkdir /tmp/picotool/bin
cp -a /usr/local/Cellar/hidapi/*/lib/*.dylib /tmp/picotool/bin/.
cp -a /usr/local/Cellar/libusb/*/lib/*.dylib /tmp/picotool/bin/.
cp -a /usr/local/Cellar/capstone/*/lib/*.dylib /tmp/picotool/bin/.
cp -a picotool /tmp/picotool/bin/.
cp -a ../LICENSE.TXT /tmp/picotool/bin/.
cp -a ../README.md /tmp/picotool/bin/.
tar cvf ../../picotool.macos.tar -C /tmp picotool
- name: Upload Picotool
uses: actions/upload-artifact@v3
with:
name: picotool.macos.tar
path: picotool.macos.tar

- name: Build OpenOCD
run: |
uname -a
brew update
brew install bash libtool automake libusb hidapi
git clone https://github.com/raspberrypi/openocd.git
pushd openocd
git checkout rp2040-v0.12.0
# Remove TEXI warning
grep -v raggedright doc/openocd.texi > p2
mv p2 doc/openocd.texi
bash bootstrap
./configure --prefix=/tmp/openocd --enable-picoprobe --enable-cmsis-dap-v2 --enable-cmsis-dap \
--disable-dummy --disable-rshim --disable-ftdi --disable-stlink --disable-ti-icdi \
--disable-ulink --disable-usb-blaster-2 --disable-ft232r --disable-vsllink \
--disable-xds110 --disable-osbdm --disable-opendous --disable-aice --disable-usbprog \
--disable-rlink --disable-armjtagew --disable-nulink --disable-kitprog \
--disable-usb-blaster --disable-presto --disable-openjtag --disable-jlink \
--disable-parport --disable-parport-ppdev --disable-parport-giveio --disable-jtag_vpi \
--disable-jtag_dpi --disable-amtjtagaccel --disable-zy1000-master --disable-zy1000 \
--disable-ioutil --disable-bcm2835gpio --disable-imx_gpio --disable-ep93xx \
--disable-at91rm9200 --disable-gw16012 --disable-oocd_trace --disable-buspirate \
--disable-sysfsgpio --disable-xlnx-pcie-xvc --disable-minidriver-dummy \
--disable-remote-bitbang
make -j
make install
popd
cp -a /usr/local/Cellar/hidapi/*/lib/*.dylib /tmp/openocd/bin/.
cp -a /usr/local/Cellar/libusb/*/lib/*.dylib /tmp/openocd/bin/.
cp -a /usr/local/Cellar/capstone/*/lib/*.dylib /tmp/openocd/bin/.
tar cvf openocd.macos.tar -C /tmp openocd
- name: Upload OpenOCD
uses: actions/upload-artifact@v3
with:
name: openocd.macos.tar
path: openocd.macos.tar
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Manually started actino to build OpenOCD for Windows and upload to an artifact
# Manually started action to build Picotool/OpenOCD for Windows and upload to an artifact

name: OpenOCD Build All Windows
name: Build All Windows
on: [workflow_dispatch]
jobs:
build:
Expand All @@ -17,25 +17,49 @@ jobs:
- uses: msys2/setup-msys2@v2
with:
msystem: ${{matrix.sys}}
install: development make libtool pkg-config autoconf automake texinfo mingw-w64-${{matrix.env}}-libusb mingw-w64-${{matrix.env}}-hidapi git mingw-w64-${{matrix.env}}-toolchain patch
- name: Build ${{matrix.env}}
install: development mingw-w64-${{matrix.env}}-make mingw-w64-${{matrix.env}}-pkg-config mingw-w64-${{matrix.env}}-autotools texinfo mingw-w64-${{matrix.env}}-libusb mingw-w64-${{matrix.env}}-hidapi git mingw-w64-${{matrix.env}}-toolchain patch mingw-w64-${{matrix.env}}-cmake pkg-config
- name: Build Picotool ${{matrix.env}}
run: |
# Get the SDK ready
git clone https://github.com/raspberrypi/pico-sdk.git
cd pico-sdk
git checkout 1.5.1
git submodule update --init
cd ..
# Check out this branch
git clone https://github.com/raspberrypi/picotool.git
cd picotool
git checkout 1.1.2
# Build!
mkdir build
cd build
if [ -e /mingw64/include/libusb-1.0/ ]; then cmake -G"MSYS Makefiles" -DPICO_SDK_PATH=../../pico-sdk -DLIBUSB_INCLUDE_DIR=/mingw64/include/libusb-1.0/ -S .. -B . ; else cmake -G"MSYS Makefiles" -DPICO_SDK_PATH=../../pico-sdk -DLIBUSB_INCLUDE_DIR=/mingw32/include/libusb-1.0/ -S .. -B . ; fi
make -j
strip picotool.exe
# Package
mkdir /tmp/picotool
mkdir /tmp/picotool/bin
cp /mingw*/bin/libhidapi*.dll /tmp/picotool/bin/.
cp /mingw*/bin/libusb*.dll /tmp/picotool/bin/.
cp -a picotool.exe /tmp/picotool/bin/.
cp -a ../LICENSE.TXT /tmp/picotool/bin/.
cp -a ../README.md /tmp/picotool/bin/.
tar cvf ../../picotool.${{matrix.env}}.tar -C /tmp picotool
- name: Upload Picotool ${{matrix.env}}
uses: actions/upload-artifact@v3
with:
name: picotool.${{matrix.env}}.tar
path: picotool.${{matrix.env}}.tar

- name: Build OpenOCD ${{matrix.env}}
run: |
git clone https://github.com/raspberrypi/openocd.git
pushd openocd
git checkout rp2040
echo Fixing GCC 12 warning
echo ZGlmZiAtLWdpdCBhL3NyYy9oZWxwZXIvY29uZmlndXJhdGlvbi5jIGIvc3JjL2hlbHBlci9jb25m\
aWd1cmF0aW9uLmMKaW5kZXggMTE0YWQyYzZjLi45ZjhiNGM3ZjQgMTAwNjQ0Ci0tLSBhL3NyYy9o\
ZWxwZXIvY29uZmlndXJhdGlvbi5jCisrKyBiL3NyYy9oZWxwZXIvY29uZmlndXJhdGlvbi5jCkBA\
IC0xNDYsNiArMTQ2LDkgQEAgaW50IHBhcnNlX2NvbmZpZ19maWxlKHN0cnVjdCBjb21tYW5kX2Nv\
bnRleHQgKmNtZF9jdHgpCiAKIGNoYXIgKmdldF9ob21lX2Rpcihjb25zdCBjaGFyICphcHBlbmRf\
cGF0aCkKIHsKKyNpZmRlZiBfV0lOMzIKKwljaGFyIGhvbWVwYXRoW01BWF9QQVRIXTsKKyNlbmRp\
ZgogCWNoYXIgKmhvbWUgPSBnZXRlbnYoIkhPTUUiKTsKIAogCWlmIChob21lID09IE5VTEwpIHsK\
QEAgLTE1NSw3ICsxNTgsNiBAQCBjaGFyICpnZXRfaG9tZV9kaXIoY29uc3QgY2hhciAqYXBwZW5k\
X3BhdGgpCiAKIAkJaWYgKGhvbWUgPT0gTlVMTCkgewogCi0JCQljaGFyIGhvbWVwYXRoW01BWF9Q\
QVRIXTsKIAkJCWNoYXIgKmRyaXZlID0gZ2V0ZW52KCJIT01FRFJJVkUiKTsKIAkJCWNoYXIgKnBh\
dGggPSBnZXRlbnYoIkhPTUVQQVRIIik7CiAJCQlpZiAoZHJpdmUgJiYgcGF0aCkgewo= | base64 -d -i > bug.patch
patch -p1 < bug.patch
git checkout rp2040-v0.12.0
bash bootstrap
./configure --prefix=/tmp/openocd --enable-picoprobe --enable-cmsis-dap-v2 --enable-cmsis-dap \
--disable-dummy --disable-rshim --disable-ftdi --disable-stlink --disable-ti-icdi \
Expand All @@ -49,15 +73,16 @@ jobs:
--disable-at91rm9200 --disable-gw16012 --disable-oocd_trace --disable-buspirate \
--disable-sysfsgpio --disable-xlnx-pcie-xvc --disable-minidriver-dummy \
--disable-remote-bitbang
make
make -j
make install
echo Copying needed DLLs and packaging as tarball
cp /mingw*/bin/libhidapi*.dll /tmp/openocd/bin/.
cp /mingw*/bin/libusb*.dll /tmp/openocd/bin/.
popd
strip /tmp/openocd/bin/openocd.exe
tar cvf openocd.${{matrix.env}}.tar -C /tmp openocd
- name: Upload Artifact
- name: Upload OpenOCD ${{matrix.env}}
uses: actions/upload-artifact@v3
with:
name: openocd.${{matrix.env}}.tar
Expand Down
78 changes: 0 additions & 78 deletions .github/workflows/openocd-macos.yml

This file was deleted.

35 changes: 0 additions & 35 deletions .github/workflows/picotool-macos.yml

This file was deleted.

42 changes: 0 additions & 42 deletions .github/workflows/picotool-windows.yml

This file was deleted.

Loading

0 comments on commit d3d2e6b

Please sign in to comment.