mkl03z32vfk4 on custom board using processor expert never reaches main

cancel
Showing results for 
Search instead for 
Did you mean: 

mkl03z32vfk4 on custom board using processor expert never reaches main

585 Views
cedrickkukela
Contributor III

Hello,

I am trying to get a MKL03Z32xxx4 running on a custom board. Processor expert generated much code for me but when I test using jlink for debugging, I dont see main(or anything else in my reset vector).

I'm new to processor expert but from the guide i thought that processor expert was suppose to generate the vector and copy it to ram by default. I this is not the case how do i get my code into the reset vector?

Cedrick

0 Kudos
11 Replies

334 Views
kerryzhou
NXP TechSupport
NXP TechSupport

Hi Cedrick Kukela,

      I find your JLINK driver is very low, please download the new JLINK driver and try again:

SEGGER - The Embedded Experts - Download

      Besides, check these points:

1.Did you try another IDE? Eg, MDK, IAR, and use the KSDK sample code, whether it is still have problem.

2. Please check your hareware, test the NMI pin, whether it is high. did you add 4.7K to 10K external resistor?

3. Send me your test project, I need to test it on myside.  It seems that your problem was not caused by the software. We need to find the root problem

Waiting for your reply!


Have a great day,
Jingjing

-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------

0 Kudos

334 Views
cedrickkukela
Contributor III

Here is a copy of my console log. I think the errors are the cause of this mess.

SEGGER J-Link GDB Server V4.80c Command Line Version

JLinkARM.dll V4.80c (DLL compiled Jan 21 2014 20:01:42)

-----GDB Server start settings-----

GDBInit file:                  none

GDB Server Listening port:     2331

SWO raw output listening port: 2332

Terminal I/O port:             2333

Accept remote connection:      localhost only

Generate logfile:              off

Verify download:               on

Init regs on start:            on

Silent mode:                   off

Single run mode:               on

------J-Link related settings------

J-Link script:                 none

Target interface:              SWD

Host interface:                USB

Target endian:                 little

Target interface speed:        30kHz

Connecting to J-Link...

J-Link is connected.

Firmware: J-Link V9 compiled Mar 29 2016 18:46:37

Hardware: V9.30

S/N: 59303487

Feature(s): GDB

Checking target voltage...

Listening on TCP/IP port 2331

Connecting to target...Connected to target

Waiting for GDB connection...Connected to 127.0.0.1

Reading all registers

Read 4 bytes @ address 0x00000000 (Data = 0xFFFFFFFF)

Target interface speed set to 30 kHz

Resetting target

Halting target CPU...

...Target halted (PC = 0x1C0000C0)

R0 = 00000000, R1 = 1C001839, R2 = 00000000, R3 = 00008000

R4 = 00000000, R5 = 1C001CB8, R6 = 00000000, R7 = 00000000

R8 = 00000000, R9 = 00000000, R10= 00000000, R11= 00000000

R12= 00000000, R13= 20000218, MSP= 20000218, PSP= 0B7E67F4

R14(LR) = 1C00071F, R15(PC) = 1C0000C0

XPSR 61000000, APSR 60000000, EPSR 01000000, IPSR 00000000

CFBP 00000000, CONTROL 00, FAULTMASK 00, BASEPRI 00, PRIMASK 00

Reading all registers

Select auto target interface speed (2000 kHz)

Flash breakpoints enabled

Semi-hosting enabled (VectorAddr = 0x08)

Wrong client mask. Semihosting I/O not changed.

SWO disabled succesfully.

ERROR: Could not detect CPU clock speed. Download of test code into RAM failed.

Failed to restore original RAM content after CPU clock frequency detection!

Failed to enable SWO. Could not measure target CPU frequency.

Downloading 192 bytes @ address 0x00000000 - Verify failed

Downloading 16 bytes @ address 0x00000400 - Verify failed

Downloading 16064 bytes @ address 0x00000410 - Verify failed

Downloading 2228 bytes @ address 0x000042D0 - Verify failed

Downloading 8 bytes @ address 0x00004B84 - Verify failed

Downloading 4 bytes @ address 0x00004B8C - Verify failed

Downloading 4 bytes @ address 0x00004B90 - Verify failed

Downloading 108 bytes @ address 0x00004B94 - Verify failed

Writing register (PC = 0x000004e8)

Read 4 bytes @ address 0x000004E8 (Data = 0xFFFFFFFF)

Read 2 bytes @ address 0x00001C4C (Data = 0xFFFF)

Read 2 bytes @ address 0x00001C4C (Data = 0xFFFF)

Resetting target

Halting target CPU...

...Target halted (PC = 0x1C0000C0)

Read 2 bytes @ address 0x00001C4C (Data = 0xFFFF)

