@@ -72,7 +72,8 @@ class MbedLsToolsBase(object):
72
72
VENDOR_ID_DEVICE_TYPE_MAP = {
73
73
'0483' : 'stlink' ,
74
74
'0d28' : 'daplink' ,
75
- '1366' : 'jlink'
75
+ '1366' : 'jlink' ,
76
+ '03eb' : 'atmel'
76
77
}
77
78
78
79
def __init__ (self , list_unmounted = False , ** kwargs ):
@@ -230,6 +231,9 @@ def _update_device_from_fs(self, device, read_details_txt):
230
231
if device .get ('device_type' ) == 'jlink' :
231
232
self ._update_device_details_jlink (device , read_details_txt )
232
233
234
+ if device .get ('device_type' ) == 'atmel' :
235
+ self ._update_device_details_atmel (device , read_details_txt )
236
+
233
237
except (OSError , IOError ) as e :
234
238
logger .warning (
235
239
'Marking device with mount point "%s" as unmounted due to the '
@@ -332,6 +336,25 @@ def _update_device_from_htm(self, device):
332
336
device ['target_id' ] = device ['target_id_usb_id' ]
333
337
device ['target_id_mbed_htm' ] = htm_target_id
334
338
339
+ def _update_device_details_atmel (self , device , _ ):
340
+ """ Updates the Atmel device information based on files from its 'mount_point'
341
+ @param device Dictionary containing device information
342
+ @param read_details_txt A boolean controlling the presense of the
343
+ output dict attributes read from other files present on the 'mount_point'
344
+ """
345
+
346
+ # Atmel uses a system similar to DAPLink, but there's no details.txt with a target ID
347
+ # to identify device we can use the serial, which is ATMLXXXXYYYYYYY
348
+ # where XXXX is the board identifier.
349
+ # This can be verified by looking at readme.htm, which also uses the board ID to redirect to platform page
350
+
351
+ device ['target_id' ] = device ['target_id_usb_id' ][4 :8 ]
352
+ platform_data = self .plat_db .get (device ['target_id' ],
353
+ device_type = 'atmel' ,
354
+ verbose_data = True )
355
+
356
+ device .update (platform_data or {"platform_name" : None })
357
+
335
358
def mock_manufacture_id (self , mid , platform_name , oper = '+' ):
336
359
"""! Replace (or add if manufacture id doesn't exist) entry in self.manufacture_ids
337
360
@param oper '+' add new mock / override existing entry
0 commit comments