I am trying to update bootloader on my FRDM-K66F which is in a brick state right now.
On erase - JLink returns error (-1). Loadbin command shows success however the board remains in dead state.
Thank you,
Igor
Solved! Go to Solution.
Hi igor brusentsev ,
Please check the board, can you find the onboard also have an MK20DX128VFM5 chip?
That chip is the debugger chip, you need to download your bootloader firmware to that chip, not the onboard K66 chip.
So, please power off the board, and disconnect the external JLINK with the FRDM-K66 J9, then connect your external JLINK SWD interface to the J10:
Then, use the same JLINK commander steps download your bootloader code to the K20 chip, after you download it, then enter the bootloader mode, and copy the CMSISDAP or the JLINK driver to the "MANTENANCE" device, then it should works OK.
The related firmware can be found from this link:
Please try it on your side.
Wish it helps you!
If you still have questions about it, please kindly let me know.
Best Regards,
Kerry
-------------------------------------------------------------------------------
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 igor brusentsev ,
Please check the board, can you find the onboard also have an MK20DX128VFM5 chip?
That chip is the debugger chip, you need to download your bootloader firmware to that chip, not the onboard K66 chip.
So, please power off the board, and disconnect the external JLINK with the FRDM-K66 J9, then connect your external JLINK SWD interface to the J10:
Then, use the same JLINK commander steps download your bootloader code to the K20 chip, after you download it, then enter the bootloader mode, and copy the CMSISDAP or the JLINK driver to the "MANTENANCE" device, then it should works OK.
The related firmware can be found from this link:
Please try it on your side.
Wish it helps you!
If you still have questions about it, please kindly let me know.
Best Regards,
Kerry
-------------------------------------------------------------------------------
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 Kerry.
Thank you for your help. After programming with JTAG bootloader( 0244_k20dx_bl_0x8000.bin ) to J9 in swd mode I am switching to J10. It is can connect now however it fails to program anything to k66.
*****************************************************
Type "connect" to establish a target connection, '?' for help
J-Link>connect
Please specify device / core. <Default>: MK66FN2M0XXX18 (ALLOW SECURITY)
Type '?' for selection dialog
Device>?
Please specify target interface:
J) JTAG (Default)
S) SWD
T) cJTAG
TIF>S
Specify target interface speed [kHz]. <Default>: 4000 kHz
Speed>
Device "MK66FN2M0XXX18" selected.
Connecting to target via SWD
InitTarget()
Found SW-DP with ID 0x2BA01477
DPIDR: 0x2BA01477
Scanning AP map to find all available APs
AP[2]: Stopped AP scan as end of AP map has been reached
AP[0]: AHB-AP (IDR: 0x24770011)
AP[1]: JTAG-AP (IDR: 0x001C0000)
Iterating through AP map to find AHB-AP to use
AP[0]: Core found
AP[0]: AHB-AP ROM base: 0xE00FF000
CPUID register: 0x410FC241. Implementer code: 0x41 (ARM)
Found Cortex-M4 r0p1, Little endian.
FPUnit: 6 code (BP) slots and 2 literal slots
CoreSight components:
ROMTbl[0] @ E00FF000
ROMTbl[0][0]: E000E000, CID: B105E00D, PID: 000BB000 SCS
ROMTbl[0][1]: E0001000, CID: B105E00D, PID: 003BB002 DWT
ROMTbl[0][2]: E0002000, CID: B105E00D, PID: 002BB003 FPB
ROMTbl[0][3]: E0000000, CID: B105E00D, PID: 003BB001 ITM
ROMTbl[0][4]: E0040000, CID: B105900D, PID: 000BB9A1 TPIU
Cortex-M4 identified.
J-Link>erase
Without any give address range, Erase Chip will be executed
Erasing device...
****** Error: Failed to download RAMCode.
Failed to prepare for programming.
Failed to download RAMCode!
ERROR: Erase returned with error code -1.
J-Link>
Unknown command. '?' for help.
J-Link>loadbin C:\Repo\0244_k20dx_bl_0x8000.bin,0
Downloading file [C:\Repo\0244_k20dx_bl_0x8000.bin]...
****** Error: Failed to prepare for programming.
Could not preserve target memory.
Unspecified error -1
J-Link>
******************************************************
Please confirm 2 things for me.
for J9: I am programming firmware(k20dx_frdmk66f_if_crc_legacy_0x8000.bin,) to MK20DX128XXX5
after that I am switching to J10
programming bootloader (0244_k20dx_bl_0x8000.bin) to MK66FN20VND18
Thank you.
Igor
Hi igor brusentsev,
You didn't read my last reply carefully, the JLINK need to download the bootloader to :MK20DX128VFM5 , not k66.
So, in the JLINK commander, you need to select the MK20DX128VFM5 , not K66, but you select the K66.
You need to know your target, your external JLINK target is the FRDM-K66 on board K20 chip, not K66 chip, K20 will be used as the debugger after you download the firmware.
Please try it again.
Wish it helps you!
If you still have questions about it, please kindly let me know.
Best Regards,
Kerry
-------------------------------------------------------------------------------
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.
-------------------------------------------------------------------------------
Thank you Kerry! I was able to get back the board original state.
I copied OpenSDA_V2_1.bin the to the "MANTENANCE" device but still the PC does not recognized
the FRDM-K66F. Only MANTENANCE state.
Now I have one more board (FRDM-K66F as well) which is in the same corrupted state as the previous board was. Once I connect via J9 I receive the following message:
**********************************************************************************
Please specify device / core. <Default>: MK20DX128XXX5
Type '?' for selection dialog
Device>
Please specify target interface:
J) JTAG (Default)
S) SWD
T) cJTAG
TIF>S
Specify target interface speed [kHz]. <Default>: 4000 kHz
Speed>
Device "MK20DX128XXX5" selected.
Connecting to target via SWD
InitTarget()
Readout protection is set and mass erase is disabled. J-Link cannot unprotect the device.
Found SW-DP with ID 0x2BA01477
DPIDR: 0x2BA01477
Scanning AP map to find all available APs
AP[2]: Stopped AP scan as end of AP map has been reached
AP[0]: AHB-AP (IDR: 0x24770011)
AP[1]: JTAG-AP (IDR: 0x001C0000)
Iterating through AP map to find AHB-AP to use
AP[0]: Skipped. Could not read CPUID register
AP[1]: Skipped. Not an AHB-AP
InitTarget()
Readout protection is set and mass erase is disabled. J-Link cannot unprotect the device.
Found SW-DP with ID 0x2BA01477
DPIDR: 0x2BA01477
Scanning AP map to find all available APs
AP[2]: Stopped AP scan as end of AP map has been reached
AP[0]: AHB-AP (IDR: 0x24770011)
AP[1]: JTAG-AP (IDR: 0x001C0000)
Iterating through AP map to find AHB-AP to use
AP[0]: Skipped. Could not read CPUID register
AP[1]: Skipped. Not an AHB-AP
****** Error: Could not find core in Coresight setup
InitTarget()
Readout protection is set and mass erase is disabled. J-Link cannot unprotect the device.
Found SW-DP with ID 0x2BA01477
DPIDR: 0x2BA01477
Scanning AP map to find all available APs
AP[2]: Stopped AP scan as end of AP map has been reached
AP[0]: AHB-AP (IDR: 0x24770011)
AP[1]: JTAG-AP (IDR: 0x001C0000)
Iterating through AP map to find AHB-AP to use
AP[0]: Skipped. Could not read CPUID register
AP[1]: Skipped. Not an AHB-AP
InitTarget()
Readout protection is set and mass erase is disabled. J-Link cannot unprotect the device.
Found SW-DP with ID 0x2BA01477
DPIDR: 0x2BA01477
Scanning AP map to find all available APs
AP[2]: Stopped AP scan as end of AP map has been reached
AP[0]: AHB-AP (IDR: 0x24770011)
AP[1]: JTAG-AP (IDR: 0x001C0000)
Iterating through AP map to find AHB-AP to use
AP[0]: Skipped. Could not read CPUID register
AP[1]: Skipped. Not an AHB-AP
****** Error: Could not find core in Coresight setup
Cannot connect to target.
J-Link>
***********************************************************************************
Is there anything I can do to fix the second board as well ?
Thank you.
Igor
HI igor brusentsev,
1. About your board which already updated the K20 bootloader firmware, and can see the "MAINTENIENCE" device.
Do you use other firmware copy to MAINTENANCE? eg, CMSIS DAP:
Whether it works or not?
About the JLINK firmware, you can use this one:
https://www.segger.com/downloads/jlink/OpenSDA_FRDM-K66F
copy to the MAINTENACE
After you copy it to the MAINTENACE, then you need to power off the board an power on it again.
2. About your another board
Seems your log is not complete, do you have the first log, whether the it contains the JTAG voltage?
Something link this:
Please make sure you connect to the correct interface.
When you change the SWD interface, you need to power off the board, connect the SWD debugger, then power on it again, don't do the hot connection.
If all the item is correct, you can try this JLINK commander: unlock kinetis
Whether you can do the flash mass erase or not? then try to connect the K20 chip again, please note, it need to be powered.
Wish it helps you!
If you still have issues about it, please kindly let me know.
Best Regards,
Kerry
-------------------------------------------------------------------------------
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 Kerry. Thank you for detailed explanation. The first board is working.
Regarding the second board - I still having issues. I am power-cycling it. unlock Kinetis and connect does not work. Below is the full log
***********************************************************************************
C:\Program Files (x86)\SEGGER\JLink>JLink.exe
SEGGER J-Link Commander V6.83c (Compiled Aug 14 2020 15:52:09)
DLL version V6.83c, compiled Aug 14 2020 15:51:02
Connecting to J-Link via USB...O.K.
Firmware: J-Link EDU Mini V1 compiled Jul 17 2020 16:25:21
Hardware version: V1.00
S/N: 801024703
License(s): FlashBP, GDB
VTref=3.298V
Type "connect" to establish a target connection, '?' for help
J-Link>connect
Please specify device / core. <Default>: MK20DX128XXX5 (ALLOW SECURITY)
Type '?' for selection dialog
Device>
Please specify target interface:
J) JTAG (Default)
S) SWD
T) cJTAG
TIF>S
Specify target interface speed [kHz]. <Default>: 4000 kHz
Speed>
Device "MK20DX128XXX5 (ALLOW SECURITY)" selected.
Connecting to target via SWD
InitTarget()
Readout protection is set and mass erase is disabled. J-Link cannot unprotect the device.
Found SW-DP with ID 0x2BA01477
DPIDR: 0x2BA01477
Scanning AP map to find all available APs
AP[2]: Stopped AP scan as end of AP map has been reached
AP[0]: AHB-AP (IDR: 0x24770011)
AP[1]: JTAG-AP (IDR: 0x001C0000)
Iterating through AP map to find AHB-AP to use
AP[0]: Skipped. Could not read CPUID register
AP[1]: Skipped. Not an AHB-AP
InitTarget()
Readout protection is set and mass erase is disabled. J-Link cannot unprotect the device.
Found SW-DP with ID 0x2BA01477
DPIDR: 0x2BA01477
Scanning AP map to find all available APs
AP[2]: Stopped AP scan as end of AP map has been reached
AP[0]: AHB-AP (IDR: 0x24770011)
AP[1]: JTAG-AP (IDR: 0x001C0000)
Iterating through AP map to find AHB-AP to use
AP[0]: Skipped. Could not read CPUID register
AP[1]: Skipped. Not an AHB-AP
****** Error: Could not find core in Coresight setup
InitTarget()
Readout protection is set and mass erase is disabled. J-Link cannot unprotect the device.
Found SW-DP with ID 0x2BA01477
DPIDR: 0x2BA01477
Scanning AP map to find all available APs
AP[2]: Stopped AP scan as end of AP map has been reached
AP[0]: AHB-AP (IDR: 0x24770011)
AP[1]: JTAG-AP (IDR: 0x001C0000)
Iterating through AP map to find AHB-AP to use
AP[0]: Skipped. Could not read CPUID register
AP[1]: Skipped. Not an AHB-AP
InitTarget()
Readout protection is set and mass erase is disabled. J-Link cannot unprotect the device.
Found SW-DP with ID 0x2BA01477
DPIDR: 0x2BA01477
Scanning AP map to find all available APs
AP[2]: Stopped AP scan as end of AP map has been reached
AP[0]: AHB-AP (IDR: 0x24770011)
AP[1]: JTAG-AP (IDR: 0x001C0000)
Iterating through AP map to find AHB-AP to use
AP[0]: Skipped. Could not read CPUID register
AP[1]: Skipped. Not an AHB-AP
****** Error: Could not find core in Coresight setup
Cannot connect to target.
J-Link>unlock Kinetis
Found SWD-DP with ID 0x2BA01477
Unlocking device...Unlock via debug port is disabled. Unlock failed.
Timeout while unlocking device.
J-Link>
*******************************************************************************
Thank you,
Igor
Hi igor brusentsev,
This board result is not good.
From your test result, your K20 Mass erase is disabled, and it is also secured, so the security level is the highest, you can't unlock it. Maybe you can apply the same K20 sample chip, and replace the on board K20 chip.
BTW, do you try to connect your on board K66, whether it can use the external debugger to download the code, it you can, you also can use the external debugger directly.
Wish it helps you!
If you still have issues about it, please kindly let me know.
Best Regards,
Kerry
-------------------------------------------------------------------------------
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 Kerry. I did try but no success.
Thank you for help.
Regards,
Igor
What do you mean, you mean even you change the on board K20 chip, still have not success?
Still can't find the ARM core? Please check the K20 power, whether K20 chip have power or not?
Wish it helps you!
If you still have issues about it, please kindly let me know.
Best Regards,
Kerry
-------------------------------------------------------------------------------
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 Kerry.
We had to purchase more boards. All new boards except one I updated with proper bootloader. Now I have 2 bricked boards. One is from the message above (we called it #2 in previous messages) - I can't connect not via J9 and not via J10.
The other bricked board(lets name it #3rd) - I would not be able to track how exactly it got bricked.
I can program firmware but once I connect the JTAG to program bootloader - voltage shows 0v (as oppose to 3.3 on the working board).
Connecting to J-Link via USB...O.K.
Firmware: J-Link EDU Mini V1 compiled Sep 28 2020 16:25:21
Hardware version: V1.00
S/N: 801024703
License(s): FlashBP, GDB
VTref=0.000V
Please advise if I can restore any of those boards.
Thank you.
Igor