I'm trying to use the UART3 in NUCLEO-F746ZG with TrueStudio. USART3 connected to ST-LINK to support the virtual COM port, but it didn't work now. I don't have oscilloscope and I really want to see the print message through hyper terminal like a realterm.
I searched this issue and found that many users were having a hard time.
Finally, I found the solution for UART example which is in STM32CubMX from the following web site. If I copy the syscall.c, then it works fine in UART example.
https://community.st.com/s/question/0D50X00009XkXDcSAN/problem-with-uart-example-on-nucleof746zg
The following is UART example code from STM32CubeMX. Directory : STM32Cube_FW_F7_V1.15.0\Projects\STM32F746ZG-Nucleo\Examples\UART\UART_Printf.
int main(void)
{
.....................
UartHandle.Instance = USARTx;
UartHandle.Init.BaudRate = 9600;
UartHandle.Init.WordLength = UART_WORDLENGTH_8B;
UartHandle.Init.StopBits = UART_STOPBITS_1;
UartHandle.Init.Parity = UART_PARITY_NONE;
UartHandle.Init.HwFlowCtl = UART_HWCONTROL_NONE;
UartHandle.Init.Mode = UART_MODE_TX_RX;
UartHandle.Init.OverSampling = UART_OVERSAMPLING_16;
if (HAL_UART_Init(&UartHandle) != HAL_OK)
{
Error_Handler();
}
}
However, I generated the code using STM32CubeMX. I only made use of USART3 and confirmed that there is syscall.c in it. But nevertheless I can't see the print message. If anyone solved this problem, I would appreciate it if they shared it.
The following is the code I generated using STM32CubeMX.
int main(void)
{
HAL_Init();
SystemClock_Config();
/* Initialize all configured peripherals */
MX_GPIO_Init();
MX_USART3_UART_Init();
/* USER CODE BEGIN 2 */
...
}
static void MX_USART3_UART_Init(void)
{
huart3.Instance = USART3;
huart3.Init.BaudRate = 9600;
huart3.Init.WordLength = UART_WORDLENGTH_8B;
huart3.Init.StopBits = UART_STOPBITS_1;
huart3.Init.Parity = UART_PARITY_NONE;
huart3.Init.Mode = UART_MODE_TX_RX;
huart3.Init.HwFlowCtl = UART_HWCONTROL_NONE;
huart3.Init.OverSampling = UART_OVERSAMPLING_16;
huart3.Init.OneBitSampling = UART_ONE_BIT_SAMPLE_DISABLE;
huart3.AdvancedInit.AdvFeatureInit = UART_ADVFEATURE_NO_INIT;
if (HAL_UART_Init(&huart3) != HAL_OK)
{
Error_Handler();
}
}