STM32F4Discovery USART Baud rate problem - Page 1
Forum section: electronics / general

author: petoknm
author_rank: Newbie
timestamp: January 03, 2014, 09:23:04 pm
content: HiI'm facing kinda weird problem. I am using STM32F4Discovery board from ST and I'm new to the world of ARM programming(I had been programming AVRs previously(for 2 years)) and I cannot find any mistake. So please could you find anything wrong with this? I am trying to communicate to PC through UART but I am getting garbage(very slowly too), I am using GNU GCC Compiler for ARM and there are no compilation errors but i think it is problem with clock initialization because in program i initialized USART to 9600 baud but i measured approximately 3200 baud with my soundcard(i dont hava an oscilloscope(very sad...)) which would correspond nicely because if the clock could be somehow unused(misconfigured) the uC could think its 25MHz XTAL but actually on the board there is 8MHz XTAL which could decrease the baud rate to ~1/3. BTW I am using Linux.My directory structure is:Code:peter-pc blinky # tree.??? inc? ??? stm32f4xx_conf.h??? lib? ??? inc? ? ??? core? ? ? ??? arm_common_tables.h? ? ? ??? arm_math.h? ? ? ??? core_cm0.h? ? ? ??? core_cm3.h? ? ? ??? core_cm4.h? ? ? ??? core_cm4_simd.h? ? ? ??? core_cmFunc.h? ? ? ??? core_cmInstr.h? ? ??? pdm_filter.h? ? ??? peripherals? ? ? ??? misc.h? ? ? ??? stm32f4xx_adc.h? ? ? ??? stm32f4xx_can.h? ? ? ??? stm32f4xx_crc.h? ? ? ??? stm32f4xx_cryp.h? ? ? ??? stm32f4xx_dac.h? ? ? ??? stm32f4xx_dbgmcu.h? ? ? ??? stm32f4xx_dcmi.h? ? ? ??? stm32f4xx_dma.h? ? ? ??? stm32f4xx_exti.h? ? ? ??? stm32f4xx_flash.h? ? ? ??? stm32f4xx_fsmc.h? ? ? ??? stm32f4xx_gpio.h? ? ? ??? stm32f4xx_hash.h? ? ? ??? stm32f4xx_i2c.h? ? ? ??? stm32f4xx_iwdg.h? ? ? ??? stm32f4xx_pwr.h? ? ? ??? stm32f4xx_rcc.h? ? ? ??? stm32f4xx_rng.h? ? ? ??? stm32f4xx_rtc.h? ? ? ??? stm32f4xx_sdio.h? ? ? ??? stm32f4xx_spi.h? ? ? ??? stm32f4xx_syscfg.h? ? ? ??? stm32f4xx_tim.h? ? ? ??? stm32f4xx_usart.h? ? ? ??? stm32f4xx_wwdg.h? ? ??? stm32f4_discovery.h? ? ??? stm32f4_discovery.h~? ? ??? stm32f4xx_conf.h? ? ??? stm32f4xx_conf.h~? ? ??? stm32f4xx.h? ? ??? stm32f4xx.h~? ? ??? system_stm32f4xx.h? ??? libstm32f4.a? ??? Makefile? ??? misc.o? ??? src? ? ??? peripherals? ? ? ??? misc.c? ? ? ??? stm32f4xx_adc.c? ? ? ??? stm32f4xx_can.c? ? ? ??? stm32f4xx_crc.c? ? ? ??? stm32f4xx_cryp_aes.c? ? ? ??? stm32f4xx_cryp.c? ? ? ??? stm32f4xx_cryp_des.c? ? ? ??? stm32f4xx_cryp_tdes.c? ? ? ??? stm32f4xx_dac.c? ? ? ??? stm32f4xx_dbgmcu.c? ? ? ??? stm32f4xx_dcmi.c? ? ? ??? stm32f4xx_dma.c? ? ? ??? stm32f4xx_exti.c? ? ? ??? stm32f4xx_flash.c? ? ? ??? stm32f4xx_fsmc.c? ? ? ??? stm32f4xx_gpio.c? ? ? ??? stm32f4xx_hash.c? ? ? ??? stm32f4xx_hash_md5.c? ? ? ??? stm32f4xx_hash_sha1.c? ? ? ??? stm32f4xx_i2c.c? ? ? ??? stm32f4xx_iwdg.c? ? ? ??? stm32f4xx_pwr.c? ? ? ??? stm32f4xx_rcc.c? ? ? ??? stm32f4xx_rng.c? ? ? ??? stm32f4xx_rtc.c? ? ? ??? stm32f4xx_sdio.c? ? ? ??? stm32f4xx_spi.c? ? ? ??? stm32f4xx_syscfg.c? ? ? ??? stm32f4xx_tim.c? ? ? ??? stm32f4xx_usart.c? ? ? ??? stm32f4xx_wwdg.c? ? ??? stm32f4_discovery.c? ??? startup_stm32f4xx.s? ??? stm32f4xx_adc.o? ??? stm32f4xx_can.o? ??? stm32f4xx_crc.o? ??? stm32f4xx_cryp_aes.o? ??? stm32f4xx_cryp_des.o? ??? stm32f4xx_cryp.o? ??? stm32f4xx_cryp_tdes.o? ??? stm32f4xx_dac.o? ??? stm32f4xx_dbgmcu.o? ??? stm32f4xx_dcmi.o? ??? stm32f4xx_dma.o? ??? stm32f4xx_exti.o? ??? stm32f4xx_flash.o? ??? stm32f4xx_fsmc.o? ??? stm32f4xx_gpio.o? ??? stm32f4xx_hash_md5.o? ??? stm32f4xx_hash.o? ??? stm32f4xx_hash_sha1.o? ??? stm32f4xx_i2c.o? ??? stm32f4xx_iwdg.o? ??? stm32f4xx_pwr.o? ??? stm32f4xx_rcc.o? ??? stm32f4xx_rng.o? ??? stm32f4xx_rtc.o? ??? stm32f4xx_sdio.o? ??? stm32f4xx_spi.o? ??? stm32f4xx_syscfg.o? ??? stm32f4xx_tim.o? ??? stm32f4xx_usart.o? ??? stm32f4xx_wwdg.o??? main.bin??? main.elf??? main.hex??? Makefile??? src? ??? main.c? ??? system_stm32f4xx.c??? stm32_flash.ldin main.c i have this :Code:#include <stm32f4xx_conf.h>void init_usart(void){GPIO_InitTypeDef GPIO_InitStructure;USART_InitTypeDef USART_InitStructure;/* enable peripheral clock for USART2 */RCC_APB1PeriphClockCmd(RCC_APB1Periph_USART2, ENABLE);/* GPIOA clock enable */RCC_AHB1PeriphClockCmd(RCC_AHB1Periph_GPIOA, ENABLE);/* GPIOA Configuration: USART2 TX on PA2 */GPIO_InitStructure.GPIO_Pin = GPIO_Pin_2;GPIO_InitStructure.GPIO_Mode = GPIO_Mode_AF;GPIO_InitStructure.GPIO_Speed = GPIO_Speed_50MHz;GPIO_InitStructure.GPIO_OType = GPIO_OType_PP;GPIO_InitStructure.GPIO_PuPd = GPIO_PuPd_UP ;GPIO_Init(GPIOA, &GPIO_InitStructure);/* Connect USART2 pins to AF2 */// TX = PA2GPIO_PinAFConfig(GPIOA, GPIO_PinSource2, GPIO_AF_USART2);USART_InitStructure.USART_BaudRate = 9600;USART_InitStructure.USART_WordLength = USART_WordLength_8b;USART_InitStructure.USART_StopBits = USART_StopBits_1;USART_InitStructure.USART_Parity = USART_Parity_No;USART_InitStructure.USART_HardwareFlowControl = USART_HardwareFlowControl_None;USART_InitStructure.USART_Mode = USART_Mode_Tx;USART_Init(USART2, &USART_InitStructure);USART_Cmd(USART2, ENABLE); // enable USART2}void Delay(__IO uint32_t nCount){while(nCount--){}}int main(void){SystemInit();init_usart();while(1){USART_SendData(USART2, 'h'); // defined in stm32f4xx_usart.hDelay(0x3FFFFF);}}in stm32f4xx_conf.h i include all other peripherals including USART and my Makefile look like this:Code:SRCS = main.c system_stm32f4xx.cPROJ_NAME=mainCC=arm-none-eabi-gccOBJCOPY=arm-none-eabi-objcopyCFLAGS = -g -O2 -Wall -Tstm32_flash.ldCFLAGS += -mlittle-endian -mthumb -mcpu=cortex-m4 -mthumb-interworkCFLAGS += -mfloat-abi=softfp -mfpu=fpv4-sp-d16vpath %.c srcvpath %.a libROOT=$(shell pwd)CFLAGS += -Iinc -Ilib -Ilib/incCFLAGS += -Ilib/inc/core -Ilib/inc/peripheralsSRCS += lib/startup_stm32f4xx.s # add startup file to buildOBJS = $(SRCS:.c=.o).PHONY: lib projall: lib projlib:$(MAKE) -C libproj:$(PROJ_NAME).elf$(PROJ_NAME).elf: $(SRCS)$(CC) $(CFLAGS) $^ -o $@ -Llib -lstm32f4$(OBJCOPY) -O ihex $(PROJ_NAME).elf $(PROJ_NAME).hex$(OBJCOPY) -O binary $(PROJ_NAME).elf $(PROJ_NAME).binclean:rm -f *.orm -f $(PROJ_NAME).elfrm -f $(PROJ_NAME).hexrm -f $(PROJ_NAME).binAND checked the system_stm32f4xx.c where all the system clocks are defined and its configured:Code:*=============================================================================* Supported STM32F4xx device revision | Rev A*-----------------------------------------------------------------------------* System Clock source | PLL (HSE)*-----------------------------------------------------------------------------* SYSCLK(Hz) | 168000000*-----------------------------------------------------------------------------* HCLK(Hz) | 168000000*-----------------------------------------------------------------------------* AHB Prescaler | 1*-----------------------------------------------------------------------------* APB1 Prescaler | 4*-----------------------------------------------------------------------------* APB2 Prescaler | 2*-----------------------------------------------------------------------------* HSE Frequency(Hz) | 8000000*-----------------------------------------------------------------------------* PLL_M | 8*-----------------------------------------------------------------------------* PLL_N | 336*-----------------------------------------------------------------------------* PLL_P | 2*-----------------------------------------------------------------------------* PLL_Q | 7*-----------------------------------------------------------------------------* PLLI2S_N | NA*-----------------------------------------------------------------------------* PLLI2S_R | NA*-----------------------------------------------------------------------------* I2S input clock | NA*-----------------------------------------------------------------------------* VDD(V) | 3.3*-----------------------------------------------------------------------------* High Performance mode | Enabled*-----------------------------------------------------------------------------* Flash Latency(WS) | 5*-----------------------------------------------------------------------------* Prefetch Buffer | OFF*-----------------------------------------------------------------------------* Instruction cache | ON*-----------------------------------------------------------------------------* Data cache | ON*-----------------------------------------------------------------------------* Require 48MHz for USB OTG FS, | Enabled* SDIO and RNG clock |*-----------------------------------------------------------------------------*=============================================================================I have no idea whats wrong i did all kinds of sanity checks but they revealed nothing... please help me figure this out...

