AnsweredAssumed Answered

STM32 Clock Issue

Question asked by snipor on May 21, 2014
Latest reply on May 22, 2014 by Clive One
I have written a small piece of Code in CooCox. I want to use it for the F303 and for the F030.
I have noticed that the reset value is not correct. Regarding to the reference manual the RCC for both is identically.

Reset value as written in the RM: 0x0000 XX83 where X is undefined. 
Binary
0000 0000 0000 0000 xxxx xxxx 1000 0011
Reading from F030 I got
0000 0000 0000 0001 0100 1000 1000 0011
And from F303
0000 0011 0000 0011 0100 0101 1000 0011
Why the readout values does not fit to the reset values?

Thanks

This is the Code for F030, for F303 it's similar.
#include "stm32f0xx.h"
#include "stm32f0xx_gpio.h"
#include "stm32f0xx_rcc.h"


int Test=0;

void wait(void);

int main(void)
{

    GPIO_InitTypeDef GPIO_InitStruct;

    RCC_AHBPeriphClockCmd(RCC_AHBPeriph_GPIOA, ENABLE);

    GPIO_InitStruct.GPIO_Pin = GPIO_Pin_5;
    GPIO_InitStruct.GPIO_Mode = GPIO_Mode_OUT;         
    GPIO_InitStruct.GPIO_Speed = GPIO_Speed_50MHz;     
    GPIO_InitStruct.GPIO_OType = GPIO_OType_PP;     
    GPIO_InitStruct.GPIO_PuPd = GPIO_PuPd_NOPULL;     
    GPIO_Init(GPIOA, &GPIO_InitStruct);             


    //SystemCoreClockUpdate();
    Test=RCC->CR;

  while(1)
  {
  GPIO_WriteBit(GPIOA, GPIO_Pin_5, Bit_SET);
  wait();

  GPIO_WriteBit(GPIOA, GPIO_Pin_5, Bit_RESET);
  wait();

   }
}

void wait(void)
{
for(int i=0;i<=100000;i++)
{
}
}


Attachments

Outcomes