Skip to content
Permalink
Browse files

dfu: make flash_img write to flash on buffer full

flash_img subsystem writes data to flash only when the amount of data to
be written is larger than available buffer space. This commit modifies
this behavior to write data to flash as soon as the buffer is full.

Signed-off-by: Piotr Mienkowski <piotr.mienkowski@gmail.com>
  • Loading branch information...
mnkp authored and carlescufi committed Jul 19, 2019
1 parent feaf008 commit a75fc4199f517fe0ca2784270772ab37403c2405
Showing with 1 addition and 1 deletion.
  1. +1 −1 subsys/dfu/img_util/flash_img.c
@@ -162,7 +162,7 @@ int flash_img_buffered_write(struct flash_img_context *ctx, u8_t *data,
int rc = 0;
int buf_empty_bytes;

while ((len - processed) >
while ((len - processed) >=
(buf_empty_bytes = CONFIG_IMG_BLOCK_BUF_SIZE - ctx->buf_bytes)) {
memcpy(ctx->buf + ctx->buf_bytes, data + processed,
buf_empty_bytes);

0 comments on commit a75fc41

Please sign in to comment.
You can’t perform that action at this time.