@@ -212,6 +212,9 @@ class SWDHelper(util.DisableNewAttr):
212212
213213 Be sure to consult the ARM Debug Interface specification
214214 that applies to your specific target (e.g. IHI 0031, IHI 0074...).
215+
216+ Some of the methods here are specific to the RP2350. Adapt as needed for
217+ other targets!
215218 '''
216219 _name = 'SWD helper functions'
217220
@@ -380,7 +383,7 @@ def set_dbgkey(self, key, trigger_bit=None, trigger_nibble=0, check_match=True):
380383 PEN .extend (nextpacket [2 ])
381384 REN .extend (nextpacket [3 ])
382385
383- self .bb .sendpacket ([CMD , HIZ , PEN , REN ], trigger_en = False , clear_matched = False )
386+ self .bb .sendpacket ([CMD , HIZ , PEN , REN ], trigger_en = False )
384387 if check_match : assert self .bb .matched , 'Problem setting DBGKEY.RESET'
385388
386389 # Husky SWD BB limits us to sending one nibble of the key at a time:
@@ -409,7 +412,7 @@ def set_dbgkey(self, key, trigger_bit=None, trigger_nibble=0, check_match=True):
409412 else :
410413 trigger_en = False
411414
412- self .bb .sendpacket ([CMD , HIZ , PEN , REN ], trigger_bit = trigger_bit , trigger_en = trigger_en , clear_matched = False )
415+ self .bb .sendpacket ([CMD , HIZ , PEN , REN ], trigger_bit = trigger_bit , trigger_en = trigger_en )
413416 if check_match : assert self .bb .matched , 'Problem setting DBGKEY byte %d' % b
414417
415418
@@ -591,7 +594,6 @@ def __init__(self, oaiface : OAI.OpenADCInterface):
591594 super ().__init__ ()
592595 self .oa = oaiface
593596 self ._trigger_en = 0
594- self ._clear_matched = 0
595597 self ._continuous_clk = 0
596598 self ._inactive_data = 0
597599 self ._inactive_state = 'high_z'
@@ -754,8 +756,7 @@ def go(self, really_go=True):
754756 else :
755757 inactive_state = 0
756758
757- raw [0 ] = (self .trigger_en << 7 ) + \
758- (self .clear_matched << 6 )
759+ raw [0 ] = (self .trigger_en << 7 )
759760 raw [1 ] = (self .continuous_clk << 7 ) + \
760761 (self .inactive_data << 6 ) + \
761762 (inactive_state << 5 ) + \
@@ -769,15 +770,14 @@ def go(self, really_go=True):
769770 self .oa .sendMessage (CODE_WRITE , "BB_TRIG_CTRL_STAT" , raw )
770771
771772
772- def sendpacket (self , packet , trigger_en = True , trigger_bit = None , clear_matched = True , timeout = 1 ):
773+ def sendpacket (self , packet , trigger_en = True , trigger_bit = None , timeout = 1 ):
773774 """ Sends a generic "packet"; waits for it to be sent.
774775
775776 Args:
776777 packet (list): list of lists defining the packet, as returned by e.g.
777778 :class:`OneWireHelper.get_generic_write_read`, or :class:`SWDHelper.getpacket`.
778779 trigger_en (bool): whether a trigger *can be* issued by the bit-banging module. Affected by :class:`BitBanger.trigger_when_matched`
779780 trigger_bit (int): timeslot on which to issue the trigger; if None, the packet's last timeslot is used.
780- clear_matched (bool): setting for :class:`BitBanger.clear_matched`
781781 timeout (int): if the packet is not done being sent after this many seconds, times out.
782782
783783 """
@@ -795,7 +795,6 @@ def sendpacket(self, packet, trigger_en=True, trigger_bit=None, clear_matched=Tr
795795 self .num_bits = len (CMD )
796796
797797 self .trigger_en = trigger_en
798- self .clear_matched = clear_matched
799798 TRG = [0 ]* len (CMD )
800799 if trigger_bit is None :
801800 TRG [- 1 ] = 1
@@ -851,17 +850,6 @@ def trigger_en(self, val):
851850 raise ValueError ()
852851 self ._trigger_en = val
853852
854- @property
855- def clear_matched (self ):
856- """ TODO: not sure this is needed?
857- """
858- return self ._clear_matched
859- @clear_matched .setter
860- def clear_matched (self , val ):
861- if val not in [0 , 1 ]:
862- raise ValueError ()
863- self ._clear_matched = val
864-
865853 @property
866854 def continuous_clk (self ):
867855 """ Specify whether the clock should run continuously.
0 commit comments