File tree Expand file tree Collapse file tree 3 files changed +18
-5
lines changed Expand file tree Collapse file tree 3 files changed +18
-5
lines changed Original file line number Diff line number Diff line change 7878
7979BOOT_LOG_MODULE_DECLARE (mcuboot );
8080
81- #define BOOT_SERIAL_INPUT_MAX 512
81+ #ifndef MCUBOOT_SERIAL_MAX_RECEIVE_SIZE
82+ #define MCUBOOT_SERIAL_MAX_RECEIVE_SIZE 512
83+ #endif
84+
8285#define BOOT_SERIAL_OUT_MAX (128 * BOOT_IMAGE_NUMBER)
8386
8487#ifdef __ZEPHYR__
@@ -107,8 +110,8 @@ BOOT_LOG_MODULE_DECLARE(mcuboot);
107110#define IMAGES_ITER (x )
108111#endif
109112
110- static char in_buf [BOOT_SERIAL_INPUT_MAX + 1 ];
111- static char dec_buf [BOOT_SERIAL_INPUT_MAX + 1 ];
113+ static char in_buf [MCUBOOT_SERIAL_MAX_RECEIVE_SIZE + 1 ];
114+ static char dec_buf [MCUBOOT_SERIAL_MAX_RECEIVE_SIZE + 1 ];
112115const struct boot_uart_funcs * boot_uf ;
113116static struct nmgr_hdr * bs_hdr ;
114117static bool bs_entry ;
Original file line number Diff line number Diff line change @@ -52,10 +52,16 @@ config MCUBOOT_SERIAL_DIRECT_IMAGE_UPLOAD
5252 selection is done.
5353
5454config BOOT_MAX_LINE_INPUT_LEN
55- int "Maximum command line length"
55+ int "Maximum input line length"
5656 default 512
5757 help
58- Maximum length of commands transported over the serial port.
58+ Maximum length of input serial port buffer.
59+
60+ config BOOT_SERIAL_MAX_RECEIVE_SIZE
61+ int "Maximum command line length"
62+ default 1024
63+ help
64+ Maximum length of received commands via the serial port.
5965
6066config BOOT_SERIAL_DETECT_PORT
6167 string "GPIO device to trigger serial recovery mode (DEPRECATED)"
Original file line number Diff line number Diff line change 241241#define MCUBOOT_MAX_IMG_SECTORS 128
242242#endif
243243
244+ #ifdef CONFIG_BOOT_SERIAL_MAX_RECEIVE_SIZE
245+ #define MCUBOOT_SERIAL_MAX_RECEIVE_SIZE CONFIG_BOOT_SERIAL_MAX_RECEIVE_SIZE
246+ #endif
247+
244248/* Support 32-byte aligned flash sizes */
245249#if DT_HAS_CHOSEN (zephyr_flash )
246250 #if DT_PROP_OR (DT_CHOSEN (zephyr_flash ), write_block_size , 0 ) > 8
You can’t perform that action at this time.
0 commit comments