Bug fix in Flash erase function for LPC MCUs.
This commit is contained in:
parent
5eb43a1ddb
commit
c7bc4b6a5d
@ -184,7 +184,7 @@ int lpc_flash_erase(struct target_flash *tf, target_addr addr, size_t len)
|
|||||||
if (f->reserved_pages && ((addr + len) >= tf->length - 0x400) ) {
|
if (f->reserved_pages && ((addr + len) >= tf->length - 0x400) ) {
|
||||||
last_full_sector -= 1;
|
last_full_sector -= 1;
|
||||||
}
|
}
|
||||||
if (start >= last_full_sector) {
|
if (start <= last_full_sector) {
|
||||||
/* Sector erase */
|
/* Sector erase */
|
||||||
if (lpc_iap_call(f, NULL, IAP_CMD_ERASE, start, last_full_sector, CPU_CLK_KHZ, f->bank))
|
if (lpc_iap_call(f, NULL, IAP_CMD_ERASE, start, last_full_sector, CPU_CLK_KHZ, f->bank))
|
||||||
return -2;
|
return -2;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user