How to Debug the Raspberry Pi Pico Using Another Pico! - Picoprobe and VSCode Tutorial

Поділитися
Вставка
  • Опубліковано 16 лип 2024
  • This video shows you how to debug the Raspberry Pi Pico using another Pico acting as a Picoprobe. We walk-through how to install the required dependencies to enable debugging inside Visual Studio Code (VSCode) and demonstrate simply how to add breakpoints and inspect register values. We debug a simple C blink LED program which was written in a previous video.
    This video also covers how to create a Picoprobe from a Raspberry Pi Pico, how to wire it to a target Pico and use it as a UART serial monitor as well as a debugger! By following this short tutorial you will be able to debug your C programs on your Pico in no time!
    The OpenOCD build and boilerplate code is available here: learnembeddedsystems.co.uk/133-2
    Links to programs mentioned in this video:
    OpenOCD: learnembeddedsystems.co.uk/133-2
    Picoprobe UF2: www.raspberrypi.org/documenta...
    Zadig: zadig.akeo.ie/
    Timestamps
    00:00 Introduction
    00:33 What will we need?
    01:23 OpenOCD
    02:18 USB Drivers
    02:50 Picoprobe UF2
    03:14 Pico Wiring
    04:28 Testing Toolchain
    06:09 Picoprobe UART to USB
    06:35 Set up VSCode
    07:40 launch.json
    08:25 Debugging
    10:28 Conclusion
    If this video helped you, please consider leaving a like and subscribing, thank you!
    To see my other videos on the Raspberry Pi Pico, check out the playlist here: • Pico Tutorials
    You can find more embedded systems tutorials and projects on my website learnembeddedsystems.co.uk
    -- Equipment I use regularly --
    The following links are affiliate links where I may make a small percentage on qualifying sales through these links. Use the respective UK or US links listed.
    Budget Soldering Iron: UK: amzn.to/3pQpvUu US: amzn.to/3bBawIJ
    Breadboards: UK: amzn.to/3solZCe US: amzn.to/3dGsHiS
    Jumper Cables: UK: amzn.to/37JfToi US: amzn.to/3r384S9
    Camera: UK: amzn.to/3qKLwFr US: amzn.to/3pK0V7C
    Lens: UK: amzn.to/380lQxp US: amzn.to/3knH3WL
    Tripod: UK: amzn.to/37H0Nzw US: amzn.to/3byKHsV
    All videos and tutorials on this channel and mentioned websites are for educational purposes only.

