cancel
Showing results for 
Search instead for 
Did you mean: 

RCC_CFGR2's bit 0 donot change when RCC_CFGR's bit 17 changed

hgyxbll
Associate II
Posted on May 22, 2015 at 08:59

Hi all, 

From the STM32F100xx Reference manual, the RCC_CFGR2's bit 0 is same as RCC_CFGR's bit 17.

And at our company's one product(which use STM32F100ZCT6) it work right. when CFGR change, the CFGR2 changed too.

But at another product(which use STM32F100VCT6) it wok wrong.

RCC_CFGR2's bit 0 donot change when RCC_CFGR's bit 17 changed.

The two product all use external 8Mhz crystal oscillator and set sys clock as 24Mhz.

The code as below:

function: SetSysClockTo24

&sharpelif defined (STM32F10X_LD_VL) || defined (STM32F10X_MD_VL) || defined (STM32F10X_HD_VL)

    /*  PLL configuration:  = (HSE / 2) * 6 = 24 MHz */

    RCC->CFGR &= (uint32_t)((uint32_t)~(RCC_CFGR_PLLSRC | RCC_CFGR_PLLXTPRE | RCC_CFGR_PLLMULL));

    RCC->CFGR |= (uint32_t)(RCC_CFGR_PLLSRC_PREDIV1 | RCC_CFGR_PLLXTPRE_PREDIV1_Div2 | RCC_CFGR_PLLMULL6);

&sharpelse 

#stm32f100vct6
6 REPLIES 6
Posted on May 25, 2015 at 08:15

And has the resulting system clock the frequency you have set?

Does it work in the other way, ie. does writing to RCC_CFGR2.bit0 influence bit 17 of RCC_CFGR?

JW

hgyxbll
Associate II
Posted on May 25, 2015 at 10:01

<<And has the resulting system clock the frequency you have set?

Yes, it is. but the RCC_CFGR2 is not right, and RCC_CFGR2 will affect

fucntion: RCC_GetClocksFreq.

Does it work in the other way, ie. does writing to RCC_CFGR2.bit0 influence bit 17 of RCC_CFGR?

No, it can not influence RCC_CFGR.

chrif
Associate II
Posted on June 05, 2015 at 13:43

Hi,

I reproduced the issue on STM32F100VBT6B (Flash size difference with STM32F100VCT6), and any change on RCC_CFGR2's bit 0 change RCC_CFGR's bit 17 and vice-versa. So, no problem exists.

Try to change another chip STM32F100VCT6.

Amel NASRI
ST Employee
Posted on June 05, 2015 at 16:09

Hello ll.hgyxb,

Could you please let us know what is exactly the marking of your STM32F100VCT6 chip?

In fact, the ones having as ''Internal code'' the value ''A'' will behave the same as what is described in RM0008.

The one used by chahrayar.chahrazed is ''STM32F100VBT6B'' (internal code is B). It is an optimized die. Any update on bit 17 of RCC_CFGR is reflected in bit 0 of RCC_CFGR2.

It is recommended to use high-density value-line devices that have internal code B in their sales types.

Best Regards

-Mayla-

To give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.

hgyxbll
Associate II
Posted on June 16, 2015 at 11:00

Hi Mayla,

>>Could you please let us know what is exactly the marking of your >>STM32F100VCT6 chip?

Sorry, I do not know how to check the marking.

But written on the chip:''STM32F100VCT6  X   HPAFV 93 KOR HP 412''.

Please help to check what is the marking?

Amel NASRI
ST Employee
Posted on June 26, 2015 at 16:04

Hello ll.hgyxb,

You can check the exact used device based on the value of ''DEV_ID'' field in DBGMCU_IDCODE register (

0xE0042000):

- If the value is 0x420 or 0x428, refer to RM0041

- Otherwise, refer to RM0008.

-Mayla-

To give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.