K70 CLK set to 2Mhz make the system hang

キャンセル
次の結果を表示 
表示  限定  | 次の代わりに検索 
もしかして: 

K70 CLK set to 2Mhz make the system hang

1,290件の閲覧回数
lourdu_xavier
Contributor II

Hi All,

I am using MK70FN1M0VMJ15, I could set the CLK to 150Mhz and 12Mhz using _lpm_set_clock_configuration() but when I set to 2Mhz system got hang (not responding), code flow went to Cpu_SetClockConfiguration() ->  Cpu_SetMCG(1U); 

in Cpu_SetMCG() 1st it executed Cpu_SetMCGModePBE then it executed the Cpu_SetMCGModeFBE() immediately it got hanged in there. i am not sure what happens. Can anyone help me to fix this issue.

Thanks in advance. 

タグ(1)
0 件の賞賛
返信
9 返答(返信)

1,127件の閲覧回数
lourdu_xavier
Contributor II

Finally I found the root-cause for the  issue 

We are running the code from DDR ram, once we enter the 2Mhz, DDR is not working. making the system not responsive, if i used the internal ram all works fine. 

our full code is big to run from internal ram, looking for a solution now.  

0 件の賞賛
返信

1,127件の閲覧回数
lourdu_xavier
Contributor II

After spending long time, I made the sample (tower board) code works on our custom board, found that the sample project works fine entering 2Mhz and wait mode and coming out for a keypress . However the project what we created not working, I replace the .c file from sample code to our project it is not working. If I add the sample project to our workspace all working happily.  It shows no issue with the board or bsp and psp projects.

 

There could be a problem with the project we are using, I am not sure what setting could create the problem.

 

Note: sample code may build with hardfp,   if required make change in project setting and in cross ARM Linked change the link path to “softfp” (in my case all other project are built with softfp so I have to change the sample code to work with my other projects)

 

${eclipse_home}../toolchain/lib/gcc/arm-none-eabi/4.8.4/armv7e-m/softfp/libgcc.a

${eclipse_home}../toolchain/arm-none-eabi/lib/armv7e-m/softfp/libc.a

${eclipse_home}../toolchain/arm-none-eabi/lib/armv7e-m/softfp/libsupc++.a

${eclipse_home}../toolchain/arm-none-eabi/lib/armv7e-m/softfp/libm.a

${eclipse_home}../toolchain/arm-none-eabi/lib/armv7e-m/softfp/libnosys.a

0 件の賞賛
返信

1,127件の閲覧回数
lourdu_xavier
Contributor II

Hi All,

Thanks for all the inputs, After analyzing HW design, there is a change in TWR-K70F120M reference board and in our customized board

1) our board using K70P256M150SF3RM -150 Mhz 

2) TWR-K70F120M using 50 MHz  in PTA18/EXTAL; our board using 20 MHz.

With the above HW changes, I am not sure what all the registers has to be modified, there is no problem when it running on 150 Mhz but with 2Mhz it is not working.

I suspect the Reference clock divider, it is in many register (MCG_C1, MCG_C11, MCG_C12 ... etc) can some one please let me know this could be a problem?, if yes how to configure the proper divider.

Thanks in advance

0 件の賞賛
返信

1,127件の閲覧回数
jingpan
NXP TechSupport
NXP TechSupport

Hi,

1) if external clock change from 50M to 20M. You should modify CPU_XTAL_CLK_HZ in bsp_cm.h.

2) Did you try lowpower demo in MQX package? It change frequency to 2M and end VLPR mode.

3) there is a KINETIS_120MHZ_SC package in NXP website. It's driver mcg.c has the same function. You can compare to your case and test on it.

Regards,

Jing

0 件の賞賛
返信

1,127件の閲覧回数
jingpan
NXP TechSupport
NXP TechSupport

Hi,

Yes, since you only use 32.768k crystal, you must use FLL to generate high frequency. But FLL's max ouput frequency is 96MHz. And fast IRC clock can't input to PLL. Please check to the RM and DS.

Regards,

Jing

0 件の賞賛
返信

1,127件の閲覧回数
lourdu_xavier
Contributor II

Thanks all, I am checking the clock configuration I will update after

Thanks

Xavier

0 件の賞賛
返信

1,127件の閲覧回数
mjbcswitzerland
Specialist V

Hi

It looks like you are attempting to use the PLL with the 2MHz IRC but this is not possible since it is neither routed to the PLL input, nor would it be in the valued frequency range for the PLL.

See the following for a more practical overview of MCG and its usage: http://www.utasker.com/kinetis/MCG.html

Regards

Mark


Complete Kinetis solutions solutions for professional needs, training and support: http://www.utasker.com/kinetis.html
Kinetis K70:
- http://www.utasker.com/kinetis/TWR-K70F120M.html
- http://www.utasker.com/kinetis/EMCRAFT_K70F120M.html

0 件の賞賛
返信

1,127件の閲覧回数
jingpan
NXP TechSupport
NXP TechSupport

Hi,

Would you please give more information about your project? For example, the IDE, RTOS, hardware config? It would be better if you can attach a project.

Regards,

Jing

0 件の賞賛
返信

1,127件の閲覧回数
lourdu_xavier
Contributor II

Thanks for the replay,

we are using customize board using MK70FN1M0VMJ15 with MQX 4.2, external OSC ABS07-32.768KHZ-T. it has Ethernet port and few other peripherals connected.

Device working fine with 150 and 12 Mhz, Wait mode is successful, interrupts works for the key pad. now I am trying to get the device to Sleep mode to save power when unused, for that first I set to 2Mhz and set the mode as Sleep after that device not responding to any key press. Debugging shows the 2Mhz CLK setting is not successful.

Please let me know if any other info required.

0 件の賞賛
返信