2018-08-06 06:25 PM
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?
2018-08-06 06:42 PM
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.
2018-08-09 02:02 AM
Yes, I already checked everything like below.
Do you have any recommendation to fix this problem?
2018-08-09 05:09 AM
I'd inspect the registers in the debugger, and signals with a scope