cancel
Showing results for 
Search instead for 
Did you mean: 

UART Communication using STM32CubeIDE

FBrin.1
Associate II

Hi,

I want to send data from my STM32 Nucleo board to the PC. I am new to STM32 field.

Like in other MCU we use Serial.write(), is there something similar in STM32?

2 REPLIES 2

 if (HAL_UART_Transmit(&Uart2Handle, (uint8_t*)string, strlen(string), 5000)!= HAL_OK)

 {

  Error_Handler();

 }

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

Thanks. I am using SubGHz_Phy application on STM32WL55JC board. https://github.com/STMicroelectronics/STM32CubeWL/tree/main/Projects/NUCLEO-WL55JC/Applications/SubGHz_Phy/SubGHz_Phy_PingPong

When I used -

char bufftr[] = "AP";

HAL_UART_Transmit(&huart2, (uint8_t*)bufftr, strlen(bufftr), 0xffff); Nothing gets displayed on the Serial port. Just below this, I am also using APP_LOG(TS_ON, VLEVEL_L, "4\n\r"); and 4 is getting displayed on the serial port.

I am not sure why HAL_UART_Transmit(&huart2, (uint8_t*)bufftr, strlen(bufftr), 0xffff) is not able to send data to serial port?