Skip to content
Commit 2dc41fcc authored by Patrick Delaunay's avatar Patrick Delaunay Committed by Patrice Chotard
Browse files

dfu: dfu_mtd: set max_buf_size to erasesize also for NOR devices



For NOR devices the logical DFU buffer size is the sector_size,
as it is done in dfu_sf.c or in spi/sf_mtd.c
(sf_mtd_info.erasesize = flash->sector_size)

For NAND the DFU size was already limited to erasesize as
has_pages = true.

So the mtd dfu backend can use this erasesize for all the MTD devices,
NOR and NAND with dfu->max_buf_size = mtd->erasesize

This difference was initially copied from MTD command, where
data is fully available in RAM without size limitation.

This patch avoids to have many sector write in dfu_mtd.c at the end
of the DFU transfer and avoids issues with USB timeout or WATCHDOG.

Signed-off-by: default avatarPatrick Delaunay <patrick.delaunay@foss.st.com>
Reviewed-by: default avatarPatrice Chotard <patrice.chotard@foss.st.com>
parent 88f7ca03
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment