While i try to connect via Jlink SWD to my device i get the below response
Any Comments!!
Hi vishal_roy,
Did you configure the PTC5 as GPIO? This pin is default as JTAG function.
Please try to use the P&E Recovery Utility described in "Bricking and Recovering FRDM-KL25Z Boards: Reset, SWD Clock and Low Power".
Best Regards,
Robin
-------------------------------------------------------------------------------
Note:
- If this post answers your question, please click the "Mark Correct" button. Thank you!
- We are following threads for 7 weeks after the last post, later replies are ignored
Please open a new thread and refer to the closed one, if you have a related question at a later point in time.
-------------------------------------------------------------------------------
Hi Robin,
Yes we are configuring PTC5 as GPIO ,from our previous conversation.
But we are using SWD interface to flash the MCU so this should not be an issue correct?
There are about 2k devices with this MCU on field and more coming out of factory with this code where we configure this PIN as GPIO we do lot of erase and flashing during QA before it goes out. Have not faced such an issue on any other device. So that is why I wanted to know if I am missing something fundamental.
If you only configure the PTC5 pin as GPIO, without modify SWD_DIO and SWD_CLK. Then using SWD interface connect MCU should not meet this issue.
Would you please let me know if you have enable any secure function?
Please follow "3.1.1 SWD connection steps" of AN12130.
Could you please try to read the MDM_AP status and control registers first. Use J-link commander and these commands:
J-Link>r0 // pull reset pin low
J-Link>swdwritedp 2,0x01000000 // MDM_AP status register
J-Link>swdreadap 0 // Read MDM_AP status register
J-Link>swdreadap 0 // Read MDM_AP status register (has to be done 2x) Flash memory ready and Mass erase enable bits should be set
J-Link>swdreadap 1 // Read MDM_AP control register
J-Link>swdreadap 1 // Read MDM_AP control register (has to be done 2x)
J-Link>unlock Kinetis // Erase and unsecure the MCU
//J-Link>swdwriteap 1,0x1 // Launch mass erase directly, set Control[0] = 1
For more information about the register please refer to Section "58.6 MDM-AP status and control registers", RM rev.12.1.
You should be able to see if the MCU secured (Status[2]), if the Mass Erase operation is enabled (Status[5]) and if the Flash memory is ready (Status[1]).