diff --git a/components/esp8266/Kconfig b/components/esp8266/Kconfig index f3647a45..050f6d85 100644 --- a/components/esp8266/Kconfig +++ b/components/esp8266/Kconfig @@ -143,6 +143,12 @@ config UART0_SWAP_IO help Enable this option, UART0's I/O pins are swaped: TXD <-> RTS, RTX <-> CTS. +config DISABLE_ROM_UART_PRINT + bool "Disable ROM UART print" + default n + help + "Disable main part of ROM UART print when rom bootloader process." + config MAIN_TASK_STACK_SIZE int "Main task stack size" default 3584 diff --git a/components/esptool_py/Makefile.projbuild b/components/esptool_py/Makefile.projbuild index 15d1bc92..f5ac8758 100644 --- a/components/esptool_py/Makefile.projbuild +++ b/components/esptool_py/Makefile.projbuild @@ -48,6 +48,10 @@ else ESPTOOL_ELF2IMAGE_OPTIONS := endif +ifdef CONFIG_DISABLE_ROM_UART_PRINT +ESPTOOL_ELF2IMAGE_OPTIONS := $(ESPTOOL_FLASH_OPTIONS) --rom_print 0 +endif + ESPTOOLPY_WRITE_FLASH=$(ESPTOOLPY_SERIAL) write_flash $(if $(CONFIG_ESPTOOLPY_COMPRESSED),-z,-u) $(ESPTOOL_WRITE_FLASH_OPTIONS) ESPTOOL_ALL_FLASH_ARGS += $(APP_OFFSET) $(APP_BIN) diff --git a/components/esptool_py/esptool/esptool.py b/components/esptool_py/esptool/esptool.py index 45a386f5..30d7e4da 100755 --- a/components/esptool_py/esptool/esptool.py +++ b/components/esptool_py/esptool/esptool.py @@ -1358,6 +1358,11 @@ class ESP8266ROMFirmwareImage(BaseFirmwareImage): """ Derive a default output name from the ELF name. """ return input_file + '-' + def close_rom_print(self): + """ Configurate UART0 baudrate to be max value to \"close\" ROM UART print. """ + segment = ImageSegment(0x60000014, '\x00' * 8) + self.segments.insert(0, segment) + def save(self, basename): """ Save a set of V1 images for flashing. Parameter is a base filename. """ # IROM data goes in its own plain binary file @@ -2353,6 +2358,9 @@ def elf2image(args): image.flash_size_freq = image.ROM_LOADER.FLASH_SIZES[args.flash_size] image.flash_size_freq += {'40m':0, '26m':1, '20m':2, '80m': 0xf}[args.flash_freq] + if args.version == '1' and args.rom_print == 0: + image.close_rom_print() + if args.output is None: args.output = image.default_output_name(args.input) image.save(args.output) @@ -2612,6 +2620,7 @@ def main(): parser_elf2image.add_argument('input', help='Input ELF file') parser_elf2image.add_argument('--output', '-o', help='Output filename prefix (for version 1 image), or filename (for version 2 single image)', type=str) parser_elf2image.add_argument('--version', '-e', help='Output image version', choices=['1','2','3'], default='1') + parser_elf2image.add_argument('--rom_print', type=arg_auto_int, help='Configurate UART0 baudrate to be max value to \"close\" ROM UART print', choices=[0, 1], default=1) add_spi_flash_subparsers(parser_elf2image, is_elf2image=True)