Lines Matching full:self
13 def __init__(self, cfg, tool, sn, erase=False): argument
15 self.bin_ = cfg.bin_file
17 self.tool = tool
18 self.sn_arg = ['-j', f'{sn}'] if sn is not None else []
19 self.erase = bool(erase)
42 def needs_product_header(self): argument
47 is_mcuboot = self.build_conf.getboolean('CONFIG_MCUBOOT')
48 uses_code_partition = self.build_conf.getboolean('CONFIG_USE_DT_CODE_PARTITION')
52 def program_bin(self): argument
54 if self.erase:
55 self.logger.info("Erasing flash...")
56 self.check_call([self.tool] + self.sn_arg + ["erase_flash"])
58 self.logger.info(f"Flashing {self.bin_}...")
59 if self.needs_product_header():
62 self.check_call([self.tool] + self.sn_arg + ["image_flash", self.bin_])
64 load_offset = self.build_conf['CONFIG_FLASH_LOAD_OFFSET']
65 … self.check_call([self.tool] + self.sn_arg + ["write_flash", f'0x{load_offset:x}', self.bin_])
67 def reset(self): argument
68 self.logger.info("Resetting...")
69 self.check_call([self.tool] + self.sn_arg + ["go"])
71 def do_run(self, command, **kwargs): argument
72 self.require(self.tool)
73 self.ensure_output('bin')
74 self.program_bin()
75 self.reset()