Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions mbed_lstools/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,3 +36,4 @@

from .main import mbedls_main
from .main import create

2 changes: 1 addition & 1 deletion mbed_lstools/darwin.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
DEBUG = logging.DEBUG
del logging

mbed_volume_name_match = re.compile(r'\b(mbed|SEGGER MSD)\b', re.I)
mbed_volume_name_match = re.compile(r'\b(mbed|SEGGER MSD|ATMEL EDBG Media)\b', re.I)

def _find_TTY(obj):
''' Find the first tty (AKA IODialinDevice) that we can find in the
Expand Down
25 changes: 24 additions & 1 deletion mbed_lstools/lstools_base.py
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,8 @@ class MbedLsToolsBase(object):
VENDOR_ID_DEVICE_TYPE_MAP = {
'0483': 'stlink',
'0d28': 'daplink',
'1366': 'jlink'
'1366': 'jlink',
'03eb': 'atmel'
}

def __init__(self, list_unmounted=False, **kwargs):
Expand Down Expand Up @@ -230,6 +231,9 @@ def _update_device_from_fs(self, device, read_details_txt):
if device.get('device_type') == 'jlink':
self._update_device_details_jlink(device, read_details_txt)

if device.get('device_type') == 'atmel':
self._update_device_details_atmel(device, read_details_txt)

except (OSError, IOError) as e:
logger.warning(
'Marking device with mount point "%s" as unmounted due to the '
Expand Down Expand Up @@ -332,6 +336,25 @@ def _update_device_from_htm(self, device):
device['target_id'] = device['target_id_usb_id']
device['target_id_mbed_htm'] = htm_target_id

def _update_device_details_atmel(self, device, _):
""" Updates the Atmel device information based on files from its 'mount_point'
@param device Dictionary containing device information
@param read_details_txt A boolean controlling the presense of the
output dict attributes read from other files present on the 'mount_point'
"""

# Atmel uses a system similar to DAPLink, but there's no details.txt with a target ID
# to identify device we can use the serial, which is ATMLXXXXYYYYYYY
# where XXXX is the board identifier.
# This can be verified by looking at readme.htm, which also uses the board ID to redirect to platform page

device['target_id'] = device['target_id_usb_id'][4:8]
platform_data = self.plat_db.get(device['target_id'],
device_type='atmel',
verbose_data=True)

device.update(platform_data or {"platform_name": None})

def mock_manufacture_id(self, mid, platform_name, oper='+'):
"""! Replace (or add if manufacture id doesn't exist) entry in self.manufacture_ids
@param oper '+' add new mock / override existing entry
Expand Down
3 changes: 3 additions & 0 deletions mbed_lstools/platform_database.py
Original file line number Diff line number Diff line change
Expand Up @@ -324,6 +324,9 @@
u'platform_name': u'KL43Z',
u'jlink_device_name': u'MKL43Z256xxx4'
}
},
u'atmel': {
u'2241': 'SAML21J18A'
}
}

Expand Down
2 changes: 1 addition & 1 deletion mbed_lstools/windows.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@


MAX_COMPOSITE_DEVICE_SUBDEVICES = 5
MBED_STORAGE_DEVICE_VENDOR_STRINGS = ['ven_mbed', 'ven_segger', 'ven_arm_v2m', 'ven_nxp']
MBED_STORAGE_DEVICE_VENDOR_STRINGS = ['ven_mbed', 'ven_segger', 'ven_arm_v2m', 'ven_nxp', 'ven_atmel']


def _get_values_with_numeric_keys(reg_key):
Expand Down