2012-07-10 01:00 PM
Hello!
I would like to send simple data from STM32F4Discovery to PC (''Hello World!'' every second would be perfect for beginning). I am pretty lost here. How do I create virtual COM port? When I connect PC to the board via Mini USB, everything is normal - board gets detected and I can use it and upload programs normally. But when I connect also micro USB port, nothing happens on computer (only LD7 green light goes ON on board). Is there any simple tutorial on how to do this? Thanks!2012-07-10 01:39 PM
Review the examples in the USB libraries
You might have to do some work to port examples to the STM32F4-Discovery, I believe most of the examples assume you have the higher end STM32xxx-EVAL series boards. Going to be a bit of a bear for the beginner. I've done some porting for the mass-storage controller example. Getting the virtual serial working is something on the strategic wish list.2012-07-10 02:00 PM
I see, thanks. I think it will be much more simple to actually buy USB-RS232 converter and connect it to the STM32F4 board, what do you think? Something like this: http://www.ebay.co.uk/itm/NEW-USB-TO-RS232-SERIAL-DB9-1PORT-CABLE-WORK-WINDOWS-7-32-64BIT-/160826243108?pt=UK_Computing_Parallel_Serial_PS_2&hash=item2571fdb824#ht_2280wt_1084
2012-07-10 03:09 PM
Forgot to ask ... are STM32F4Discovery's UART pins 5V tolerant or not? I was thinking about connecting it to Arduino Mega.
2012-07-10 03:54 PM
You really want to avoid RS232 signalling voltages, ie 12V. What you want is a USB-to-CMOS-Serial (3V or so), which you can then wire directly to the Discovery series boards.
http://www.ftdichip.com/Support/Documents/DataSheets/DLP/dlptxrx-v14-ds.pdf
These use FTDI chips, but the ones from SiLabs or Prolific work just as well. Some of the pins are 5V Tolerant (FT), check the chip data sheet or reference manual. From memory, USART1 on PA9,PA10 is, but honestly couldn't tell you if that escapes from your board. I'm using USART3.2012-07-10 05:56 PM
Looking at this data sheet:
http://www.st.com/internet/com/TECHNICAL_RESOURCES/TECHNICAL_LITERATURE/DATASHEET/DM00037051.pdf
, all USART pins are fault tolerant ... can you confirm this for me, please? Does this mean I can connect it the Arduino without problems?2012-07-10 06:16 PM
I'm working on this now, but I've got a question. Are the USB libraries C or C++? Reason I ask is I'm getting an error I don't understand. The line:
typedef
typedef struct
_USB_OTG_GREGS
//000h{
{__IOuint32_t
GOTGCTL
;
/* USB_OTG Control and Status Register 000h*/__IO
uint32_t
GOTGINT
;
/* USB_OTG Interrupt Register 004h*/ Is throwing the error: Multiple markers at this line- Syntax error
- expected specifier-qualifier-list
I hope it's some other problem, as TrueStudio Lite only offers the C compiler. Thanks in advance.2012-07-10 07:36 PM
Looking at this data sheet:
http://www.st.com/internet/com/TECHNICAL_RESOURCES/TECHNICAL_LITERATURE/DATASHEET/DM00037051.pdf
, all USART pins are fault tolerant ... can you confirm this for me, please? Does this mean I can connect it the Arduino without problems? Yeah, looks good, I've got a whole bunch of STM32 series parts rattling around here, the F1's were less complete with the FT pins, always check the specs. 5V != Fault Arduino should probably work, the STM32's won't output at 5V, so if ~2.9V or whatever VOH is at, is good then you'll be fine. Check VOL/VOH vs VIL/VIH. It won't blow up. Make sure you bond your grounds together between the boards.2012-07-10 07:43 PM
I'm working on this now, but I've got a question. Are the USB libraries C or C++? Reason I ask is I'm getting an error I don't understand.
I'm building with C, the USB stuff builds with GNU/GCC 4.6.2 and 4.7.1 no problems, ditto Keil 4.53 Perhaps you're missing some include paths in the project? Check for warnings. Or some command line define options.2012-07-11 03:37 AM
Thanks!
So - if I use USART3 on STM32F4 and USART1 from ArduinoMega2560, I should connect like this:STM32F4 ARDUINOPB10 (TX) ......................................... 19 (RX1)PB11 (RX) ......................................... 18 (TX1)GND .................................................. GNDQuestion 1: There are more GND (ground) points on each of the boards ... does it matter which I take or not?Question 2: Is there mistake in data sheet (page 31) ... it says USART 1 and 6 have speeds up to 10.5 Mbit/s, while others only 5.25 bits/s ... bits/s?!