Quantcast
Channel: Engineering(DIY)
Viewing all articles
Browse latest Browse all 20

STM32F3-Discovery Usart with printf

$
0
0
Hi,

The next step after setting up the Development Environment for STM32F3-Discovery was to communicate with computer via serial port.
I have added usart support to my board using USART2 module, which had TX connected to PA2 pin and RX to PA3 pin(both with alternate function set to 7).

The next step was to connect the pins to PC serial port. I have used a MAX3232 module(note that you need a chip with 3.3V support).

After using printf function I have noticed that linker asks for some functions like _write which are used internally. I have added a file newlib_subs.c to implement these function.

You can download the example project from here.
The settings for usart communication are:
baudrate: 115200
parity: none
data bits: 8
stop bits: 1
flow control: none

If you want to use interrupts to read from USART you can use the code from here.

You can checkmy project via svn from my repository using:
svn checkout http://andrei-development.googlecode.com/svn/branches/dev/stm32f3-discovery



Viewing all articles
Browse latest Browse all 20

Trending Articles