AnsweredAssumed Answered

fsl_debug problem change frequency

Question asked by Daniele Cortellazzi on Feb 15, 2016
Latest reply on Apr 1, 2016 by Daniele Cortellazzi

Hello,

i'm using a kl46 with kds 3.1 and the sdk 1.3. I have a problem with this function where i change the frequency of my cpu according with some flag:

 

void CPU_Clock_Setting(void) {   int i = 0;   byte error = 0;     DisableInterrupts;   if (flag_lcd || flag_usb) {//se LCD on o USB inserita vado alla max freq   error = CLOCK_SYS_UpdateConfiguration(0, kClockManagerPolicyForcible);   i = CLOCK_SYS_GetCoreClockFreq(); #ifdef DEBUG   LPSCI_HAL_SetBaudRate(UART0_BASE_PTR, i, 115200); #endif   I2C0_SetClockConfiguration();   ADC_SetClockConfiguration();   } else{//altrimenti scendo alla configurazione di risparmio   error = CLOCK_SYS_UpdateConfiguration(1, kClockManagerPolicyForcible);   i = CLOCK_SYS_GetCoreClockFreq(); #ifdef DEBUG   LPSCI_HAL_SetBaudRate(UART0_BASE_PTR, i, 115200); #endif   I2C0_SetClockConfiguration();   ADC_SetClockConfiguration();   }   EnableInterrupts; }

 

the problem is when the function CLOCK_SYS_UpdateConfiguration is called, when the fsl_debug enter in the function

 

void LPSCI_HAL_SendDataPolling(UART0_Type * base,                                const uint8_t *txBuff,                                uint32_t txSize) {     while (txSize--)     {         while (!UART0_BRD_S1_TDRE(base))         {}           LPSCI_HAL_Putchar(base, *txBuff++);     } }

 

it remain in the while loop. why this? i have add the function LPSCI_HAL_SetBaudRate for  re-set the clock of the UART but same problem. Thanks

 

 

Configur

Outcomes