1.We are using 26MHz cryatal instead of 32MHz,and we make the following modification:
1)Modify codes according to the instructions below:
https://community.nxp.com/t5/Wireless-Connectivity-Knowledge/Operating-KW36-with-a-26MHz-XTAL/ta-p/1...
2)Change MCG mode to FBE mode;
const mcg_config_t mcgConfig_BOARD_BootClockRun =
{
.mcgMode = kMCG_ModeFBE,
.irclkEnableMode = kMCG_IrclkEnable,
.ircs = kMCG_IrcSlow,
.fcrdiv = 0x0U,
.frdiv = 0x5U,
.drs = kMCG_DrsMid,
.dmx32 = kMCG_Dmx32Fine,
.oscsel = kMCG_OscselOsc,
}
CLOCK_SetExternalRefClkConfig(mcgConfig_BOARD_BootClockRUN. oscsel);
CLOCK_SetFbeMode(mcgConfig_BOARD_BootClockRUN.frdiv,
mcgConfig_BOARD_BootClockRUN. dmx32,
mcgConfig_BOARD_BootClockRUN. drs,
CLOCK_CONFIG_ FllStableDelay);
3)Modify the codes of FlexCan_Config:
void FlexCan_Config(void)
{
flexcan_config_t flexcanConfig;
FLEXCAN_GetDe faultConfig(&flexcanConfig);
flexcanConfig.clksrc=kFLEXCAN_ ClkSrcOsc;
flexcanConfig .baudRate = 125000;
flexcanConfig .enableIndividMask = true; NULL);
flexcanConfig .maxMbNum = 32;
flexcanConfig .timingConfig .phaseSeg1 = 4;
flexcanConfig .timingConfig .phaseSeg2 = 3;
flexcanConfig .timingConfig.propSeg = 2
FLEXCAN_Init (CAN0Channel, &flexcanConfig, CAN_CLK_FREQ);
FLEXCAN_TransferCreateHandle(CAN0Channel, & flexcanHandle, FlexCan_Callback, NULL);
}
Is there any code in other places that needs to be modified?
2.When KW36 works in FEI mode, after debugging, it enters Deepsleep mode 3 after executing the following codes:
#define cPWR_UsePowerDownMode 1
#define cPWR_DeepSleepMode 3
RSIM->CONTROL = RSIM_CONTROL_MODIFY_FEILD(RSIM_CONTROL_RF_OSC_EN, 0);
the external crystal can be stopped normally.
When the clock is working in FBE mode as modified above, after performing the same operations, the external crystal is still working, that is, the external crystal is not turned off. How can I turn off the external crystal when entering Deepsleep mode 3 in FBE mode?Is there any code in other places that needs to be modified?