Skip to content

Instantly share code, notes, and snippets.

@Josua-SR
Last active August 10, 2018 18:37
Show Gist options
  • Save Josua-SR/d2eb6ddc7becd3ef6f0abd52d0c8e2fc to your computer and use it in GitHub Desktop.
Save Josua-SR/d2eb6ddc7becd3ef6f0abd52d0c8e2fc to your computer and use it in GitHub Desktop.
reduce default buffer size for DFU
From cf8d6bb88aba508b8236a8b2549bff30d7184f49 Mon Sep 17 00:00:00 2001
From: Josua Mayer <josua@solid-run.com>
Date: Fri, 10 Aug 2018 20:36:39 +0200
Subject: [PATCH] dfu: set default buffer size to 1MB
This is a workaround for the memory allocation error that occurs with the
default size of 8MB.
Signed-off-by: Josua Mayer <josua@solid-run.com>
---
include/dfu.h | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/include/dfu.h b/include/dfu.h
index 7e322d9d27..71792db05a 100644
--- a/include/dfu.h
+++ b/include/dfu.h
@@ -83,7 +83,7 @@ struct sf_internal_data {
#define DFU_NAME_SIZE 32
#define DFU_CMD_BUF_SIZE 128
#ifndef CONFIG_SYS_DFU_DATA_BUF_SIZE
-#define CONFIG_SYS_DFU_DATA_BUF_SIZE (1024*1024*8) /* 8 MiB */
+#define CONFIG_SYS_DFU_DATA_BUF_SIZE (1024*1024*1) /* 1 MiB */
#endif
#ifndef CONFIG_SYS_DFU_MAX_FILE_SIZE
#define CONFIG_SYS_DFU_MAX_FILE_SIZE CONFIG_SYS_DFU_DATA_BUF_SIZE
--
2.18.0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment