improvement for .vscode+openocd#140
Conversation
|
I get what you're going for but this means I'll be on constant guard duty to never check in my S/N and since everyone else will check in theirs I'll have to guard every PR too. It's why I have a hard rule of no workstation config in my repos - helps to prevent credential leaks too. Can the debugger can switch on something else like contents of flash or RAM? |
|
Of course, you are right. I understand and support your position and the rule you described. Perhaps instead of creating a pull request, I should have posted this as a topic in https://github.com/orgs/picocomputer/discussions. Someone involved in building firmware for the RP6502 might be interested in it. While trying to make my life easier and avoid mistakes about which Pico board I am flashing the built firmware to, this is the solution I have found so far. I am still looking for other ways to avoid having to add workarounds like this to my fork every time. Before the solution I presented, I used to add two additional tasks to However, without exposing anyone to the risk of leaking private data, perhaps you could add a non-disruptive change: pass the If someone wants to use the solution I presented, they would have to modify their own |
|
To answer your question: after reviewing the OpenOCD documentation, it seems to me that, at least for now, this is the only solution. |
|
from my notepad (own thoughts and fragments of discussions with different AIs) : maybe is the other way, but there is no better fully logical method than stable identification of the specific probe, or the physical USB path. In this repo both targets ( Possible alternatives to
What I cannot really do is tell OpenOCD: “flash RIA because I selected target Conclusion: if both Debug Probes are connected at the same time, |
|
Codex answer me as follows : The debugger/Pico extension/OpenOCD must first select a Debug Probe before it can read anything from the microcontroller over SWD. Only after selecting a probe can it connect to the RP2350 and read flash, RAM, or registers. So firmware contents or RAM contents cannot be the initial criterion for selecting the probe, because they are only available after that selection has already been made. But - one workaround seems to be possible:
But that would be custom script logic, not the standard behavior of the Pico Debug task/OpenOCD. It also has limitations: the marker must already exist, RAM after reset is usually not a reliable identifier, and if the wrong or empty firmware is currently flashed, identification by firmware contents stops being dependable. In practice, for two identical Pico 2 boards, the best criteria are still external to the target:
So: the debugger itself cannot reliably switch between probes based on flash/RAM contents without first connecting to each probe and adding extra scripting. |
|
Was your question meant to be rhetorical because you solved it differently? |
|
I haven't spent any time on this. I spend less than 5 minutes a year swapping cables . It going to take a lot longer than that to develop a solution and maintain it. You could ask on the Raspberry Pi Pico forums or the OpenOCD mailing list for ideas. |
578ff19 to
bcfd32d
Compare
Improvement to make firmware programming directly from VSCode easier
when the configuration uses two separate Debug Probes connected to the RIA and VGA.