Programming a fresh MK22FN512XXX12

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

Programming a fresh MK22FN512XXX12

1,323 Views
gokhangunay
Contributor III

Hi all,

I am newbie in programming any freescale MCU and I started the job through FRDM-KV31 board. Everything is went glitch-less and I really enjoyed with MCU's peripheral offers especially the flextimer (for power conversion applications). So I decided to design my own board and ordered MK22fn512vlh12 MCU to prepare a customized board for my specific purposes. I prepared a very basic board for programming including related power rail capacitors, pins for SWD debug port (io and clk) and reset. I connected the board to FRDM-KV31 through the SWD port but could not get the MCU programmed.

I uploaded j-link binary to the FRDM board and used related jlink softwares. That is I all played with the J-Link debugger.

It seems that the MCU ID is detected; but it gives error for further steps and complaining about an error in unsecuring the mcu (timeout error). I read the related articles on the similar problems with other MCUs and tried to apply to my case but I came fruitless again and again. I decreased debugger clock frequency down to 4kHz, added some serial resistors (22to100ohm) to the SWD signal paths to suppress any possible ringing noise but the same. Besides, I did no attempt to write the flash security section (0x400-0x410).

So is there any guy to help me to solve the problem I encounter now?

Thanks in advance.

Tags (1)
0 Kudos
9 Replies

844 Views
kerryzhou
NXP TechSupport
NXP TechSupport

Hi gokhan guany,

   Thank you for your interest in NXP Kinetis product, I would like to provide service for you.

1. If you want to use the FRDM-KV31 as the JLINK debugger.

  You must cut the wire in the J11, you can find the wire between J11 in the back side of the FRDM-KV31 board.

pastedImage_1.png

Then you need to use the JLINK firmware, FRDM-KV31 on board opensda is the version 1.0.

So, please download JLINK firmare from this link:

SEGGER - The Embedded Experts - Downloads 

Install the JLINK driver from this link:

SEGGER - The Embedded Experts - Downloads 

(1) FRDM-KV31 power off, then press the reset button and hold on it, plug the board, you will find your board is a device named as "BOOTLOADER"

   Release the RESET button

(2) Send "OpenSDA_V1.bin" to your "BOOTLOADER", wait the sending is finished.

(3)Power off the board and power on it again, you will find your board is the JLINK device

pastedImage_5.png

2. Use the JLINK commander to check whether it can connect your MK22FN512VLH12

I have connect it to the FRDM-K22 board which also has the MK22FN512VLH12 chip, it can recognize the chip with JLINK commander.

pastedImage_6.png

3, If you still have problem

 Please refer to the FRDM-K22 board check your basic board.

 The chip solid temperature can't be higher than 270 degree, other it maybe damaged.

 Reset pin should have 4.7K to 10K external pull up resistor,0.1uf to ground.

 NMI and SWD_DIO should have 4.7K to 10K external pull up resistor.

More details, please refer to FRDM-K22 board:

http://www.nxp.com/assets/downloads/data/en/schematics/FRDM-K22F-SCH.pdf 

Wish it helps you!

If you still have question, please let me know!


Have a great day,

Kerry

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

0 Kudos

844 Views
gokhangunay
Contributor III

Hi Kerry,

Thanks for the help .

It is quite useful.

Step by step

>>1. If you want to use the FRDM-KV31 as the JLINK debugger.

 >> You must cut the wire in the J11, you can find the wire between J11 in the back side of the FRDM-KV31 board.

I did this, I diconnected SWD-IO and SWD-CLK from the related unpopulated jumpers.

>>Then you need to use the JLINK firmware, FRDM-KV31 on board opensda is the version 1.0.

>>So, please download JLINK firmare from this link:

>>SEGGER - The Embedded Experts - Downloads 

>>Install the JLINK driver from this link:

>>SEGGER - The Embedded Experts - Downloads 

>>(1) FRDM-KV31 power off, then press the reset button and hold on it, plug the board, you will find your board is a device named as "BOOTLOADER"

>>Release the RESET button

>>(2) Send "OpenSDA_V1.bin" to your "BOOTLOADER", wait the sending is finished.