КОМЕНТАРІ • 97

  • @simonquin7617
    @simonquin7617 3 роки тому +27

    I am reasonably experienced in embedded systems and can say that fighting tool chains is a massive waste of time. These videos are first class, well done!

    • @gautombose4172
      @gautombose4172 2 роки тому +1

      I totally agree. "fighting tool chains" is pointless.
      Some one should put the debugger in the second core and use interrupts to switch over.

    • @danieljimenez1989
      @danieljimenez1989 2 роки тому +1

      That can't always be done, some use the second core for running code

    • @gautombose4172
      @gautombose4172 2 роки тому +1

      @@danieljimenez1989 One needs to WALK before one can RUN.
      I can not not even get the Debug to work.

    • @gautombose4172
      @gautombose4172 2 роки тому

      @@danieljimenez1989 Ladyada talks about it. But then, talk is cheap.

  • @w9ran
    @w9ran Місяць тому

    Thank you for this clear tutorial! A Part 2 would be helpful, especially for those of us who are trying to wean ourselves from the Arduino IDE, but are accustomed to being able to plug the Pico into USB and download the code to it. I think that is only possible using PicoProbe and SWD, but taking it slow and showing each step of the process and some examples for how the debugging capability of PicoProbe and openocd can be used by beginner level programmers hoping to move into a more professional environment would be great.

  • @markgregory6521
    @markgregory6521 3 роки тому +6

    Yes please ... part two would be really useful.

  • @matthiassuess7293
    @matthiassuess7293 3 роки тому +4

    An absolutely great and clear tutorial on OpenOCD and Pi Pico. Thank you for your effort and your additional information on your website. It saved me a lot of time and trying. Thank you very much. Please make a 2nd part of the tutorial - it is very interesting. Many greetings from Germany!

    • @LearnEmbeddedSystems
      @LearnEmbeddedSystems  3 роки тому +1

      Glad you found it helpful! Thank you for watching and I will get part 2 out soon!

  • @hshpegel
    @hshpegel 3 роки тому +4

    Thank you for a terrific video and yes, a part 2 would be very much appreciated.

    • @LearnEmbeddedSystems
      @LearnEmbeddedSystems  3 роки тому +1

      Thank you for watching, glad you found it helpful! Will get on the part 2!

  • @haroldemmers3678
    @haroldemmers3678 3 роки тому +1

    A part two on this video would be great.
    This is super helpful.

  • @leeharrold5613
    @leeharrold5613 2 роки тому

    You are amazing. Thank you so much! Your video has made debugging rust much easier for me.

  • @skf957
    @skf957 3 роки тому +1

    Yes please! Plus-n for the part-2. You deserve more subs than you've got. I'm new to C and wouldn't have chosen to go with it were it not for your tutorials. Thank you.

  • @rodolfoblasser3329
    @rodolfoblasser3329 Рік тому

    Man, this is amazing. Thank you for sharing the knowledge and resources.

  • @khhhhhhh1
    @khhhhhhh1 3 роки тому +1

    Great video! love to see a part2

  • @Lammy2k
    @Lammy2k 3 роки тому

    I wish every tutorial was as good as this one

  • @PATRIK67KALLBACK
    @PATRIK67KALLBACK 3 роки тому +1

    Great video! I look forward to part 2.

  • @brendanfarthing
    @brendanfarthing 3 роки тому

    Great video, thanks a lot. Thumbs up for part 2!

  • @jugnu361
    @jugnu361 3 роки тому +2

    Much Awaited

    • @gautombose4172
      @gautombose4172 2 роки тому +1

      Can you help me ? I am getting stuck.

  • @y2ksw1
    @y2ksw1 3 роки тому +1

    This is incredibly helpful! Thank you!

  • @antaris42
    @antaris42 3 роки тому

    Thanks ! Waiting for a part 2 :)

  • @ShaunakDe
    @ShaunakDe 3 роки тому

    Thanks for making this!

  • @gautombose4172
    @gautombose4172 2 роки тому

    Very helpful video. I shall try this.

  • @MotoRideswJohn
    @MotoRideswJohn 3 роки тому +1

    Great tutorial!

  • @anssietelaniemi3397
    @anssietelaniemi3397 2 місяці тому

    Nice. Helped a bunch.

  • @ahmedmoustafa6829
    @ahmedmoustafa6829 Рік тому

    Excellent video

  • @juanguiillermocallejimenez3615
    @juanguiillermocallejimenez3615 3 роки тому

    Great Video. Thank you.

  • @spotterinc.engineering5207
    @spotterinc.engineering5207 3 роки тому +1

    Great explanation video. I assume your web docs are as clear as this! Thanks.

  • @j.p.denoyer7377
    @j.p.denoyer7377 3 роки тому +6

    some of the steps are presented out of sequence. The picoprobe UF2 file has to be installed on a Pico before zadig installer shows the driver

    • @gautombose4172
      @gautombose4172 2 роки тому

      I got as far as PICOPROBE UF2 File. Then I am stuck. Can not get openocd to work on my 32bit windows 10 desktop.

  • @mytechnotalent
    @mytechnotalent 3 роки тому +4

    What I would love to see is a very through set of tutorials in C for the Pico. The examples are great in the sdk but would love additional ones including how to use a TFT display, etc.

    • @gautombose4172
      @gautombose4172 2 роки тому

      The benefit of using a PICO is to get the applications, up and running quickly.

    • @gautombose4172
      @gautombose4172 2 роки тому

      Well spoken Mr. Thomas. I am sure MR. Shawn Hymel is up for the task. That is after he has helped me, and the other 99 followers, to get over sticky points. For now, I am stuck.

    • @mytechnotalent
      @mytechnotalent 2 роки тому

      @@gautombose4172 What are you stuck on?

  • @markgregory6521
    @markgregory6521 3 роки тому +5

    This is brilliant, thank you very much!

    • @LearnEmbeddedSystems
      @LearnEmbeddedSystems  3 роки тому

      Glad it was helpful!

    • @samsonbeckett4810
      @samsonbeckett4810 3 роки тому

      I realize I am quite randomly asking but does anyone know of a good place to watch newly released tv shows online?

    • @richardcaspian4414
      @richardcaspian4414 3 роки тому

      @Samson Beckett Try FlixZone. Just search on google for it =)

    • @kashtoncory5942
      @kashtoncory5942 3 роки тому

      @Richard Caspian Yup, I've been watching on FlixZone for since april myself :D

    • @samsonbeckett4810
      @samsonbeckett4810 3 роки тому

      @Richard Caspian thank you, I signed up and it seems to work :) I really appreciate it !!

  • @rickzinni6698
    @rickzinni6698 Рік тому

    Yes, please add the more in-depth debugging video. Cheers.

  • @adamreynolds1541
    @adamreynolds1541 3 роки тому +2

    I had to copy the picoprobe.uf2 to the pico before zadig would let me install the correct usb driver. That's not the order in the video. Just thought I'd point it out in case anyone has the same problem. Thanks for the videos. A guide to pico debugging would be really helpful.

    • @vizionthing
      @vizionthing Рік тому

      Thanks Adam, save me a pile of frustration

  • @w9ran
    @w9ran Рік тому +6

    Having problems. I've used Zadig enough to know the UF2 has to be flashed first, but under "Show All Devices" there is no Interface 2, only Interface 0 and 1. Windows assigns CDC-ACM UART to Interface 1 and it shows up as a COM port. Windows assigns CMSIS-DAP v2 to Interface 0 and when I run OpenOCD (your prebuilt version) it cannot find a Picoprobe. I've tried using Zadig to replace the driver with libusb but the same result occurs. The UF2 file was downloaded today from the R-Pi Pico site. Any suggestions appreciated!

    • @dragoscirca
      @dragoscirca 6 місяців тому

      I have the same issue, did you figure it out in the meantime?

  • @TheRcEngineer
    @TheRcEngineer 2 роки тому

    I would have saved so much time. If only I watched your video before the getting started documentation,...

  • @rubbermaiden
    @rubbermaiden 3 місяці тому

    Marvelous

  • @larrybud
    @larrybud 6 місяців тому

    As of the end of 2023, make the jump to Platform IO and the pico debug probe, and it's pretty much a one click solution. You don't have to set any of this up manually.

  • @uajoku
    @uajoku 3 роки тому

    Helpful Video.
    Your breadboard looks different from what is commonly available. Please can you please share the make/brand/or store link to get it.

  • @thomassargood6938
    @thomassargood6938 5 місяців тому +1

    Great video and very helpful. I did however need to use commands from the updated "Getting started with Pico" document as the old command (as stated in the video) does not work any more
    src/openocd -f interface/cmsis-dap.cfg -c "adapter speed 5000" -f target/rp2040.cfg -s tcl
    instead of:
    src/openocd -f interface/picoprobe.cfg -f target/rp2040.cfg -s tcl
    Would love to see a part two tot his video!

    • @LearnEmbeddedSystems
      @LearnEmbeddedSystems  5 місяців тому +1

      Thank you for letting me know the command changes. I will look into updating the video & going into more detail debugging. Thanks!

  • @vincentvidal3305
    @vincentvidal3305 3 роки тому

    Nice video to demonstrate a blinking Led, Ok, thanks, is the second Pico support multidrop SWD ? If yes, It should be cool to see how to debug with 2 cores ?

  • @dw4_
    @dw4_ 2 роки тому

    Thanks for the tutorial! One issue, when I use breakpoints in the C source file, the code stops at the assembly code and not the C code, any idea how to fix this?

  • @MrSlowpokee
    @MrSlowpokee Рік тому

    Thanks for this video! Using this picoprobe as a pseudo "Jtag" interface is almost as painful as debugging a kernel driver on a Windows VM! I was able to replicate the processes which is the 1st for me with this project. However, I am using Visual Studio Code with PlatformIO and I need to edit the platformio.ini instead of the json cfg files as they are auto-generated from PlatformIO extension. Can you point me into how to modify the ini file to match the operations as defined in the cfg file?

  • @bennguyen1313
    @bennguyen1313 Рік тому

    Does the new Pi Pico Debug probe program the same way (hold the button, plug in usb, and copying the picoprobe uf2 file to it)?
    Regarding the VS Code extensions (Cortex-Debug, CMake Tools, Cpp tools),
    in order to debug non-Pi devices (ex. stm32), would you just need to change the launch json file to point to the target's svd and cfg files? I understand openocd uses the universal arm protocol 'CMSIS-DAP', but is it necessary to modify or rebuild openocd/msys2 tool whenever you debug a different Arm device (cortex m0m3m7)?
    BTW, George Hotz has a great 2016 video where he shows a different way to debug.. he made a qemu-based tool (qira) that allows for 'timeless' debugging!

  • @eFeXuy
    @eFeXuy 3 роки тому

    Thanks a lot, if it took me a while to make it run because eff VS Code and its useless error messages. So frustrating.

  • @j.p.denoyer7377
    @j.p.denoyer7377 3 роки тому

    How do you make headers fit the debug pins?
    How do you get the double breadboard pictured?

  • @edgeeffect
    @edgeeffect 3 роки тому

    Picoprobe sounds a lot like the Black Magic Probe that I use on STM32.
    I wonder if I can use my Black Magic Probe on the Pico.... it's a bit easier because it has GDB built in and doesn't need OpenOCD or any of that.

  • @chriskiwi9833
    @chriskiwi9833 2 роки тому

    Is this still the current best way to set up the tool chain?

  • @jkn8932
    @jkn8932 2 роки тому

    Can you please cover how to debug multi file project?

  • @HitAndMissLab
    @HitAndMissLab Рік тому

    Can this same setup be used on Raspberry Pi Zero 2 W?

  • @chipsoft1
    @chipsoft1 2 роки тому

    Is it possible to use picoprobe for another microcontrollers, such as Microchip Cortex-M4?

  • @jyvben1520
    @jyvben1520 3 роки тому

    for C programming on windows, one day !
    4:20 or as monitor for micropython serial output, might be interesting

  • @null_carrier
    @null_carrier 3 роки тому

    Where did you get that double-width half-size breadboard?

  • @gabrielfienco2531
    @gabrielfienco2531 2 роки тому

    if i want to program another mcu, like atmega, stm32 or sam21, will it work?

  • @robn2497
    @robn2497 2 місяці тому

    What do you do if it failed to open OR find the device

  • @pobeydishner3687
    @pobeydishner3687 3 роки тому

    Love this video! However, with the "arm-none-eabi-gdb hello_serial.elf" directions, I get "Reading symbols from hello_serial.elf..." but then "(No debugging symbols found in hello_serial.elf)"... Not sure how this happened? ... Do I need to recompile the examples in some way to have the "debugging symbols" with all the examples? ... Thank you in advance! ... I have a second question, namely, IS THERE a VIS STUDIO CODE youTUBE vid showing this same thing on a Rasp Pi 4 running VIS STUDIO CODE?... Would love to see it!

  • @Videogame9559
    @Videogame9559 6 місяців тому

    I need this one pi pico running strange and not loading at all .

  • @gorannikolic5004
    @gorannikolic5004 3 роки тому

    From where did you get your Knowledge?

  • @paulspark7287
    @paulspark7287 8 місяців тому

    Why does Zadig 2.5 (and Zadig 2.8) only show 3 devices and none of them are the Pico probe? Have you missed a step in this video? Is one of the Picos supposed to be connected?

  • @gautombose4172
    @gautombose4172 2 роки тому

    If only you could upload a zip file comprising of, OPENOCD, PICOTOOL and win32lib USB Driver, I shall get unstuck. But the software will have to work on 32bit windows 10 PC.

  • @andrewhartley8781
    @andrewhartley8781 3 роки тому +1

    I followed your advice in this video to the letter. Running the hello_serial.elf worked just fine with the pico-probe and Putty displayed the output as in your video.
    I then continued and installed Cortex-Dubug etc, still all following your advice. But, when I attempted to debug with Cortex I get a warning dialog that reads:
    "Failed to launch OpenOCD GDB Server. Timeout."
    I have tried installing an older version of Cortex-Debug, but I still get the same warning dialog. What can you suggest please?
    BTW your videos are very good.

    • @andrewhartley8781
      @andrewhartley8781 3 роки тому +1

      I got it to work. Disconnected the micro-usb cable from the pico-probe, re-connected and then launched VS Code. Attempted to debug via Cortex again and it worked. I have now installed Cortext-Debug v3.12 again.

    • @gautombose4172
      @gautombose4172 2 роки тому

      Can you help me. I am getting stuck.

  • @cernejr
    @cernejr 3 роки тому +2

    This would be tedious/painful to figure all out on one own - thank you.

  • @neail5466
    @neail5466 Рік тому

    Could you please confirm if this method can be used to prob any serial devices?
    I am not sure if you already had, please make a indepth tutorial for decoding the debug info. Surely checking you channel... Sorry if already done ...and yes a part 2...I don't know it matters or not after a year. Thanks for the video. Atleast a stepping stone for beginners.

  • @darthjeder
    @darthjeder Рік тому

    VSCode is complaining about "Identifier true is not defined" but yet the LED is blinking in debug mode...
    ...thanks

  • @diegogarber1
    @diegogarber1 2 роки тому

    Oh no! I was so pumped until i saw you’re coding in C :’(

  • @j.p.denoyer7377
    @j.p.denoyer7377 3 роки тому

    The pico probe UF2 does not appear to exist.
    On the page linked the only thing about Pico probe is an ad to buy a cover.
    On page 60 of the getting started documentation it gives the same link and claims the UF2 appears under "utilities". There are no "utilities" on the page

    • @LearnEmbeddedSystems
      @LearnEmbeddedSystems  3 роки тому +1

      Interesting, I can still see it on the following link www.raspberrypi.org/documentation/rp2040/getting-started/#board-specifications under the "About Raspberry Pi PIco" Tab

    • @j.p.denoyer7377
      @j.p.denoyer7377 3 роки тому

      Found it. Thanks for the quick response

  • @gautombose4172
    @gautombose4172 2 роки тому

    It is simply not working for me. I have spent hours at it. What you show in this video does not necessarily follow, what I get in real life downloads, even, if I follow your instructions step by step. I have windows10 on a 32bit desktop PC. Do I need to get a new 64 bit PC with windows 10 ?.
    Your (zip file) picotool and openocd, did not work on my 32 bit windows 10.
    MinGW is not working on 32 bit windows 10 PC.
    The question is, if I have to get a new PC, should I no get a PI4, or, PI400 which can simplify, considerably, the set up for me to run VSCODE for debugging pico.
    Please advise.
    Perhaps it is time for some one to bring out a proper IDE like STM32 IDE with CUBEMX.

    • @duckyblender
      @duckyblender 10 місяців тому

      64 bit binaries will not work on a 32 bit computer... You can buy a raspberry pi or a new PC, that's up to you :)

  • @louisroux8517
    @louisroux8517 3 роки тому

    Peeco?

  • @AndyM8
    @AndyM8 Місяць тому

    This is so stupid. All microcontrollers should be plug and play. Zero setup time. Straight to implementation. Looks like developers are masochistic enough, and enjoying the endless toolchain setup adventures, also to prove themselves important and useful.