From 0b0f42c6dfd77197ae6fdd03ec0dd60223516241 Mon Sep 17 00:00:00 2001 From: Morten Engelhardt Olsen Date: Wed, 20 Aug 2025 12:35:32 -0700 Subject: [PATCH 1/3] Fixup markdown warnings --- CONTRIBUTING.md | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 0a20f420c..4b68ba49d 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -1,12 +1,10 @@ -Contributing -============ +# Contributing We appreciate your contributions! Because this is an open source project, we want to keep it as easy as possible to contribute changes. However, we need contributors to follow a few guidelines. By contributing to pyOCD you agree to the [Code of Conduct](CODE_OF_CONDUCT.md). - ## Coding style Contributed source code must follow [PEP8](https://www.python.org/dev/peps/pep-0008/) style @@ -17,13 +15,13 @@ annotations, static type checking isn't actual performed by CI. Also, it is perf the errant module. Other formatting requirements: + - 4 space indents, no tabs are allowed. - No trailing whitespace. - All source files must end with a newline (an empty line at the end). - Lines should generally not be longer than 120 characters, though this is not a hard rule. Overall readability is more important. - ## Process Before you submit your changes, please ensure that: @@ -43,7 +41,6 @@ The [developers' guide](docs/developers_guide.md) describes how to create your d environment. The [automated tests guide](docs/automated_tests.md) provides information about the available types of tests and describes how to run the tests. - ## License By creating a pull request on GitHub asking to merge your content into pyOCD, you agree to the [Developer Certificate of @@ -63,5 +60,3 @@ case must be considered individually. If you are the owner of the source code, t relicense to Apache 2.0. The most important thing is that the license is compatible with Apache 2.0. Examples are MIT, the BSD licenses, and similar. GPL-licensed code is expressly disallowed to be contributed, as the GPL is not compatible with Apache 2.0 (or any of the Apache-compatible licenses). - - From 37683afed5107be28810ee5d8376fdd3e8216c17 Mon Sep 17 00:00:00 2001 From: Morten Engelhardt Olsen Date: Wed, 20 Aug 2025 12:35:59 -0700 Subject: [PATCH 2/3] If the lookup for pname from the pdsc descriptor of a core on an AP fails, just don't set it For devices that have 'hidden' cores, there will not be a correctly describing the AP entry. So, if we cannot find the processor, just let it go nameless. This fixes #1800, #1678, #1637 --- pyocd/target/pack/pack_target.py | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/pyocd/target/pack/pack_target.py b/pyocd/target/pack/pack_target.py index 0ed42303e..c9f162bcd 100644 --- a/pyocd/target/pack/pack_target.py +++ b/pyocd/target/pack/pack_target.py @@ -1,6 +1,7 @@ # pyOCD debugger # Copyright (c) 2017-2020 Arm Limited # Copyright (c) 2021-2022 Chris Reed +# Copyright (c) 2025 Morten Engelhardt Olsen # SPDX-License-Identifier: Apache-2.0 # # Licensed under the Apache License, Version 2.0 (the "License"); @@ -510,8 +511,11 @@ def is_reset_sequence_enabled(name: str) -> bool: @staticmethod def _pack_target_add_core(_self, core: CoreTarget) -> None: """@brief Override to set node name of added core to its pname.""" - pname = _self._pack_device.processors_ap_map[cast(CortexM, core).ap.address].name - core.node_name = pname + try: + pname = _self._pack_device.processors_ap_map[cast(CortexM, core).ap.address].name + core.node_name = pname + except KeyError: + LOG.info("No pname found for core #%d", core.core_number) CoreSightTarget.add_core(_self, core) @staticmethod @@ -646,5 +650,3 @@ def collect_target_type(dev: CmsisPackDevice) -> None: (target_name.lower() == dev.part_number.lower()) for dev in ManagedPacks.get_installed_targets() ) - - From 876290a81264a6d96a1c369ea41d4d8db68e5037 Mon Sep 17 00:00:00 2001 From: Morten Engelhardt Olsen Date: Wed, 20 Aug 2025 12:50:34 -0700 Subject: [PATCH 3/3] Instead of not setting a node name if the pname lookup fails, use the name of the architecture of the core --- pyocd/target/pack/pack_target.py | 1 + 1 file changed, 1 insertion(+) diff --git a/pyocd/target/pack/pack_target.py b/pyocd/target/pack/pack_target.py index c9f162bcd..e7c49d9c1 100644 --- a/pyocd/target/pack/pack_target.py +++ b/pyocd/target/pack/pack_target.py @@ -516,6 +516,7 @@ def _pack_target_add_core(_self, core: CoreTarget) -> None: core.node_name = pname except KeyError: LOG.info("No pname found for core #%d", core.core_number) + core.node_name = cast(CortexM, core).architecture.name CoreSightTarget.add_core(_self, core) @staticmethod