cancel
Showing results for 
Search instead for 
Did you mean: 

systick always 3 times what it should be

michaelmccartyeng
Associate II
Posted on June 18, 2013 at 05:03

I've tested the example systick app and it worked, but my (keil) app will not work. I'm just trying to blink a light on a 2 sec interval, super frustrating.

the project settings have the system clock at 25mhz. I'm using stm32f4 eval board.

// in that system.c file

#if !defined  (HSE_VALUE) 

  #define HSE_VALUE    ((uint32_t)25000000) /*!< Value of the External oscillator in Hz */

#endif /* HSE_VALUE */

/**

 * @brief In the following line adjust the External High Speed oscillator (HSE) Startup 

   Timeout value 

   */

#if !defined  (HSE_STARTUP_TIMEOUT) 

  #define HSE_STARTUP_TIMEOUT    ((uint16_t)0x0500)   /*!< Time out for HSE start up */

#endif /* HSE_STARTUP_TIMEOUT */   

#if !defined  (HSI_VALUE)   

  #define HSI_VALUE    ((uint32_t)16000000) /*!< Value of the Internal oscillator in Hz*/

#endif /* HSI_VALUE */  

// in startup

case 0x01:

if (SysTick_Config(SystemCoreClock / 1000))

/* Capture error */ 

while (1);

}

nodeTimeID = data[j++];

break;

// elsewhere 

while(1)

{    

GPIOD->BSRRL = GPIO_Pin_14; // hi 

Delay(2000);

GPIOD->BSRRH = GPIO_Pin_14; // lo

Delay(2000);

}
1 REPLY 1
Posted on June 18, 2013 at 05:21

Check if you have HSE_VALUE defined as part of the project meta-data.

Make sure the settings for HSE_VALUE are coherent with the board, and the the PLL settings in the system_stm32f4xx.c are too. The STM32F4-Discovery has an 8 MHz crystal.

Confirm clocks via MCOx pins.

Try configuring with HSI
Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..