AnsweredAssumed Answered

Hello World with JLink

Question asked by Randy Seedle on Apr 17, 2019
Latest reply on Apr 23, 2019 by Alice_Yang

I have a FRDM-K64F board from NXP with a MK64FN1M0VLL12 processor.
I seem to be having some issues with the hello_world application. The
JLink drivers load and I see comm 13 in the Window device manager.
I updated the firmware on the board to the file: latest 02_OpenSDA_FRDM-K64F .
I was able to copy and paste the hex executable file into the E: drive in Windows Explorer.
Starting the debug operation looks like it might work but there is no
feedback on a terminal connected to comm 13 that hello_world should produce.

 

Other issues (Programming and Erase) using JLink.

 

Erase does not work (Started in MCUXpressor Quickstart Panel):
Operation completed with the following error(please see consolefor more details):
Unable to perform operation !
Command failed with exit code 1

 

log from console:
Executing flash operation 'Erase' (Erase flash) - Tue Apr 16 15:52:04 CDT 2019
Checking MCU info...
Scanning for targets...
Executing flash action...
SEGGER J-Link Commander V6.44f (Compiled Apr 12 2019 17:17:37)
DLL version V6.44f, compiled Apr 12 2019 17:17:02
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 ARM V8 compiled Nov 28 2014 13:44:46
Hardware version: V8.00
S/N: 58006015
License(s): RDI,FlashDL,FlashBP,JFlash
VTref=3.306V
Target connection not established yet but required for command.
Device "MK64FN1M0XXX12" selected.
Connecting to target via SWD
InitTarget()
Found SW-DP with ID 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.
Erasing device...
****** Error: Failed to download RAMCode.
Failed to prepare for programming.
Failed to download RAMCode!
ERROR: Erase returned with error code -1.
Script processing completed.
Unable to perform operation!
Command failed with exit code 1

 

Programming does not work (Started in MCUXpressor Quickstart Panel):
Operation completed with the following error(please see console for more details):
Unable to perform operation!
Command failed with exit code 1

 

log from console:
Executing flash operation 'Program' (Program executable into flash Debug\frdmk64f_hello_world.axf) - Tue Apr 16 15:56:02 CDT 2019
Checking MCU info...
Scanning for targets...
Executing flash action...
SEGGER J-Link Commander V6.44f (Compiled Apr 12 2019 17:17:37)
DLL version V6.44f, compiled Apr 12 2019 17:17:02
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 ARM V8 compiled Nov 28 2014 13:44:46
Hardware version: V8.00
S/N: 58006015
License(s): RDI,FlashDL,FlashBP,JFlash
VTref=3.306V
Target connection not established yet but required for command.
Device "MK64FN1M0XXX12" selected.
Connecting to target via SWD
InitTarget()
Found SW-DP with ID 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.
Reset delay: 0 ms
Reset type NORMAL: Resets core & peripherals via SYSRESETREQ & VECTRESET bit.
Reset: Halt core after reset via DEMCR.VC_CORERESET.
Reset: Reset device via AIRCR.SYSRESETREQ.
AfterResetTarget()
PC = 00000660, CycleCnt = 00000000
R0 = 00000000, R1 = 00000000, R2 = 00000000, R3 = 00000000
R4 = 00000000, R5 = 00000000, R6 = 00000000, R7 = 00000000
R8 = 00000000, R9 = 00000000, R10= 00000000, R11= 00000000
R12= 00000000
SP(R13)= 1FFFF530, MSP= 1FFFF530, PSP= 00000000, R14(LR) = FFFFFFFF
XPSR = 01000000: APSR = nzcvq, EPSR = 01000000, IPSR = 000 (NoException)
CFBP = 00000000, CONTROL = 00, FAULTMASK = 00, BASEPRI = 00, PRIMASK = 00
FPS0 = 00000000, FPS1 = 00000000, FPS2 = 00000000, FPS3 = 00000000
FPS4 = 00000000, FPS5 = 00000000, FPS6 = 00000000, FPS7 = 00000000
FPS8 = 00000000, FPS9 = 00000000, FPS10= 00000000, FPS11= 00000000
FPS12= 00000000, FPS13= 00000000, FPS14= 00000000, FPS15= 00000000
FPS16= 00000000, FPS17= 00000000, FPS18= 00000000, FPS19= 00000000
FPS20= 00000000, FPS21= 00000000, FPS22= 00000000, FPS23= 00000000
FPS24= 00000000, FPS25= 00000000, FPS26= 00000000, FPS27= 00000000
FPS28= 00000000, FPS29= 00000000, FPS30= 00000000, FPS31= 00000000
FPSCR= 00000000
Downloading file [C:\Users\Randy\Documents\MCUXpressoIDE_10.3.1_2233\workspace\frdmk64f_hello_world\Debug\frdmk64f_hello_world.hex]...
****** Error: Failed to download RAMCode.
Failed to prepare for programming.
Failed to download RAMCode!
Unspecified error -1
Script processing completed.
Unable to perform operation!
Command failed with exit code 1

 

Debugging does not work (Started in MCUXpressor Quickstart Panel):
[MCUXpresso Semihosting Telnet console for 'frdmk64f_hello_world JLink Debug' started on port 50098 @ 127.0.0.1]

 

SEGGER J-Link GDB Server V6.44f - Terminal output channel

 

Log from debug window:
GNU gdb (GNU Tools for Arm Embedded Processors 7-2018-q2-update) 8.1.0.20180315-git
Copyright (C) 2018 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.  Type "show copying"
and "show warranty" for details.
This GDB was configured as "--host=i686-w64-mingw32 --target=arm-none-eabi".
Type "show configuration" for configuration details.
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>.
Find the GDB manual and other documentation resources online at:
<http://www.gnu.org/software/gdb/documentation/>.
For help, type "help".
Type "apropos word" to search for commands related to "word".

 

 

 


monitor exec SetRestartOnClose=1

Outcomes