Skip to content

Commit f388f8c

Browse files
committed
rtos: Add hint for zephyr’s Thread Info configuration
This should allow for easier discoverability of that parameter.
1 parent 456cbf8 commit f388f8c

File tree

2 files changed

+9
-4
lines changed

2 files changed

+9
-4
lines changed

pyocd/rtos/provider.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -53,14 +53,15 @@ def __init__(self, target):
5353
self._last_run_token = -1
5454
self._read_from_target = False
5555

56-
def _lookup_symbols(self, symbolList, symbolProvider):
56+
def _lookup_symbols(self, symbolList, symbolProvider, allowPartial = False):
5757
syms = {}
5858
for name in symbolList:
5959
addr = symbolProvider.get_symbol_value(name)
6060
LOG.debug("Value for symbol %s = %s", name, hex(addr) if addr is not None else "<none>")
61-
if addr is None:
61+
if addr is not None:
62+
syms[name] = addr
63+
elif not allowPartial:
6264
return None
63-
syms[name] = addr
6465
return syms
6566

6667
def init(self, symbolProvider):

pyocd/rtos/zephyr.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -274,9 +274,13 @@ def __init__(self, target):
274274

275275
def init(self, symbolProvider):
276276
# Lookup required symbols.
277-
self._symbols = self._lookup_symbols(self.ZEPHYR_SYMBOLS, symbolProvider)
277+
self._symbols = self._lookup_symbols(self.ZEPHYR_SYMBOLS, symbolProvider, True)
278278
if self._symbols is None:
279279
return False
280+
if len(self._symbols) != len(self.ZEPHYR_SYMBOLS):
281+
LOG.warning("Zephyr kernel detected. Build your Zephyr application with `CONFIG_DEBUG_THREAD_INFO=y` to " +
282+
"enable thread awareness.")
283+
return False
280284

281285
self._update()
282286
self._target.session.subscribe(self.event_handler, Target.Event.POST_FLASH_PROGRAM)

0 commit comments

Comments
 (0)