This is an automated email from Gerrit. Tomas Vanek (van...@fbl.cz) just uploaded a new patch set to Gerrit, which you can find at http://openocd.zylin.com/5522
-- gerrit commit 7f0f2c20d6f7c2c076c7996781afc3bf3d7b3025 Author: Tomas Vanek <van...@fbl.cz> Date: Mon Mar 16 15:49:54 2020 +0100 flash/nor/nrf5: mass_erase: remove useless error message/return 'nrf5 mass_erase' updates sector protection cache after successful mass erase. nRF52833/840 uses ACL flash protection, which is not supported in nrf5 driver. mass_erase then looks like it failed. Suppress error message and don't propagate nrf5_protection_check() error return as it is not related to the requested operation result. Change-Id: Ie58cda68eb104d410b02777c3df5b343408e2666 Signed-off-by: Tomas Vanek <van...@fbl.cz> diff --git a/src/flash/nor/nrf5.c b/src/flash/nor/nrf5.c index 8422589..3ba59f4 100644 --- a/src/flash/nor/nrf5.c +++ b/src/flash/nor/nrf5.c @@ -1163,23 +1163,16 @@ COMMAND_HANDLER(nrf5_handle_mass_erase_command) } res = nrf5_erase_all(chip); - if (res != ERROR_OK) { + if (res != ERROR_OK) LOG_ERROR("Failed to erase the chip"); - nrf5_protect_check(bank); - return res; - } - res = nrf5_protect_check(bank); - if (res != ERROR_OK) { - LOG_ERROR("Failed to check chip's write protection"); - return res; - } - - res = get_flash_bank_by_addr(target, NRF5_UICR_BASE, true, &bank); - if (res != ERROR_OK) - return res; + /* Protection is checked here as the preparation for an eventual flash + * write/erase. Don't complain if the check fails. + * The NVMC has no indicator of a protection violation - that's the reason + * both write and erase check for protected state before starting. */ + (void)nrf5_protect_check(bank); - return ERROR_OK; + return res; } COMMAND_HANDLER(nrf5_handle_info_command) -- _______________________________________________ OpenOCD-devel mailing list OpenOCD-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/openocd-devel