Keil Flash programming error in Kinetis MKE14F512VLL16

cancel
Showing results for 
Search instead for 
Did you mean: 

Keil Flash programming error in Kinetis MKE14F512VLL16

Jump to solution
957 Views
aman_kumar
Contributor II

Hi All,

I am working on a custom board with the Kintes MKE14F512VLL16 microcontroller. I started out by developing some basic code on the evaluation module (i.e TWR-KE18F) which has the MKE18F xx series part. After my board was ready i am trying to make changes to the existing project to move it to the MKE14F part number. I have made most of the changes to the source code and drivers as needed but i am unable to download the code into my board. 

I am using Segger JLink Plus debugger and Keil microvision IDE.

It appears to be some type of project configuration issue pertaining to the RAM allocation. I am able to successfully erase the chip using the same settings. 

The error log is below and project configuration screenshots are also attached. Any help will be greatly appreciated !! 

JLink info:
------------
DLL: V6.46 , compiled May 23 2019 17:49:56
Firmware: J-Link V10 compiled May 17 2019 09:51:10
Hardware: V10.10
S/N : 600115652
Feature(s) : RDI, FlashBP, FlashDL, JFlash, GDB

* JLink Info: InitTarget()
* JLink Info: Protection bytes in flash at addr. 0x400 - 0x40F indicate that readout protection is set.
For debugger connection the device needs to be unsecured.
Note: Unsecuring will trigger a mass erase of the internal flash.
* JLink Info: Executing default behavior previously saved in the registry.
* JLink Info: Device will be unsecured now.
* JLink Info: TotalIRLen = 4, IRPrint = 0x01
* JLink Info: JTAG chain detection found 1 devices:
* JLink Info: #0 Id: 0x4BA00477, IRLen: 04, CoreSight JTAG-DP
* JLink Info: Scanning AP map to find all available APs
* JLink Info: AP[2]: Stopped AP scan as end of AP map has been reached
* JLink Info: AP[0]: AHB-AP (IDR: 0x24770011)
* JLink Info: AP[1]: JTAG-AP (IDR: 0x001C0000)
* JLink Info: Iterating through AP map to find AHB-AP to use
* JLink Info: AP[0]: Core found
* JLink Info: AP[0]: AHB-AP ROM base: 0xE00FF000
* JLink Info: CPUID register: 0x410FC241. Implementer code: 0x41 (ARM)
* JLink Info: Found Cortex-M4 r0p1, Little endian.
* JLink Info: FPUnit: 6 code (BP) slots and 2 literal slots
* JLink Info: CoreSight components:
* JLink Info: ROMTbl[0] @ E00FF000
* JLink Info: ROMTbl[0][0]: E000E000, CID: B105E00D, PID: 000BB00C SCS-M7
* JLink Info: ROMTbl[0][1]: E0001000, CID: B105E00D, PID: 003BB002 DWT
* JLink Info: ROMTbl[0][2]: E0002000, CID: B105E00D, PID: 002BB003 FPB
* JLink Info: ROMTbl[0][3]: E0000000, CID: B105E00D, PID: 003BB001 ITM
* JLink Info: ROMTbl[0][4]: E0040000, CID: B105900D, PID: 000BB9A1 TPIU
ROMTableAddr = 0xE00FF000
* JLink Info: Reset: Halt core after reset via DEMCR.VC_CORERESET.
* JLink Info: Reset: Reset device via AIRCR.SYSRESETREQ.
* JLink Info: AfterResetTarget()

Target info:
------------
Device: MKE14F512VLL16
VTarget = 5.025V
State of Pins:
TCK: 1, TDI: 0, TDO: 0, TMS: 0, TRES: 1, TRST: 1
Hardware-Breakpoints: 6
Software-Breakpoints: 8192
Watchpoints: 4
JTAG speed: 5000 kHz

Erase Done.
**JLink Warning: T-bit of XPSR is 0 but should be 1. Changed to 1.
**JLink Warning: Could not read memory location 0x20000000 when trying to set soft RAM BP
Cannot setup Breakpoint at Address
Programming Failed!
Error: Flash Download failed - "Cortex-M4"
Flash Load finished at 14:09:04

I have attached screenshots of the project configuration settings below for your reference.

2.jpg

1.jpg

3.jpg

4.jpg

5.jpg

Labels (1)
1 Solution
694 Views
aman_kumar
Contributor II

Hi Kerry,

Thank you so much for your response . The JLink commander worked fine and i was able to program the boards with the "loadfile" command.

I got a response back from the team at Keil to make this work and here is the suggestion provided by them

