A few years ago installing the Pico SDK on Ubuntu (X64_86 using Intel I5 processor) didn't really work well. But now it seems to be different and I made a short guide how to install the Pico SDK on Ubuntu using these links:
https://learn.arm.com/learning-paths/mi ... _pico/sdk/
https://www.youtube.com/watch?v=T09zMnDtpZ4
A big thank goes to the young British gentleman at the latter link, who led me to the secrets of OpenOCD. My instructions (quick and dirty styled and with not native English )
"Installing-PICO-SDK-On-X86-64-Ubuntu.txt" uses the RPi Pico W as a test device.
Hhhmmm... Seems that I cannot attach a tex file on this message. Have to think how to proceed.
Let's put file's text into the code tags. Hopefully this works.
EDIT:
This is the debugger in question:
https://www.raspberrypi.com/products/debug-probe/
Note that I used on my "drawing" orange-black-yellow colored cable on the D(Debug) connector.
https://learn.arm.com/learning-paths/mi ... _pico/sdk/
https://www.youtube.com/watch?v=T09zMnDtpZ4
A big thank goes to the young British gentleman at the latter link, who led me to the secrets of OpenOCD. My instructions (quick and dirty styled and with not native English )
"Installing-PICO-SDK-On-X86-64-Ubuntu.txt" uses the RPi Pico W as a test device.
Hhhmmm... Seems that I cannot attach a tex file on this message. Have to think how to proceed.
Let's put file's text into the code tags. Hopefully this works.
EDIT:
This is the debugger in question:
https://www.raspberrypi.com/products/debug-probe/
Note that I used on my "drawing" orange-black-yellow colored cable on the D(Debug) connector.
Code:
Installing-PICO-SDK-On-X86-64-Ubuntu.txt2025-01-15 by penitkoInstalling PICO-SDK and its tools and connectingcomputer to raspberrypi debugger and that to pico w board.At this time we do not connect RPI debugger's U connector topico w board. 1 Installing PICO-SDK with Arm's bash script on Ubuntu 22.04 or 20.04======================================================================Installing pico-sdk and tools with arm's way:https://learn.arm.com/learning-paths/microcontrollers/rpi_pico/sdk/Get SDK installing script from site shown below:wget https://raw.githubusercontent.com/raspberrypi/pico-setup/master/pico_setup.shBefore starting SDK installation, Ubuntu needs some packages:sudo apt-get install jq minicom make cmake gdb-multiarch automake autoconf libtool libftdi-dev libusb-1.0-0-dev pkg-config clang-format -yUse SKIP_ variables to skip the VS Code and UART software installation on Ubuntu.SKIP_VSCODE=1 SKIP_UART=1 bash ./pico_setup.sh( I put those variable's initializations in the script:if grep -q Raspberry /proc/cpuinfo; then echo "Running on a Raspberry Pi"else echo "Not running on a Raspberry Pi. Use at your own risk!" SKIP_UART=1 SKIP_VSCODE=1 # BY penitkofi)( IMPORTANT - this way you can use your vscode without any problems - at least in my case)By the way, it is better to install VS CODE from Ubuntu's snap:sudo snap install code --classic)Run script:SKIP_VSCODE=1 SKIP_UART=1 bash ./pico_setup.shAfter downloading SDK and installation, check theinstallation.Source new variables that installation added:source ~/.bachrcThere are 4 added variables:env | grep PICOPICO_EXTRAS_PATH=/home/...PICO_SDK_PATH=/home/...PICO_PLAYGROUND_PATH=/home/...PICO_EXAMPLES_PATH=/home/...Check versions:arm-none-eabi-gcc --versiongdb-multiarch --versioncmake --versionopenocd --version2 Connecting computer to pico w and to raspberry debugger==========================================================Cable wirings from rasberry debugger board to pico w:pico w and debugger used cable colorings:o = orangeb = blacky = yellowconnect (debugger)y---(pico w)yconnect (debugger)b---(pico w)bconnect (debugger)o---(pico w)opico w - board------------------usb-conncector upcomponent side upo b yo o osilver can------------------ || || cable (or 3 colored wires) || ....raspberry debugger that has two connectors (D and U, and USB)y b oo o o------------------ D -connector component side up usb-connector------------------ 3 TESTING INSTALLATION WITHOUT DEBUGGER (we use debugger later)==================================================================0 Follow instructions here and copy hello.c and CMakeLists.txt and save them.1 Save hello.c to hello directory (hello named project directory because CMakeLists.txt uses just that name)2 Save CMakeLists.txt in the hello directory.3 Go in the hello directory.4 mkdir build5 cd build6 cmake ..7 makeNow you should have hello.uf2 in build directory. Upload that file in the RPI-RP2 usb drive.Application should start at once.Check application's printings :sudo minicom -b 115200 -o -D /dev/ttyACM0(stop printings with CTR+A and then Z. )4 Watch Youtube video and follow instructions==============================================Debugging the Pico W using a "Debug Probe" and Visual Studio CodeEmbedded Tutorialhttps://www.youtube.com/watch?v=T09zMnDtpZ44.1 Making debugging server listening and debugging(sudo) openocd -f interface/cmsis-dap.cfg -f target/rp2040.cfg -c "adapter speed 5000"If you have not modified new Dev rules, you might need to use sudo with openocd command.After command, debugger server should wait at localhost:33334.2 (Initializing the tinyusb submodulehttps://forums.raspberrypi.com/viewtopic.php?t=325398 )=>https://github.com/raspberrypi/pico-sdk( cd pico-sdk and run : git submodule update --init=>What is the point of 'git submodule init'?https://stackoverflow.com/questions/44366417/what-is-the-point-of-git-submodule-init)Now we can make a new pico-w project, but first we have to download python applicationthat we can use for creating projects that makes CMakeLists.txt already for us.We have to download the project generator (=python application) (we do not have to build it)cd ~/picogit clone https//github.com/raspberrypi/pico-project-generator.gitrun it : ./python3 project_creator.py --gui=> If tkinter in not found, install it: sudo apt install python3-tktry again : ./python3 project_creator.py --gui and fill the form.4.3Creating a project with project generator and replacing project's launch.json withanother *.json file. Because when we debug, we use remote debugger server.After creating the new pico-w project, change under .vscode found launch.json with/pico/pico-examples/ide/vscode/ and copylauncn-remote-openocd.json andsave it in the just created project and change it's name to launch.json. Before thatdelete on change the name of original launch.json. But perhaps we'll don'tneed it - at the moment.We are almost done but one thing we have to change. We change just created launch.jsonfile by adding the localhost before port 3333 contained in tag "gdbTarge".Change "your-openocd" with "localhost". After change row looks like that:"gdbTarget": "localhost:3333",Now we are nearly there. On the bottom bar is text: No Kit Selected": So select kit from the bottom bar: Choose.... arm-none-eabi6:21 - this time I am not sure what heppu seleceted:may debug.Push Green triangle from upper left cornet with text "Pico Debug" and select /home/user_name/pico/flashy or blink/build/flashy.elf or blink.elfPrintings with printf in C from pico-w device on computer's sceen can be seen with e.g minicom:sudo minicom -b 115200 -o -D /dev/ttyACM0
Statistics: Posted by penitko — Thu Jan 16, 2025 6:23 am