cancel
Showing results for 
Search instead for 
Did you mean: 

serial monitor not working

yessine
Associate III

im trying to create a project that write something in the serial monitor(raed/write) . i followed many tutorials step by step but i everytime my serial monitor doesnt print my message( i used tera term/putty/and even the serial monitor in the ide "command shell console". 

- i already fixed the baud rate to 115200

- i already confugured the usart3 pins pd8 and pb11 or pd8 and pd9 for RX and TX

-i already activated the NVIC settings in usart3 menu

- this is the code that i used in while(1) part : 

while (1)

{

/* Transmit "Hello, World!" over USART3 */

char msg[] = "Hello, World!\r\n";

HAL_UART_Transmit(&huart3, (uint8_t*)msg, sizeof(msg) - 1, HAL_MAX_DELAY);

 

/* Add a delay to avoid flooding the serial monitor */

HAL_Delay(1000);

}

 

the code was built with 0 errors 0 warnings

is there something that i misssed or i need to ckeck or did wrong

 

im using stm32f407G disc1 board and it's only connected to the c through the cable

Screenshot 2024-07-09 115726.png

1 ACCEPTED SOLUTION

Accepted Solutions
Andrew Neil
Evangelist III

@yessine wrote:

I'm using stm32f407G disc1 board 


So this: https://www.st.com/en/evaluation-tools/stm32f4discovery.html

 


@yessine wrote:

 it's only connected to the c through the cable


Pardon?

You should connect it to your computer using the mini USB socket (CN1):

AndrewNeil_0-1720528330834.png

Make sure that you are using a full data cable - not just a charging cable.

When you plug the cable in, you should see a  COM port appear in the Device Manager:

AndrewNeil_1-1720528485202.png

https://community.st.com/t5/stm32-mcus-products/program-upload-method-in-nucleo-stm32f103/m-p/633828/highlight/true#M233986

You need to connect your terminal to that COM port.

 

Did you follow the instructions for connecting to the ST-Link's virtual COM port:

AndrewNeil_3-1720529061394.png

https://www.st.com/resource/en/user_manual/um1472-discovery-kit-with-stm32f407vg-mcu-stmicroelectronics.pdf#page=15

 

Please see the posting tips for how to properly post source code:

https://community.st.com/t5/community-guidelines/how-to-write-your-question-to-maximize-your-chances-to-find-a/ta-p/575228

 

 

View solution in original post

8 REPLIES 8
Andrew Neil
Evangelist III

@yessine wrote:

I'm using stm32f407G disc1 board 


So this: https://www.st.com/en/evaluation-tools/stm32f4discovery.html

 


@yessine wrote:

 it's only connected to the c through the cable


Pardon?

You should connect it to your computer using the mini USB socket (CN1):

AndrewNeil_0-1720528330834.png

Make sure that you are using a full data cable - not just a charging cable.

When you plug the cable in, you should see a  COM port appear in the Device Manager:

AndrewNeil_1-1720528485202.png

https://community.st.com/t5/stm32-mcus-products/program-upload-method-in-nucleo-stm32f103/m-p/633828/highlight/true#M233986

You need to connect your terminal to that COM port.

 

Did you follow the instructions for connecting to the ST-Link's virtual COM port:

AndrewNeil_3-1720529061394.png

https://www.st.com/resource/en/user_manual/um1472-discovery-kit-with-stm32f407vg-mcu-stmicroelectronics.pdf#page=15

 

Please see the posting tips for how to properly post source code:

https://community.st.com/t5/community-guidelines/how-to-write-your-question-to-maximize-your-chances-to-find-a/ta-p/575228

 

 

Guillaume K
ST Employee

when you write


@yessine wrote:

im using stm32f407G disc1 board and it's only connected to the c through the cable

 

do you mean the board is connected to the computer with the USB cable ?

Are you trying to use the virtual com port feature of the STLINK ?

I've had a look at stm32f407G disc1 schematics and I can't find VCP connection between the STM32F4 and the STLINK on the board. I guess the VCP feature is not present.

Or are you trying to use the STM32F4 GPIO ports as UART with a direct connection ? (using an GPIO-USB adapter to connect to PC ?)

TDK
Guru

> im using stm32f407G disc1 board and it's only connected to the c through the cable

You'll need to use a UART to USB adapter, or otherwise connect the UART pins to the computer somehow. USART3 isn't connected to the VCP interface on that board. Nothing is.

TDK_0-1720529620648.png

 

If you feel a post has answered your question, please click "Accept as Solution".

sorry for the typing error . i meant the board is attached to the PC* through a usb type B cable(the one that you showed in the image attached . and yes the pc have recognized the device i cheked in the device manager. besides that , i didnt really understand  the VCP part. 

sorry for the typing error . i meant the board is attached to the PC* through a usb type B cable(the one that you showed in the image attached . and yes the pc have recognized the device i cheked in the device manager. isn't a connecting cable enough ?

yessine
Associate III

thanks . i realized that my board dont have VCM i have an other L4 board im gonna test wih it


@yessine wrote:

i realized that my board don't have VCM 


Pardon?

Did you mean VCP - ie, Virtual COM Port ?

As explained earlier, your board does have a VCP - it's just that you have to manually make the physical connections to it.


@Guillaume K wrote:

I've had a look at stm32f407G disc1 schematics and I can't find VCP connection between the STM32F4 and the STLINK on the board. I guess the VCP feature is not present.


As stated in the User Manual, the VCP is present - it's just not connected to the Target.

The user has to make that connection manually:

AndrewNeil_0-1720604715536.png