I don't fully understand the usage of the DebugProbeAggregator.get_probe_with_id(board_id), for example, in the test/automated_test.py:164.
As it is now, when I have only st-link probes connected and override the target in the pyocd.yaml, get_probe_with_id() still returns the CMSISDAPProbe probe even if it found no interface and has no probe with such id.
Shouldn't it return None in that case?
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub, or mute the thread.
It sounds like there might be a bug. If no CMSIS-DAP probe is connected, it definitely should not be returning a CMSISDAPProbe
instance. Could you provide some more detail, like the list of connected probes and the exact output of get_probe_with_id()
? I just want to make sure I'm understanding the problem fully. Thanks!
Examples of the output:
## => Board Name | Unique ID
-- -- ----------------------
0 => STM32 STLinkV2-1 | 066AFF393430533457055540
1 => STM32 STLinkV2 | 53FF6D067865495422580467
>>> from pyocd.probe.aggregator import DebugProbeAggregator
>>> probe = DebugProbeAggregator.get_probe_with_id('53FF6D067865495422580467')
>>> print(probe)
<CMSISDAPProbe@19d76eabdd8 >
>>> print(probe.unique_id)
53FF6D067865495422580467
For me, these lines are the one I don't understand - here and here.
Why if no interface is found pyOCD still creates some objects?
This is definitely a bug.
The code in DAPAccessCMSISDAP.__init__()
is mostly correct. The constructor should only be called if it is known that a device exists. But it does need to handle the case where the device has disappeared between first identifying it and calling the constructor.
The primary bug here is in CMSISDAPProbe.get_probe_with_id()
, as you have discovered.
Thanks for reporting this! I'll fix it right away.