2024-11-25 04:39 AM - last edited on 2024-11-25 04:49 AM by SofLit
I need UART to use printf, but it's showing as disabled. How can I enable it, and I also need an example code for printf.
Solved! Go to Solution.
2024-11-25 05:26 AM - edited 2024-11-25 05:29 AM
If you pass the mouse on USART3, you will get the warning and the information about the issue:
There are IO conflicts with FMC or/and LTDC.
So you need to go to the pinout view and type USART3. All USART3 pins will toggle. Then select the pin that you need to use for UART3.
Attached a project where I configured USART3 on PB10 and PB11.
But becarefull, for this discovery you need to use USART1 not USART3 over STLINK Virtual comport as said in this thread for printf:
https://community.st.com/t5/stm32-mcus-embedded-software/how-to-use-printf/td-p/733254
And if you need to use USART3 you need to check the HW and manage the conflicts on the board by referring to the schematics.
Hope that answers your question.
2024-11-25 04:48 AM - edited 2024-11-25 04:50 AM
Again, please put a correct title for your posts. "uart" doesn't make any sense.
For your question: Look at the warning. It seems there is a GPIO conflict between USART3 and something else ..
Please share your ioc file.
2024-11-25 04:58 AM
hello iam using stm32f429i-disc1 in this how to enable usart1?
2024-11-25 05:00 AM
I've already said there is a conflict in your config and I've requested to share your ioc file.
2024-11-25 05:06 AM
2024-11-25 05:26 AM - edited 2024-11-25 05:29 AM
If you pass the mouse on USART3, you will get the warning and the information about the issue:
There are IO conflicts with FMC or/and LTDC.
So you need to go to the pinout view and type USART3. All USART3 pins will toggle. Then select the pin that you need to use for UART3.
Attached a project where I configured USART3 on PB10 and PB11.
But becarefull, for this discovery you need to use USART1 not USART3 over STLINK Virtual comport as said in this thread for printf:
https://community.st.com/t5/stm32-mcus-embedded-software/how-to-use-printf/td-p/733254
And if you need to use USART3 you need to check the HW and manage the conflicts on the board by referring to the schematics.
Hope that answers your question.
2024-11-25 05:40 AM
yes iam using USART1 but in UASRT1 is not enabling ,how i enable usart1?
2024-11-25 05:46 AM - edited 2024-11-25 05:46 AM
You need just to go to USART1 and select "Asynchronous":
USART1 is on PA9 (Tx) and PA10 (Rx) which is inline with the schematics:
2024-11-25 09:11 PM
I tried this pin, but UART is not working And I am checking it in the H-terminal by connecting a CP2102. I need example code of usart.
2024-11-26 01:04 AM - edited 2024-11-28 03:19 AM
Please take a photo of your board (Top and Bottom) with a good resolution and share it with us.
Forget about CP2102. You can use directly the STLINK module as virtual comport connected to this USB connector:
Check your device manager. You must have STLINK Virtual COM Port listed in Ports list like the following:
PS: we cannot help you with an answer like: "this is not working". It's working but I'm sure there is something wrong in your project or your environment.
You need to tell what you have done in details so we can converge rapidly to the solution.