My pico arrived on Monday, 24 January, but I had other things that I had to do, so I resisted starting on it until Tuesday, 25th.
I'm documenting everything to make sure that I understand what's going on!
The Easy Bit!!!
- Open the package and have a good look - very easy!!!
- Follow the instructions in: https://www.raspberrypi.org/documentation/pico/getting-started/ in the tab labelled "Getting started with C/C++
- Plugging a micro USB plug into the socket on the pico, whilst simultaneously pressing the BOOTSEL button on the pico will not be easy!
- To get round this, I plugged the male end of a male A to female A USB extension cable into my PC and had the female end sitting conveniently on my desk.
- I then plugged a short USB A male to micro USB cable into the micro USB connector on the pico board. The male A end is not yet connected, so no power!
- Yes!!! When I connected the pico to the PC, by plugging the USB A male on the short cable into the USB A female on the extension cable, whilst simultaneously pressing the BOOTSEL button on the pico, there was a warble from the PC speaker, and the pico appeared as a removeable drive called RPI-RP2 (:I) - 127Mb - In File Manager on the PC.
- Yes!!! I downloaded the UF2 file for blink - blink.UF2, 25kB, to the Downloads folder on the PC.
- YES!!! I copied and pasted the UF2 file onto the RPI-RP2 drive.There was a warble, the RPI-RP2 drive disappeared from the File Manager window and the LED on the pico started flashing!
- Disconnect from the PC and, obviously, the LED stops flashing.
- Reconnect to the PC and the LED starts flashing.
- Disconnect and reconnect, whilst pressing the BOOTSEL button: the LED stops flashing, the RPI-RP2 drive reappears and the pico is ready to be reflashed.
- Disconnect and reconnect: the RPI-RP2 drive disappears and does not reappear; the LED starts flashing again. I just wanted to check that placing the pico into the reflash mode didn't destroy the resident program.
Now It Gets Much Harder!!
Because I have a stable, if outdated, development environment for Arduino/Esp8266 installed on my main W10 PC, I decided to try and install the pico environment on an ASUS W10 laptop.
For this next section I have used:
https://datasheets.raspberrypi.org/pico/getting-started-with-pico.pdf
EDIT - the above document has been revised and sections renumbered since this blog was written
And shabaz 's blog: Working with the Raspberry Pi Pico with Windows and C/C++
I've also looked at posts from michaelkellett jomoenginer14rhb
Firstly, following shabaz's blog:
1. Downloaded and installed Visual Studio Code from the Visual Studio Website link. Seemed OK
2. Within VS, installed the CMake tools extension. Seemed OK.
3. Downloaded CMake from the CMake website link. Installation was more problematic:
- The CMake installation didn't like the presence of ASUS Smart Gesture software, which supports the laptop trackpad, and asked for permission to remove it before it would proceed; not a problem, because I don't use the trackpad; I always use a mouse!
- Eventually, after removing the ASUS package, installation proceeded for a while and then hung, claiming there was another installation in progress (?)
- I cancelled the installation (which took quite a while to roll back) and then tried again......same problem!
- I rebooted the laptop and tried the installation again - this time it ran to completion, BUT, failed to show me the screen which would allow me to choose the System Path option, as shown in shabaz's screen shot.
- I uninstalled CMake and re-installed again. this time, I got the System Path screen, made the appropriate choice and the installation ran to completion.
4. Downloaded and installed the the Build Tools for Visual Studio, using the link and shabaz's screenshot. It took a while.
5. Following shabaz's next screen shot, I installed C++ Build Tools. The comment that it might take a few minutes was an understatement! It took about 20 minutes!
6. Following shabaz's advice, I then switched to the pico getting started guide (see above) using the links in section 8.2.1 to download and install:
- ARM GCC complier. Don't forget to tick the box to register the PATH to the environment variable.
- Python 3. I already had 3.7 32-bit installed; I upgraded to 3.7 64-bit.
- I needed to customise the installation to add Python to the PATH variable.
- I forced the installation Folder to be C:\Program Files\Python37 - this is NOT the default installation location.
- I also followed the instructions in the NOTE box to create a symlink between Python3.exe and Python.exe - don't forget to open the command window with administrator privileges.
- Python 3. I already had 3.7 32-bit installed; I upgraded to 3.7 64-bit.
- Git. During the installation, dont forget to:
- Change the default editor - I chose Notepad++
- Check the box to allow Git to be used from third-party tools
- Check the box for "Checkout as-is, Commit as-is"
- Check the box for "Use Windows default console window"
- Check the box for "Enable experimental support for pseudo consoles"
- Git. During the installation, dont forget to:
(I have no idea what some of the above means! )
7. I continued to follow the the pico getting started guide at Section 8.2.2 EDIT: 9.2.2, to Load the SDK and examples
- Opened a command window
- Created a a folder structure: C:\Users\pico\Downloads and then entered all the commands as shown
8. I followed Section 8.2.3 EDIT: 9.2.3 in the getting started document
- All went well until I got to: C:\Users\pico\Downloads\pico-examples\build> cmake -G "NMake Makefiles" .. which ran but produced a number of errors, relating to being unable to open certain files for witing, suggesting that the Visual Studio Developer Command prompt needed opening with administrator privileges.
- I closed the VS window and reopened with administrator privileges.
- I repeated C:\Users\pico\Downloads\pico-examples\build> cmake -G "NMake Makefiles" .. and it appeared to run to completion except for being unable to find Doxygen.
- I then ran the final command: C:\Users\pico\Downloads\pico-examples\build> nmake and the screen filled with loads and loads of coloured messages, which didn't seem to be errors!!!!!!!!!!!!
- This was similar to shabaz's screenshot and went on for a considerable time
- It appears to be successfully building all the pico examples!!!
- This is not what section 8.2.3EDIT: 9.2.3 said would be happening! They appear to have left out a step where I should have been identifying the "hello world" example.
- After almost an hour, everything has stopped and I'm pretty sure I've compiled and built all of the examples.
9. Using File manager, I can navigate to .....\build\blink\ folder, where I can find (amongst other files) blink.uf2, 25k. This is the file I need to flash the pico.
10. BIG TEST:
- Unplugged the pico from the PC and plugged it into the laptop, with the BOOTSEL button pressed down.
- The laptop warbled and the RPI-RP2 drive appeared in the File manager window
- Copied the blink.uf2 file from ....\build\blink\ and pasted it onto the RPI-RP2 drive.
- Laptop warbled and the LED on the pico started flashing.
- SUCCESS!!!
CONCLUSIONS:
1. I appear to have successfully built the pico SDK.
2. I appear to have successfully built/compliled all the examples.
3. At least one of the examples actually works - blink.
Next Step:
Learn how to modify the blink source file - to blink2 - build/compile it and then flash the pico with the modified file.
Top Comments