X-Git-Url: https://review.openocd.org/gitweb?p=openocd.git;a=blobdiff_plain;f=src%2Fflash%2Fnor%2Fnrf51.c;h=bfa199a2ffc415a7b8c5e010427b80b60ff833de;hp=8b6a57fb8db73e6c2e253d2e6c605917c6ca77da;hb=56802d794e9b23c290ccb373c44b86999f35ca20;hpb=f30bb58644ac604f67837b7a4d7ba22fb77a1974 diff --git a/src/flash/nor/nrf51.c b/src/flash/nor/nrf51.c index 8b6a57fb8d..bfa199a2ff 100644 --- a/src/flash/nor/nrf51.c +++ b/src/flash/nor/nrf51.c @@ -581,6 +581,12 @@ static int nrf51_erase_page(struct flash_bank *bank, } if ((ppfc & 0xFF) == 0xFF) { + /* We can't erase the UICR. Double-check to + see if it's already erased before complaining. */ + default_flash_blank_check(bank); + if (sector->is_erased == 1) + return ERROR_OK; + LOG_ERROR("The chip was not pre-programmed with SoftDevice stack and UICR cannot be erased separately. Please issue mass erase before trying to write to this region"); return ERROR_FAIL; };