1) Slow down the speed to the interface to 1 MHz (default is 5 MHz)

2) Change the port to SW from JTAG

3) Under Connect and Reset options select "Kinetis"

This allows you to load the code without any issues but you may still have to press the "RST" button on Keil to get the control to main() and then you can proceed with your debug/single stepping etc.

Fixed.jpg

Thank you very much for all your help and hope this helps others who encounter this issue in the future !!

Regards,

Aman  

View solution in original post

0 Kudos
4 Replies
694 Views
kerryzhou
NXP TechSupport
NXP TechSupport

Hi Aman Kumar,

    Please try your modified project on the TWR-KE18F directly, whether you meet the same problem or not?

   TWR-KE18F board can compatible with your MKE14F512VLL16, so if your modified project has no problem, it should also works on the TWR-KE18F board.

   If the TWR-KE18F board also have the problem, then we can make sure the problem still in your software side, otherwise, we also need to check your MKE14F512VLL16 hardware.

1. About the code

   You can download the SDK for your MKE14F512VLL16 

pastedImage_1.png

Then, when you open the project, you just need to replace the related file and driver, .s file in folder:

SDK_2.6.0_MKE14F512xxx16\devices\MKE14F16

You can try it.

2. About the hardware

  Could you use the JLINK commander to connect your own KE14F board again, can you find the ARM core with SWD/JTAG, when you do the mass erase, can you finish it?

Have a great day,
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.
-------------------------------------------------------------------------------

694 Views
aman_kumar
Contributor II

Hi Kerry,

Thank you so much for all of your suggestions !!!

As per your request i tried to program my modified project to the TWR-KE18F board directly and this operation was successful. I was able to see the following messages in Keil window:

Erase Done.
Programming Done.
Verify OK.

I then proceeded to try the JLink commander utility to test the erase operation on my custom board. This also seem to work fine.

Type "connect" to establish a target connection, '?' for help
J-Link>connect
Please specify device / core. <Default>: MKE14F512XXX16
Type '?' for selection dialog
Device>MKE14F512XXX16
Please specify target interface:
J) JTAG (Default)
S) SWD
T) cJTAG
TIF>J
Device position in JTAG chain (IRPre,DRPre) <Default>: -1,-1 => Auto-detect
JTAGConf>-1,-1
Specify target interface speed [kHz]. <Default>: 4000 kHz
Speed>4000
Device "MKE14F512XXX16" selected.


Connecting to target via JTAG
InitTarget()
Connect Under Reset
Protection bytes in flash at addr. 0x400 - 0x40F indicate that readout protection is set.
For debugger connection the device needs to be unsecured.
Note: Unsecuring will trigger a mass erase of the internal flash.
Executing default behavior previously saved in the registry.
Device will be unsecured now.
TotalIRLen = 4, IRPrint = 0x01
JTAG chain detection found 1 devices:
#0 Id: 0x4BA00477, IRLen: 04, CoreSight JTAG-DP
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: 000BB00C SCS-M7
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
Erasing device...
J-Link: Flash download: Total time needed: 0.604s (Prepare: 0.053s, Compare: 0.000s, Erase: 0.548s, Program: 0.000s, Verify: 0.000s, Restore: 0.002s)
Erasing done.
J-Link>

 

The issue however still remains. 

Regards,

Aman

0 Kudos
694 Views
kerryzhou
NXP TechSupport
NXP TechSupport

Hi Aman,

   Please use your MDK project generate the app.bin file, then use the JLINK commander download the file directly on your customer board: loaderfile app.bin 0x00

Please try it, whether no IDE can download the code or not?

  BTW, do you have the IAR, if you have IAR, you also can try that IDE download to your own customer board.

  Because I DON'T have the MKE14F512VLL16 board, then I can't test directly.

 So, you need to test it on your side.

Have a great day,
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.
-------------------------------------------------------------------------------

695 Views
aman_kumar
Contributor II

Hi Kerry,

Thank you so much for your response . The JLink commander worked fine and i was able to program the boards with the "loadfile" command.

I got a response back from the team at Keil to make this work and here is the suggestion provided by them

1) Slow down the speed to the interface to 1 MHz (default is 5 MHz)

2) Change the port to SW from JTAG

3) Under Connect and Reset options select "Kinetis"

This allows you to load the code without any issues but you may still have to press the "RST" button on Keil to get the control to main() and then you can proceed with your debug/single stepping etc.

Fixed.jpg

Thank you very much for all your help and hope this helps others who encounter this issue in the future !!

Regards,

Aman  

View solution in original post

0 Kudos