cancel
Showing results for 
Search instead for 
Did you mean: 

BASIC USART

xtian
Associate II
Posted on January 17, 2013 at 09:41

Hi Guys,

I am 1 week old to STM32 Platforms and I am using stm32VL and stm32f4Discovery,

and it is my first time to program microcontroller in C platform

I am having a hardtime understanding the sample i found in web for USART hmm I dont know how to make them work.

I understand all the arrays and logics what i dont understand is the process.. If anyone could give me a crash course where would i put the init or usart... etc.. if you could perform a relation so I could understand it better. I found many eamples but I was not able to run sucessfully even one sample.

I tried this by clive

https://my.st.com/public/STe2ecommunities/mcu/Lists/STM32Discovery/Flat.aspx?RootFolder=https%3a%2f%2fmy.st.com%2fpublic%2fSTe2ecommunities%2fmcu%2fLists%2fSTM32Discovery%2fSTM32F100%20UART%20problem&FolderCTID=0x01200200770978C69A1141439FE559EB459D75800084C20D8867EAD444A5987D47BE638E0F&currentviews...

but I got this error

Building configuration: basicIO - Debug

Updating build tree...

Linking

Error[Li005]: no definition for ''USART_Init'' [referenced from C:\Users\KDREY.PH\Desktop\

cimba research\trials\BASICIO\Debug\Obj\basicIO.o]

Error[Li005]: no definition for ''USART_Cmd'' [referenced from C:\Users\KDREY.PH\

Desktop\cimba research\trials\BASICIO\Debug\Obj\basicIO.o]

Error[Li005]: no definition for ''USART_ITConfig'' [referenced from C:\Users\KDREY.PH\

Desktop\cimba research\trials\BASICIO\Debug\Obj\basicIO.o]

Error while running Linker

 

Total number of errors: 3

Total number of warnings: 0

7 REPLIES 7
Posted on January 17, 2013 at 13:45

Yeah, you'll need to work with your include files so it pulls in the ones from the libraries it needs, and that the project has the library source files in it.

You should perhaps review some of the project templates, and examples from the firmware library. Build those and understand the basic construction method for projects.
Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..
xtian
Associate II
Posted on January 17, 2013 at 14:40

Thanks clive! question.. do i need to exactly follow the formatting of the folder in IAR like CMSIS, user or they are just conventions and practices it still depend on my project options

Posted on January 17, 2013 at 15:49

IAR isn't my thing, under Keil I build my projects within the tree of the firmware library, and back reference into the library source and include directories.

C:\Keil\ARM\Examples\ST\stm32vldiscovery_package\Project\DemoUSART1

C:\Keil\ARM\Examples\ST\STM32F4-Discovery_FW_V1.1.0\Project\USART1

This way when a new version of the library comes out I can just clone the project under the new tree and recompile.

With some GNU/GCC builds it is frankly easier to corral all the source/library and include files into one or two directories to reduce the dependencies and simplify the MAKE file/process. This flatness allows it to easily be zipped up and provided as a standalone example.

You'll have to decide how to drive the tools, and what best fits your source management style.

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..
frankmeyer9
Associate II
Posted on January 17, 2013 at 16:22

I can't speak of the  IAR WB, but other toolchain have options to include user-defined macros / shell variables in the project paths setup, such as $(ProjectDir) or $(STM32Fxxx_Peripheral_Lib).

That is a convenient way to ease the project transfer, at least when using the same toolchain.

xtian
Associate II
Posted on January 18, 2013 at 01:59

when I tried keil I only found this:

Itried the Hello which is a usart example for f103 it didn't work my suspicion is because there are not the same model though they are the same series.

ahhh another question can I use programs for same series but different Part number for example f103 used for stm32vl(assuming pin connections are followed and HSE was properly setted)

Posted on January 18, 2013 at 02:47

Most likely it's trying to run it at 72 MHz, which the F100 won't hack.

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..
xtian
Associate II
Posted on January 18, 2013 at 02:54

Thank you Clive.. it is becoming more clear now