diff options
Diffstat (limited to 'scripts')
-rwxr-xr-x | scripts/compiledb-full-path-mingw.sh | 13 | ||||
-rw-r--r-- | scripts/install-msys2.ps1 | 3 | ||||
-rwxr-xr-x | scripts/install-packages-mingw.sh | 14 | ||||
-rw-r--r-- | scripts/readme.md | 28 |
4 files changed, 58 insertions, 0 deletions
diff --git a/scripts/compiledb-full-path-mingw.sh b/scripts/compiledb-full-path-mingw.sh new file mode 100755 index 0000000..be45ca7 --- /dev/null +++ b/scripts/compiledb-full-path-mingw.sh @@ -0,0 +1,13 @@ +#!/bin/sh +[ `uname -o` != "Msys" ] && exit + +COMPILEDB_FILE="$1" + +fixpath () { + NEW="C:/msys64`which $1`.exe" + sed "s#\"$1\",#\"$NEW\",#g" -i "$COMPILEDB_FILE" +} + +fixpath arm-none-eabi-gcc +fixpath arm-none-eabi-objcopy +sed 's#"/\(.\)/#"\U\1:/#g' -i "$COMPILEDB_FILE"
\ No newline at end of file diff --git a/scripts/install-msys2.ps1 b/scripts/install-msys2.ps1 new file mode 100644 index 0000000..e7e0472 --- /dev/null +++ b/scripts/install-msys2.ps1 @@ -0,0 +1,3 @@ +Start-BitsTransfer -Source https://github.com/msys2/msys2-installer/releases/download/2022-09-04/msys2-x86_64-20220904.exe -Destination .\msys2-x86_64-latest.exe +.\msys2-x86_64-latest.exe in --confirm-command --accept-messages --root C:/msys64 +Remove-Item .\msys2-x86_64-latest.exe diff --git a/scripts/install-packages-mingw.sh b/scripts/install-packages-mingw.sh new file mode 100755 index 0000000..9acb392 --- /dev/null +++ b/scripts/install-packages-mingw.sh @@ -0,0 +1,14 @@ +#!/bin/sh +pacman --noconfirm --needed -Sy \ + make git \ + mingw-w64-x86_64-arm-none-eabi-gcc \ + mingw-w64-x86_64-arm-none-eabi-gdb \ + mingw-w64-x86_64-arm-none-eabi-newlib \ + mingw-w64-x86_64-arm-none-eabi-binutils \ + mingw-w64-x86_64-stlink \ + mingw-w64-x86_64-gdb-multiarch \ + python python-pip + +pip3 install compiledb + +printf "\n\n\ninstalling packages done!" diff --git a/scripts/readme.md b/scripts/readme.md new file mode 100644 index 0000000..d7b6fb2 --- /dev/null +++ b/scripts/readme.md @@ -0,0 +1,28 @@ +# scripts + +this subdirectory contains build toolchain setup and other auxiliary scripts + +## windows install + +right-click "install-msys2.ps1" and click "Run with PowerShell" in the context +menu. this will open powershell, install msys2, and close the powershell window +once it's done installing. + +open "MSYS2 MINGW64" from the windows start menu, and use the `cd` command to +navigate to this folder. drive letters (`C:\`) are written like `/c/` in msys2, +and paths use forward slashes instead of backward slashes. e.g. `cd +/c/Users/Loek/Documents/project-weerstation/scripts`. + +run `sh install-packages-mingw.sh`, and wait for the text "installing packages +done!" to appear. + +you've now installed the necessary tools to compile, upload and debug the stm32 +firmware. shortcuts for commonly used commands are implemented as visual studio +code tasks, so you don't have to be a terminal ninja. + +### notes + +- if you're experiencing libusb-related issues while using st-link, try using + [zadig](https://zadig.akeo.ie/) to update the usb driver. +- make sure to use the 64-bit version of msys2 (titled "MSYS2 MINGW64" in your + start menu) |