MQX 3.8.1 changing clock

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

MQX 3.8.1 changing clock

837 Views
dingo
Contributor III

hello everybody,

I work with MQX3.8.1 , twrk60n512 and IAR, I want to change the default clock settings in twrk60n512.h file to use 12MHz instead default 96MHz, with MQX3.7 this change can be easy made without any change in application code. I don't want to use LPM driver in MQX3.8.1 only change the clock . I didn't find any documentation on using the "clock management", new in MQX3.8.1.

best regards,

Stefan Tripac

0 Kudos
3 Replies

388 Views
c0170
Senior Contributor III

Hello Tripac Stefan,

Have you read Getting started? There's 6.4 Processor Expert and default clock settings in Kinetis BSP. Where is reference to the document How to setup kinetis clock using Pe (in doc/cw folder). Which can shed some light on clock configuration. If you insist on not using Low power Manager or clock manager, write your own routine in init_hw.c file to set desired clock.

Regards,

MartinK

0 Kudos

388 Views
dingo
Contributor III

Hello Martin,

I didn't have installed the PE until now, I want to use the "clock management" functions to change the clock and I ask for some documentation regarding this subject, in MQX 3.7 was very simple to change some divisors in <board>.h file. In the same way I have made some changes in twrk60N512.h of the MQX3.8.1:

#define BSP_CLOCK_CONFIGURATION_STARTUP (BSP_CLOCK_CONFIGURATION_12MHZ)

#define BSP_CLOCK_SRC         (CPU_XTAL_CLK_HZ)

#define BSP_CORE_CLOCK    (CPU_CORE_CLK_HZ_CONFIG_1)

#define BSP_SYSTEM_CLOCK(CPU_CORE_CLK_HZ_CONFIG_1)

#define BSP_CLOCK                  (CPU_BUS_CLK_HZ_CONFIG_1)

#define BSP_BUS_CLOCK         (CPU_BUS_CLK_HZ_CONFIG_1)

#define BSP_FLEXBUS_CLOCK (CPU_FLEXBUS_CLK_HZ_CONFIG_1)

#define BSP_FLASH_CLOCK     (CPU_FLASH_CLK_HZ_CONFIG_1)


I have build the bsp and psp and after that, I have rebuild the "timer" example. Without debugger,  the program run OK , but in IAR debug mode when press Go menu, the debug messages in periodic timer functions didn't appear on PEmicro terminal. like the timer didn't start. This can be tested by anyone.

best regards,

Stefan

0 Kudos

388 Views
Martin_
NXP Employee
NXP Employee

Hi Stefan,

if you wish to configure the clocks this way, you will need to change also bsp_cm.c line 161:

from: static uint8_t ClockConfigurationID = CPU_CLOCK_CONFIG_0;

to: static uint8_t ClockConfigurationID = CPU_CLOCK_CONFIG_1;

I tried your configuration on my board and the "timer" example works from debugger as well as standalone.

0 Kudos