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 @@ -59,10 +59,16 @@ config BOOT_SERIAL_UNALIGNED_BUFFER_SIZE
5959 requirements. Set to 0 to disable.
6060
6161config BOOT_MAX_LINE_INPUT_LEN
62- int "Maximum command line length"
62+ int "Maximum input line length"
6363 default 512
6464 help
65- Maximum length of commands transported over the serial port.
65+ Maximum length of input serial port buffer.
66+
67+ config BOOT_SERIAL_MAX_RECEIVE_SIZE
68+ int "Maximum command line length"
69+ default 1024
70+ help
71+ Maximum length of received commands via the serial port.
6672
6773config BOOT_SERIAL_DETECT_PORT
6874 string "GPIO device to trigger serial recovery mode (DEPRECATED)"
Original file line number Diff line number Diff line change 244244#define MCUBOOT_SERIAL_UNALIGNED_BUFFER_SIZE CONFIG_BOOT_SERIAL_UNALIGNED_BUFFER_SIZE
245245#endif
246246
247+ #ifdef CONFIG_BOOT_SERIAL_MAX_RECEIVE_SIZE
248+ #define MCUBOOT_SERIAL_MAX_RECEIVE_SIZE CONFIG_BOOT_SERIAL_MAX_RECEIVE_SIZE
249+ #endif
250+
247251/* Support 32-byte aligned flash sizes */
248252#if DT_HAS_CHOSEN (zephyr_flash )
249253 #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