From e45bb43b84e7142c731ca5f7704f8b8660d1d522 Mon Sep 17 00:00:00 2001 From: Ole Odendahl Date: Sun, 23 Oct 2022 18:51:56 +0200 Subject: [PATCH] Clarified mac address code so that it will be clearer what it contains (static device mac). --- flashing/pyocd/flash_firmware.py | 4 ++-- flashing/pyocd/mac_address_reader.py | 7 ++++++- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/flashing/pyocd/flash_firmware.py b/flashing/pyocd/flash_firmware.py index 78b968a..8a2a918 100644 --- a/flashing/pyocd/flash_firmware.py +++ b/flashing/pyocd/flash_firmware.py @@ -38,5 +38,5 @@ with ConnectHelper.session_with_chosen_probe() as session: target.resume() mac_converter = MacAddressReader(target) - mac_address = mac_converter.get_mac_address() - print(f'Device MAC Address: {mac_address}') + mac_address = mac_converter.get_static_mac_address() + print(f'Static manufacturer MAC address: {mac_address}') diff --git a/flashing/pyocd/mac_address_reader.py b/flashing/pyocd/mac_address_reader.py index a52c55a..5e370cd 100644 --- a/flashing/pyocd/mac_address_reader.py +++ b/flashing/pyocd/mac_address_reader.py @@ -8,7 +8,12 @@ class MacAddressReader(): def __init__(self, target: Target) -> None: self.target = target - def get_mac_address(self) -> str: + def get_static_mac_address(self) -> str: + ''' + Reads the static mac address assigned by the manufacturer. + + This chip property is readonly and may be different from the mac address in the application code. + ''' memory_blocks = self._get_blocks() return self._convert_blocks(memory_blocks)