@@ -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
0 commit comments