+20
−8
Loading
Previously it was assumed that the trailer would fit one sector. While
this works for most devices, some which happen to have lots of sectors
end up using lots of space for their swap status area. The same issue
could also happen if sectors are small (less than 2K/4K, for example).
This fixes the issue by checking the trailer size and erasing all
sectors that encompass it.
Signed-off-by:
Fabio Utzig <utzig@apache.org>
CRA Git | Maintained and supported by SUSTech CRA and CCSE