Unable to debug MK22FX512AVLQ12; RESET pin always in Low state

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

Unable to debug MK22FX512AVLQ12; RESET pin always in Low state

2,067 Views
vaibhavi_padwal
Contributor II

Hi,
I am trying to debug MK22FX512AVLQ12 using MCUXpresso IDE and PEMicro Multilink Universal (Rev. D) but I am unable to debug. I also tried to debug the same using LPC11U68 board but still not able to debug. In both the cases I have used the SWD interface (SWD DIO and SWDCLK pins).


I have attached the screenshots of the error I get in both the cases.


Also I have observed that the RESET Pin of the controller is always in low state despite of an external pull up resistor on the pin.


Please help in resolving the issue.


Thanks and Regrads,
Vaibhavi

0 Kudos
13 Replies

1,672 Views
jingpan
NXP TechSupport
NXP TechSupport

Hi Vaibhavi,

Can you clarify the hardware and software situation?

Regards,

Jing

0 Kudos

1,672 Views
vaibhavi_padwal
Contributor II

Hi,


There is an update. Now I am able to get the sawtooth waveform on RESET pin (which is expected behaviour for blank chip) but still unable to debug the controller.


The hardware specifications are as mentioned above. I have attached schematics for the SWD interface connection. We have also connected EZP_CS_b pin (pin 54) to VDD explicitely.
For software part, I am using MCUXpresso IDE and SDK_2.3.1_MK22FX512Axxx12.

Pleaes help in resolving the issue.

Thanks and Regards,

Vaibhavi

0 Kudos

1,672 Views
jingpan
NXP TechSupport
NXP TechSupport

Hi,

First of all, SWDIO need a pullup resistor.

The sawtooth waveform may caused by many reason. Please see the attachment.

Regards,

Jing

1,672 Views
vaibhavi_padwal
Contributor II

Hi, 

Thank you for your suggestions.

I made following changes w. r. t. to schematic attached refering to https://community.nxp.com/thread/518934.

1. Added 10K pullup resistor on NMI pin

2. Added 10K pullup resistor on SWD_DIO pin

3. Added the circuit as mentioned on link on Vout33.

I was able to program MK22FX512AVLQ12 once using FRDM K22F board, firmwared it as JLINK. But when tried multiple times it gives me following error while erasing the flash:

Executing flash operation 'Erase' (Erase flash) - Fri Nov 29 15:25:57 IST 2019
Checking MCU info...
Scanning for targets...
Executing flash action...
SEGGER J-Link Commander V6.42b (Compiled Feb 5 2019 17:33:07)
DLL version V6.42b, compiled Feb 5 2019 17:31:40
J-Link Command File read successfully.
Processing script file...
J-Link Commander will now exit on Error
J-Link connection not established yet but required for command.
Connecting to J-Link via USB...O.K.
Firmware: J-Link OpenSDA 2 compiled May 27 2019 11:01:03
Hardware version: V1.00
S/N: 621000000
VTref=3.300V
Target connection not established yet but required for command.
Device "MK22FX512AXXX12" selected.
Connecting to target via SWD
InitTarget()
Connect Under Reset
Communication error while accessing MDM-AP.
Connect Under Reset
InitTarget()
Connect Under Reset
Communication error while accessing MDM-AP.
Connect Under Reset
****** Error: InitTarget(): PCode returned with error code -1
InitTarget()
Connect Under Reset
Communication error while accessing MDM-AP.
Connect Under Reset
InitTarget()
Connect Under Reset
Communication error while accessing MDM-AP.
Connect Under Reset
****** Error: InitTarget(): PCode returned with error code -1
Cannot connect to target.
Script processing completed.
Unable to perform operation!
Command failed with exit code 1

 

There is no change in the code which I am tring to debug with. What could be the possible reason for this? and Can you suggest some solution for the same?

Thanks and Regards,

Vaibhavi

0 Kudos

