Associate III
July 24, 2020
Question
UART Problem when using default initialization
- July 24, 2020
- 3 replies
- 1273 views
Hello,
I've encountered a problem while using the STM32CubeIDE.
I have a project targeting the NUCLEO-F722ZE EVB - the purpose is to print "Hello World!" to the PC console connected to the ST-LINK USB.
When creating a new project, at the MXCube I'm presented with an option to "Initialize all peripherals with their default Mode".
If I choose "yes" my code prints ASCII garbage to the screen.
If I choose "no" and set the UART peripheral manually - it works fine (prints "Hello World!").
This is my code (inside the main function) after all the auto-generated initialization:
while (1)
{
uint8_t buffer[] = "Hello World!\n\r";
HAL_UART_Transmit(&huart3, buffer, sizeof(buffer), 0xFFFF);
}I checked that the UART settings in both cases (auto initialized and manual) are the same. So what may cause such a problem ? Is it a bug in the tool ?