From aba16f70370a9af0f6bc09c7c9d9c8da11f09c28 Mon Sep 17 00:00:00 2001 From: Larry Snizek Date: Fri, 18 Aug 2017 14:24:54 +0100 Subject: [PATCH] Comments to describe FLASH_MAX_UPGRADE_SIZE --- module_dfu/src/flash_interface.c | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/module_dfu/src/flash_interface.c b/module_dfu/src/flash_interface.c index 9cb823a3..3ed695fd 100755 --- a/module_dfu/src/flash_interface.c +++ b/module_dfu/src/flash_interface.c @@ -4,8 +4,18 @@ #include #include +/* Defines flash area to erase on first DFU download request received + * + * Flash library will round it up to the nearest sector, e.g. 4KB + * + * XS2 internal flash IS25LQ016B takes 70ms to erase one sector + * 128KB will take over 2 seconds, for instance + * + * Your host software might implement a 5sec timeout as per USB spec 9.2.6.1, + * and 5 seconds is just over 300KB + */ #ifndef FLASH_MAX_UPGRADE_SIZE -#define FLASH_MAX_UPGRADE_SIZE 128 * 1024 // 128K default +#define FLASH_MAX_UPGRADE_SIZE (128 * 1024) #endif #define FLASH_ERROR() do {} while(0)