1,672 Views
jingpan
NXP TechSupport
NXP TechSupport

Hi,

It seems your problem is same as Gaurav. Is the problem still there?

Regards,

Jing

0 Kudos

1,672 Views
vaibhavi_padwal
Contributor II

Hi Jing,

Any further suggestions on this? 

Awaiting respose.

Thanks in advance.

Best Regards,

Vaibhavi

0 Kudos

1,672 Views
jingpan
NXP TechSupport
NXP TechSupport

Hi,

FRDM-K22F is not fit for K22FX512Axxx12. This chip is more similar to K21F120MA. They have same mask set. So, I test it on a TWR-K21F120MA. It seems Jlink+MCUXpresso can work, but PE+MCUXpresso10.3 can't. Then, I also tried on IAR. IAR+PE can work well.

Please try on IAR or KEIL, at least you can exclude hardware problem. Also please try ulink/CMSIS-DAP or jlink if you can get them.

Regards,

Jing

0 Kudos

1,672 Views
vaibhavi_padwal
Contributor II

Hi Jing,

I have tried using CMSIS-DAP (using LPC11U68 board) previously but I was unable to debug the controller in that case. I have attached the screenshot in the query for the same. After all the suggested modifications in the hardware, I again tried with CMSIS-DAP but it still shows the same error. 

pastedImage_3.png

I do not have TWR-K21F120MA board. 


Can you please share an example Keil project which I can test on my controller of MK22FX512AVLQ12? So that I can try Keil +JLINK on my controller. That would be really helpful.

Thanks in advance.

Best Regards,

Vaibhavi

0 Kudos

1,672 Views
jingpan
NXP TechSupport
NXP TechSupport

Hi,

The Keil demo project is in K22FX512Axxx SDK. You can find them in SDK_2.3.1_MK22FX512Axxx12\boards\twrk21f120m.

Regards,

Jing

0 Kudos

1,672 Views
vaibhavi_padwal
Contributor II

Hi,

After following modification in hardware, as suggested in https://community.nxp.com/thread/518934 I am able to program the controller using JLINK as well as PE Micro. 

1. 4.7K pull up on NMI Pin

2. 10K pull up on SWD-DIO

3. 100 Ohm and 2.2uF RC on VOUT33 pin

4. 1nF capacitor on SWD-CLK

I am able to program using MCUXpresso multiple times without any errors. The issue is resolved now.

Thank you for you suggestions and quick replies.

Best Regards,

Vaibhavi

0 Kudos

1,672 Views
vaibhavi_padwal
Contributor II

Hi Jing,

I will try and update you about the same soon.

Best Regards,

Vaibhavi

0 Kudos

1,672 Views
vaibhavi_padwal
Contributor II

Hi,

Yes the problem still persists.

While debugging MK22FX512AVLQ12 multiple times, the behaviour is not predictable. Most of the times it shows the error I mentioned above and is unable to debug. Few times, (after calling erase_all_pin.jlk multiple times, as suggested in the 'Kinetis Lock issue Analysis and unlock way.pdf') I am able to debug but again after 2-3 debug attempts it starts showing the same error.

I have tried to use the same JLINK to debug FRDM K22F  which has MK22FN512VLH12 on board and it is able to debug multiple times without any error.

Can you suggest what could the possible cause behind such behaviour?

Thanks in advance.

Best Regards,

Vaibhavi

0 Kudos

1,672 Views
vaibhavi_padwal
Contributor II

Hi,

Thank you for your reply.

I have now added 10K pull up resistor on SWDIO pin but still no luck.


Also I have tried to mass Earse the flash as suggested in the attachment. I used GUI Flash tool of MCUXpresso with PEMicro as well as LPC11U68 board debugger but it is unable to perform the operation. Please see the attached screenshot for the same.

Since I don't have a JLINK with me right now, can you please suggest some other way to debug the controller without JLINK?

Thanks and Regards,

Vaibhavi

0 Kudos