Read 2 bytes @ address 0x00001C4C (Data = 0xFFFF)

Read 2 bytes @ address 0x00001C4C (Data = 0xFFFF)

R0 = 00000000, R1 = 1C001839, R2 = 00000000, R3 = 00008000

R4 = 00000000, R5 = 1C001CB8, R6 = 00000000, R7 = 00000000

R8 = 00000000, R9 = 00000000, R10= 00000000, R11= 00000000

R12= 00000000, R13= 20000218, MSP= 20000218, PSP= 0B7E67F4

R14(LR) = 1C00071F, R15(PC) = 1C0000C0

XPSR 61000000, APSR 60000000, EPSR 01000000, IPSR 00000000

CFBP 00000000, CONTROL 00, FAULTMASK 00, BASEPRI 00, PRIMASK 00

Reading all registers

Read 4 bytes @ address 0x1C0000C0 (Data = 0x490D480C)

Read 4 bytes @ address 0x1C00071E (Data = 0xD0F52800)

Read 4 bytes @ address 0x1C00071E (Data = 0xD0F52800)

0 Kudos

334 Views
cedrickkukela
Contributor III

Hello,

I am still struggling with this and am just looking for sources of more information. I have my interrupts to fun form internal Flash as well as my code. I think there is something wrong with my linker config or vector table config. Could some out post a working linker config for this processor? I am also looking in to how to set the vector table register. Any info would be appreciated.

Cedrick

0 Kudos

334 Views
kerryzhou
NXP TechSupport
NXP TechSupport

Hi Cedrich Kukela,

    The vector table already in the startup_MKL03Z4.s.

    About the working linker config, you can refer to the KL03 KSDK1.3.0, there has a lot of sample code for your reference, all these sample code is working ok.

    Please download the sample code from this link:

Software Development Kit for Kinetis MCUs|NXP

  You can refer to the gpio code:C:\Freescale\KSDK_1.3.0\examples\frdmkl03z\driver_examples\gpio\kds

Wish it helps you!

If you still have question, please let me know!


Have a great day,

Jingjing

-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------

0 Kudos

334 Views
cedrickkukela
Contributor III

Yes jlink commonader can see the processor

when i think there is a problem with the binary that is created. when i look at the dis assembly, some sections seem to be left undefined(even for the demo apps).

2016-05-04.png

my isr shows much of the same.

2016-05-04 (1).png

Any advice?

0 Kudos

334 Views
kerryzhou
NXP TechSupport
NXP TechSupport

Hi Cedrick ,

    What the IDE you are using with PE? KDS?

    I use the KDS create a Processor expert with KSDK1.3.0 for your referece.

    You can find the main calling in the startup_MKKL03Z.s, in the startup file, there has a reset handler which calls the main function, just like the following picture:

70.jpg

  The project is in the attachment.

Wish it helps you!

If you still have question, please contact me!


Have a great day,
Jingjing

-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------

0 Kudos

334 Views
cedrickkukela
Contributor III

Thank you for your reply,

I do have all the of the start up files and my .S file does have the reset handler. The problem is when i run my application and try to debug it I seem to have nothing in 0x00000000 and 0x00000004. These should be the initial stack register value and pc. Because they are missing my fails to initialize properly. Yes I am using kds with pe. I am all so using jlink on my custom board to read see what is going on.

any suggestions would be welcome. I think i am making a mistake somewhere in my linker settings. I am pretty sure processor expert generates they initial isr.

Thank you

Cedrick 

0 Kudos

334 Views
cedrickkukela
Contributor III

I tried you example and i never hit my breakpoint in main. The device starts up and the vector table but when i click run it just goes into the weeds.

Thank you

0 Kudos

334 Views
kerryzhou
NXP TechSupport
NXP TechSupport

Hi Cedrick Kukela,

    Do you mean when you run my project directly, and you also can't enter in main? This project just a empty project, and it is working ok on my FRDM-KL03 board.

71.jpg

    Could you give me a screenshot where your code stopping?

    I wondering whether your hardware can download the code, please give me some problem picture from your side.

    Besides, please use the JLINK Commander check your board, whether it can find the ARM Cortex M0+ core.

Have a great day,
Jingjing

-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------

0 Kudos

334 Views
cedrickkukela
Contributor III

ps

I would like for the reset handler to call main when it is done. But there is nothing but ffff in the 0x0 and 0x4. How is this configured with processor expert?

Thank you

0 Kudos

334 Views
cedrickkukela
Contributor III

When i look at my generated code folder I have the start up files defined. They also have entries in my map file. For what ever reason though I i end up with nothing in my isr. my reset vector does not call the reset handler. Does any one know how to get processor expert to load this. I have included my ld file and map.

Thank you

0 Kudos