@@ -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 ):
@@ -230,6 +231,9 @@ def _update_device_from_fs(self, device, read_details_txt):
230231 if device .get ('device_type' ) == 'jlink' :
231232 self ._update_device_details_jlink (device , read_details_txt )
232233
234+ if device .get ('device_type' ) == 'atmel' :
235+ self ._update_device_details_atmel (device , read_details_txt )
236+
233237 except (OSError , IOError ) as e :
234238 logger .warning (
235239 'Marking device with mount point "%s" as unmounted due to the '
@@ -332,6 +336,25 @@ def _update_device_from_htm(self, device):
332336 device ['target_id' ] = device ['target_id_usb_id' ]
333337 device ['target_id_mbed_htm' ] = htm_target_id
334338
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+
335358 def mock_manufacture_id (self , mid , platform_name , oper = '+' ):
336359 """! Replace (or add if manufacture id doesn't exist) entry in self.manufacture_ids
337360 @param oper '+' add new mock / override existing entry
0 commit comments