#NEWLINE# def setupFPB( self ) : #NEWLINE# #INDENT# '\n        Reads the number of hardware breakpoints available on the core\n        and disable the FPB (Flash Patch and Breakpoint Unit)\n        which will be enabled when a first breakpoint will be set\n        ' #NEWLINE# fpcr = self . readMemory ( CortexM . FP_CTRL ) #NEWLINE# self . nb_code = ( ( ( fpcr >> 8 ) & 112 ) | ( ( fpcr >> 4 ) & 15 ) ) #NEWLINE# self . nb_lit = ( ( fpcr >> 7 ) & 15 ) #NEWLINE# logging . info ( '%d hardware breakpoints, %d literal comparators' , self . nb_code , self . nb_lit ) #NEWLINE# for i in range ( self . nb_code ) : #NEWLINE# #INDENT# self . hw_breakpoints . append ( Breakpoint ( ( CortexM . FP_COMP0 + ( 4 * i ) ) ) ) #NEWLINE# #UNINDENT# self . disableFPB ( ) #NEWLINE# for bp in self . hw_breakpoints : #NEWLINE# #INDENT# self . writeMemory ( bp . comp_register_addr , 0 )