Forum > Embedded - ARM

Using PICO Debug Probe

(1/2) > >>

krolikbest:
Uploading a compiled file using picoprobe is already covered but this time I'd like to describe how to use PICO Debug Probe in Windows. Perhaps some finds it obvious, but for me to understand how to use it, it took me a little, so that's why I write it now.
The Pico Debug Probe comes with already uploaded firmware. After connection it to usb Windows should discover  it and report it under Device Manager. Not distinguishing then between releases https://github.com/raspberrypi/picoprobe/releases: debugprobe and picoprobe, constantly tried to use Zadig to configure newly discovered usb port in Windows. But Zadig is no longer required.
In order to upload your compiled program to the Pico it has to be:

1. Use a special Lazarus release to create and build your .elf program
2. Download and unack openocd. I use version 0.12, downloaded from https://www.raspberrypi.com/documentation/microcontrollers/debug-probe.html
3. open cmd in Administrator mode, navigate to your opencmd file (from previous step)
4. It could happen that in rp2040.cfg you have to change this line

--- Quote ---source [find target/swj-dp.tcl]
--- End quote ---
as I did to
--- Quote ---source [find scripts/target/swj-dp.tcl]
--- End quote ---
4.Then use something like

--- Code: Pascal  [+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i < x.length; i++) { x[i].style.maxHeight='none'; x[i].style.height = Math.min(x[i].clientHeight+15,306)+'px'; x[i].style.resize = "vertical";}};} ---"path_to your openocd_file">openocd -f scripts/interface/cmsis-dap.cfg -f scripts/target/rp2040.cfg -c "adapter speed 5000" -c "program "path_to some_elf_file" verify reset exit" 
This is exactly what is described here:https://www.raspberrypi.com/documentation/microcontrollers/debug-probe.html
----------
If you did it in different way please share it.

nouzi:
Thank  @krolikbest
you can add this to wiki

krolikbest:
Not yet until I know how to debug

dbannon:
krolikbest, just a few points in the interest of accuracy, especially if you intend to get this onto the wiki. (And thats a good idea !)


--- Quote from: krolikbest on November 11, 2023, 07:36:08 pm ---The Pico Debug Probe comes with already uploaded firmware.

--- End quote ---
You can also just use another Pico and load the Probe firmware onto it.


--- Quote from: krolikbest on November 11, 2023, 07:36:08 pm ---1. Use a special Lazarus release to create and build your .elf program

--- End quote ---
Hmm, I suspect thats a "special FPC release" ?   Michael required Lazarus main but that was two years ago, so what ever went into it then should be there now. And, good news, it seems that Michael's special code for FPC has now been merged into FPC so, you should be able to use that to build a Pico cross compiler. I have not tried it yet myself, just a query.

https://forum.lazarus.freepascal.org/index.php/topic,65136.msg496422.html#msg496422

Davo

krolikbest:

--- Quote ---You can also just use another Pico and load the Probe firmware onto it.

--- End quote ---
Yes, of course, but my goal was to use Pico Debug Probe (a special hardware).


--- Quote ---Hmm, I suspect thats a "special FPC release" ?   Michael required Lazarus main but that was two years ago, so what ever went into it then should be there now. And, good news, it seems that Michael's special code for FPC has now been merged into FPC so, you should be able to use that to build a Pico cross compiler. I have not tried it yet myself, just a query.

https://forum.lazarus.freepascal.org/index.php/topic,65136.msg496422.html#msg496422

--- End quote ---

I used for that purpose (a great tool) fpcupdeluxe to instal Lazarus (trunk ver) in order to compile for Pico. It would be great to have merged crosscompiler into FPC though. So far (for Pico) I've been using MMBasic but obviously it's interpreter hence using Pico in industrial use it was rather like a toy than seriously.

Navigation

[0] Message Index

[#] Next page

Go to full version