Question
STM32F4 Discovery slow speed
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