From mboxrd@z Thu Jan 1 00:00:00 1970 From: Tom Rini Date: Mon, 19 Oct 2015 20:06:42 -0400 Subject: [U-Boot] dfu: dfu_sf: Use the erase sector size for erase operations In-Reply-To: <1442894100-14406-1-git-send-email-festevam@gmail.com> References: <1442894100-14406-1-git-send-email-festevam@gmail.com> Message-ID: <20151020000642.GQ23893@bill-the-cat> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de On Tue, Sep 22, 2015 at 12:55:00AM -0300, Fabio Estevam wrote: > From: Fabio Estevam > > SPI NOR flashes need to erase the entire sector size and we cannot pass > any arbitrary length for the erase operation. > > To illustrate the problem: > > Copying data from PC to DFU device > Download [=========================] 100% 478208 bytes > Download done. > state(7) = dfuMANIFEST, status(0) = No error condition is present > state(10) = dfuERROR, status(14) = Something went wrong, but the > device does not know what it was > Done! > > In this case, the binary has 478208 bytes and the M25P32 SPI NOR > has an erase sector of 64kB. > > 478208 = 7 entire sectors of 64kiB + 19456 bytes. > > Erasing the first seven 64 kB sectors works fine, but when trying > to erase the remainding 19456 causes problem and the board hangs. > > Fix the issue by always erasing with the erase sector size. > > Signed-off-by: Fabio Estevam > Acked-by: Lukasz Majewski Applied to u-boot/master, thanks! -- Tom -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 836 bytes Desc: Digital signature URL: