diff --git a/src/flash/nor/stm32f1x.c b/src/flash/nor/stm32f1x.c index e882d7f79..ab1ef2aef 100644 --- a/src/flash/nor/stm32f1x.c +++ b/src/flash/nor/stm32f1x.c @@ -473,7 +473,7 @@ static int stm32x_write_block_async(struct flash_bank *bank, const uint8_t *buff /* memory buffer */ buffer_size = target_get_working_area_avail(target); - buffer_size = MIN(hwords_count * 2, MAX(buffer_size, 256)); + buffer_size = MIN(hwords_count * 2 + 8, MAX(buffer_size, 256)); /* Normally we allocate all available working area. * MIN shrinks buffer_size if the size of the written block is smaller. * MAX prevents using async algo if the available working area is smaller