2024-07-09 04:54 AM
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
Solved! Go to Solution.
2024-07-09 05:40 AM - edited 2024-07-09 05:44 AM
@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):
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:
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:
Please see the posting tips for how to properly post source code:
2024-07-09 05:40 AM - edited 2024-07-09 05:44 AM
@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):
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:
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:
Please see the posting tips for how to properly post source code:
2024-07-09 05:42 AM - edited 2024-07-09 05:50 AM
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 ?)
2024-07-09 05:53 AM
> 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.
2024-07-10 12:54 AM
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.
2024-07-10 12:57 AM
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 ?
2024-07-10 02:16 AM
thanks . i realized that my board dont have VCM i have an other L4 board im gonna test wih it
2024-07-10 02:24 AM - edited 2024-07-10 02:47 AM
@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.
2024-07-10 02:46 AM
@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: