cancel
Showing results for 
Search instead for 
Did you mean: 

STM32F4 Discovery slow speed

danelifab
Associate II
Posted on October 21, 2014 at 00:00

Hi all, I am working with the STM32F4 Discovery board and I changed the Standard Periph Library from 1.0 to 1.4

With the 1.4 version the boards run slow with this code:

#include ''stm32f4xx_conf.h''
#include ''stm32f4xx.h''
GPIO_InitTypeDef GPIO_InitStructure;
void Delay(__IO uint32_t nCount) {
while(nCount--) {
}
}
int main(void) {
/* GPIOD Periph clock enable */
RCC_AHB1PeriphClockCmd(RCC_AHB1Periph_GPIOD, ENABLE);
/* Configure PD12, 13, 14 and PD15 in output pushpull mode */
GPIO_InitStructure.GPIO_Pin = GPIO_Pin_12 | GPIO_Pin_13 | GPIO_Pin_14 | GPIO_Pin_15;
GPIO_InitStructure.GPIO_Mode = GPIO_Mode_OUT;
GPIO_InitStructure.GPIO_OType = GPIO_OType_PP;
GPIO_InitStructure.GPIO_Speed = GPIO_Speed_100MHz;
GPIO_InitStructure.GPIO_PuPd = GPIO_PuPd_NOPULL;
GPIO_Init(GPIOD, &GPIO_InitStructure);
while (1) {
/* Set PD12 Green */
GPIOD->BSRRL = GPIO_Pin_12;
/* Reset PD13 Orange, PD14 Red, PD15 Blue */
GPIOD->BSRRH = GPIO_Pin_13 | GPIO_Pin_14 | GPIO_Pin_15;
Delay(10000000L);
/* Set PD13 Orange */
GPIOD->BSRRL = GPIO_Pin_13;
/* Reset PD12 Green, PD14 Red, PD15 Blue */
GPIOD->BSRRH = GPIO_Pin_12 | GPIO_Pin_14 | GPIO_Pin_15;
Delay(10000000L);
/* Set PD14 Red */
GPIOD->BSRRL = GPIO_Pin_14;
/* Reset PD12 Green, PD13 Orange, PD15 Blue */
GPIOD->BSRRH = GPIO_Pin_12 | GPIO_Pin_13 | GPIO_Pin_15;
Delay(10000000L);
/* Set PD15 Blue */
GPIOD->BSRRL = GPIO_Pin_15;
/* Reset PD12 Green, PD13 Orange, PD14 Red */
GPIOD->BSRRH = GPIO_Pin_12 | GPIO_Pin_13 | GPIO_Pin_14;
Delay(10000000L);
}
}

I set HSE_VALUE to 8000000 with the both library but the speed of leds is half with the 1.4 library. Anyone know what is happening? I use Ecipse IDE. Thnaks
4 REPLIES 4
Posted on October 21, 2014 at 01:43

Guess you want to make sure what system_stm32f4xx.c is doing with the PLL, and defines for which CPU. Also make sure you aren't using the F401C code, as that part runs at 84 MHz, not 168 MHz.

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..
Posted on October 21, 2014 at 01:48

1.4? DSP Library

STM32F4-DISCO V1.1.0

http://www.st.com/web/en/catalog/tools/PF257904

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..
danelifab
Associate II
Posted on October 21, 2014 at 15:00

Thanks for reply.

I use this library 

http://www.st.com/web/en/catalog/tools/PF257901

I think the problem is the system file you means, I check this at this night.

Regards.

danelifab
Associate II
Posted on October 21, 2014 at 23:08

Hi Clive , you were right , the problem was the system_stm32f4xx.c file.Now it works fine.Thanks for your time.