Skip to content

Commit 7cb39f6

Browse files
committed
Add support for XPLAINED PRO SAML21 board
1 parent 3c81a02 commit 7cb39f6

File tree

5 files changed

+29
-4
lines changed

5 files changed

+29
-4
lines changed

mbed_lstools/__init__.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,3 +36,4 @@
3636

3737
from .main import mbedls_main
3838
from .main import create
39+

mbed_lstools/darwin.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
2828
DEBUG = logging.DEBUG
2929
del logging
3030

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

3333
def _find_TTY(obj):
3434
''' Find the first tty (AKA IODialinDevice) that we can find in the

mbed_lstools/lstools_base.py

Lines changed: 23 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,8 @@ class MbedLsToolsBase(object):
7272
VENDOR_ID_DEVICE_TYPE_MAP = {
7373
'0483': 'stlink',
7474
'0d28': 'daplink',
75-
'1366': 'jlink'
75+
'1366': 'jlink',
76+
'03eb': 'atmel'
7677
}
7778

7879
def __init__(self, list_unmounted=False, **kwargs):
@@ -226,7 +227,8 @@ def _update_device_from_fs(self, device, read_details_txt):
226227
{
227228
'daplink': self._update_device_details_daplink_compatible,
228229
'stlink': self._update_device_details_daplink_compatible,
229-
'jlink': self._update_device_details_jlink
230+
'jlink': self._update_device_details_jlink,
231+
'atmel': self._update_device_details_atmel
230232
}[device['device_type'] or 'daplink'](device, read_details_txt)
231233
except (OSError, IOError) as e:
232234
logger.warning(
@@ -330,6 +332,25 @@ def _update_device_from_htm(self, device):
330332
device['target_id'] = device['target_id_usb_id']
331333
device['target_id_mbed_htm'] = htm_target_id
332334

335+
def _update_device_details_atmel(self, device, _):
336+
""" Updates the Atmel device information based on files from its 'mount_point'
337+
@param device Dictionary containing device information
338+
@param read_details_txt A boolean controlling the presense of the
339+
output dict attributes read from other files present on the 'mount_point'
340+
"""
341+
342+
# Atmel uses a system similar to DAPLink, but there's no details.txt with a target ID
343+
# to identify device we can use the serial, which is ATMLXXXXYYYYYYY
344+
# where XXXX is the board identifier.
345+
# This can be verified by looking at readme.htm, which also uses the board ID to redirect to platform page
346+
347+
device['target_id'] = device['target_id_usb_id'][4:8]
348+
platform_data = self.plat_db.get(device['target_id'],
349+
device_type='atmel',
350+
verbose_data=True)
351+
352+
device.update(platform_data or {"platform_name": None})
353+
333354
def mock_manufacture_id(self, mid, platform_name, oper='+'):
334355
"""! Replace (or add if manufacture id doesn't exist) entry in self.manufacture_ids
335356
@param oper '+' add new mock / override existing entry

mbed_lstools/platform_database.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -324,6 +324,9 @@
324324
u'platform_name': u'KL43Z',
325325
u'jlink_device_name': u'MKL43Z256xxx4'
326326
}
327+
},
328+
u'atmel': {
329+
u'2241': 'SAML21J18A'
327330
}
328331
}
329332

mbed_lstools/windows.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@
3838

3939

4040
MAX_COMPOSITE_DEVICE_SUBDEVICES = 5
41-
MBED_STORAGE_DEVICE_VENDOR_STRINGS = ['ven_mbed', 'ven_segger', 'ven_arm_v2m', 'ven_nxp']
41+
MBED_STORAGE_DEVICE_VENDOR_STRINGS = ['ven_mbed', 'ven_segger', 'ven_arm_v2m', 'ven_nxp', 'ven_atmel']
4242

4343

4444
def _get_values_with_numeric_keys(reg_key):

0 commit comments

Comments
 (0)