author: Unknown
author_rank: Unknown
timestamp: January 03, 2014, 09:26:15 pm
content: Use the code tags.

author: petoknm
author_rank: Newbie
timestamp: January 03, 2014, 09:35:48 pm
content: thanks that looks much better... well... I'm a newcomer

author: AndreasF
author_rank: Frequent Contributor
timestamp: January 03, 2014, 11:10:11 pm
content: Even though the comment in system_stm32f4xx.c says "HSE Frequency 8000000", you either need to make sure that the relevant #define of HSE_VALUE is also set to 8000000, e.g. by changing it in stm32f4xx.h or define it within your toolchain:from "stm43f4xx.h", lines 83ff:Code:/*** @brief In the following line adjust the value of External High Speed oscillator (HSE)used in your applicationTip: To avoid modifying this file each time you need to use different HSE, youcan define the HSE value in your toolchain compiler preprocessor.*/#if !defined (HSE_VALUE)#define HSE_VALUE ((uint32_t)25000000) /*!< Value of the External oscillator in Hz */#endif /* HSE_VALUE */

author: petoknm
author_rank: Newbie
timestamp: January 04, 2014, 08:30:46 am
content: Oh... yeah i will definately try that... because in my system_stm32f4xx.c file where all the clocks are configured i could not see any define as to HSE clock even though it was mentioned in the beggining of the file... thanks

