cancel
Showing results for 
Search instead for 
Did you mean: 

RESOLVED: USART functions returning ''no definition error''

selmesal
Associate II
Posted on October 12, 2016 at 19:24

Hello, 

When using USART, is stm32f4xx_usart.h the only file I would need to include?

I currently have this:

#include ''stm32f4xx.h''

#include ''stm32f4_discovery.h''

#include ''stm32f4xx_usart.h''

#include <string.h>

But, I am still getting the following:

Error[Li005]: no definition for ''USART_SendData'' [referenced from C:\work\Projects\STM\SandBox\STSW\08182016\STM32F4-Discovery_FW_V1.1.0\Project\Peripheral_Examples\TIM_PWM_Output\ 

EWARM\TIM_PWM_Output\Obj\main.o] 

Error[Li005]: no definition for ''USART_ReceiveData'' [referenced from C:\work\Projects\STM\SandBox\STSW\08182016\STM32F4-Discovery_FW_V1.1.0\Project\Peripheral_Examples\TIM_PWM_Output\ 

EWARM\TIM_PWM_Output\Obj\main.o] 

Error[Li005]: no definition for ''USART_Init'' [referenced from C:\work\Projects\STM\SandBox\STSW\08182016\STM32F4-Discovery_FW_V1.1.0\Project\Peripheral_Examples\TIM_PWM_Output\EWARM\ 

TIM_PWM_Output\Obj\main.o] 

Error while running Linker 

Any hints will be greatly appreciated. 

Thanks, 

Sel
2 REPLIES 2
Posted on October 12, 2016 at 19:37

Any hints will be greatly appreciated.

Include files don't pull in code, they define interfaces. Add stm32f4xx_usart.c to your project so the body of the functions you are calling can be bound by the linker.

Tips, buy me a coffee, or three.. PayPal Venmo Up vote any posts that you find helpful, it shows what's working..
selmesal
Associate II
Posted on October 12, 2016 at 22:13

Thank you.