Hi there,
We're using the MK22FN512VLH12 in our open source keyboard.
The last time I checked the schematic of the FRDM-K22F board, I noticed that it uses a 10K pull-up and a 0.1uF bypass cap on the RESET line, so I just copied this aspect of the design, and it worked well.
Recently, an EE friend of mine suggested to ditch these components, saying that the MCU should already have an internal pull-up, and the bypass cap doesn't serve a good purpose, so I purposefully not soldered these components to our latest prototype.
Lo and behold, after connecting the prototype to USB, KBOOT didn't enumerate as it usually does. On top of that, the MCU was behaving as it was locked upon trying to connect to it with Segger J-Link. This is the output of JLink Commander (JLink.exe):
Type "connect" to establish a target connection, '?' for help
J-Link>connect
Please specify device / core. <Default>: MK22FN512XXX12
Type '?' for selection dialog
Device>
Please specify target interface:
J) JTAG (Default)
S) SWD
TIF>s
Specify target interface speed [kHz]. <Default>: 4000 kHz
Speed>
Device "MK22FN512XXX12" selected.
Found SWD-DP with ID 0x2BA01477
Protection bytes in flash at addr. 0x400 - 0x40F indicate that readout protection is set.
For debugger connection the device needs to be unsecured.
Device will be unsecured now.
Note: Unsecuring will trigger a mass erase of the internal flash.
Found SWD-DP with ID 0x2BA01477
Protection bytes in flash at addr. 0x400 - 0x40F indicate that readout protection is set.
For debugger connection the device needs to be unsecured.
Device will be unsecured now.
Note: Unsecuring will trigger a mass erase of the internal flash.****** Error: Kinetis (connect): Timeout while unsecuring device. Erase never starts.
Kinetis (connect): Failed to unsecure Kinetis device.Found SWD-DP with ID 0x2BA01477
Protection bytes in flash at addr. 0x400 - 0x40F indicate that readout protection is set.
For debugger connection the device needs to be unsecured.
Device will be unsecured now.
Note: Unsecuring will trigger a mass erase of the internal flash.
Found SWD-DP with ID 0x2BA01477
Protection bytes in flash at addr. 0x400 - 0x40F indicate that readout protection is set.
For debugger connection the device needs to be unsecured.
Device will be unsecured now.
Note: Unsecuring will trigger a mass erase of the internal flash.****** Error: Kinetis (connect): Timeout while unsecuring device. Erase never starts.
Kinetis (connect): Failed to unsecure Kinetis device.Cannot connect to target.
My questions are:
Thanks in advance for your help!
- Laci
Solved! Go to Solution.
Hi Laci,
No, please add the external pull up resistor and capacitor in the reset pin, not only reset pin, NMI pin also need to add the external pull up resistor, because the internal pull up is weak.
You can find the recommendation in the kinetis peripheral module quick reference:
http://www.nxp.com/assets/documents/data/en/quick-start-guide/KQRUG.pdf
Page 28.
About the secure, please refer to this document:
Kinetis Lock issue analysis and unlock way.pdf
If your reset pin power up eariler than VDD, it will lock the chip and hard to recover.
So, please take care, in the practical usage, please use the recommended design.
Wish it helps you!
Have a great day,
Kerry
-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------
Hi Laci,
No, please add the external pull up resistor and capacitor in the reset pin, not only reset pin, NMI pin also need to add the external pull up resistor, because the internal pull up is weak.
You can find the recommendation in the kinetis peripheral module quick reference:
http://www.nxp.com/assets/documents/data/en/quick-start-guide/KQRUG.pdf
Page 28.
About the secure, please refer to this document:
Kinetis Lock issue analysis and unlock way.pdf
If your reset pin power up eariler than VDD, it will lock the chip and hard to recover.
So, please take care, in the practical usage, please use the recommended design.
Wish it helps you!
Have a great day,
Kerry
-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------
Thank you so much, Kerry! Your answer helped a lot and explained the issue clearly.
If I use the NMI pin as a GPIO out pin, I assume that I don't need an external pull-up, right?
- Laci
Hi Laci,
Yes, if you disable the NMI function, you don't need an external pull-up resistor.
Please note, disable the NMI function should modify the flash configuration field,FOPT[2]=0, the flash address is 0x40d.
Wish it helps you!
Have a great day,
Kerry
-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------
Got it, Kerry. Thank you so much for your help!