Skip to content

Commit 5a0adf0

Browse files
committed
ADIv5: 'adi.v5.max_invalid_ap_count' session option.
1 parent f384bde commit 5a0adf0

File tree

3 files changed

+12
-1
lines changed

3 files changed

+12
-1
lines changed

docs/options.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,14 @@ processed. The consequence of this is that these options cannot be set in a YAML
1414

1515
<tr><th>Option Name</th><th>Type</th><th>Default</th><th>Description</th></tr>
1616

17+
<tr><td>adi.v5.max_invalid_ap_count</td>
18+
<td>int</td>
19+
<td>3</td>
20+
<td>
21+
If this number of invalid APs is found in a row, then AP scanning will stop. The 'scan_all_aps' option
22+
takes precedence over this option if set.
23+
</td></tr>
24+
1725
<tr><td>allow_no_cores</td>
1826
<td>bool</td>
1927
<td>False</td>

pyocd/core/options.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,9 @@
2222
## @brief Definitions of the builtin options.
2323
BUILTIN_OPTIONS = [
2424
# Common options
25+
OptionInfo('adi.v5.max_invalid_ap_count', int, 3,
26+
"If this number of invalid APs is found in a row, then AP scanning will stop. The 'scan_all_aps' option "
27+
"takes precedence over this option if set."),
2528
OptionInfo('allow_no_cores', bool, False,
2629
"Prevents raising an error if no core were found after CoreSight discovery."),
2730
OptionInfo('auto_unlock', bool, True,

pyocd/coresight/discovery.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,7 @@ def _find_aps(self):
127127
invalid_count = 0
128128
elif not self.session.options.get('scan_all_aps'):
129129
invalid_count += 1
130-
if invalid_count == 2:
130+
if invalid_count == self.session.options.get('adi.v5.max_invalid_ap_count'):
131131
break
132132
except exceptions.Error as e:
133133
LOG.error("Exception while probing AP#%d: %s", apsel, e,

0 commit comments

Comments
 (0)