Updated building on windows instructions

Gabriel Koppenstein committed 2023-12-25 15:34:50 +01:00
1 parent 553345d96e
commit 7f5c7377ca
1 file changed
+33 -17
+33 -17
@@ -16,33 +16,49 @@ To build the software and run it on the Controller we need to interface the RP20
### Windows
1. Download and install [Pico setup for Windows](https://github.com/raspberrypi/pico-setup-windows) and make sure to check the box for also installing Zadig. You might also need to install [Build Tools for Visual Studio 2022](https://visualstudio.microsoft.com/downloads/)
2. Clone and build Pico repos either by checking the box at the end of the setup.
3. Connect Raspberry Pi Pico via USB while holding the reset button. Your Pi Pico should now be visible in Windows explorer as a mass storage device.
4. Download the latest prebuilt "picoprobe.uf2" release binary from [here](https://github.com/raspberrypi/picoprobe/releases) or download it from the [Raspberry Pi Website](https://www.raspberrypi.com/documentation/microcontrollers/raspberry-pi-pico.html#debugging-using-another-raspberry-pi-pico). Alternatively, you can get the file by navigating to the picoprobe/build subfolder.
5. Copy "picoprobe.uf2" to your Pi Pico. The Pi Pico onboard LED should now light up.
6. Navigate to the tools subfolder in your installation folder and open zadig.exe
7. Install the picoprobe driver using "zadig.exe" as shown in [Getting started with Raspberry Pi Pico - Appendix A - Page 62](https://datasheets.raspberrypi.com/pico/getting-started-with-pico.pdf#%5B%7B%22num%22%3A65%2C%22gen%22%3A0%7D%2C%7B%22name%22%3A%22XYZ%22%7D%2C115%2C692.106%2Cnull%5D)
8. Connect GND to GND, VBUS to +V, GPIO2 to SWCLK, GPIO3 to SWDIO as shown in the picture below.
1. Connect Raspberry Pi Pico via USB while holding the reset button. Your Pi Pico should now be visible in Windows explorer as a mass storage device.
2. Download the latest prebuilt "picoprobe.uf2" release binary from [here](https://github.com/raspberrypi/picoprobe/releases) or download it from the [Raspberry Pi Website](https://www.raspberrypi.com/documentation/microcontrollers/raspberry-pi-pico.html#debugging-using-another-raspberry-pi-pico).
3. Copy "picoprobe.uf2" to your Pi Pico. The Pi Pico onboard LED should now light up.
4. Connect GND to GND, GPIO2 to SWCLK, GPIO3 to SWDIO, VBUS to +V, as shown in the picture below .
<img src="https://github.com/gab-k/RP2040-Decoder/blob/main/docs/svg/Debug_Connections.svg" width="700"/>
9. To finally build and flash, open the Developer Command Prompt for Pico and type the following commands:
5. Download and install [Pico setup for Windows](https://github.com/raspberrypi/pico-setup-windows)
6. Download and install [MSYS2](https://www.msys2.org/)
7. Open a MSYS2 MINGW64 shell window
8. Update all pacman packages
```sh
pacman -Syu
```
9. Install mingw-w64-x86_64-toolchain (choose to install all)
```sh
pacman -S mingw-w64-x86_64-toolchain
```
10. Add "C:\msys64\mingw64\bin" to your users PATH environment variable. If you have choosen to not use the default directory for MSYS2 add the one you have choosen. [How to do this?](https://www.computerhope.com/issues/ch000549.htm)
11. Open the Pico - Developer Powershell
12. Navigate to a folder you like and clone the project repository
```sh
git clone https://github.com/gab-k/RP2040-Decoder
```
13. Enter cloned repository, create and enter build directory
```sh
git clone https://github.com/gab-k/RP2040-Decoder.git
cd RP2040-Decoder
mkdir build
cd build
cmake -G "NMake Makefiles" ..
nmake
openocd -f interface/picoprobe.cfg -f target/rp2040.cfg -c "program RP2040-decoder.elf verify reset exit"
```
(Note: On newer SDKs use this command: openocd -f interface/cmsis-dap.cfg -f target/rp2040.cfg -c "adapter speed 5000" -c"program rp2040-decoder.elf verify reset exit")
```
14. Run CMake and the mingw32-make to build
```sh
cmake -G "MinGW Makefiles" -DCMAKE_BUILD_TYPE=Debug ..
mingw32
```
15. Flash the decoders software using openocd
```sh
openocd -f interface/cmsis-dap.cfg -f target/rp2040.cfg -c "adapter speed 5000" -c"program rp2040-decoder.elf verify reset exit"
```
### Other OS
Please refer to [Getting started - Pico](https://datasheets.raspberrypi.com/pico/getting-started-with-pico.pdf). Chapter 3 & 5 and Appendix A are the most relevant but you might also refer to chapter 9.1 if you are using macOS.
The first four steps are identical to the steps described above for windows users. Regarding building and flashing, please refer to [Getting started - Pico](https://datasheets.raspberrypi.com/pico/getting-started-with-pico.pdf). Chapter 3 & 5 and Appendix A are the most relevant but you might also refer to chapter 9.1 if you are using macOS.
## 4. Wiring and initial startup