/var/www/restricted/ssh/stm32/www/stm32circle/ STM CircleOS forum / Set the CPU core clock from VERY_LOW to VERY_HIGH

Username:     
Password:     
             

Forum
  • Index
  •  » circleOS
  •  » Set the CPU core clock from VERY_LOW to VERY_HIGH

# 1   2008-05-16 22:12:59 Set the CPU core clock from VERY_LOW to VERY_HIGH

armaniake
Member
From: USA, Texas
Registered: 2007-08-22
Posts: 38

Set the CPU core clock from VERY_LOW to VERY_HIGH

Hi all,

I needed to be able to change SYSTICK frequency. In order to do so, I wanted to change SYSCLK.

When I looked at the code in scheduler.c, I saw in RCC_Configuration():

   /* Set CPU clock */
   UTIL_SetPll( UTIL_ReadBackupRegister( BKP_PLL ) );

To me,   "UTIL_SetPll( UTIL_ReadBackupRegister( BKP_PLL ) )"  enables the PLL, once previously configured


But I'm not sure what the parameter UTIL_ReadBackupRegister( BKP_PLL ) is? It should be a speed between VERY_LOW and VERY_HIGH. But how are BKP_PLL and VERY_LOW/HIGH linked in CircleOS? What is BKP_PLL but just BKP_SYS2? What is BKP_SYS2 in fact?

Thank you very much for any ideas,

Offline

 

# 2   2008-05-19 09:38:43 Set the CPU core clock from VERY_LOW to VERY_HIGH

Francis
Administrator
From: France-Grenoble
Registered: 2007-07-09
Posts: 890

Re: Set the CPU core clock from VERY_LOW to VERY_HIGH

There is a backup area (few registers) in the STM32. When the core is powered off, these registers are still powered by the battery.
UTIL_ReadBackupRegister( BKP_PLL ) allows to read the register at the index 'BKP_PLL'.

The general setting (such as speed..) are saved in these registers in order to restore the same context when restarting your Primer. That's all.

Offline

 

# 3   2008-05-19 18:33:34 Set the CPU core clock from VERY_LOW to VERY_HIGH

armaniake
Member
From: USA, Texas
Registered: 2007-08-22
Posts: 38

Re: Set the CPU core clock from VERY_LOW to VERY_HIGH

Thanks Francis,

I get the idea now.


What is the default value of BKP_PLL register when the Primer starts? It looks like MEDIUM_SPEED but not sure. But also, where is it defined in the code?

If I read well, BKP_PLL is the place where the whole Primer runs its speed from (through UTIL_SetPLL()).

I can see that main.c retrieves the BKP_PLL value when PRIMER starts (scheduler.c). I can also see that the speed is saved in fQuit() in menu.c. I see also that we use UTIL_WriteBackupRegister() to write in BKP_LL but I cannot see where UTIL_WriteBackupRegister() is used to set a default value to BKP_PLL.

Thanks

Offline

 

# 4   2008-05-21 16:22:31 Set the CPU core clock from VERY_LOW to VERY_HIGH

Francis
Administrator
From: France-Grenoble
Registered: 2007-07-09
Posts: 890

Re: Set the CPU core clock from VERY_LOW to VERY_HIGH

Sorry for the late answer. It seems that we don't initialize these values. Therefore, the 'cold-reset' value (0) is the default. But 0 does not match with a correct value and there is a test in set_PLL:
   if( ( speed < SPEED_VERY_LOW ) || ( speed > SPEED_VERY_HIGH ) )
      {
      speed = SPEED_MEDIUM;
      }

Offline

 

# 5   2011-02-03 16:40:39 Set the CPU core clock from VERY_LOW to VERY_HIGH

ziopierugo
New member
Registered: 2010-08-29
Posts: 4

Re: Set the CPU core clock from VERY_LOW to VERY_HIGH

Same ideas to SAVE POWER?

Offline

 

  • Index
  •  » circleOS
  •  » Set the CPU core clock from VERY_LOW to VERY_HIGH

Board footer