Author Topic: STM32F4Discovery USART Baud rate problem  (Read 9544 times)

0 Members and 1 Guest are viewing this topic.

Offline petoknmTopic starter

  • Newbie
  • Posts: 7
STM32F4Discovery USART Baud rate problem
« on: January 03, 2014, 09:23:04 pm »
Hi
I'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: [Select]
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.ld

in main.c i have this :

Code: [Select]
#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 = PA2
GPIO_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.h
Delay(0x3FFFFF);
}

}

in stm32f4xx_conf.h i include all other peripherals including USART and my Makefile look like this:

Code: [Select]
SRCS = main.c system_stm32f4xx.c


PROJ_NAME=main

CC=arm-none-eabi-gcc
OBJCOPY=arm-none-eabi-objcopy

CFLAGS  = -g -O2 -Wall -Tstm32_flash.ld
CFLAGS += -mlittle-endian -mthumb -mcpu=cortex-m4 -mthumb-interwork
CFLAGS += -mfloat-abi=softfp -mfpu=fpv4-sp-d16

vpath %.c src
vpath %.a lib

ROOT=$(shell pwd)

CFLAGS += -Iinc -Ilib -Ilib/inc
CFLAGS += -Ilib/inc/core -Ilib/inc/peripherals

SRCS += lib/startup_stm32f4xx.s # add startup file to build

OBJS = $(SRCS:.c=.o)

.PHONY: lib proj

all: lib proj

lib:
$(MAKE) -C lib

proj: $(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).bin

clean:
rm -f *.o
rm -f $(PROJ_NAME).elf
rm -f $(PROJ_NAME).hex
rm -f $(PROJ_NAME).bin

AND checked the system_stm32f4xx.c where all the system clocks are defined and its configured:
Code: [Select]
*=============================================================================
  *        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... :-//
« Last Edit: January 03, 2014, 10:10:15 pm by petoknm »
 

Lurch

  • Guest
Re: STM32F4Discovery USART Baud rate problem
« Reply #1 on: January 03, 2014, 09:26:15 pm »
Use the code tags.
 

Offline petoknmTopic starter

  • Newbie
  • Posts: 7
Re: STM32F4Discovery USART Baud rate problem
« Reply #2 on: January 03, 2014, 09:35:48 pm »
thanks that looks much better... well... I'm a newcomer :D
« Last Edit: January 03, 2014, 10:13:30 pm by petoknm »
 

Offline AndreasF

  • Frequent Contributor
  • **
  • Posts: 251
  • Country: gb
    • mind-dump.net
Re: STM32F4Discovery USART Baud rate problem
« Reply #3 on: January 03, 2014, 11:10:11 pm »
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: [Select]
/**
 * @brief In the following line adjust the value of External High Speed oscillator (HSE)
   used in your application
   
   Tip: To avoid modifying this file each time you need to use different HSE, you
        can 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 */

my random ramblings mind-dump.net
 

Offline petoknmTopic starter

  • Newbie
  • Posts: 7
Re: STM32F4Discovery USART Baud rate problem
« Reply #4 on: January 04, 2014, 08:30:46 am »
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 :D
 

Offline petoknmTopic starter

  • Newbie
  • Posts: 7
Re: STM32F4Discovery USART Baud rate problem
« Reply #5 on: January 04, 2014, 09:00:36 am »
It actually is defined in stm32f4xx_conf.h like this :
Code: [Select]
#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...
 

Offline AndreasF

  • Frequent Contributor
  • **
  • Posts: 251
  • Country: gb
    • mind-dump.net
Re: STM32F4Discovery USART Baud rate problem
« Reply #6 on: January 04, 2014, 10:10:00 am »
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).
my random ramblings mind-dump.net
 

Offline petoknmTopic starter

  • Newbie
  • Posts: 7
