[prev in list] [next in list] [prev in thread] [next in thread] 

List:       openocd-development
Subject:    [openocd:tickets] #236 Cannot flash Kinetis Z parts
From:       "Martin Hierholzer" <mhier48 () users ! sourceforge ! net>
Date:       2022-05-30 9:04:18
Message-ID: /p/openocd/tickets/236/0567626b273246b52332f100d7f8dfcc7b68e06a.tickets () openocd ! p ! sourceforge ! net
[Download RAW message or body]

[Attachment #2 (multipart/related)]


--===============2349044122411256827==
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit

Thanks for the fast reply! I will submit this to Gerrit once I have addressed your \
first comments.

About the REVID: The interface switch was done between Revision 1.x and 2.x. This is \
described in this NXP document:

https://www.nxp.com.cn/docs/en/application-note/AN4445.pdf

My MK60 chip has the part number MK60DN512ZVMC10 and REVID = 7. The very first \
revisions 1.0 to 1.2 were not even called MK60  but PK60 but without a "Z" in the \
part number. The "Z" in the mask set obviously does not correspond to the "Z" in the \
part number at all.  NXP made a fine mess here...

Still, the KL series should not be affected by my change at all. They seem to end up \
in the "Newer K-series or KL series MCU" branch of the if condition testing the \
KINETIS_SDID_K_SERIES_MASK.

Anyway, if only the KL series needs switching the VLPR to RUN mode, maybe we could \
just remove the entire check for the older K-series MCUs. This would eliminate the \
need to discriminate between the REVIDs at all. I would probably do that by \
introducing a new field in the kinetis_chip struct controlling whether \
kinetis_check_run_mode() shall check the pmstat at all.

Do you agree this may be the better approach? Or is it important to check also on \
K-series whether the MCU is in normal RUN mode for extra reliability?


---

** [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 03:55 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.
--===============2349044122411256827==
MIME-Version: 1.0
Content-Type: text/html; charset="us-ascii"
Content-Transfer-Encoding: 7bit

<div class="markdown_content"><p>Thanks for the fast reply! I will submit this to \
Gerrit once I have addressed your first comments.</p> <p>About the REVID: The \
interface switch was done between Revision 1.x and 2.x. This is described in this NXP \
document:</p> <p><a href="https://www.nxp.com.cn/docs/en/application-note/AN4445.pdf" \
rel="nofollow">https://www.nxp.com.cn/docs/en/application-note/AN4445.pdf</a></p> \
<p>My MK60 chip has the part number MK60DN512ZVMC10 and REVID = 7. The very first \
revisions 1.0 to 1.2 were not even called MK60  but PK60 but without a "Z" in the \
part number. The "Z" in the mask set obviously does not correspond to the "Z" in the \
part number at all.  NXP made a fine mess here...</p> <p>Still, the KL series should \
not be affected by my change at all. They seem to end up in the "Newer K-series or KL \
series MCU" branch of the if condition testing the KINETIS_SDID_K_SERIES_MASK.</p> \
<p>Anyway, if only the KL series needs switching the VLPR to RUN mode, maybe we could \
just remove the entire check for the older K-series MCUs. This would eliminate the \
need to discriminate between the REVIDs at all. I would probably do that by \
introducing a new field in the kinetis_chip struct controlling whether \
kinetis_check_run_mode() shall check the pmstat at all.</p> <p>Do you agree this may \
be the better approach? Or is it important to check also on K-series whether the MCU \
is in normal RUN mode for extra reliability?</p> <hr/>
<p><strong> <a class="alink" \
href="https://sourceforge.net/p/openocd/tickets/236/">[tickets:#236]</a> Cannot flash \
Kinetis Z parts</strong></p> <p><strong>Status:</strong> new<br/>
<strong>Milestone:</strong> 0.9.0<br/>
<strong>Created:</strong> Thu May 02, 2019 09:41 AM UTC by Ramy<br/>
<strong>Last Updated:</strong> Fri May 27, 2022 03:55 PM UTC<br/>
<strong>Owner:</strong> nobody</p>
<p>I am using a Kinetis MK20DN512<strong>Z</strong>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:<br/> "Flash operation not possible \
in current run mode: SMC_PMSTAT: 0x0"</p> <p>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.</p> <p>I \
have attempted to use earlier versions of OpenOCD which don't have this check, but \
they fail when trying to flash either device.</p> <hr/>
<p>Sent from sourceforge.net because openocd-devel@lists.sourceforge.net is \
subscribed to <a href="https://sourceforge.net/p/openocd/tickets/">https://sourceforge.net/p/openocd/tickets/</a></p>
 <p>To unsubscribe from further messages, a project admin can change settings at <a \
href="https://sourceforge.net/p/openocd/admin/tickets/options.">https://sourceforge.net/p/openocd/admin/tickets/options.</a> \
                Or, if this is a mailing list, you can unsubscribe from the mailing \
                list.</p></div>
--===============2349044122411256827==--





[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic