Skip to content

Commit

Permalink
coresight: target: allow algos to run on secondary cores
Browse files Browse the repository at this point in the history
Signed-off-by: Maximilian Deubel <maximilian.deubel@nordicsemi.no>
  • Loading branch information
maxd-nordic committed Jan 1, 2024
1 parent 5ab5c32 commit 0d8e86e
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
1 change: 1 addition & 0 deletions pyocd/core/memory_map.py
Original file line number Diff line number Diff line change
Expand Up @@ -474,6 +474,7 @@ class FlashRegion(MemoryRegion):
'erased_byte_value': 0xff,
'access': 'rx', # By default flash is not writable.
'are_erased_sectors_readable': True,
'core_index': 0, # Core to be used to access this region
})

_algo: Optional[Dict[str, Any]]
Expand Down
4 changes: 2 additions & 2 deletions pyocd/coresight/coresight_target.py
Original file line number Diff line number Diff line change
Expand Up @@ -286,12 +286,12 @@ def create_flash(self) -> None:
argspec = getfullargspec(klass.__init__)
if 'flash_algo' in argspec.args:
if region.algo is not None:
obj = klass(self, region.algo)
obj = klass(self._cores[region.core_index], region.algo)
else:
LOG.warning("flash region '%s' has no flash algo" % region.name)
continue
else:
obj = klass(self) # type:ignore
obj = klass(self._cores[region.core_index]) # type:ignore

# Set the region in the flash instance.
obj.region = region
Expand Down

0 comments on commit 0d8e86e

Please sign in to comment.