boot_serial: Allow using a buffer larger than 512 bytes
There are 3 levels of buffers and only the first one seems to be
configurable, this fixes that issue.
Signed-off-by: Jamie McCrae <jamie.mccrae@nordicsemi.no>
diff --git a/boot/zephyr/Kconfig.serial_recovery b/boot/zephyr/Kconfig.serial_recovery
index e254ede..225c430 100644
--- a/boot/zephyr/Kconfig.serial_recovery
+++ b/boot/zephyr/Kconfig.serial_recovery
@@ -52,10 +52,16 @@
selection is done.
config BOOT_MAX_LINE_INPUT_LEN
- int "Maximum command line length"
+ int "Maximum input line length"
default 512
help
- Maximum length of commands transported over the serial port.
+ Maximum length of input serial port buffer.
+
+config BOOT_SERIAL_MAX_RECEIVE_SIZE
+ int "Maximum command line length"
+ default 1024
+ help
+ Maximum length of received commands via the serial port.
config BOOT_SERIAL_DETECT_PORT
string "GPIO device to trigger serial recovery mode (DEPRECATED)"
diff --git a/boot/zephyr/include/mcuboot_config/mcuboot_config.h b/boot/zephyr/include/mcuboot_config/mcuboot_config.h
index 4dc105f..fbdcddd 100644
--- a/boot/zephyr/include/mcuboot_config/mcuboot_config.h
+++ b/boot/zephyr/include/mcuboot_config/mcuboot_config.h
@@ -241,6 +241,10 @@
#define MCUBOOT_MAX_IMG_SECTORS 128
#endif
+#ifdef CONFIG_BOOT_SERIAL_MAX_RECEIVE_SIZE
+#define MCUBOOT_SERIAL_MAX_RECEIVE_SIZE CONFIG_BOOT_SERIAL_MAX_RECEIVE_SIZE
+#endif
+
/* Support 32-byte aligned flash sizes */
#if DT_HAS_CHOSEN(zephyr_flash)
#if DT_PROP_OR(DT_CHOSEN(zephyr_flash), write_block_size, 0) > 8