author: petoknm
author_rank: Newbie
timestamp: January 04, 2014, 09:00:36 am
content: It actually is defined in stm32f4xx_conf.h like this :Code:#if defined (HSE_VALUE)/* Redefine the HSE value; it's equal to 8 MHz on the STM32F4-DISCOVERY Kit */#undef HSE_VALUE#define HSE_VALUE ((uint32_t)8000000)#endif /* HSE_VALUE */So i really dont know what going on here...

author: AndreasF
author_rank: Frequent Contributor
timestamp: January 04, 2014, 10:10:00 am
content: In that case, I suspect that the inclusion of stm32f4xx_conf.h either happens after the clocks are already set up (with the incorrect HSE_VALUE), or that it gets included before system_stm32f4xx.h and nothing happens, because it hasn't been defined yet (since it's only a re-define).

author: petoknm
author_rank: Newbie
timestamp: January 04, 2014, 10:19:49 am
content: maybe the compilation procedure is wrong... this is the compilation i use :Code:peter-pc blinky # makemake -C libmake: Entering directory `/home/peter/stm32/blinky/lib'arm-none-eabi-gcc -g -O2 -Wall -mlittle-endian -mthumb -mcpu=cortex-m4 -mthumb-interwork -mfloat-abi=softfp -mfpu=fpv4-sp-d16 -ffreestanding -nostdlib -Iinc -Iinc/core -Iinc/peripherals -c -o misc.o src/peripherals/misc.carm-none-eabi-gcc -g -O2 -Wall -mlittle-endian -mthumb -mcpu=cortex-m4 -mthumb-interwork -mfloat-abi=softfp -mfpu=fpv4-sp-d16 -ffreestanding -nostdlib -Iinc -Iinc/core -Iinc/peripherals -c -o stm32f4xx_dma.o src/peripherals/stm32f4xx_dma.carm-none-eabi-gcc -g -O2 -Wall -mlittle-endian -mthumb -mcpu=cortex-m4 -mthumb-interwork -mfloat-abi=softfp -mfpu=fpv4-sp-d16 -ffreestanding -nostdlib -Iinc -Iinc/core -Iinc/peripherals -c -o stm32f4xx_rcc.o src/peripherals/stm32f4xx_rcc.carm-none-eabi-gcc -g -O2 -Wall -mlittle-endian -mthumb -mcpu=cortex-m4 -mthumb-interwork -mfloat-abi=softfp -mfpu=fpv4-sp-d16 -ffreestanding -nostdlib -Iinc -Iinc/core -Iinc/peripherals -c -o stm32f4xx_adc.o src/peripherals/stm32f4xx_adc.carm-none-eabi-gcc -g -O2 -Wall -mlittle-endian -mthumb -mcpu=cortex-m4 -mthumb-interwork -mfloat-abi=softfp -mfpu=fpv4-sp-d16 -ffreestanding -nostdlib -Iinc -Iinc/core -Iinc/peripherals -c -o stm32f4xx_exti.o src/peripherals/stm32f4xx_exti.carm-none-eabi-gcc -g -O2 -Wall -mlittle-endian -mthumb -mcpu=cortex-m4 -mthumb-interwork -mfloat-abi=softfp -mfpu=fpv4-sp-d16 -ffreestanding -nostdlib -Iinc -Iinc/core -Iinc/peripherals -c -o stm32f4xx_rng.o src/peripherals/stm32f4xx_rng.carm-none-eabi-gcc -g -O2 -Wall -mlittle-endian -mthumb -mcpu=cortex-m4 -mthumb-interwork -mfloat-abi=softfp -mfpu=fpv4-sp-d16 -ffreestanding -nostdlib -Iinc -Iinc/core -Iinc/peripherals -c -o stm32f4xx_can.o src/peripherals/stm32f4xx_can.carm-none-eabi-gcc -g -O2 -Wall -mlittle-endian -mthumb -mcpu=cortex-m4 -mthumb-interwork -mfloat-abi=softfp -mfpu=fpv4-sp-d16 -ffreestanding -nostdlib -Iinc -Iinc/core -Iinc/peripherals -c -o stm32f4xx_flash.o src/peripherals/stm32f4xx_flash.carm-none-eabi-gcc -g -O2 -Wall -mlittle-endian -mthumb -mcpu=cortex-m4 -mthumb-interwork -mfloat-abi=softfp -mfpu=fpv4-sp-d16 -ffreestanding -nostdlib -Iinc -Iinc/core -Iinc/peripherals -c -o stm32f4xx_rtc.o src/peripherals/stm32f4xx_rtc.carm-none-eabi-gcc -g -O2 -Wall -mlittle-endian -mthumb -mcpu=cortex-m4 -mthumb-interwork -mfloat-abi=softfp -mfpu=fpv4-sp-d16 -ffreestanding -nostdlib -Iinc -Iinc/core -Iinc/peripherals -c -o stm32f4xx_crc.o src/peripherals/stm32f4xx_crc.carm-none-eabi-gcc -g -O2 -Wall -mlittle-endian -mthumb -mcpu=cortex-m4 -mthumb-interwork -mfloat-abi=softfp -mfpu=fpv4-sp-d16 -ffreestanding -nostdlib -Iinc -Iinc/core -Iinc/peripherals -c -o stm32f4xx_fsmc.o src/peripherals/stm32f4xx_fsmc.carm-none-eabi-gcc -g -O2 -Wall -mlittle-endian -mthumb -mcpu=cortex-m4 -mthumb-interwork -mfloat-abi=softfp -mfpu=fpv4-sp-d16 -ffreestanding -nostdlib -Iinc -Iinc/core -Iinc/peripherals -c -o stm32f4xx_sdio.o src/peripherals/stm32f4xx_sdio.carm-none-eabi-gcc -g -O2 -Wall -mlittle-endian -mthumb -mcpu=cortex-m4 -mthumb-interwork -mfloat-abi=softfp -mfpu=fpv4-sp-d16 -ffreestanding -nostdlib -Iinc -Iinc/core -Iinc/peripherals -c -o stm32f4xx_cryp_aes.o src/peripherals/stm32f4xx_cryp_aes.carm-none-eabi-gcc -g -O2 -Wall -mlittle-endian -mthumb -mcpu=cortex-m4 -mthumb-interwork -mfloat-abi=softfp -mfpu=fpv4-sp-d16 -ffreestanding -nostdlib -Iinc -Iinc/core -Iinc/peripherals -c -o stm32f4xx_gpio.o src/peripherals/stm32f4xx_gpio.carm-none-eabi-gcc -g -O2 -Wall -mlittle-endian -mthumb -mcpu=cortex-m4 -mthumb-interwork -mfloat-abi=softfp -mfpu=fpv4-sp-d16 -ffreestanding -nostdlib -Iinc -Iinc/core -Iinc/peripherals -c -o stm32f4xx_spi.o src/peripherals/stm32f4xx_spi.carm-none-eabi-gcc -g -O2 -Wall -mlittle-endian -mthumb -mcpu=cortex-m4 -mthumb-interwork -mfloat-abi=softfp -mfpu=fpv4-sp-d16 -ffreestanding -nostdlib -Iinc -Iinc/core -Iinc/peripherals -c -o stm32f4xx_cryp.o src/peripherals/stm32f4xx_cryp.carm-none-eabi-gcc -g -O2 -Wall -mlittle-endian -mthumb -mcpu=cortex-m4 -mthumb-interwork -mfloat-abi=softfp -mfpu=fpv4-sp-d16 -ffreestanding -nostdlib -Iinc -Iinc/core -Iinc/peripherals -c -o stm32f4xx_hash.o src/peripherals/stm32f4xx_hash.carm-none-eabi-gcc -g -O2 -Wall -mlittle-endian -mthumb -mcpu=cortex-m4 -mthumb-interwork -mfloat-abi=softfp -mfpu=fpv4-sp-d16 -ffreestanding -nostdlib -Iinc -Iinc/core -Iinc/peripherals -c -o stm32f4xx_syscfg.o src/peripherals/stm32f4xx_syscfg.carm-none-eabi-gcc -g -O2 -Wall -mlittle-endian -mthumb -mcpu=cortex-m4 -mthumb-interwork -mfloat-abi=softfp -mfpu=fpv4-sp-d16 -ffreestanding -nostdlib -Iinc -Iinc/core -Iinc/peripherals -c -o stm32f4xx_cryp_des.o src/peripherals/stm32f4xx_cryp_des.carm-none-eabi-gcc -g -O2 -Wall -mlittle-endian -mthumb -mcpu=cortex-m4 -mthumb-interwork -mfloat-abi=softfp -mfpu=fpv4-sp-d16 -ffreestanding -nostdlib -Iinc -Iinc/core -Iinc/peripherals -c -o stm32f4xx_hash_md5.o src/peripherals/stm32f4xx_hash_md5.carm-none-eabi-gcc -g -O2 -Wall -mlittle-endian -mthumb -mcpu=cortex-m4 -mthumb-interwork -mfloat-abi=softfp -mfpu=fpv4-sp-d16 -ffreestanding -nostdlib -Iinc -Iinc/core -Iinc/peripherals -c -o stm32f4xx_tim.o src/peripherals/stm32f4xx_tim.carm-none-eabi-gcc -g -O2 -Wall -mlittle-endian -mthumb -mcpu=cortex-m4 -mthumb-interwork -mfloat-abi=softfp -mfpu=fpv4-sp-d16 -ffreestanding -nostdlib -Iinc -Iinc/core -Iinc/peripherals -c -o stm32f4xx_cryp_tdes.o src/peripherals/stm32f4xx_cryp_tdes.carm-none-eabi-gcc -g -O2 -Wall -mlittle-endian -mthumb -mcpu=cortex-m4 -mthumb-interwork -mfloat-abi=softfp -mfpu=fpv4-sp-d16 -ffreestanding -nostdlib -Iinc -Iinc/core -Iinc/peripherals -c -o stm32f4xx_hash_sha1.o src/peripherals/stm32f4xx_hash_sha1.carm-none-eabi-gcc -g -O2 -Wall -mlittle-endian -mthumb -mcpu=cortex-m4 -mthumb-interwork -mfloat-abi=softfp -mfpu=fpv4-sp-d16 -ffreestanding -nostdlib -Iinc -Iinc/core -Iinc/peripherals -c -o stm32f4xx_usart.o src/peripherals/stm32f4xx_usart.carm-none-eabi-gcc -g -O2 -Wall -mlittle-endian -mthumb -mcpu=cortex-m4 -mthumb-interwork -mfloat-abi=softfp -mfpu=fpv4-sp-d16 -ffreestanding -nostdlib -Iinc -Iinc/core -Iinc/peripherals -c -o stm32f4xx_dac.o src/peripherals/stm32f4xx_dac.carm-none-eabi-gcc -g -O2 -Wall -mlittle-endian -mthumb -mcpu=cortex-m4 -mthumb-interwork -mfloat-abi=softfp -mfpu=fpv4-sp-d16 -ffreestanding -nostdlib -Iinc -Iinc/core -Iinc/peripherals -c -o stm32f4xx_i2c.o src/peripherals/stm32f4xx_i2c.carm-none-eabi-gcc -g -O2 -Wall -mlittle-endian -mthumb -mcpu=cortex-m4 -mthumb-interwork -mfloat-abi=softfp -mfpu=fpv4-sp-d16 -ffreestanding -nostdlib -Iinc -Iinc/core -Iinc/peripherals -c -o stm32f4xx_wwdg.o src/peripherals/stm32f4xx_wwdg.carm-none-eabi-gcc -g -O2 -Wall -mlittle-endian -mthumb -mcpu=cortex-m4 -mthumb-interwork -mfloat-abi=softfp -mfpu=fpv4-sp-d16 -ffreestanding -nostdlib -Iinc -Iinc/core -Iinc/peripherals -c -o stm32f4xx_dbgmcu.o src/peripherals/stm32f4xx_dbgmcu.carm-none-eabi-gcc -g -O2 -Wall -mlittle-endian -mthumb -mcpu=cortex-m4 -mthumb-interwork -mfloat-abi=softfp -mfpu=fpv4-sp-d16 -ffreestanding -nostdlib -Iinc -Iinc/core -Iinc/peripherals -c -o stm32f4xx_iwdg.o src/peripherals/stm32f4xx_iwdg.carm-none-eabi-gcc -g -O2 -Wall -mlittle-endian -mthumb -mcpu=cortex-m4 -mthumb-interwork -mfloat-abi=softfp -mfpu=fpv4-sp-d16 -ffreestanding -nostdlib -Iinc -Iinc/core -Iinc/peripherals -c -o stm32f4xx_dcmi.o src/peripherals/stm32f4xx_dcmi.carm-none-eabi-gcc -g -O2 -Wall -mlittle-endian -mthumb -mcpu=cortex-m4 -mthumb-interwork -mfloat-abi=softfp -mfpu=fpv4-sp-d16 -ffreestanding -nostdlib -Iinc -Iinc/core -Iinc/peripherals -c -o stm32f4xx_pwr.o src/peripherals/stm32f4xx_pwr.carm-none-eabi-ar -r libstm32f4.a misc.o stm32f4xx_dma.o stm32f4xx_rcc.o stm32f4xx_adc.o stm32f4xx_exti.o stm32f4xx_rng.o stm32f4xx_can.o stm32f4xx_flash.o stm32f4xx_rtc.o stm32f4xx_crc.o stm32f4xx_fsmc.o stm32f4xx_sdio.o stm32f4xx_cryp_aes.o stm32f4xx_gpio.o stm32f4xx_spi.o stm32f4xx_cryp.o stm32f4xx_hash.o stm32f4xx_syscfg.o stm32f4xx_cryp_des.o stm32f4xx_hash_md5.o stm32f4xx_tim.o stm32f4xx_cryp_tdes.o stm32f4xx_hash_sha1.o stm32f4xx_usart.o stm32f4xx_dac.o stm32f4xx_i2c.o stm32f4xx_wwdg.o stm32f4xx_dbgmcu.o stm32f4xx_iwdg.o stm32f4xx_dcmi.o stm32f4xx_pwr.oarm-none-eabi-ar: creating libstm32f4.amake: Leaving directory `/home/peter/stm32/blinky/lib'arm-none-eabi-gcc -g -O2 -Wall -Tstm32_flash.ld -mlittle-endian -mthumb -mcpu=cortex-m4 -mthumb-interwork -mfloat-abi=softfp -mfpu=fpv4-sp-d16 -Iinc -Ilib -Ilib/inc -Ilib/inc/core -Ilib/inc/peripherals src/main.c src/system_stm32f4xx.c lib/startup_stm32f4xx.s -o main.elf -Llib -lstm32f4arm-none-eabi-objcopy -O ihex main.elf main.hexarm-none-eabi-objcopy -O binary main.elf main.binI'm not sure if this is the correct compilation procedure... if not how could i fix it?...

author: petoknm
author_rank: Newbie
timestamp: January 04, 2014, 10:45:19 am
content: I finally solved it it was defined in a different file included in stm32f4xx_conf.h -> stm32f4xx.h as being 25MHz... i just changed it to 8MHz and it works fine... but it was kinda hidden... thanks for the help anyway

author: AndreasF
author_rank: Frequent Contributor
timestamp: January 04, 2014, 11:46:15 am
content: Excellent! Just re-reading my first reply I actually meant stm32f4xx.h, but for some reason I wrote "stm43f4xx.h" (which makes no sense, of course - fingers must have slipped).Anyways, glad you got it figured out.