AnsweredAssumed Answered

Error while running linker (USART)

Question asked by lapiana.francesco on Aug 3, 2015
Latest reply on Aug 3, 2015 by lapiana.francesco
Hello,
I'm using  the STM32F030R8T6 microcontroller and IAR IDE.

The following is a part of code that I'm using:
01.USART_InitTypeDef USART_InitStructure;
02.GPIO_InitTypeDef GPIO_InitStructure;
03. 
04.RCC_AHBPeriphClockCmd(RCC_AHBPeriph_GPIOA, ENABLE);
05. 
06.RCC_APB2PeriphClockCmd(RCC_APB2Periph_USART1,ENABLE);
07. 
08.GPIO_PinAFConfig(GPIOA, GPIO_PinSource9, GPIO_AF_1);
09.GPIO_PinAFConfig(GPIOA, GPIO_PinSource10, GPIO_AF_1);
10. 
11./* Configure USART1 pins:  Rx and Tx ----------------------------*/
12.GPIO_InitStructure.GPIO_Pin =  GPIO_Pin_9;
13.GPIO_InitStructure.GPIO_Speed = GPIO_Speed_50MHz;
14.GPIO_InitStructure.GPIO_Mode = GPIO_Mode_AF;
15.GPIO_InitStructure.GPIO_OType = GPIO_OType_PP;
16.GPIO_InitStructure.GPIO_PuPd = GPIO_PuPd_UP;
17.GPIO_Init(GPIOA, &GPIO_InitStructure);
18.GPIO_InitStructure.GPIO_Pin = GPIO_Pin_10;
19.GPIO_Init(GPIOA, &GPIO_InitStructure);
20. 
21. 
22.USART_InitStructure.USART_BaudRate = 38400;
23.USART_InitStructure.USART_WordLength = USART_WordLength_8b;
24.USART_InitStructure.USART_StopBits = USART_StopBits_1;
25.USART_InitStructure.USART_Parity = USART_Parity_No;
26.USART_InitStructure.USART_HardwareFlowControl = USART_HardwareFlowControl_None;
27.USART_InitStructure.USART_Mode = USART_Mode_Rx | USART_Mode_Tx;
28.USART_Init(USART1, &USART_InitStructure);
29. 
30.USART_Cmd(USART1,ENABLE);

I put:
1.#ifdef USE_STDPERIPH_DRIVER
2.  #include "stm32f0xx_conf.h"
3.#endif /* USE_STDPERIPH_DRIVER */
and in the project configuration i put
STM32F0XX
USE_STDPERIPH_DRIVER

and this is the error:
Error[Li005]: no definition for "USART_Init" [referenced from C:\Users\...\Debug\Obj\ filename.o]
Error[Li005]: no definition for "USART_Cmd" [referenced from C:\Users\...\Debug\Obj\ filename.o]
Error while running Linker 


Can you give me a little help?

Outcomes