code: def write_page(buf, xfer_offset):
      
  
      xfer_base = 0x08000000
  
      # Set mem write address
      set_address(xfer_base+xfer_offset)
  
      # Send DNLOAD with fw data
      __dev.ctrl_transfer(0x21, __DFU_DNLOAD, 2, __DFU_INTERFACE, buf, __TIMEOUT)
  
      # Execute last command
      if get_status() != __DFU_STATE_DFU_DOWNLOAD_BUSY:
          raise Exception("DFU: write memory failed")
  
      # Check command state
      if get_status() != __DFU_STATE_DFU_DOWNLOAD_IDLE:
          raise Exception("DFU: write memory failed")
  
      if __verbose:
          print ("Write: 0x%x " % (xfer_base + xfer_offset))
docs: Writes a single page. This routine assumes that memory has already
      been erased.