K65 Core / system clock max to write to Flash

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

K65 Core / system clock max to write to Flash

1,329 Views
charlesklibbe
Contributor I

Hello,

I would like to know what is the clocking requirements for the K65 when using 180MHz and writing to the flash?

I can't seem to find any mention in the documentation but if I try write to the flash I get a kStatus_FLASH_AccessError. I have tried to slow the core clock down by changing SIM->CLKDIV1 (OUTDIV1, OUTDIV2, OUTDIV3 & OUTDIV4) and I still get the access error even though the core clock is now 45MHz and the other clocks are divided appropriately. 

Regards,

Charles Klibbe

0 Kudos
Reply
6 Replies

1,146 Views
charlesklibbe
Contributor I

Hi Guys,

Thanks for the replies, but can someone let me know why you can't just slow down the core clock and still be able to write to the flash?

I've worked with devices before where all that was necessary was to slow the CPU clock and you could use the flash write functions.

My problem is that I'm running a synchronous interface and if I change the clock then my sampling is affected while the clock is not at the correct frequency.

Regards,

Charles

0 Kudos
Reply

1,146 Views
mjbcswitzerland
Specialist V

Charles

The HIGH SPEED RUN mode state will logically block Flash programming - that means that there is presumably a digital connection from the RUN state output to the Flash module controlling this. It blocks programming irrespective of the actual speed of operation.

If you don't set HIGH SPEED RUN mode but just RUN mode instead you can also probably work at 180MHz and the Flash programming indeed operates. This will however be operating out of specification so should not be done for anything more that testing or geek-projects where over-clocking may be considered 'cool'.

For applications where the HIGH SPEED RUN mode restrictions are not acceptable the device should be used as a fully-functional 120MHz device instead in the default RUN mode.

Regards

Mark

0 Kudos
Reply

1,146 Views
charlesklibbe
Contributor I

Thanks Mark, I'll try to work around it.

Regards,

Charles

0 Kudos
Reply

1,146 Views
charlesklibbe
Contributor I

Just an update on other points I found relating to the HSRUN Flash access:

32.1.3 Glossary
HSRUN — An MCU power mode enabling high-speed access to the memory resources
in the FTFE module. The user has no access to the Flash command set when the MCU is
in HSRUN mode.

32.4.10.1 Command Write Sequence

Attempts to launch an FTFE command in HSRUN mode will be trapped with the ACCERR flag being set.

Regards,

Charles

0 Kudos
Reply

1,146 Views
kerryzhou
NXP TechSupport
NXP TechSupport

Hi Charies Klibbe,

    Just as Mark has replied, you can find in the K65 RM, chapter 8.7 Flash Program Restrictions.

    HRUN can't do programmed or erased, please change the mode to RUN mode, then you can do the flash operation.

Wish it helps you!


Have a great day,
Kerry

-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------

0 Kudos
Reply

1,146 Views
mjbcswitzerland
Specialist V

Hi

pastedImage_1.png

Try a binary from http://www.utasker.com/kinetis/TWR-K65F180M.html (include Flash test interface).

If you are in RUN mode you can program up to 120MHz core speed.

Get Open Source uTasker K65 code from http://www.utasker.com/forum/index.php?topic=1721.msg7086#msg7086
including K65 Flash driver and emulation.

Regards

Mark


Professional support for Kinetis: http://www.utasker.com/index.html
Remote desktop one-on-one coaching: http://www.utasker.com/services.html
Getting started to expert videos: https://www.youtube.com/results?search_query=utasker+shorts

0 Kudos
Reply