Re: STM32F4Discovery USART Baud rate problem
« Reply #7 on: January 04, 2014, 10:19:49 am »
maybe the compilation procedure is wrong... this is the compilation i use :
Code: [Select]
peter-pc blinky # make
make -C lib
make[1]: 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.c
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 stm32f4xx_dma.o src/peripherals/stm32f4xx_dma.c
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 stm32f4xx_rcc.o src/peripherals/stm32f4xx_rcc.c
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 stm32f4xx_adc.o src/peripherals/stm32f4xx_adc.c
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 stm32f4xx_exti.o src/peripherals/stm32f4xx_exti.c
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 stm32f4xx_rng.o src/peripherals/stm32f4xx_rng.c                                                                                                             
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 stm32f4xx_can.o src/peripherals/stm32f4xx_can.c                                                                                                             
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 stm32f4xx_flash.o src/peripherals/stm32f4xx_flash.c                                                                                                         
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 stm32f4xx_rtc.o src/peripherals/stm32f4xx_rtc.c                                                                                                             
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 stm32f4xx_crc.o src/peripherals/stm32f4xx_crc.c                                                                                                             
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 stm32f4xx_fsmc.o src/peripherals/stm32f4xx_fsmc.c                                                                                                           
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 stm32f4xx_sdio.o src/peripherals/stm32f4xx_sdio.c                                                                                                           
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 stm32f4xx_cryp_aes.o src/peripherals/stm32f4xx_cryp_aes.c
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 stm32f4xx_gpio.o src/peripherals/stm32f4xx_gpio.c
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 stm32f4xx_spi.o src/peripherals/stm32f4xx_spi.c
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 stm32f4xx_cryp.o src/peripherals/stm32f4xx_cryp.c
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 stm32f4xx_hash.o src/peripherals/stm32f4xx_hash.c
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 stm32f4xx_syscfg.o src/peripherals/stm32f4xx_syscfg.c
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 stm32f4xx_cryp_des.o src/peripherals/stm32f4xx_cryp_des.c
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 stm32f4xx_hash_md5.o src/peripherals/stm32f4xx_hash_md5.c
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 stm32f4xx_tim.o src/peripherals/stm32f4xx_tim.c
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 stm32f4xx_cryp_tdes.o src/peripherals/stm32f4xx_cryp_tdes.c
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 stm32f4xx_hash_sha1.o src/peripherals/stm32f4xx_hash_sha1.c
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 stm32f4xx_usart.o src/peripherals/stm32f4xx_usart.c
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 stm32f4xx_dac.o src/peripherals/stm32f4xx_dac.c
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 stm32f4xx_i2c.o src/peripherals/stm32f4xx_i2c.c
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 stm32f4xx_wwdg.o src/peripherals/stm32f4xx_wwdg.c
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 stm32f4xx_dbgmcu.o src/peripherals/stm32f4xx_dbgmcu.c
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 stm32f4xx_iwdg.o src/peripherals/stm32f4xx_iwdg.c
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 stm32f4xx_dcmi.o src/peripherals/stm32f4xx_dcmi.c
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 stm32f4xx_pwr.o src/peripherals/stm32f4xx_pwr.c
arm-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.o
arm-none-eabi-ar: creating libstm32f4.a
make[1]: 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 -lstm32f4
arm-none-eabi-objcopy -O ihex main.elf main.hex
arm-none-eabi-objcopy -O binary main.elf main.bin

I'm not sure if this is the correct compilation procedure... if not how could i fix it?...
 

Offline petoknmTopic starter

  • Newbie
  • Posts: 7
Re: STM32F4Discovery USART Baud rate problem
« Reply #8 on: January 04, 2014, 10:45:19 am »
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 :D
 

Offline AndreasF

  • Frequent Contributor
  • **
  • Posts: 251
  • Country: gb
    • mind-dump.net
Re: STM32F4Discovery USART Baud rate problem
« Reply #9 on: January 04, 2014, 11:46:15 am »
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.

my random ramblings mind-dump.net
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf