Permanently write code into Flash in KL27

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

Permanently write code into Flash in KL27

698 Views
tonyenertron
Contributor I


Dear all,

I am using KDS 3.2 to write code for KL27 micro-controller. I used P&E's USB-SWD interface for debugging.

I had finished the development and would like to test the power-on behavior.

I tried to use "Flash from file" menu option to write the code (debug code) into the chip. After that, I can see the

code starts executing after I pressed the reset button. This is what I expected.

However I tried to power cycle the board. This time I didn't see the code start running. Had any one experienced this before? Any suggestion. My program will light an LED at the beginning so I can know whether the program starts or not.

Thansk!

0 Kudos
Reply
5 Replies

518 Views
tonyenertron
Contributor I

Thanks for all who help.

The problem had been solved. The peripheral connected to PTA4 will pull-low for a little while once we do power cycle.

This will trigger the NMI interrupt.

To solve this, I had modified the startup_ML27Z644.S file,

/* Flash Configuration */

    .section .FlashConfig, "a"

    .long 0xFFFFFFFF

    .long 0xFFFFFFFF

    .long 0xFFFFFFFF

    .long 0xFFFF39FE

    .text

    .thumb

change the FOPT from 3D to 39 and mask out the NMI. Now it works.

0 Kudos
Reply

518 Views
kerryzhou
NXP TechSupport
NXP TechSupport

Hi Tony,

Another way, add 4.7K to 10K external pullup resistor in PTA4.

Wish it helps you!

Jingjing

0 Kudos
Reply

518 Views
kerryzhou
NXP TechSupport
NXP TechSupport

Hi Tony,

    You said you want to power cycle the board, do you mean your external power will on and off periodically?

    What the frequent of your power cycle? Can you give us some wave?


Have a great day,

Jingjing

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

0 Kudos
Reply

518 Views
tonyenertron
Contributor I

Thanks for your reply.

I only turn off the power and turn it on again to see what happened during the initialization.

0 Kudos
Reply

518 Views
kerryzhou
NXP TechSupport
NXP TechSupport

Hi Tony,

1.  Please use the KSDK2.0 KL27 download your code to your flash again, just make sure it is not caused by your code.

Welcome to Kinetis Expert | Kinetis Expert

Choose FRDM KL27 board.

2. This is is the timing diagram during POR,

77.jpg

  Please use the oscilloscope to check the POR wave, whether it is correct on your side.

  After you check it, then give me your test wave.


Have a great day,
Jingjing

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

0 Kudos
Reply