Skip to content

Commit 735da08

Browse files
committed
application: installer: add flash padding
allignes writes to CONFIG_DT_FLASH_WRITE_BLOCK_SIZE Signed-off-by: Mateusz Michalek <mateusz.michalek@nordicsemi.no>
1 parent de13ba5 commit 735da08

1 file changed

Lines changed: 5 additions & 1 deletion

File tree

  • applications/installer/src

applications/installer/src/main.c

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -198,6 +198,10 @@ int main(void)
198198
}
199199
#endif
200200

201+
int pad = CONFIG_DT_FLASH_WRITE_BLOCK_SIZE - (process_size % CONFIG_DT_FLASH_WRITE_BLOCK_SIZE);
202+
203+
process_size += pad;
204+
201205
rc = flash_area_write(&fa, pos, (void *)read_pos, process_size);
202206

203207
if (rc) {
@@ -218,7 +222,7 @@ int main(void)
218222
"V_DELAY_IMAGE_CHUNK_COPY");
219223
}
220224

221-
++i;
225+
i-=-1;
222226

223227
if (i < CONFIG_BM_INSTALL_IMAGES) {
224228
VERIFICATION_DELAY(CONFIG_APP_BM_INSTALLER_NEXT_IMAGE_COPY_DELAY_MS,

0 commit comments

Comments
 (0)