2022-07-28 04:12 AM
UART_HandleTypeDef hlpuart1;
///init///
hlpuart1.Instance = LPUART1;
hlpuart1.Init.BaudRate = 256000;
hlpuart1.Init.WordLength = UART_WORDLENGTH_8B;
hlpuart1.Init.StopBits = UART_STOPBITS_1;
hlpuart1.Init.Parity = UART_PARITY_NONE;
hlpuart1.Init.Mode = UART_MODE_TX_RX;
hlpuart1.Init.HwFlowCtl = UART_HWCONTROL_NONE;
hlpuart1.Init.OneBitSampling = UART_ONE_BIT_SAMPLE_DISABLE;
hlpuart1.Init.ClockPrescaler = UART_PRESCALER_DIV1;
hlpuart1.AdvancedInit.AdvFeatureInit = UART_ADVFEATURE_NO_INIT;
hlpuart1.FifoMode = UART_FIFOMODE_DISABLE;
uint8_t Test[] = "Hello World !!!\r\n"; //Data to send
if (HAL_UART_Transmit(&hlpuart1,Test,sizeof(Test),100)!= HAL_OK)
{
Error_Handler();
}
2022-07-28 04:58 AM
If it use GPIOG bank makes sure that is enabled/powered, there is a special setting to enable VddIo2
Use strlen rather than sizeof as latter also counts NUL
2022-07-28 06:57 AM
that is working when I use it alone but when I used embedded wizard UI along with that code then it will not work for me
2022-07-28 08:18 AM
I don't trust Wizards, they're a mercurial bunch..
/* Enable voltage range 1 boost mode for frequency above 80 Mhz */
__HAL_RCC_PWR_CLK_ENABLE();
HAL_PWREx_ControlVoltageScaling(PWR_REGULATOR_VOLTAGE_SCALE1_BOOST);
HAL_PWREx_EnableVddIO2(); /* IOSV bit MUST be set to access GPIO port G[2:15] */
__HAL_RCC_PWR_CLK_DISABLE();
2022-07-28 08:39 AM
Ok
Let me check it
Thanks for your support