printf and scanf functions is not working in stm cube IDE
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2021-05-26 12:07 AM
Hai,
I am using the printf and scan f functions in my code of stm cube IDE, when I want to print some messages on VIRTUAL COM port , but the messages are not showing in my serial monitor. I dont know why it is not working , is there we have to write an extra functions for printf and scanf functions in my code , how can i overcome this problem , actually I just want to print the user messages on COM port of serial monitor and also receiving the user entered data,
Thanks and Regards,
raj
Solved! Go to Solution.
- Labels:
-
STM32CubeIDE
Accepted Solutions
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2021-06-07 5:07 AM
Hello Raj!
When printf is called it typically calls the _write function. In the _write function you will need to implement where the I/O should be directed. By default the _write function does not send anything on the virtual com port. You'll find the _write function in the syscalls.c file.
If you would like a guide, you could try to google something along the lines of:
STM32 example virtual com port
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2021-05-26 1:17 AM
Hi @RKUMA.2​ ,
Can you please precise the MCU/Board you are working with ?
Best Regards,
Ons.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2021-06-06 10:53 PM
Hi @Ons KOOLI​ I am working on stm32f070c6 MCU , in that by using adc ,I want to measure the resistance of resistor connected at adc pin, by using simple ohms law ,but I am confuse with the how much current sinks at adc pin ,in datasheet page no. 58(The GPIOs (general purpose input/outputs) can sink or source up to +/-8 mA, and sink or source up to +/- 20 mA (with a relaxed VOL/VOH). In the user application, the number of I/O pins which) I'm confusing this points how much adc pin sink current for stm32f070c6 , i want to know the current(i) value voltage difference between adc and 3.3 gives the voltage(v) value ,by using ohms law i will find out the resistance(r) value connected at adc pin, I am facing another problem using stm cube IDE I am unable to use the printf or scanf functions, it doesn't print the user message to the serial monitor. please give the reply for above two queries
Thanks and Regards
RAJ
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2021-06-07 5:07 AM
Hello Raj!
When printf is called it typically calls the _write function. In the _write function you will need to implement where the I/O should be directed. By default the _write function does not send anything on the virtual com port. You'll find the _write function in the syscalls.c file.
If you would like a guide, you could try to google something along the lines of:
STM32 example virtual com port
