X-Git-Url: https://review.openocd.org/gitweb?a=blobdiff_plain;f=src%2Fflash%2Fnor%2Fstellaris.c;h=0b7c45a31f45ba241d6df6e21c869d0315a3dae4;hb=57d7743639d5092770d79f7c4b12ae694c482750;hp=21a0cffd44aecebd864a3ce55e1d4ddbd0633e71;hpb=e70d42a727bebc5ae0ce0b1386620d30ea00b05b;p=openocd.git diff --git a/src/flash/nor/stellaris.c b/src/flash/nor/stellaris.c index 21a0cffd44..0b7c45a31f 100644 --- a/src/flash/nor/stellaris.c +++ b/src/flash/nor/stellaris.c @@ -693,8 +693,8 @@ static int stellaris_protect(struct flash_bank *bank, int set, int first, int la if (!set) { - LOG_ERROR("Can't unprotect write-protected pages."); - /* except by the "recover locked device" procedure ... */ + LOG_ERROR("Hardware doesn't suppport page-level unprotect. " + "Try the 'recover' command."); return ERROR_INVALID_ARGUMENTS; } @@ -706,7 +706,7 @@ static int stellaris_protect(struct flash_bank *bank, int set, int first, int la || (last < first) || !(last & 1) || (last >= 2 * stellaris_info->num_lockbits)) { - LOG_ERROR("Can't protect unaligned or out-of-range sectors."); + LOG_ERROR("Can't protect unaligned or out-of-range pages."); return ERROR_FLASH_SECTOR_INVALID; } @@ -805,8 +805,7 @@ static const uint8_t stellaris_write_code[] = 0x04,0x36, /* adds r6, r6, #4 */ 0x96,0x42, /* cmp r6, r2 */ 0xF4,0xD1, /* bne mainloop */ - /* exit: */ - 0xFE,0xE7, /* b exit */ + 0x00,0xBE, /* bkpt #0 */ /* pFLASH_CTRL_BASE: */ 0x00,0xD0,0x0F,0x40, /* .word 0x400FD000 */ /* FLASHWRITECMD: */ @@ -1216,7 +1215,7 @@ COMMAND_HANDLER(stellaris_handle_recover_command) retval = jtag_execute_queue(); /* wait 400+ msec ... OK, "1+ second" is simpler */ - sleep(1); + usleep(1000); /* USER INTERVENTION required for the power cycle * Restarting OpenOCD is likely needed because of mode switching. @@ -1241,7 +1240,7 @@ static const struct command_registration stellaris_exec_command_handlers[] = { .handler = stellaris_handle_recover_command, .mode = COMMAND_EXEC, .usage = "bank_id", - .help = "recover locked device", + .help = "recover (and erase) locked device", }, COMMAND_REGISTRATION_DONE };