2015-05-21 11:59 PM
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 #stm32f100vct62015-05-24 11:15 PM
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? JW2015-05-25 01:01 AM
<<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 affectfucntion: 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.2015-06-05 04:43 AM
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.2015-06-05 07:09 AM
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.
2015-06-16 02:00 AM
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?2015-06-26 07:04 AM
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.