2024-08-15 06:01 AM
Hai,
I am using STM32L496ZG-P board and STM32CUBE IDE (1.15.1).
I tried to print hello world in tera term using UART/USART,USB etc , i tried many programs by reffering many videos in youtube, and some docs from STM communinty link etc etc,. Maximum all the ways i tried , but running is successfull, i can debug also , but prints are not coming in tera term. Some basic baudrate ,stopbit etc settings are all i checked properly, still i am not getting.
Please help me for this.
I connected the STM32L496ZG-P board to the laptop using USB cable which is present at debugger side of the board. So is there any jumper settings or shall i have to use any usb converter or any tx rx pin i need to connect. Please tell me.
Thanku
2024-08-15 11:37 AM
Hello @jacobgeorge and welcome to the Community :)
Ensure that the UART peripheral is correctly configured, and that Tera Term is configured with the correct settings to match the UART configuration. This includes the correct COM port, baud rate, data bits, parity, and stop bits.
Here is an example configuration :
void UART_Init(void) {
UART_HandleTypeDef huart;
huart.Instance = USARTx; // Replace with your UART instance
huart.Init.BaudRate = 115200;
huart.Init.WordLength = UART_WORDLENGTH_8B;
huart.Init.StopBits = UART_STOPBITS_1;
huart.Init.Parity = UART_PARITY_NONE;
huart.Init.Mode = UART_MODE_TX_RX;
huart.Init.HwFlowCtl = UART_HWCONTROL_NONE;
huart.Init.OverSampling = UART_OVERSAMPLING_16;
if (HAL_UART_Init(&huart) != HAL_OK) {
// Initialization error
Error_Handler();
}
}
Check the physical connections between the board and the PC. Ensure that the TX and RX lines are properly connected, and that the USB cable is working correctly.
Ensure that the ST-LINK Virtual COM port is enabled and correctly configured.
I recommend you check one of the ready-to-use UART examples available in the STM32CubeL4 firmware package to identify what you have missed.
I suggest you debug and localize where the code hangs/stop: check if the UART transmit function is being called. You can set breakpoints and check the status of the UART peripheral and identify what is the problem that you see and when it occurs.
How to redirect the printf function to a UART for ... - STMicroelectronics Community
Otherwise, you can share your code, your ioc file or post some screenshots of the CubeMX configuration to check it.
2024-08-22 04:34 AM
Did STM32L496ZG-P boards supports for SWV(Serial wire viewer). Can i see the printf output there?
2024-08-22 04:50 AM - edited 2024-08-22 04:50 AM
Hello @jacobgeorge did @Imen.D comment answered your question and got messages on TeraTerm?
Can i see the printf output there?
What do you mean by "there"? in TeraTerm?
You can use Serial Wire Viewer for example with CubeIDE in debug mode.
2024-08-22 04:56 AM
@jacobgeorge wrote:I tried to print hello world in tera term using UART/USART,USB etc
Please show what you tried.
See the Posting Tips for how to post your source code; also show a schematic of how you connected it all up: