On 22.04.2017 14:25, Florian Uekermann wrote:
>> Please do not use ST-Link for NXP Kinetis flash programming.
>>
>> 1) It is quite easy to lock a Kinetis device into secure mode.
>> A high level adapter like ST-Link can not issue mass erase to unlock the
>> device.
> Thanks for the advice Tom. I ordered a CMSIS-DAP based adapter. Due to slow 
> mail service where I live, I'm stuck with ST-Link/V2 for a while, so it would 
> be nice to be able to erase the flash somehow.
>> 2) ST-Link unlike other adapters triggers a verify error on every clear
>> of a 'w1c' bit in a register (write one to clear). Also a write to other
>> registers
>> with some read-only bits can do the same.
> Any way to work around that? Is it possible to ignore the verify error and 
> clear the memory?
>
If you can compile OpenOCD from source, try change 
src/jtag/drivers/stlink_usb.c line 408

          case STLINK_JTAG_WRITE_VERIF_ERROR:
                  LOG_DEBUG("Verify error");
                  return ERROR_OK; /* quick hack to ignore error on w1c 
type registers */

Of course no warranty.
If you want to do it more acceptable way (and contribute to OpenOCD), a 
new error type ERROR_WRITE_VERIFY
should be introduced and ignored on any write to a register with w1c or 
read only bits.

Tom

------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
OpenOCD-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/openocd-devel

Reply via email to