Lines Matching full:self
15 def __init__(self, cfg, tool, dev_id=None, tool_opt=[], erase=False, reset=True): argument
17 self.bin_ = cfg.bin_file
19 self.tool = tool
20 self.dev_id = dev_id
21 self.erase = bool(erase)
22 self.reset = bool(reset)
24 self.tool_opt = []
26 self.tool_opt += opts
57 def needs_product_header(self): argument
62 is_mcuboot = self.build_conf.getboolean('CONFIG_MCUBOOT')
63 uses_code_partition = self.build_conf.getboolean('CONFIG_USE_DT_CODE_PARTITION')
67 def get_options(self): argument
69 if self.dev_id is not None:
70 device_args = ['-j', f'{self.dev_id}']
71 return device_args + self.tool_opt
73 def program_bin(self): argument
74 options = self.get_options()
76 if self.erase:
77 self.logger.info("Erasing flash...")
78 self.check_call([self.tool] + options + ["erase_flash"])
80 self.logger.info(f"Flashing {self.bin_}...")
81 if self.needs_product_header():
84 self.check_call([self.tool] + options + ["image_flash", self.bin_])
86 load_offset = self.build_conf['CONFIG_FLASH_LOAD_OFFSET']
87 … self.check_call([self.tool] + options + ["write_flash", f'0x{load_offset:x}', self.bin_])
89 def reset_device(self): argument
90 self.logger.info("Resetting...")
91 options = self.get_options()
92 self.check_call([self.tool] + options + ["go"])
94 def do_run(self, command, **kwargs): argument
95 self.require(self.tool)
96 self.ensure_output('bin')
97 self.program_bin()
98 if self.reset:
99 self.reset_device()