Martin,
thanks for working on this issue.
Could you please submit the patch to our gerrit at https://review.openocd.org
See https://openocd.org/doc/doxygen/html/patchguide.html for details.

IMO we should detect "Initial Product Rev" (Z part) more precisely.
I browsed Freescale docs and "Initial Product Rev" exists for
KINETIS_K_SDID_K10_M100, KINETIS_K_SDID_K20_M100, KINETIS_K_SDID_K30_M100, 
KINETIS_K_SDID_K40_M100, KINETIS_K_SDID_K60_M100 and also for K50 M100 never 
supported in OpenOCD

I found a doc relevant to SIM_SDID REVID
https://www.nxp.com/docs/en/engineering-bulletin/EB782.pdf
I would guess by mask set names that only revision number 1.0 (REVID 0) is 
"Initial Product Rev"

Also see a similar doc for K22F which doesn't have any "Initial Product Rev"
https://www.nxp.com/docs/en/engineering-bulletin/EB811.pdf
The lowest REVID is 1 so it looks like we can just check for REVID 0 to detect 
"Initial Product Rev".
Unfortunately Freescale doesn't publish revision lists of all Kinetis devices 
so my guess might be wrong. To be safe from a possible regression I would 
prefer checking for REVID 0 on the devices listed above.



---

** [tickets:#236] Cannot flash Kinetis Z parts**

**Status:** new
**Milestone:** 0.9.0
**Created:** Thu May 02, 2019 09:41 AM UTC by Ramy
**Last Updated:** Fri May 27, 2022 01:27 PM UTC
**Owner:** nobody


I am using a Kinetis MK20DN512**Z**VLQ10 which is an earlier version of the 
MK20DN512VLQ10. Flashing the non-Z part works fine in OpenOCD 0.10, but when 
flashing the Z part, the following error occurs:
"Flash operation not possible in current run mode: SMC_PMSTAT: 0x0"

It looks like the code in the kinetis_check_run_mode function reads the 
SMC_PMSTAT register on the target device to check that it is in run mode. This 
register does not exist on the earlier revision K20 device, so pmstat is always 
0 and OpenOCD refuses to program the device.

I have attempted to use earlier versions of OpenOCD which don't have this 
check, but they fail when trying to flash either device.


---

Sent from sourceforge.net because openocd-devel@lists.sourceforge.net is 
subscribed to https://sourceforge.net/p/openocd/tickets/

To unsubscribe from further messages, a project admin can change settings at 
https://sourceforge.net/p/openocd/admin/tickets/options.  Or, if this is a 
mailing list, you can unsubscribe from the mailing list.


Reply via email to