2020-08-04 09:00 AM
In a project for a STM32L4S7ZITx with LPUART1 enabled the following code is generated:
/**
* @brief LPUART1 Initialization Function
* @param None
* @retval None
*/
static void MX_LPUART1_UART_Init(void)
{
/* USER CODE BEGIN LPUART1_Init 0 */
/* USER CODE END LPUART1_Init 0 */
/* USER CODE BEGIN LPUART1_Init 1 */
/* USER CODE END LPUART1_Init 1 */
hlpuart1.Instance = LPUART1;
hlpuart1.Init.BaudRate = 115200;
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;
if (HAL_UART_Init(&hlpuart1) != HAL_OK)
{
Error_Handler();
}
if (HAL_UARTEx_SetTxFifoThreshold(&hlpuart1, UART_TXFIFO_THRESHOLD_1_8) != HAL_OK)
{
Error_Handler();
}
if (HAL_UARTEx_SetRxFifoThreshold(&hlpuart1, UART_RXFIFO_THRESHOLD_1_8) != HAL_OK)
{
Error_Handler();
}
if (HAL_UARTEx_DisableFifoMode(&huart1) != HAL_OK)
{
Error_Handler();
}
/* USER CODE BEGIN LPUART1_Init 2 */
/* USER CODE END LPUART1_Init 2 */
}
Line 39 is the only place that huart1 is referenced in any of the generated code. I assume this is meant to be hlpuart1.
Solved! Go to Solution.
2020-08-05 12:47 AM
@STawn.1 Issue confirmed and it will be fixed,
Thanks for your feedback.
Khouloud
2020-08-04 09:18 AM
Hello @STawn.1
It will be internally checked
Regards,
Khouloud
2020-08-05 12:47 AM
@STawn.1 Issue confirmed and it will be fixed,
Thanks for your feedback.
Khouloud
2020-09-25 06:05 PM
Chiming in that this issue also just affected me today, so it is still not fixed.
2020-09-28 01:52 AM
Hello @CBald
The fix will be available for the next CubeMX release (6.1.0).
Regards,
Khouloud
2020-09-29 04:34 AM
I'd like to add to this bug: it also happens in the LPUART1_IRQHandler:
void LPUART1_IRQHandler(void)
{
/* USER CODE BEGIN LPUART1_IRQn 0 */
/* USER CODE END LPUART1_IRQn 0 */
HAL_UART_IRQHandler(&huart1); //<--- Here, huart1 should be hlpuart1
/* USER CODE BEGIN LPUART1_IRQn 1 */
/* USER CODE END LPUART1_IRQn 1 */
}
2020-09-29 07:06 AM
Hi @Mhd
Could you please share your ioc file ?
Thanks
Khouloud
2020-09-29 07:56 AM
2020-09-29 08:18 AM
2020-09-29 08:26 AM
@Mhd & @CBald fix is done, it will be available in the next release.
Thanks for your feedbacks
Khouloud