#NEWLINE# def setHardwareBreakpoint( self , addr ) : #NEWLINE# #INDENT# '\n        set a hardware breakpoint at a specific location in flash\n        ' #NEWLINE# if ( self . fpb_enabled is False ) : #NEWLINE# #INDENT# self . enableFPB ( ) #NEWLINE# #UNINDENT# if ( addr >= 536870912 ) : #NEWLINE# #INDENT# logging . error ( 'Breakpoint out of range 0x%X' , addr ) #NEWLINE# return False #NEWLINE# #UNINDENT# if ( self . availableBreakpoint ( ) == 0 ) : #NEWLINE# #INDENT# logging . error ( 'No more available breakpoint!!, dropped bp at 0x%X' , addr ) #NEWLINE# return False #NEWLINE# #UNINDENT# for bp in self . hw_breakpoints : #NEWLINE# #INDENT# if ( not bp . enabled ) : #NEWLINE# #INDENT# bp . enabled = True #NEWLINE# bp_match = ( 1 << 30 ) #NEWLINE# if ( addr & 2 ) : #NEWLINE# #INDENT# bp_match = ( 2 << 30 ) #NEWLINE# #UNINDENT# self . writeMemory ( bp . comp_register_addr , ( ( ( addr & 536870908 ) | bp_match ) | 1 ) ) #NEWLINE# bp . addr = addr #NEWLINE# self . num_hw_breakpoint_used += 1 #NEWLINE# self . breakpoints [ addr ] = bp #NEWLINE# return True #NEWLINE# #UNINDENT# #UNINDENT# return False