6 years, 7 months ago.

Mbed Serial2Serial

Hi,

I am trying to send data to serial line on STM32 Discovery kit. teraterm on bouth ends.

  1. include "mbed.h"

Serial pc(USBTX, USBRX); tx, rx Serial device(PA_0, PA_1); tx, rx

int main() {

pc.baud(115200); device.baud(115200);

printf("Hello\n"); device.printf("Hello\n");

}

Bauds are right but in device side i end up with "Z«::"(Hello) Any idea why?

Pc side works fine

posted by Joni Patana 08 Nov 2017

1 Answer

6 years, 7 months ago.

Joni,

instead of prinft, try using pc.printf.

Accepted Answer

Thanks for the quick answer! Pc side works fine. Device not. But after a full day of figthing i realised that i am reading serial ttl with serial rs232 adapter. So the problem is most likely there.

posted by Joni Patana 08 Nov 2017