0

Expected first printf line of software to serial output to Windows7 PC is:

main() ************************** SW START Project 2016-10-30 x1

Actual serial output (at TeraTerm or PuTTY);

▒▒▒▒()j**j*j**j*j**j*j**j*j**j*j ▒▒Ӕ▒Ҕ ▒▒▒▒▒▒▒ r01v-q0-30▒q

Serial worked great from mbed or VisualGDB to NUCLEO evaluation board. ie.:

Serial pc(USBTX, USBRX);

Now, I'm running VisualGDB to the actual target board with a STM32F091RC.
ie.:

Serial pc(SERIAL_TX, SERIAL_RX);

At 9600, some chars are correct, most are garbage. I've tried alternate target and cables, same problem. PC's Terminal program (TeraTerm or PuTTY) set at 8,n,1. Looked in mbed library; default config is 8 data, no parity, 1 stop.

USB/serial converter cable is: FTDIChip TTL-232R-RPi (normally for Raspberry Pi).

Bence Kaulics
  • 7,066
  • 7
  • 33
  • 63
Doug Null
  • 7,989
  • 15
  • 69
  • 148
  • 1
    The software works with an evaluation board, and the same software doesn't work on a custom board. It looks like a problem with the board. – followed Monica to Codidact Oct 31 '16 at 14:36
  • Assuming the 'failure' is repeatable, maybe the custom board has different divisor for the UART - have you tried changing the PC serial port baud rate up/down? You say 'default config is 8 data...' - perhaps on your custom board that default isn't being asserted - try asserting the serial data format. – DisappointedByUnaccountableMod Nov 01 '16 at 08:52
  • Are you sure it's suppose to be 9600? Generally when you get garbage but see some of the characters it's a baud rate issue. Do you need hardware handshaking? – Baddack Nov 01 '16 at 15:17
  • Did you checked that the crystal/clock source frequency in your NUCLEO evaluation board and Target board are same? – K.H.A.J.A.S Nov 02 '16 at 11:26

3 Answers3

0

It could be clock mismatch between eval board and target board. Assuming, you have correct grounding. Another issue could be number of data bits in configs is off.

stiebrs
  • 379
  • 3
  • 13
0

I guess it is not relevant anymore, but you have to pay attention to this points.

  • The Signal level is 3.3v and not 5v, not all USB Uart adapters work correctly with is
  • The polarity is the inverted to the standard, i.e. start bit is 1.5bit low like here

arm uart

devopsfool
  • 25
  • 4
0

Ensure you have correct parity and bits. Most people (and Arduino) use 8N1 by default, but STM32 sample code uses 7O1 by default. See here: https://community.st.com/thread/40340-stm32cubefwf2v140projectsstm32f207zg-nucleoexamplesuartuartprintf-printing-garbage-data-over-the-terminal

Gabriel Staples
  • 36,492
  • 15
  • 194
  • 265