SWD_CLK pin assigned as GPIO by mistake

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

SWD_CLK pin assigned as GPIO by mistake

Jump to solution
2,216 Views
nikhilsarnaik
Contributor III

Hi guys,

Has anyone come across this issue before?

I have accidentally assigned the SWD_CLK pin as GPIO on K60.

And now I am not been able to debug or even download the code onto the processor (that is understandable as the assignment I did must not be allowing the CLK signal from the debugger into the JTAG port). But does anyone know a way to reassign or force assign the pin as SWD_CLK.

Thanks for the help

Nikhil

Tags (3)
0 Kudos
1 Solution
1,438 Views
deepakrana
NXP Employee
NXP Employee

hi

What is the status of PTA4 at POR

Hope you have not made this pin low at POR

Make sure this pin is high at POR because if this pin is low at POR then the controller goes to EZ mode.

If you are using the Jlink utility then check this

press the reset button and hold it low

power cycle your board

now turn on the jlink.exe

check if you are able to get communication over J-link or not, i mean it should be able to detect the core and give you an okay message.

View solution in original post

0 Kudos
5 Replies
1,438 Views
LuisCasado
NXP Employee
NXP Employee

Hi,

Try this, similar issue:

http://mcuoneclipse.com/2013/06/16/bricking-and-recovering-frdm-kl25z-boards-reset-swd-clock-and-low...

You have the Recovery utility link in the post.

Best Regards,

Luis

0 Kudos
1,438 Views
deepakrana
NXP Employee
NXP Employee

hi

this should not be a problem as at POR the default state of the pin is JTAG_TCLK, so you should be able to debug.

Surprising this is a problem. What is the programmer at your end. Do you have a J-link with you.

With the J-link you have a command line utility  Jlink.exe. This can be used to communicate over the JTAG port with the reset line low. If this programmer is there with you then this might be a way possible.

Not sure i can replicate your problem , this might be risking a board at my end :-)

1,438 Views
nikhilsarnaik
Contributor III

Hi Deepak,

Yes I do use J-link to program the K60.

But I am not able to program even at POR,

I had already had tried the jlink which shows the following log.

SEGGER J-Link Commander V4.56 ('?' for help)

Compiled Oct 22 2012 19:40:24

DLL version V4.56, compiled Oct 22 2012 19:40:04

Firmware: J-Link ARM V8 compiled Sep 20 2012 13:27:01

Hardware: V8.00

S/N: 58009589

Feature(s): JFlash

VTarget = 3.287V

Info: TotalIRLen = ?, IRPrint = 0x..000000000000000000000000

Info: TotalIRLen = ?, IRPrint = 0x..000000000000000000000000

No devices found on JTAG chain. Trying to find device on SWD.

Info: Found SWD-DP with ID 0x2BA01477

Info: Found SWD-DP with ID 0x2BA01477

No device found on SWD.

Did not find any core.

Failed to identify target. Trying again with slow (4 kHz) speed.

Info: TotalIRLen = ?, IRPrint = 0x..000000000000000000000000

Info: TotalIRLen = ?, IRPrint = 0x..000000000000000000000000

No devices found on JTAG chain. Trying to find device on SWD.

Info: Found SWD-DP with ID 0x2BA01477

Info: Found SWD-DP with ID 0x2BA01477

No device found on SWD.

Did not find any core.

J-Link>


The procedure which cause this issue is a bit difficult to explain but I will try to do so:

-I am writing a custom bootloader(bare metal) for a application running on K60 (based on MQX)

-I programmed the main application on the board.

-Then I programmed the bootloader which just jumps to the address of main application.

- I have used the appropriate linker files.

- When I ran the bootloader the code successfully jumped to the correct address and ran main application.

- But I am not been able to reprogram/or communicate the board with via JTAG.

- I get unable to get CPU status error.


in bootloader code I just tried to toggle a LED connected on PA4 but accidentally assigned the PA0 which is SWD_CLK as GPIO.

by :


PORTA_PCR0 = 0x00000100;

instead of

//PORTA_PCR4 = 0x00000100;

That is why I was suspecting it to be cause of the problem.

Does it explain my problem

Thanks and regards

Nikhil



0 Kudos
1,439 Views
deepakrana
NXP Employee
NXP Employee

hi

What is the status of PTA4 at POR

Hope you have not made this pin low at POR

Make sure this pin is high at POR because if this pin is low at POR then the controller goes to EZ mode.

If you are using the Jlink utility then check this

press the reset button and hold it low

power cycle your board

now turn on the jlink.exe

check if you are able to get communication over J-link or not, i mean it should be able to detect the core and give you an okay message.

0 Kudos
1,438 Views
nikhilsarnaik
Contributor III

Hi Deepak,

Yes forcing the reset pin to low while using J-link did bring my processor back to life.

Thanks for the help

Nikhil

0 Kudos