Lines Matching refs:self
13 def __init__(self, cfg, tool, sn, erase=False, reset=True): 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)
20 self.reset = bool(reset)
45 def needs_product_header(self): argument
50 is_mcuboot = self.build_conf.getboolean('CONFIG_MCUBOOT')
51 uses_code_partition = self.build_conf.getboolean('CONFIG_USE_DT_CODE_PARTITION')
55 def program_bin(self): argument
57 if self.erase:
58 self.logger.info("Erasing flash...")
59 self.check_call([self.tool] + self.sn_arg + ["erase_flash"])
61 self.logger.info(f"Flashing {self.bin_}...")
62 if self.needs_product_header():
65 self.check_call([self.tool] + self.sn_arg + ["image_flash", self.bin_])
67 load_offset = self.build_conf['CONFIG_FLASH_LOAD_OFFSET']
68 … self.check_call([self.tool] + self.sn_arg + ["write_flash", f'0x{load_offset:x}', self.bin_])
70 def reset_device(self): argument
71 self.logger.info("Resetting...")
72 self.check_call([self.tool] + self.sn_arg + ["go"])
74 def do_run(self, command, **kwargs): argument
75 self.require(self.tool)
76 self.ensure_output('bin')
77 self.program_bin()
78 if self.reset:
79 self.reset_device()