cancel
Showing results for 
Search instead for 
Did you mean: 

How to show characters on a teraterm using STM32373C-EVAL board?

gsung
Associate

I'm stuck with the problem that any words are not printed in the teraterm.

I'm using STM32373C-EVAL board and trying to print words using serial port(CN12 connector).

I added function below to use printf function,

int __io_putchar(int ch) {
	uint8_t c[1];
	c[0] = ch & 0x00FF;
	HAL_UART_Transmit(&huart2, &*c, 1, 10);
 
	return ch;
}
 
int _write(int file, char *ptr, int len) {
	int DataIdx;
	for (DataIdx = 0; DataIdx < len; DataIdx++) {
		__io_putchar(*ptr++);
	}
	return len;
}

and then I checked serial port number and baud rate etc.

But it still doesn't work.

Can you give me some advice to fix this problem? Did I miss some setting of UART or other point?

3 REPLIES 3

int __io_putchar(int ch) {

HAL_UART_Transmit(&huart2, (void *)&ch, 1, 10);

return ch;

}

Check state of JP6

Make sure you have the GPIO D and USART2 clocks enabled, and that PD5 and PD6 is properly configured, with the right AF selection.

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..
gsung
Associate

Yes, I already checked everything like below.

0690X000006BrwsQAC.jpg

0690X000006BrwxQAC.jpg

0690X000006Brx2QAC.jpg

Do you have any recommendation to fix this problem?

I'd inspect the registers in the debugger, and signals with a scope

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..