diff --git a/mtk b/mtk index f4cdce4..445106f 100755 --- a/mtk +++ b/mtk @@ -826,6 +826,26 @@ if __name__ == '__main__': da_dump.add_argument('--noreconnect', action="store_true", help='Disable reconnect') da_rpmb.add_argument('--noreconnect', action="store_true", help='Disable reconnect') + parser_script.add_argument('--uartloglevel', help='Set uart log level (0=Trace, 2=Normal)') + parser_printgpt.add_argument('--uartloglevel', help='Set uart log level (0=Trace, 2=Normal)') + parser_footer.add_argument('--uartloglevel', help='Set uart log level (0=Trace, 2=Normal)') + parser_e.add_argument('--uartloglevel', help='Set uart log level (0=Trace, 2=Normal)') + parser_es.add_argument('--uartloglevel', help='Set uart log level (0=Trace, 2=Normal)') + parser_wl.add_argument('--uartloglevel', help='Set uart log level (0=Trace, 2=Normal)') + parser_wf.add_argument('--uartloglevel', help='Set uart log level (0=Trace, 2=Normal)') + parser_w.add_argument('--uartloglevel', help='Set uart log level (0=Trace, 2=Normal)') + parser_rs.add_argument('--uartloglevel', help='Set uart log level (0=Trace, 2=Normal)') + parser_rf.add_argument('--uartloglevel', help='Set uart log level (0=Trace, 2=Normal)') + parser_rl.add_argument('--uartloglevel', help='Set uart log level (0=Trace, 2=Normal)') + parser_gpt.add_argument('--uartloglevel', help='Set uart log level (0=Trace, 2=Normal)') + parser_r.add_argument('--uartloglevel', help='Set uart log level (0=Trace, 2=Normal)') + da_keys.add_argument('--uartloglevel', help='Set uart log level (0=Trace, 2=Normal)') + da_unlock.add_argument('--uartloglevel', help='Set uart log level (0=Trace, 2=Normal)') + da_peek.add_argument('--uartloglevel', help='Set uart log level (0=Trace, 2=Normal)') + da_poke.add_argument('--uartloglevel', help='Set uart log level (0=Trace, 2=Normal)') + da_dump.add_argument('--uartloglevel', help='Set uart log level (0=Trace, 2=Normal)') + da_rpmb.add_argument('--uartloglevel', help='Set uart log level (0=Trace, 2=Normal)') + args = parser.parse_args() cmd = args.cmd if cmd not in cmds: diff --git a/mtkclient/Library/daconfig.py b/mtkclient/Library/daconfig.py index c3a39aa..2405ac3 100755 --- a/mtkclient/Library/daconfig.py +++ b/mtkclient/Library/daconfig.py @@ -124,6 +124,7 @@ class DAconfig(metaclass=LogBase): self.boot2size = 0 self.flashtype = "emmc" self.reconnect = self.config.reconnect + self.uartloglevel = self.config.uartloglevel self.sparesize = 0 self.readsize = 0 self.pagesize = 512 diff --git a/mtkclient/Library/mtk_daxflash.py b/mtkclient/Library/mtk_daxflash.py index 132abdc..9f84704 100755 --- a/mtkclient/Library/mtk_daxflash.py +++ b/mtkclient/Library/mtk_daxflash.py @@ -1046,7 +1046,7 @@ class DAXFlash(metaclass=LogBase): def setup_env(self): if self.xsend(self.Cmd.SETUP_ENVIRONMENT): - da_log_level = 0 + da_log_level = int(self.daconfig.uartloglevel) log_channel = 1 system_os = self.FtSystemOSE.OS_LINUX ufs_provision = 0x0 diff --git a/mtkclient/Library/mtk_main.py b/mtkclient/Library/mtk_main.py index d15ecbc..bc034b5 100644 --- a/mtkclient/Library/mtk_main.py +++ b/mtkclient/Library/mtk_main.py @@ -44,6 +44,12 @@ class ArgHandler(metaclass=LogBase): config.reconnect = not args.noreconnect except AttributeError: pass + config.uartloglevel = 2 + try: + if args.uartloglevel is not None: + config.uartloglevel = args.uartloglevel + except AttributeError: + pass try: if args.payload is not None: config.payloadfile = args.payload