Memory violation

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Memory violation

872 Views
xavierbuhot
Contributor II

Hello,

I have a problem when I program my K60 kinetis.

I try an example and the programm block on this statement:

while (!(MCG_S & MCG_S_LOCK_MASK)){}; // Wait for LOCK bit to set

And then the k60 restart from the beginning.

Why this happen?

Best regard.

Tags (3)
0 Kudos
5 Replies

684 Views
LuisCasado
NXP Employee
NXP Employee

Hello Xabier,

Check that the clock configuration (external oscillator, external crystal,..)  of the board that SW was developed for (i.e. TWR-K60N512/TWR-K60D100) is the same you're using in your HW.

And other possible issue is that SW is developed for silicon v1.x  (TWR-K60N512) and your silicon is v2.x (TWR-K60D100).

Regards

Luis  

0 Kudos

684 Views
xavierbuhot
Contributor II

Thank you for the answer.

I only have problem on my custom card. On the K60 TWR kit there are a PK60N512VMD100 and the clock is 50.000P  EC3953PBN.

On my board there are MK60DN512ZVLQ10 and the clock 50.000R EC3953 BN..

I don't understand that on my second card, the programmation works properly but on the first one, the programmation locks on this statement:

while (!(MCG_S & MCG_S_LOCK_MASK)){}; // Wait for LOCK bit to set

The version of the processor and the clock I use could creates that problem?

Why do I have different behavious on my two card?

Best regard.

0 Kudos

684 Views
LuisCasado
NXP Employee
NXP Employee

Hello,

What code are you using, bare metal, MQX,..?

Regards,

Luis

0 Kudos

684 Views
xavierbuhot
Contributor II

I use a IAR IDE for microcontroler programming.

Is that the answer you need?

Xavier

0 Kudos

684 Views
LuisCasado
NXP Employee
NXP Employee

No. I think you started from some Freescale code, MQX distribution, SC code example package,…

Your TWR uses a very early silicon PKxxx and you board production silicon v1.x.

One possible issue is the wrong CLOCK configuration in the code for the silicon you use, other possibility is a HW problem y the clock layout. Your code stops because the PLL/FLL is not locked. Have you verified that clock signal is in the MCU pin correctly?

Luis

0 Kudos