0

I recently bought a STM32F103C8T6 board (blue pill) I programming to it using the USB to Serial TTL I bought (CP2102).

I'm still taking very first steps and trying to figure out how to operate the component. I was able to burn a basic script to STM32F103C8T6 that causes the P13(LED) to blink.

Now I'm trying to add basic printing that I can see over the serial interface Which I am already connected to (CP2102).

Here's what my code looks like:

void setup() {
// initialize digital pin PC13 as an output.
pinMode(PC13, OUTPUT);
Serial.print("finish setup function \r\n"); // try to print something using serial
}

void loop() { 
digitalWrite(PC13, HIGH);
delay(500);

digitalWrite(PC13, LOW);
delay(500);

Serial.print("loop throgh loop function \r\n"); // try to print something using serial
}

Everything is compiled and loaded fine (I work through ARDUINO IDE), but it is not clear to me where I can see these prints.

I tried to see them in Tools-> serial monitor (in the arduino ide tool) But I didn't see any printing ...

(I know that my code got loaded successfully because I play with the speed of the LED blinks and I see that it is responding to the change at the speed of the flicker).

It feels like it's a really stupid question but where can I see my prints?

migrated from electronics.stackexchange.com Oct 19 '18 at 15:41

This question came from our site for electronics and electrical engineering professionals, students, and enthusiasts.

  • Do you need to initialize the serial interface? That's normally done for Arduino sketches. – Elliot Alderson Oct 18 '18 at 20:01
  • You miss-spelled the word 'throgh'. It should be 'through'. If it is a command it MUST have correct spelling. – Sparky256 Oct 18 '18 at 20:05
  • 1
    thank you @Sparky256 it's not a command , i simply try to print this sentence – dog scotter Oct 18 '18 at 20:13
  • thank you @ElliotAlderson what i need to initialized and how? can you please give me some basics examples of this? – dog scotter Oct 18 '18 at 20:13
  • Look for some sample code that uses the serial interface. There are many, many examples available and some are included with the Arduino IDE. I'll admit it's not clear to me what programming environment you are using. – Elliot Alderson Oct 18 '18 at 20:23

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.