>>(3)Power off the board and power on it again, you will find your board is the JLINK device.

I was already using the J-Link firmware so it was done previously and successfully working. I also attached another external board (prepared in the same way for MK22FN) including MKL82Z128XXX7 mcu and it is perfrectly working even for very high connection speeds. So the problem is not here neither.

>>2. Use the JLINK commander to check whether it can connect your MK22FN512VLH12

>>I have connect it to the FRDM-K22 board which also has the MK22FN512VLH12 chip, it can recognize the chip with JLINK commander.

And here the problem begins. The J-Link sees the MCU  with SWD-DP ID0x2BA01477 as in your screen caption but is giving timeout error when tryin to unlock it. I also cannot apply erase command and gives error. 

>>3, If you still have problem

>>Please refer to the FRDM-K22 board check your basic board.

 >>The chip solid temperature can't be higher than 270 degree, other it maybe damaged.

I did not applied hot air, I soldered with normal soldering tools and heat is applied only to pins. So I do not expect overheating.

>> Reset pin should have 4.7K to 10K external pull up resistor,0.1uf to ground.

>> NMI and SWD_DIO should have 4.7K to 10K external pull up resistor.

Here maybe a difference. I applied 1uf (gnd) and 220Ohm (vdd) setup. But the same setup perfectly worked for the MKL82Z128XXX7 MCU so I also do not account it as a problem. Maybe, the two MCUs (MKL82xxx and MK22FNxxx) have different reset circuit??

Thank you much for your precious helps again.

best

gokhan

0 Kudos

844 Views
kerryzhou
NXP TechSupport
NXP TechSupport

Hi gokhan,

   Thank you for your detail reply.

   After reading your reply, I am still think you need to do these things:

1. update the JLINK firmware to the newest version, as what I have did.

At lease, I have use it can connect to the FRDM-K22 chip and the external KL series chip.

Just exclude the debug firmware version problem.

2.  Change your external circuit as what I have said. 220 pullup is too small, please change it to 10K. capacitor to 0.1uf.

 Take care, don't add external pull up in SWD_CLK, this pin actually need to add pull down, but the internal pull down is enough.

 NMI should add external pullup/

  Please modify the hardware.

  I don't whether you also have other board with the K22 chip? Solider is really very important, because higher than 270 degree temperature may damage the pin. I already meet a lot of customers suffering this problem.


Have a great day,
Kerry

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

0 Kudos

844 Views
gokhangunay
Contributor III

Thanks Kerry.

I think I need to buy a new MCU and prepare a new board with the recommended resistor/capacitor values.

Because I changed them and still the problem persists. Most probably the MCU is damaged. Thanks again.

Gokhan

0 Kudos

844 Views
kerryzhou
NXP TechSupport
NXP TechSupport

Hi gokhan gunay,

   Before your design it, please read this post carefully.

https://community.nxp.com/servlet/JiveServlet/download/2019-439921-857127-396709/Kinetis+Lock+issue+... 


Have a great day,
Kerry

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

844 Views
gokhangunay
Contributor III

Hi Kerry Zhou,

Thanks fro your precious helps.

I will try to apply the steps in the documents.

Have a nice weekend.

gokhan

0 Kudos

844 Views
kerryzhou
NXP TechSupport
NXP TechSupport

Hi gokhan,

   You are welcome!

  After you try it, if you still have question, just let me know!

  If your question is solved, please help me to mark the correct answer to close this case.

  Thank you!


Have a great day,
Kerry

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

0 Kudos

844 Views
gokhangunay
Contributor III

Hi Kerry again,

I examined the document you sent and have an opinion that I hard-locked the MCU because at the first time I tried to communicate with the MCU, I did not put capacitor and resistor on the reset pin. I directly connected it to the programmer.

So there is a high probability of getting the reset high before the VDD line in which case you get the MCU hard-locked according to the document you sent.

I will inform you for further developments.

Thanks,

gokhan

0 Kudos

844 Views
kerryzhou
NXP TechSupport
NXP TechSupport

Hi gokhan gunay,

OK, any update, just let me know!

But for the new question, you should better to post a new case.


Have a great day,
Kerry

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